[Haskell-cafe] Constraints on data-types, mis-feature?

Daniil Elovkov daniil.elovkov at googlemail.com
Mon Jul 9 04:12:06 EDT 2007


In the archives of haskell-cafe I found a mention of constraints on
datatypes as a mis-feature of Haskell. In particular, that they're not
propagated well. Can someone elaborate on that?

Also, are they still considered a mis-feature with the emergence of GADTs ?

If I have

data GADT a where
   Alt :: (a -> b -> c) -> GADT a -> GADT b -> GADT c

and I want to constrain all a, b, c.

Would it be better to expose all of them as type vars, rather than
constrain in-place? It would lead to a rather verbose code.

More information about the Haskell-Cafe mailing list