Changes between Version 8 and Version 9 of ClassMethodTypes


Ignore:
Timestamp:
Feb 2, 2006 4:43:27 AM (8 years ago)
Author:
john@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ClassMethodTypes

    v8 v9  
    2222 
    2323 
    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. 
     24would 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).   
    2525 
    26 This would not affect typecase based implementations of classes such as jhcs. 
     26Even 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. 
    2727 
    2828 
     29Typecase 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. 
     30 
     31== Examples == 
     32 
     33Can someone submit some real world examples of where this would be useful? 
    2934 
    3035== Cons ==