2 data List a = Nil | Cons a (List a)
\r
4 hasEvenLength :: List a -> Boolean
\r
5 hasEvenLength l = do
\r
7 even (Cons _ t) = odd t
\r
9 odd (Cons _ t) = even t
\r
12 main = hasEvenLength (Cons (1 :: Integer) (Cons (2 :: Integer) (Cons (3 :: Integer) (Cons (4 :: Integer) Nil))))
\r