(************************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) (* 'a t -> 'a t (** Append an element in front of a stream. *) val thunk : 'a t Lazy.t -> 'a t (** Internalize the lazyness of a stream. *) (** {6 Destructors} *) val is_empty : 'a t -> bool (** Whethere a stream is empty. *) val peek : 'a t -> ('a * 'a t) option (** Return the head and the tail of a stream, if any. *) (** {6 Standard operations} The complexity of stream-returning functions depends on the lazy status of the actual content of the stream, i.e. a lazy stream will be processed lazily. Other functions 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. *) (** {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. *) val lempty : 'a t (** Lazy empty stream. *)