Haskell's syntax

Arjan van IJzendoorn afie@cs.uu.nl
Tue, 22 Apr 2003 16:47:28 +0200


Hello Paul,

> Of these I think that (3) is most serious.  What I do is tell students
> that a data type declaration such as:
> 
>   data Tree a = Bin (Tree a) a (Tree a) | Nil
> 
> is really a kind of shorthand for:
> 
>   data Tree a where
>     Bin :: Tree a -> a -> Tree a -> Tree a
>     Nil :: Tree a

I like this. And it solves both (3) and (1) (because the bars are gone).

Thanks, Arjan