Here's some of the threatened examples:


> data OrdFuncExist = OE (Ord a => Char -> a)

> data OrdListExist = OLE (Ord a => [a])

> emap :: OrdFuncExist -> [Char] -> OrdListExist
> emap (OE f) l = OLE (map f l)

Grand...  (Apparently.)  But now I try to define an actual OrdFuncExist:

> blah = OE fromEnum

    Inferred type is less polymorphic than expected
        Quantified type variable `a' is unified with `Int'
    In an expression with expected type:
        forall a1. (Ord a1) => Char -> a1
    In the first argument of `OE', namely `fromEnum'
    In the right-hand side of a pattern binding: OE fromEnum

Whaaaaat?  I dinnae unnerstan', captain.


The other problem:

> emax :: OrdListExist -> OrdListExist
> emax (OLE l) = OLE [maximum l]

Now, I think I see why this doesn't work:  but any ideas on how to fix?

Cheers,
Alex.

Reply via email to