]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/LocalDefinitions.scl
Automatic execution of SCL tests in Maven
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / LocalDefinitions.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/LocalDefinitions.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/LocalDefinitions.scl
new file mode 100644 (file)
index 0000000..0e4690a
--- /dev/null
@@ -0,0 +1,12 @@
+\r
+data List a = Nil | Cons a (List a)\r
+\r
+reverse :: List a -> List a\r
+reverse l = do \r
+    reverseAux accum Nil        = accum\r
+    reverseAux accum (Cons h t) = reverseAux (Cons h accum) t\r
+    reverseAux Nil l\r
+    \r
+main = reverse (Cons (1 :: Integer) (Cons (2 :: Integer) (Cons (3 :: Integer) (Cons (4 :: Integer) Nil))))\r
+--\r
+(Cons 4 (Cons 3 (Cons 2 (Cons 1 Nil))))
\ No newline at end of file