Module Core_kernel.Sequence
This module extends Base.Sequence
with bin_io.
type 'a t
= 'a Base.Sequence.t
include Bin_prot.Binable.S1 with type 'a t := 'a t
val bin_shape_t : Bin_prot.Shape.t -> Bin_prot.Shape.t
val bin_size_t : ('a, 'a t) Bin_prot.Size.sizer1
val bin_write_t : ('a, 'a t) Bin_prot.Write.writer1
val bin_read_t : ('a, 'a t) Bin_prot.Read.reader1
val __bin_read_t__ : ('a, int -> 'a t) Bin_prot.Read.reader1
val bin_writer_t : ('a, 'a t) Bin_prot.Type_class.S1.writer
val bin_reader_t : ('a, 'a t) Bin_prot.Type_class.S1.reader
val bin_t : ('a, 'a t) Bin_prot.Type_class.S1.t
module Step : sig ... end
module Merge_with_duplicates_element : sig ... end
include module type of sig ... end with type 'a t := 'a Base.Sequence.t and module Step := Base.Sequence.Step and module Merge_with_duplicates_element := Base.Sequence.Merge_with_duplicates_element
type 'a t
= 'a Base__Sequence.t
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val sexp_of_t : ('a -> Base.Sexp.t) -> 'a t -> Base.Sexp.t
type 'a sequence
= 'a t
val mem : 'a t -> 'a -> equal:('a -> 'a -> bool) -> bool
val length : 'a t -> int
val is_empty : 'a t -> bool
val iter : 'a t -> f:('a -> unit) -> unit
val fold : 'a t -> init:'accum -> f:('accum -> 'a -> 'accum) -> 'accum
val fold_result : 'a t -> init:'accum -> f:('accum -> 'a -> ('accum, 'e) Base.Result.t) -> ('accum, 'e) Base.Result.t
val fold_until : 'a t -> init:'accum -> f:('accum -> 'a -> ('accum, 'final) Base__.Container_intf.Continue_or_stop.t) -> finish:('accum -> 'final) -> 'final
val exists : 'a t -> f:('a -> bool) -> bool
val for_all : 'a t -> f:('a -> bool) -> bool
val count : 'a t -> f:('a -> bool) -> int
val sum : (module Base__.Container_intf.Summable with type t = 'sum) -> 'a t -> f:('a -> 'sum) -> 'sum
val find : 'a t -> f:('a -> bool) -> 'a option
val find_map : 'a t -> f:('a -> 'b option) -> 'b option
val to_list : 'a t -> 'a list
val to_array : 'a t -> 'a array
val min_elt : 'a t -> compare:('a -> 'a -> int) -> 'a option
val max_elt : 'a t -> compare:('a -> 'a -> int) -> 'a option
val foldi : ('a t, 'a, 'b) Base__.Indexed_container_intf.foldi
val iteri : ('a t, 'a) Base__.Indexed_container_intf.iteri
val existsi : 'a t -> f:(int -> 'a -> bool) -> bool
val counti : 'a t -> f:(int -> 'a -> bool) -> int
val findi : 'a t -> f:(int -> 'a -> bool) -> (int * 'a) option
val find_mapi : 'a t -> f:(int -> 'a -> 'b option) -> 'b option
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
val (>>|) : 'a t -> ('a -> 'b) -> 'b t
module Monad_infix = Base__Sequence.Monad_infix
val bind : 'a t -> f:('a -> 'b t) -> 'b t
val return : 'a -> 'a t
val map : 'a t -> f:('a -> 'b) -> 'b t
val join : 'a t t -> 'a t
val ignore_m : 'a t -> unit t
val all : 'a t list -> 'a list t
val all_unit : unit t list -> unit t
module Let_syntax = Base__Sequence.Let_syntax
module Step = Base__Sequence.Step
val unfold_step : init:'s -> f:('s -> ('a, 's) Step.t) -> 'a t
val unfold : init:'s -> f:('s -> ('a * 's) option) -> 'a t
val unfold_with : 'a t -> init:'s -> f:('s -> 'a -> ('b, 's) Step.t) -> 'b t
val unfold_with_and_finish : 'a t -> init:'s_a -> running_step:('s_a -> 'a -> ('b, 's_a) Step.t) -> inner_finished:('s_a -> 's_b) -> finishing_step:('s_b -> ('b, 's_b) Step.t) -> 'b t
val nth : 'a t -> int -> 'a option
val nth_exn : 'a t -> int -> 'a
val folding_map : 'a t -> init:'b -> f:('b -> 'a -> 'b * 'c) -> 'c t
val folding_mapi : 'a t -> init:'b -> f:(int -> 'b -> 'a -> 'b * 'c) -> 'c t
val mapi : 'a t -> f:(int -> 'a -> 'b) -> 'b t
val filteri : 'a t -> f:(int -> 'a -> bool) -> 'a t
val filter : 'a t -> f:('a -> bool) -> 'a t
val merge : 'a t -> 'a t -> compare:('a -> 'a -> int) -> 'a t
val merge_with_duplicates : 'a t -> 'b t -> compare:('a -> 'b -> int) -> ('a, 'b) Merge_with_duplicates_element.t t
val hd : 'a t -> 'a option
val hd_exn : 'a t -> 'a
val tl : 'a t -> 'a t option
val tl_eagerly_exn : 'a t -> 'a t
val find_exn : 'a t -> f:('a -> bool) -> 'a
val for_alli : 'a t -> f:(int -> 'a -> bool) -> bool
val append : 'a t -> 'a t -> 'a t
val concat : 'a t t -> 'a t
val concat_map : 'a t -> f:('a -> 'b t) -> 'b t
val concat_mapi : 'a t -> f:(int -> 'a -> 'b t) -> 'b t
val interleave : 'a t t -> 'a t
val round_robin : 'a t list -> 'a t
val zip : 'a t -> 'b t -> ('a * 'b) t
val zip_full : 'a t -> 'b t -> [ `Both of 'a * 'b | `Left of 'a | `Right of 'b ] t
val reduce_exn : 'a t -> f:('a -> 'a -> 'a) -> 'a
val reduce : 'a t -> f:('a -> 'a -> 'a) -> 'a option
val group : 'a t -> break:('a -> 'a -> bool) -> 'a list t
val find_consecutive_duplicate : 'a t -> equal:('a -> 'a -> bool) -> ('a * 'a) option
val remove_consecutive_duplicates : 'a t -> equal:('a -> 'a -> bool) -> 'a t
val range : ?stride:int -> ?start:[ `exclusive | `inclusive ] -> ?stop:[ `exclusive | `inclusive ] -> int -> int -> int t
val init : int -> f:(int -> 'a) -> 'a t
val filter_map : 'a t -> f:('a -> 'b option) -> 'b t
val filter_mapi : 'a t -> f:(int -> 'a -> 'b option) -> 'b t
val filter_opt : 'a option t -> 'a t
val sub : 'a t -> pos:int -> len:int -> 'a t
val take : 'a t -> int -> 'a t
val drop : 'a t -> int -> 'a t
val drop_eagerly : 'a t -> int -> 'a t
val take_while : 'a t -> f:('a -> bool) -> 'a t
val drop_while : 'a t -> f:('a -> bool) -> 'a t
val drop_while_option : 'a t -> f:('a -> bool) -> ('a * 'a t) option
val split_n : 'a t -> int -> 'a list * 'a t
val chunks_exn : 'a t -> int -> 'a list t
val shift_right : 'a t -> 'a -> 'a t
val shift_right_with_list : 'a t -> 'a list -> 'a t
val shift_left : 'a t -> int -> 'a t
module Infix = Base__Sequence.Infix
val cartesian_product : 'a t -> 'b t -> ('a * 'b) t
val interleaved_cartesian_product : 'a t -> 'b t -> ('a * 'b) t
val intersperse : 'a t -> sep:'a -> 'a t
val cycle_list_exn : 'a list -> 'a t
val repeat : 'a -> 'a t
val singleton : 'a -> 'a t
val delayed_fold : 'a t -> init:'s -> f:('s -> 'a -> k:('s -> 'r) -> 'r) -> finish:('s -> 'r) -> 'r
val fold_m : bind:('acc_m -> f:('acc -> 'acc_m) -> 'acc_m) -> return:('acc -> 'acc_m) -> 'elt t -> init:'acc -> f:('acc -> 'elt -> 'acc_m) -> 'acc_m
val iter_m : bind:('unit_m -> f:(unit -> 'unit_m) -> 'unit_m) -> return:(unit -> 'unit_m) -> 'elt t -> f:('elt -> 'unit_m) -> 'unit_m
val to_list_rev : 'a t -> 'a list
val of_list : 'a list -> 'a t
val of_lazy : 'a t Base.Lazy.t -> 'a t
val memoize : 'a t -> 'a t
val force_eagerly : 'a t -> 'a t
val bounded_length : 'a t -> at_most:int -> [ `Greater | `Is of int ]
val length_is_bounded_by : ?min:int -> ?max:int -> 'a t -> bool
val of_seq : 'a Base__.Import.Caml.Seq.t -> 'a t
val to_seq : 'a t -> 'a Base__.Import.Caml.Seq.t
module Generator = Base__Sequence.Generator
module Expert = Base__Sequence.Expert
module type Heap = sig ... end
val merge_all : (module Heap) -> 'a t list -> compare:('a -> 'a -> int) -> 'a t
Merges elements from sequences that are assumed to be sorted by
compare
to produce a sequence also sorted bycompare
. If any of the inputs are not sorted, the order of the output is not guaranteed to be sorted.This includes duplicate elements in the output (whether they occur within one input sequence, or across different input sequences).