]> gerrit.simantics Code Review - simantics/platform.git/blob - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/LocalDefinitions2.scl
Merge commit '876ede6'
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / LocalDefinitions2.scl
1 \r
2 data List a = Nil | Cons a (List a)\r
3 \r
4 hasEvenLength :: List a -> Boolean\r
5 hasEvenLength l = do \r
6     even Nil        = True\r
7     even (Cons _ t) = odd t\r
8     odd  Nil        = False\r
9     odd  (Cons _ t) = even t\r
10     even l\r
11 \r
12 main = hasEvenLength (Cons (1 :: Integer) (Cons (2 :: Integer) (Cons (3 :: Integer) (Cons (4 :: Integer) Nil))))\r
13 --\r
14 true