[Haskell] GADT: call for proper terminology

oleg at pobox.com oleg at pobox.com
Tue Oct 10 22:12:23 EDT 2006


Niklas Broberg wrote:
> Annotate the data type using a GADT:
> data MyData a where
>  MyCon :: MyData a

The range of the data constructor MyCon is the entire type MyData a --
so the above data type is the regular algebraic data type, and can be
written just as
	data MyData a = MyCon
which, some say, makes the fact 'a' is phantom, and the overall intent
clearer.

One may hear phrases how generally awesome and indispensable GADT are;
it is distressing to realize then that sometimes (often?) one is
talking about regular algebraic data types, only in the `where'
syntax.

It helps to reduce confusion about the merits of various features and
additions to Haskell if we use the term GADT exclusively for truly
_generalized_ algebraic data types.




More information about the Haskell mailing list