summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal/should_compile/map.hs
blob: f4ec1ec769b5b25cca7ae1376c34278e8abfca82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
module Test where
data Boolean = FF | TT
data Pair a b = MkPair a b
data LList alpha = Nill | Conss alpha (LList alpha) 
data Nat = Zero | Succ Nat
data Tree x = Leaf x | Node (Tree x) (Tree x) 
data A a = MkA a (A a) 

{-
map :: (a -> b) -> [a] -> [b]
map f xs = case xs of
             []     -> []
             (y:ys) -> (f y):(map f ys)

map_ide :: [[a]] -> [[a]]
map_ide = map (\x->x)
-}

my_id :: a -> a
my_id x = x

idNat :: Nat -> Nat
idNat x = x

idBool :: Boolean -> Boolean
idBool x = x

fun :: (a->b) -> a -> b
fun f x = g f
 where 
  g f   = f x