-\r
-data List a = Nil | Cons a (List a)\r
-\r
-map :: (a -> b) -> List a -> List b\r
-map f Nil = Nil\r
-map f (Cons h t) = Cons (f h) (map f t)\r
-\r
-constMap :: a -> List b -> List a\r
-constMap c = map (\x -> c)\r
-\r
-main = constMap (5 :: Integer) (Cons (1 :: Integer) (Cons (2 :: Integer) (Cons (3 :: Integer) Nil)))\r
---\r
+
+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)))
\ No newline at end of file