Changes between Version 9 and Version 10 of ClassMethodTypes


Ignore:
Timestamp:
Feb 2, 2006 4:49:15 AM (9 years ago)
Author:
john@…
Comment:

remove long winded explanation. replace with concise sentence.

Legend:

Unmodified
Added
Removed
Modified
  • ClassMethodTypes

    v9 v10  
    2121}}} 
    2222 
    23  
    24 would have to carry around a dictionary for Num as well as Foo in dictionary passing implementation of type classes. In general some sort of fixpoint iteration would be needed to determine the set of dictionaries needed on an existential type. other choices would be to disallow existential types of such classes, disallow calling of methods with such constraints on an existential, or require the user specify a full list of needed classes in the data type (ruling out the ability to create existentials of things that are Foos but not Nums).   
    25  
    26 Even if this were done there would be no way to _statically_ tell if an existential will be filled with something of type Num, so a runtime error would have to be used when it isn't. Basically, we would have to conjure a dictionary full of bottoms for Num out of thin air. 
    27  
     23would have to carry around a dictionary for Num as well as Foo in dictionary passing implementation of type classes if it wished to use methods of this form. 
    2824 
    2925Typecase based implementations of classes such as jhcs do not have a problem with classes or existentials of this form since all classes are determined from the single type parameter no matter how many classes are actually needed.