2 Jul
2010
2 Jul
'10
12:43 a.m.
Leaf and Branch are type-constructors, and "Tree a" is a parametrized type. Constructor is what you actually use to construct trees, but the type (Tree a) you use to annotate values. Like in
let t = Branch (Leaf 1) (Leaf 2) :: Tree Int you constuct a tree with two leaves, and after two colons say, that the type of the tree is Tree Int
Markus