[Haskell-beginners] a bunch o' questions

Markus Läll markus.l2ll at gmail.com
Thu Jul 1 12:43:04 EDT 2010


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


More information about the Beginners mailing list