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

Jim Apple jbapple+haskell-cafe at gmail.com
Tue Jul 10 13:05:12 EDT 2007


On 7/9/07, Jonathan Cast <jcast at ou.edu> wrote:
> GADTs don't change anything (at least, not the last time I checked).

GHC (in HEAD, at least) eliminates this wart for any datatype declared
with GADT syntax.

http://www.haskell.org/ghc/dist/current/docs/users_guide/data-type-extensions.html#gadt-style

"Any data type that can be declared in standard Haskell-98 syntax can
also be declared using GADT-style syntax. The choice is largely
stylistic, but GADT-style declarations differ in one important
respect: they treat class constraints on the data constructors
differently. Specifically, if the constructor is given a type-class
context, that context is made available by pattern matching."

Jim


More information about the Haskell-Cafe mailing list