(** [filter pred s] - Return a stream of the elements that satisfy pred. *) val filter : ('a -> bool) -> 'a Stream.t -> 'a Stream.t (** Return a list of the elements of a stream *) val to_list : 'a Stream.t -> 'a list (** Apply f to the elements of a stream *) val map : ('a -> 'b) -> 'a Stream.t -> 'b Stream.t (** Combination of map and filter: when f x returns None the element is omitted, when f x returns Some y, y is returned. *) val map_filter : ('a -> 'b option) -> 'a Stream.t -> 'b Stream.t (** Like map, but pass the option to f. This way we get a call to f following the last element -- useful for closing channels. *) val mapopt : ('a option -> 'b option) -> 'a Stream.t -> 'b Stream.t (** Discard the next n elements of a stream. (See Stream.npeek) *) val njunk : int -> 'a Stream.t -> unit (** Like concat but for a stream of streams *) val flatten : 'a Stream.t Stream.t -> 'a Stream.t (** [concat lst] - Concatenate the elements of a list of streams (deprecated, use "flatten (Stream.of_list lst)") *) val concat : 'a Stream.t list -> 'a Stream.t (** Conceptual inverse of flatten. Elements that match the predicate always appear as the first element of a sub-stream. *) val chop : ('a -> bool) -> 'a Stream.t -> 'a Stream.t Stream.t (** Deprecated, use chop. Split up a stream of options at each None. *) val split : 'a option Stream.t -> 'a Stream.t Stream.t (** Don't use this. *) val sort : ('a -> 'a -> int) -> 'a Stream.t -> 'a Stream.t