343e36ad47aa81691d6c43adeaebc823bb583cf2
[ghc-hetmet.git] / ghc / compiler / tests / stranal / map.lhs
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 > id :: a -> a
20 > 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