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