I would prefer notation like:
data Parser a | Alt (Parser a) (Parser a)
| Map ( b -> a) (Parser b)
| Succ a
Parser (a,b) | Seq (Parser a) (Parser b)
Parser String | Lit (String -> Bool)
Parser [a] | Many (Parser a)
This takes away the noise in the heading of the current GHC notation
(which is just plain confusing), and enables e.g. grouping of common
alternatives,
Doaitse Swierstra
On Oct 11, 2006, at 11:42 PM, Lennart Augustsson wrote:
Well, Kent Petersson and I proposed them as an addition to Haskell
in 1994, so they are not that new. :)
-- Lennart
http://web.cecs.pdx.edu/~sheard/papers/silly.pdf
On Oct 11, 2006, at 09:47 , Paul Hudak wrote:
Lennart Augustsson wrote:
Well, I think the GADT type definition syntax is the syntax data
type definitions should have had from the start. Too bad we
didn't realize it 15 years ago.
-- Lennart
I agree! In my experience teaching Haskell, the current syntax is
a bit confusing for newbies, and for years I've been telling
students, "It really means this: ..." and then I write out a
syntax more like GADT's.
I also think that if we had adopted this syntax from the
beginning, GADT's would have been "discovered" far sooner than now.
-Paul
_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell
_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell