Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
include module type of struct include Stream end
type 'a t = 'a Stream.t
The type of streams holding values of type 'a
.
Raised by parsers when none of the first components of the stream patterns is accepted.
Raised by parsers when the first component of a stream pattern is accepted, but one of the following components is rejected.
val from : (int -> 'a option) -> 'a t
Stream.from f
returns a stream built from the function f
. To create a new stream element, the function f
is called with the current stream count. The user function f
must return either Some <value>
for a value or None
to specify the end of the stream.
Do note that the indices passed to f
may not start at 0
in the general case. For example, [< '0; '1; Stream.from f >]
would call f
the first time with count 2
.
val of_string : string -> char t
Return the stream of the characters of the string parameter.
val of_bytes : bytes -> char t
Return the stream of the characters of the bytes parameter.
val of_channel : Pervasives.in_channel -> char t
Return the stream of the characters read from the input channel.
val peek : 'a t -> 'a option
Return Some
of "the first element" of the stream, or None
if the stream is empty.
val junk : 'a t -> unit
Remove the first element of the stream, possibly unfreezing it before.
val count : 'a t -> int
Return the current count of the stream elements, i.e. the number of the stream elements discarded.
val next_exn : 'a t -> 'a
val next : 'a t -> 'a option
val npeek : 'a t -> int -> 'a list
val is_empty : 'a t -> bool
val empty : unit -> 'a t
val of_list : 'a list -> 'a t
val iteri : 'a t -> f:(int -> 'a -> 'b) -> unit
val iter : 'a t -> f:('a -> 'b) -> unit
val find_map : 'a t -> f:('a -> 'b option) -> 'b option
val find : 'a t -> f:('a -> bool) -> 'a option
val find_exn : 'a t -> f:('a -> bool) -> 'a
val exists : 'a t -> f:('a -> bool) -> bool
val for_all : 'a t -> f:('a -> bool) -> bool
val foldi : 'a t -> init:'b -> f:(int -> 'b -> 'a -> 'b) -> 'b
val fold : 'a t -> init:'b -> f:('b -> 'a -> 'b) -> 'b
val reduce : 'a t -> f:('a -> 'a -> 'a) -> 'a
val sum : int t -> int
val fsum : float t -> float
val drop_whilei : 'a t -> f:(int -> 'a -> bool) -> unit
val drop_while : 'a t -> f:('a -> bool) -> unit
val drop : 'a t -> n:int -> unit
val init : int -> f:(int -> 'a) -> 'a t
val singleton : 'a -> 'a t
val to_list : 'a t -> 'a Core.Std.List.t
val unfoldi : 'a -> f:(int -> 'a -> ('b * 'a) option) -> 'b t
val unfold : 'a -> f:('a -> ('b * 'a) option) -> 'b t
val range : ?until:int -> int -> int t
val strings_of_channel :
?buffer_size:int ->
Core.Std.In_channel.t ->
Core.Std.String.t t
val of_array : 'a Core.Std.Array.t -> 'a Stream.t
val to_array : 'a t -> 'a Core.Std.Array.t
val of_hashtbl :
('a, 'b) Core.Std.Hashtbl.t ->
('a Core.Std.Hashtbl.key * 'b) t
val to_hashtbl :
('a Core.Std.Hashtbl.Poly.key * 'b) t ->
('a, 'b) Core.Std.Hashtbl.Poly.t
val of_map : ('a, 'b, 'c) Core.Std.Map.t -> ('a * 'b) t
val to_map : ('a * 'b) t -> ('a, 'b) Core.Std.Map.Poly.t
val of_set : ('a, 'b) Core.Std.Set.t -> 'a t
val to_set : 'a t -> 'a Core.Std.Set.Poly.t
module Infix : sig ... end