[Haskell-cafe] an idea for modifiyng data/newtype syntax: use `::=` instead of `=`
Alexey Muranov
alexey.muranov at gmail.com
Sat Aug 8 20:22:12 UTC 2015
Hi, Lars,
On 8 août 2015, at 17:29, Lars Hupel <lars at hupel.info> wrote:
> there is already an alternative syntax for declaring datatypes:
>
> data Date where
> Date :: Int -> Int -> Int -> Date
>
> data Anniversary where
> Birthday :: Name -> Date -> Anniversary
> Wedding :: Name -> Name -> Date -> Anniversary
>
> This is called "GADT syntax" and can be enabled with -XGADTSyntax in GHC.*
Thank you for suggesting GADT, but i already knew about it. IMO this does not make the syntax with the equality sign (the one to which newcomers are introduced first) less weird :).
Alexey.
More information about the Haskell-Cafe
mailing list