2 data List a = Nil | Cons a (List a)
4 map :: (a -> b) -> List a -> List b
6 map f (Cons h t) = Cons (f h) (map f t)
8 constMap :: a -> List b -> List a
9 constMap c = map (\x -> c)
11 main = constMap (5 :: Integer) (Cons (1 :: Integer) (Cons (2 :: Integer) (Cons (3 :: Integer) Nil)))
13 (Cons 5 (Cons 5 (Cons 5 Nil)))