RE: First-class types

2003-03-05 Thread Simon Peyton-Jones
| 1) Coerce a a can be defined as coerce=id for all a. However, this |may of course lead to overlap in the type structure, so we must |write a separate instance definition for Coerce Int Int, Coerce |Double Double, etc. if we want types to be decidable. I'd love for |some clever

Re: First-class types

2003-03-04 Thread Jan-Willem Maessen
Simon PJ replies: > Ingenious, but unnecessarily complicated. You don't need existential > types at all. > (See the code below, which is considerably simpler and, I fancy, a bit > more efficient.) Also, I'm not sure why you make 'Type' (which is > pretty much the Typable class in the Dynamic libra

RE: First-class types

2003-03-04 Thread Simon Peyton-Jones
| The following is a more flexible alternative to overloading. We | essentially define a function on types and invoke it, seemingly at run | time. No Dynamics or unsafe computations are employed. We only need | existential types, multi-parameter classes and functional | dependencies. The code also