Fri Aug 26 16:06:33 CEST 2011

Haskell tuples vs. lists

It's interesting to note the symmetry between:

  f [] = ...
  f (x:xs) = ... f xs ...


  instance F () where ...
  instance (F a, F b) => F (a,b) where ...

The f operates on lists of values while the F "operates" on types that
can have a nested structure known at compile time, i.e. (Int,Double)
or (Int,(Int,(Double,())))