Hi Alex,
| Here's some of the threatened examples:
|
| > data OrdFuncExist = OE (Ord a => Char -> a)
| > data OrdListExist = OLE (Ord a => [a])
Perhaps this is a GHC/Hugs difference, but the syntax that you've
used here isn't permitted in Hugs ... and in old versions where it
might have been allowed, it would suggest *universal* quantification
rather than existential.
I just rewrote the definitions to fit with the Hugs syntax for
existentials as follows:
> data OrdFuncExist = forall a. Ord a => OE (Char -> a)
> data OrdListExist = forall a. Ord a => OLE [a]
and now the rest of the code that you sent type checks without any
apparent problem, including emap, blah, and emax.
[We keep trying to argue that it makes sense to use the "forall" keyword
here (because the constructor function that is being defined really does
have a polymorphic type). But perhaps this is a further indication that
the time for a "exists" keyword has come!]
Hope this helps!
All the best,
Mark
----------------------------------------------------------------------------
[EMAIL PROTECTED] Pacific Software Research Center, Oregon Graduate Institute
Looking for a PhD or PostDoc? Interested in joining PacSoft? Let us know!