]> gerrit.simantics Code Review - simantics/platform.git/blob - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Map1.scl
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / Map1.scl
1 data List a = Nil | Cons a (List a)
2
3 map f Nil = Nil
4 map f (Cons h t) = Cons (f h) (map f t)
5
6 map2 f l = run l
7   where
8     run Nil = Nil
9     run (Cons h t) = Cons (f h) (run t)
10
11 map3 f l = run l
12   where
13     run Nil = Nil
14     run (Cons h t) = Cons (f h) (map f t)
15     
16 main = "Foo"
17 --
18 Foo