]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.runtime/scl/Lazy.scl
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.scl.runtime / scl / Lazy.scl
1 import "Prelude"
2
3 importJava "org.simantics.scl.runtime.lazy.Lazy" where
4     data Lazy e a
5     
6     @JavaName "<init>"
7     lazy :: (<e> a) -> Lazy e a
8     force :: Lazy e a -> <e> a
9 /*
10 type LazyList e a = Lazy e (LazyListStr e a)
11 data LazyListStr e a = LLNil | LLCons a (LazyList e a)
12
13 headLL :: LazyList e a -> <e> Maybe a
14 headLL ll = match force ll with
15     LLNil -> Nothing
16     LLCons h _ -> Just h
17
18 tailLL :: LazyList e a -> <e> Maybe (LazyList e a)
19 tailLL ll = match force ll with
20     LLNil -> Nothing
21     LLCons _ t -> Just t
22   */  
23 // data StaticFunction a e b
24 // data Closure a e b = Closure a (StaticFunction a e b)
25 // closure :: (<e> a) -> Closure ? e b
26 // staticFunction :: StaticFunction a e b -> a -> <e> b