[Haskell-cafe] an idea for modifiyng data/newtype syntax: use `::=` instead of `=`

Jeffrey Brown jeffbrown.the at gmail.com
Thu Aug 20 23:13:26 UTC 2015


Anybody who comes acros "data _ = _" and feels entitled to understand it
before looking up the data keyword is being too lazy.

On Wed, Aug 19, 2015 at 1:09 AM, Alexey Muranov <alexey.muranov at gmail.com>
wrote:

> On 18 août 2015, at 08:16, Richard A. O'Keefe <ok at cs.otago.ac.nz> wrote:
>
> > If you want to argue about the grammar of 'data' declarations,
> > go right ahead.  I myself was a little confused by them at
> > the beginning, because the declare a new type and some
> > constructors, but do not declare 'data' in the sense that a
> > DATA statement in BASIC or Fortran or the DATA DIVISION in
> > COBOL does.  The word 'data' is so very far from conveying
> > the idea "introduce a new type" that it's not funny.
>
> Ok, then, just hypothetically (i do not want to argue about actually
> introducing it), how about
>
>     type Name = String
>     type Date ::= Date Int Int Int
>     type Anniversary ::= Birthday Name Date | Wedding Name Name Date
>
> instead of
>
>     type Name = String
>     data Date = Date Int Int Int
>     data Anniversary = Birthday Name Date | Wedding Name Name Date
>
> ?
>
> Alexey.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150820/5dcb3313/attachment.html>


More information about the Haskell-Cafe mailing list