data List a = Nil | Cons a (List a) deriving (Show) map' :: (a -> b) -> List a -> List b map' _ Nil = Nil map' f (Cons x xs) = Cons (f x) (map' f xs)