]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/Forall2.scl
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.scl.compiler / tests / org / simantics / scl / compiler / tests / scl / Forall2.scl
diff --git a/bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/Forall2.scl b/bundles/org.simantics.scl.compiler/tests/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