]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/LocalDefinitions2.scl
Automatic execution of SCL tests in Maven
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / LocalDefinitions2.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/LocalDefinitions2.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/LocalDefinitions2.scl
new file mode 100644 (file)
index 0000000..f17a8be
--- /dev/null
@@ -0,0 +1,14 @@
+\r
+data List a = Nil | Cons a (List a)\r
+\r
+hasEvenLength :: List a -> Boolean\r
+hasEvenLength l = do \r
+    even Nil        = True\r
+    even (Cons _ t) = odd t\r
+    odd  Nil        = False\r
+    odd  (Cons _ t) = even t\r
+    even l\r
+\r
+main = hasEvenLength (Cons (1 :: Integer) (Cons (2 :: Integer) (Cons (3 :: Integer) (Cons (4 :: Integer) Nil))))\r
+--\r
+true
\ No newline at end of file