aboutsummaryrefslogtreecommitdiff
path: root/lib/iStream.ml
diff options
context:
space:
mode:
authorppedrot2013-08-08 12:28:17 +0000
committerppedrot2013-08-08 12:28:17 +0000
commitf0a83ebe0cb8d1a4815ce551cdca66f13a93c72e (patch)
tree605a87dbc501e431487d8a504d91f05db365e1ee /lib/iStream.ml
parent1f80821a8d3586933201d7094b32f06d29e444d3 (diff)
Small fix in IStream interface.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16667 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/iStream.ml')
-rw-r--r--lib/iStream.ml10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/iStream.ml b/lib/iStream.ml
index 33424b6e44..64cbb5807e 100644
--- a/lib/iStream.ml
+++ b/lib/iStream.ml
@@ -12,9 +12,13 @@ type 'a node =
and 'a t = 'a node Lazy.t
-let empty = Lazy.lazy_from_val Nil
+let lift (n : 'a node) : 'a t = Obj.magic n
+(** Small hack to overcome a missing optimization in OCaml compilation of lazy
+ values. *)
-let cons x s = Lazy.lazy_from_val (Cons (x, s))
+let empty = lift Nil
+
+let cons x s = lift (Cons (x, s))
let thunk s = lazy (Lazy.force (Lazy.force s))
@@ -76,5 +80,3 @@ let rec concat_node = function
and concat (s : 'a t t) =
thunk (lazy (concat_node (Lazy.force s)))
-
-let lempty = empty