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