]> gerrit.simantics Code Review - simantics/platform.git/blob - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Effects2.scl
(refs #7307) Added features field to SCL module header
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / Effects2.scl
1 import "JavaBuiltin" as Java
2
3 importJava "java.util.List" where
4     data List a
5
6     add :: List a -> a -> <Proc> Boolean
7
8 importJava "java.util.ArrayList" where
9     @JavaName "<init>"
10     arrayList :: Integer -> <Proc> List a
11
12 singleton :: a -> <Proc> List a
13 singleton el = result
14   where
15     result = arrayList 1
16     r = add result el
17
18 main :: List Integer
19 main = runProc (singleton (13 :: Integer))
20 --
21 [13]