H98 and H2010 allow a context to be given for datatypes, e.g. the
"Eq a" in
data Eq a => Foo a = Constr a
I have made a proposal to remove support for that context (ticket
#139).
Although I would prefer that contexts of datatypes did the right and
useful thing, in the absence of a proposal of that nature, I am quite
happy to add my +1 to their removal instead.
As Igloo notes, GADTs are a more viable way to achieve the storing of
the dictionary within the constructor, e.g.
data OrdTree a where
Leaf :: a -> OrdTree a
Branch :: Ord a => OrdTree a -> OrdTree a -> OrdTree a
Regards,
Malcolm
_______________________________________________
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime