2 data List a = Nil | Cons a (List a)
4 first :: List Integer -> Integer
5 //first Nil = 0 :: Integer
8 reverse :: List a -> List a
9 reverse l = reverseAux Nil l
11 reverseAux accum Nil = accum
12 reverseAux accum (Cons h t) = reverseAux (Cons h accum) t
15 main = first (reverse l)
17 l = Cons (1 :: Integer) (Cons (2 :: Integer) (Cons (3 :: Integer) Nil))