[Haskell-cafe] Polymorphic algebraic type constructors

MR K P SCHUPKE k.schupke at imperial.ac.uk
Tue Jun 22 13:20:29 EDT 2004


>to be [] in each case.

ahh but in this example:

 f :: [Int] -> [Bool]
 f (i:is) = even i : f is
 f e@[]   = e

e is an empty list of Ints not an empty list of Bools!

you mean:

f :: [Int] -> [Bool]
 f (i:is) = even i : f is
 f _ = []


Keean.


More information about the Haskell-Cafe mailing list