> As a matter of fact, I think that the desire in Haskell to have notation
> for types reflect traditional notation for values (e.g [a] for (List a),
> a->b for Hom(a,b), (a,b) for a*b etc), can be too much of a good thing.
Those who have taught FP to beginning students will know that this is
an understatement. C uses a declaration style with a similar
philosophy, contributing little to its clarity.
In Haskell, the problem is most acute with data-types. I invariably
have problems explaining that given:
data Tree a = Leaf a
| Br a (Tree a) (Tree a)
the `Leaf a' above is different (but related to!) `Leaf 3'. A syntax such
as:
data Tree a where
Leaf :: a -> Tree a
Br :: a -> Tree a -> Tree a -> Tree a
or
data Tree a where
Leaf :: a -> t
Br :: a -> t -> t -> t
where type t = Tree a
may be slightly longer but is considerably less confusing.
Besides, this syntax is more uniform being in the spirit of class and instance.
Above all, it reflects most closely the intention of a datatype
definition: viz the creation of constructors.