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