
12 Dec
2004
12 Dec
'04
5:25 p.m.
On Sun, Dec 12, 2004 at 07:46:42PM +0100, Sebastian Sylvan wrote:
Could someone point me to some documentation on whats being created here and how its used?
It's basically a shorthand for writing accessor functions.
You could do something like: data Tree a = Nil | Node (Tree a) a (Tree a) left (Node l _ _) = l value (Node _ v _) = v right (Node _ _ r) = r
Record field labels can be also used in pattern matching and in record update. Especially the latter is very useful. For more information, see The Haskell 98 Report. Best regards, Tomasz