f4ec1ec769b5b25cca7ae1376c34278e8abfca82
[ghc-hetmet.git] / ghc / tests / stranal / should_compile / map.hs
1 module Test where
2 data Boolean = FF | TT
3 data Pair a b = MkPair a b
4 data LList alpha = Nill | Conss alpha (LList alpha) 
5 data Nat = Zero | Succ Nat
6 data Tree x = Leaf x | Node (Tree x) (Tree x) 
7 data A a = MkA a (A a) 
8
9 {-
10 map :: (a -> b) -> [a] -> [b]
11 map f xs = case xs of
12              []     -> []
13              (y:ys) -> (f y):(map f ys)
14
15 map_ide :: [[a]] -> [[a]]
16 map_ide = map (\x->x)
17 -}
18
19 my_id :: a -> a
20 my_id x = x
21
22 idNat :: Nat -> Nat
23 idNat x = x
24
25 idBool :: Boolean -> Boolean
26 idBool x = x
27
28 fun :: (a->b) -> a -> b
29 fun f x = g f
30  where 
31   g f   = f x
32