[Haskell-cafe] Re: Are GADTs what I need?

Luke Palmer lrpalmer at gmail.com
Tue Jul 14 02:38:51 EDT 2009


On Mon, Jul 13, 2009 at 10:33 PM, Ashley Yakeley <ashley at semantic.org>wrote:

> On Mon, 2009-07-13 at 23:20 -0700, Jason Dagit wrote:
> >          data EqualType a b where
> >            MkEqualType :: EqualType t t
> >
> > Is there any reason to prefer this over:
> > data EqualType a b where
> >   MkEqualType :: EqualType a a
>
> They're exactly the same. Yours just looks a bit "left-biased", that's
> all.


For GADTs I prefer the kind color:

data EqualType :: * -> * -> * where
    MkEqualType :: EqualType a a

Except I don't usually use it, because I mostly use GADT syntax
pedagogically, as introduction to algebraic data types, and introducing
kinds just seems to confuse things further.

Luke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090714/bae5e360/attachment.html


More information about the Haskell-Cafe mailing list