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@gmail.com> wrote:
On 18 août 2015, at 08:16, Richard A. O'Keefe <ok@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@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe