aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2014-07-22 13:53:50 +0200
committerPierre-Marie Pédrot2014-07-22 13:53:50 +0200
commit062d07eb5446c1032fda232b9a09e20e5410dd92 (patch)
tree807b805fc0eebb3c8f0f27b9091ab751778b70d4 /lib
parent3007da7147d86f2e85347b9e70c1faea7d2eed06 (diff)
Adding a "is_val" primitive to IStream.
Diffstat (limited to 'lib')
-rw-r--r--lib/iStream.ml2
-rw-r--r--lib/iStream.mli3
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/iStream.ml b/lib/iStream.ml
index 36b9c43ad0..ef69eaf2b0 100644
--- a/lib/iStream.ml
+++ b/lib/iStream.ml
@@ -38,6 +38,8 @@ let is_empty s = match Lazy.force s with
let peek = Lazy.force
+let is_val = Lazy.is_val
+
let rec of_list = function
| [] -> empty
| x :: l -> cons x (of_list l)
diff --git a/lib/iStream.mli b/lib/iStream.mli
index a059570107..67e5e0764f 100644
--- a/lib/iStream.mli
+++ b/lib/iStream.mli
@@ -42,6 +42,9 @@ val is_empty : 'a t -> bool
val peek : 'a t -> ('a , 'a t) u
(** Return the head and the tail of a stream, if any. *)
+val is_val : 'a t -> bool
+(** Check if the head has already been evaluated. *)
+
(** {6 Standard operations}
All stream-returning functions are lazy. The other ones are eager. *)