X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=tests%2Forg.simantics.scl.compiler.tests%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftests%2Fscl%2FLambda.scl;h=2fdff75387ac4985c246b083c22d068f428949c3;hp=2316b30b4aa99a31c077114248ee83d1385a981c;hb=HEAD;hpb=bb5a3edf299cb943999c72c69dd68fb740c8a506 diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Lambda.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Lambda.scl index 2316b30b4..2fdff7538 100644 --- a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Lambda.scl +++ b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Lambda.scl @@ -1,13 +1,13 @@ - -data List a = Nil | Cons a (List a) - -map :: (a -> b) -> List a -> List b -map f Nil = Nil -map f (Cons h t) = Cons (f h) (map f t) - -constMap :: a -> List b -> List a -constMap c = map (\x -> c) - -main = constMap (5 :: Integer) (Cons (1 :: Integer) (Cons (2 :: Integer) (Cons (3 :: Integer) Nil))) --- + +data List a = Nil | Cons a (List a) + +map :: (a -> b) -> List a -> List b +map f Nil = Nil +map f (Cons h t) = Cons (f h) (map f t) + +constMap :: a -> List b -> List a +constMap c = map (\x -> c) + +main = constMap (5 :: Integer) (Cons (1 :: Integer) (Cons (2 :: Integer) (Cons (3 :: Integer) Nil))) +-- (Cons 5 (Cons 5 (Cons 5 Nil))) \ No newline at end of file