diff options
Diffstat (limited to 'testsuite/tests/stranal/should_compile/map.hs')
-rw-r--r-- | testsuite/tests/stranal/should_compile/map.hs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/should_compile/map.hs b/testsuite/tests/stranal/should_compile/map.hs new file mode 100644 index 0000000000..f4ec1ec769 --- /dev/null +++ b/testsuite/tests/stranal/should_compile/map.hs @@ -0,0 +1,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 + |