]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Lambda.scl
Automatic execution of SCL tests in Maven
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / Lambda.scl
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
new file mode 100644 (file)
index 0000000..2316b30
--- /dev/null
@@ -0,0 +1,13 @@
+\r
+data List a = Nil | Cons a (List a)\r
+\r
+map :: (a -> b) -> List a -> List b\r
+map f Nil        = Nil\r
+map f (Cons h t) = Cons (f h) (map f t)\r
+\r
+constMap :: a -> List b -> List a\r
+constMap c = map (\x -> c)\r
+\r
+main = constMap (5 :: Integer) (Cons (1 :: Integer) (Cons (2 :: Integer) (Cons (3 :: Integer) Nil)))\r
+--\r
+(Cons 5 (Cons 5 (Cons 5 Nil)))
\ No newline at end of file