]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.runtime/scl/Lazy.scl
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.scl.runtime / scl / Lazy.scl
diff --git a/bundles/org.simantics.scl.runtime/scl/Lazy.scl b/bundles/org.simantics.scl.runtime/scl/Lazy.scl
new file mode 100644 (file)
index 0000000..ccd6a11
--- /dev/null
@@ -0,0 +1,26 @@
+import "Prelude"
+
+importJava "org.simantics.scl.runtime.lazy.Lazy" where
+    data Lazy e a
+    
+    @JavaName "<init>"
+    lazy :: (<e> a) -> Lazy e a
+    force :: Lazy e a -> <e> a
+/*
+type LazyList e a = Lazy e (LazyListStr e a)
+data LazyListStr e a = LLNil | LLCons a (LazyList e a)
+
+headLL :: LazyList e a -> <e> Maybe a
+headLL ll = match force ll with
+    LLNil -> Nothing
+    LLCons h _ -> Just h
+
+tailLL :: LazyList e a -> <e> 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 :: (<e> a) -> Closure ? e b
+// staticFunction :: StaticFunction a e b -> a -> <e> b