]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Forall2.scl
Automatic execution of SCL tests in Maven
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / Forall2.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Forall2.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Forall2.scl
new file mode 100644 (file)
index 0000000..97d1c35
--- /dev/null
@@ -0,0 +1,9 @@
+\r
+data List a = Nil | Cons a (List a)\r
+\r
+build :: (forall l. l -> (a -> l -> l) -> l) -> List a\r
+build f = f Nil Cons\r
+\r
+main = build (\nil cons -> cons (1 :: Integer) (cons (2 :: Integer) nil))\r
+-- \r
+(Cons 1 (Cons 2 Nil))
\ No newline at end of file