[Haskell-cafe] Re: Basic question concerning data constructors

Peter Hercek phercek at gmail.com
Mon Dec 31 14:03:23 EST 2007


Joost Behrends wrote:
> We read 
> 
> data Pair a b = Pair a b
> 
> in YetAnotherHaskellTutorial. And that is all ! If we omit "data" here, this 
> would be a silly pleonasm. And no single word about this strange behavior of 
> "data" in every tutorial i read.

When learning a language, I find it useful to consult grammar to find out
  the relevant part of the syntax; then I can check the Haskell online
  report for explanations.

For example you presented: ... searching for data in
  http://www.hck.sk/users/peter/HaskellEx.htm
... gives you
  http://www.hck.sk/users/peter/HaskellEx.htm#topdecl
... and from there you can quickly find relevant part of Haskel report:
  http://www.haskell.org/onlinereport/decls.html#sect4.2.1

Haskell has a nice html specification online (thanks for it!).

Peter.



More information about the Haskell-Cafe mailing list