Batteries user guide : Batteries.Enum

`sig
type 'a t = 'a BatEnum.t
module type Enumerable =
sig
type 'a enumerable
val enum : 'a enumerable -> 'a t
val of_enum : 'a t -> 'a enumerable
end
type 'a enumerable = 'a t
type 'a mappable = 'a t
val iter : ('a -> unit) -> 'a t -> unit
val iter2 : ('a -> 'b -> unit) -> 'a t -> 'b t -> unit
val exists : ('a -> bool) -> 'a t -> bool
val for_all : ('a -> bool) -> 'a t -> bool
val fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'b
val reduce : ('a -> 'a -> 'a) -> 'a t -> 'a
val sum : int t -> int
val fsum : float t -> float
val fold2 : ('a -> 'b -> 'c -> 'c) -> 'c -> 'a t -> 'b t -> 'c
val scanl : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'b t
val scan : ('a -> 'a -> 'a) -> 'a t -> 'a t
val iteri : (int -> 'a -> unit) -> 'a t -> unit
val iter2i : (int -> 'a -> 'b -> unit) -> 'a t -> 'b t -> unit
val foldi : (int -> 'a -> 'b -> 'b) -> 'b -> 'a t -> 'b
val fold2i : (int -> 'a -> 'b -> 'c -> 'c) -> 'c -> 'a t -> 'b t -> 'c
val find : ('a -> bool) -> 'a t -> 'a
val find_map : ('a -> 'b option) -> 'a t -> 'b
val is_empty : 'a t -> bool
val peek : 'a t -> 'a option
val get : 'a t -> 'a option
val get_exn : 'a t -> 'a
val push : 'a t -> 'a -> unit
val junk : 'a t -> unit
val clone : 'a t -> 'a t
val force : 'a t -> unit
val take : int -> 'a t -> 'a t
val drop : int -> 'a t -> unit
val skip : int -> 'a t -> 'a t
val take_while : ('a -> bool) -> 'a t -> 'a t
val drop_while : ('a -> bool) -> 'a t -> 'a t
val span : ('a -> bool) -> 'a t -> 'a t * 'a t
val break : ('a -> bool) -> 'a t -> 'a t * 'a t
val group : ('a -> 'b) -> 'a t -> 'a t t
val group_by : ('a -> 'a -> bool) -> 'a t -> 'a t t
val clump : int -> ('a -> unit) -> (unit -> 'b) -> 'a t -> 'b t
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t
val filter : ('a -> bool) -> 'a t -> 'a t
val filter_map : ('a -> 'b option) -> 'a t -> 'b t
val append : 'a t -> 'a t -> 'a t
val prefix_action : (unit -> unit) -> 'a t -> 'a t
val suffix_action : (unit -> unit) -> 'a t -> 'a t
val concat : 'a t t -> 'a t
val flatten : 'a t t -> 'a t
exception No_more_elements
exception Infinite_enum
val empty : unit -> 'a t
val make :
next:(unit -> 'a) -> count:(unit -> int) -> clone:(unit -> 'a t) -> 'a t
val from : (unit -> 'a) -> 'a t
val from_while : (unit -> 'a option) -> 'a t
val from_loop : 'b -> ('b -> 'a * 'b) -> 'a t
val seq : 'a -> ('a -> 'a) -> ('a -> bool) -> 'a t
val unfold : 'b -> ('b -> ('a * 'b) option) -> 'a t
val init : int -> (int -> 'a) -> 'a t
val singleton : 'a -> 'a t
val repeat : ?times:int -> 'a -> 'a t
val cycle : ?times:int -> 'a t -> 'a t
val delay : (unit -> 'a t) -> 'a t
val to_object : 'a t -> (< clone : 'b; count : int; next : 'a > as 'b)
val of_object : (< clone : 'b; count : int; next : 'a > as 'b) -> 'a t
val enum : 'a t -> 'a t
val of_enum : 'a t -> 'a t
val count : 'a t -> int
val fast_count : 'a t -> bool
val hard_count : 'a t -> int
val range : ?until:int -> int -> int t
val dup : 'a t -> 'a t * 'a t
val combine : 'a t * 'b t -> ('a * 'b) t
val uncombine : ('a * 'b) t -> 'a t * 'b t
val merge : ('a -> 'a -> bool) -> 'a t -> 'a t -> 'a t
val uniq : 'a t -> 'a t
val switch : ('a -> bool) -> 'a t -> 'a t * 'a t
val partition : ('a -> bool) -> 'a t -> 'a t * 'a t
val arg_min : ('a -> 'b) -> 'a t -> 'a
val arg_max : ('a -> 'b) -> 'a t -> 'a
val while_do : ('a -> bool) -> ('a t -> 'a t) -> 'a t -> 'a t
module Infix :
sig
val ( -- ) : int -> int -> int t
val ( --^ ) : int -> int -> int t
val ( --. ) : float * float -> float -> float t
val ( --- ) : int -> int -> int t
val ( --~ ) : char -> char -> char t
val ( // ) : 'a t -> ('a -> bool) -> 'a t
val ( /@ ) : 'a t -> ('a -> 'b) -> 'b t
val ( @/ ) : ('a -> 'b) -> 'a t -> 'b t
val ( //@ ) : 'a t -> ('a -> 'b option) -> 'b t
val ( @// ) : ('a -> 'b option) -> 'a t -> 'b t
end
val ( -- ) : int -> int -> int t
val ( --^ ) : int -> int -> int t
val ( --. ) : float * float -> float -> float t
val ( --- ) : int -> int -> int t
val ( --~ ) : char -> char -> char t
val ( // ) : 'a t -> ('a -> bool) -> 'a t
val ( /@ ) : 'a t -> ('a -> 'b) -> 'b t
val ( @/ ) : ('a -> 'b) -> 'a t -> 'b t
val ( //@ ) : 'a t -> ('a -> 'b option) -> 'b t
val ( @// ) : ('a -> 'b option) -> 'a t -> 'b t
module WithMonad :
functor (Mon : BatInterfaces.Monad) ->
sig
type 'a m = 'a Mon.m
val sequence : 'a m t -> 'a t m
val fold_monad : ('a -> 'b -> 'a m) -> 'a -> 'b t -> 'a m
end
module Monad :
sig
type 'a m = 'a t
val return : 'a -> 'a m
val bind : 'a m -> ('a -> 'b m) -> 'b m
end
val print :
?first:string ->
?last:string ->
?sep:string ->
('a BatInnerIO.output -> 'b -> unit) ->
'a BatInnerIO.output -> 'b t -> unit
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val ord : ('a -> 'a -> BatOrd.order) -> 'a t -> 'a t -> BatOrd.order
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
module Exceptionless : sig val find : ('a -> bool) -> 'a t -> 'a option end
module Labels :
sig
val iter : f:('a -> unit) -> 'a t -> unit
val iter2 : f:('a -> 'b -> unit) -> 'a t -> 'b t -> unit
val exists : f:('a -> bool) -> 'a t -> bool
val for_all : f:('a -> bool) -> 'a t -> bool
val fold : f:('b -> 'a -> 'b) -> init:'b -> 'a t -> 'b
val fold2 : f:('a -> 'b -> 'c -> 'c) -> init:'c -> 'a t -> 'b t -> 'c
val iteri : f:(int -> 'a -> unit) -> 'a t -> unit
val iter2i : f:(int -> 'a -> 'b -> unit) -> 'a t -> 'b t -> unit
val foldi : f:(int -> 'a -> 'b -> 'b) -> init:'b -> 'a t -> 'b
val fold2i :
f:(int -> 'a -> 'b -> 'c -> 'c) -> init:'c -> 'a t -> 'b t -> 'c
val find : f:('a -> bool) -> 'a t -> 'a
val take_while : f:('a -> bool) -> 'a t -> 'a t
val drop_while : f:('a -> bool) -> 'a t -> 'a t
val map : f:('a -> 'b) -> 'a t -> 'b t
val mapi : f:(int -> 'a -> 'b) -> 'a t -> 'b t
val filter : f:('a -> bool) -> 'a t -> 'a t
val filter_map : f:('a -> 'b option) -> 'a t -> 'b t
val from : f:(unit -> 'a) -> 'a t
val from_while : f:(unit -> 'a option) -> 'a t
val from_loop : init:'b -> f:('b -> 'a * 'b) -> 'a t
val seq : init:'a -> f:('a -> 'a) -> cnd:('a -> bool) -> 'a t
val unfold : init:'b -> f:('b -> ('a * 'b) option) -> 'a t
val init : int -> f:(int -> 'a) -> 'a t
val switch : f:('a -> bool) -> 'a t -> 'a t * 'a t
val compare : ?cmp:('a -> 'a -> int) -> 'a t -> 'a t -> int
module LExceptionless :
sig val find : f:('a -> bool) -> 'a t -> 'a option end
end
val iapp : 'a t -> 'a t -> 'a t
val icons : 'a -> 'a t -> 'a t
val ising : 'a -> 'a t
val lapp : (unit -> 'a t) -> 'a t -> 'a t
val lcons : (unit -> 'a) -> 'a t -> 'a t
val lsing : (unit -> 'a) -> 'a t
val slazy : (unit -> 'a t) -> 'a t
end`