X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.runtime%2Fscl%2FLazy.scl;fp=bundles%2Forg.simantics.scl.runtime%2Fscl%2FLazy.scl;h=ccd6a116455b9b8b52d7fa1458f8d25fb127e424;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.runtime/scl/Lazy.scl b/bundles/org.simantics.scl.runtime/scl/Lazy.scl new file mode 100644 index 000000000..ccd6a1164 --- /dev/null +++ b/bundles/org.simantics.scl.runtime/scl/Lazy.scl @@ -0,0 +1,26 @@ +import "Prelude" + +importJava "org.simantics.scl.runtime.lazy.Lazy" where + data Lazy e a + + @JavaName "" + lazy :: ( a) -> Lazy e a + force :: Lazy e a -> a +/* +type LazyList e a = Lazy e (LazyListStr e a) +data LazyListStr e a = LLNil | LLCons a (LazyList e a) + +headLL :: LazyList e a -> Maybe a +headLL ll = match force ll with + LLNil -> Nothing + LLCons h _ -> Just h + +tailLL :: LazyList e a -> Maybe (LazyList e a) +tailLL ll = match force ll with + LLNil -> Nothing + LLCons _ t -> Just t + */ +// data StaticFunction a e b +// data Closure a e b = Closure a (StaticFunction a e b) +// closure :: ( a) -> Closure ? e b +// staticFunction :: StaticFunction a e b -> a -> b