
20 Nov
2010
20 Nov
'10
6:33 a.m.
Andrew Coppin
Now here's an interesting thought. Haskell has "algebraic data types". "Algebraic" because they are sum types of product types (or, equivilently, product types of sum types). Now I don't actually know what those terms mean,
The quick rule to remember this that the size of the resulting types correspond to the arithmetic names. I.e. data Sum a b = A a | B b -- values = values in a + values in b data Prod a b = P a b -- values = values in a * values in b I guess this makes [X] an exponential type, although I don't remember seeing that term :-) -k -- If I haven't seen further, it is by standing in the footprints of giants