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