]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Effects2.scl
Automatic execution of SCL tests in Maven
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / Effects2.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Effects2.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Effects2.scl
new file mode 100644 (file)
index 0000000..d595ee9
--- /dev/null
@@ -0,0 +1,21 @@
+import "JavaBuiltin" as Java\r
+\r
+importJava "java.util.List" where\r
+    data List a\r
+\r
+    add :: List a -> a -> <Proc> Boolean\r
+\r
+importJava "java.util.ArrayList" where\r
+    @JavaName "<init>"\r
+    arrayList :: Integer -> <Proc> List a\r
+\r
+singleton :: a -> <Proc> List a\r
+singleton el = result\r
+  where\r
+    result = arrayList 1\r
+    r = add result el\r
+\r
+main :: List Integer\r
+main = runProc (singleton (13 :: Integer))\r
+--\r
+[13]
\ No newline at end of file