From 9043add656177eeac1491a73d2f3ab92bec0013c Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Sat, 29 Dec 2018 14:31:27 -0500 Subject: Imported Upstream version 8.8.2 --- clib/iStream.mli | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 clib/iStream.mli (limited to 'clib/iStream.mli') diff --git a/clib/iStream.mli b/clib/iStream.mli new file mode 100644 index 00000000..40d579be --- /dev/null +++ b/clib/iStream.mli @@ -0,0 +1,83 @@ +(************************************************************************) +(* * The Coq Proof Assistant / The Coq Development Team *) +(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *) +(* 'a t -> 'a t +(** Append an element in front of a stream. *) + +val thunk : (unit -> ('a,'a t) u) -> 'a t +(** Internalize the lazyness of a stream. *) + +val make : ('a -> ('b, 'a) u) -> 'a -> 'b t +(** Coiteration constructor. *) + +(** {6 Destructors} *) + +val is_empty : 'a t -> bool +(** Whethere a stream is empty. *) + +val peek : 'a t -> ('a , 'a t) u +(** Return the head and the tail of a stream, if any. *) + +(** {6 Standard operations} + + All stream-returning functions are lazy. The other ones are eager. *) + +val app : 'a t -> 'a t -> 'a t +(** Append two streams. Not tail-rec. *) + +val map : ('a -> 'b) -> 'a t -> 'b t +(** Mapping of streams. Not tail-rec. *) + +val iter : ('a -> unit) -> 'a t -> unit +(** Iteration over streams. *) + +val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a +(** Fold over streams. *) + +val concat : 'a t t -> 'a t +(** Appends recursively a stream of streams. *) + +val map_filter : ('a -> 'b option) -> 'a t -> 'b t +(** Mixing [map] and [filter]. Not tail-rec. *) + +val concat_map : ('a -> 'b t) -> 'a t -> 'b t +(** [concat_map f l] is the same as [concat (map f l)]. *) + +(** {6 Conversions} *) + +val of_list : 'a list -> 'a t +(** Convert a list into a stream. *) + +val to_list : 'a t -> 'a list +(** Convert a stream into a list. *) + +(** {6 Other}*) + +val force : 'a t -> 'a t +(** Forces the whole stream. *) -- cgit v1.2.3