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.tval bin_size_t : ('a, 'a t) Bin_prot.Size.sizer1val bin_write_t : ('a, 'a t) Bin_prot.Write.writer1val bin_read_t : ('a, 'a t) Bin_prot.Read.reader1val __bin_read_t__ : ('a, int -> 'a t) Bin_prot.Read.reader1val bin_writer_t : ('a, 'a t) Bin_prot.Type_class.S1.writerval bin_reader_t : ('a, 'a t) Bin_prot.Type_class.S1.readerval bin_t : ('a, 'a t) Bin_prot.Type_class.S1.t
module Step : sig ... endmodule Merge_with_duplicates_element : sig ... endinclude 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 -> intval equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> boolval 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) -> boolval length : 'a t -> intval is_empty : 'a t -> boolval iter : 'a t -> f:('a -> unit) -> unitval fold : 'a t -> init:'accum -> f:('accum -> 'a -> 'accum) -> 'accumval fold_result : 'a t -> init:'accum -> f:('accum -> 'a -> ('accum, 'e) Base.Result.t) -> ('accum, 'e) Base.Result.tval fold_until : 'a t -> init:'accum -> f:('accum -> 'a -> ('accum, 'final) Base__.Container_intf.Continue_or_stop.t) -> finish:('accum -> 'final) -> 'finalval exists : 'a t -> f:('a -> bool) -> boolval for_all : 'a t -> f:('a -> bool) -> boolval count : 'a t -> f:('a -> bool) -> intval sum : (module Base__.Container_intf.Summable with type t = 'sum) -> 'a t -> f:('a -> 'sum) -> 'sumval find : 'a t -> f:('a -> bool) -> 'a optionval find_map : 'a t -> f:('a -> 'b option) -> 'b optionval to_list : 'a t -> 'a listval to_array : 'a t -> 'a arrayval min_elt : 'a t -> compare:('a -> 'a -> int) -> 'a optionval max_elt : 'a t -> compare:('a -> 'a -> int) -> 'a optionval foldi : ('a t, 'a, 'b) Base__.Indexed_container_intf.foldival iteri : ('a t, 'a) Base__.Indexed_container_intf.iterival existsi : 'a t -> f:(int -> 'a -> bool) -> boolval counti : 'a t -> f:(int -> 'a -> bool) -> intval findi : 'a t -> f:(int -> 'a -> bool) -> (int * 'a) optionval find_mapi : 'a t -> f:(int -> 'a -> 'b option) -> 'b optionval (>>=) : 'a t -> ('a -> 'b t) -> 'b tval (>>|) : 'a t -> ('a -> 'b) -> 'b t
module Monad_infix = Base__Sequence.Monad_infixval bind : 'a t -> f:('a -> 'b t) -> 'b tval return : 'a -> 'a tval map : 'a t -> f:('a -> 'b) -> 'b tval join : 'a t t -> 'a tval ignore_m : 'a t -> unit tval all : 'a t list -> 'a list tval all_unit : unit t list -> unit t
module Let_syntax = Base__Sequence.Let_syntaxmodule Step = Base__Sequence.Stepval unfold_step : init:'s -> f:('s -> ('a, 's) Step.t) -> 'a tval unfold : init:'s -> f:('s -> ('a * 's) option) -> 'a tval unfold_with : 'a t -> init:'s -> f:('s -> 'a -> ('b, 's) Step.t) -> 'b tval 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 tval nth : 'a t -> int -> 'a optionval nth_exn : 'a t -> int -> 'aval folding_map : 'a t -> init:'b -> f:('b -> 'a -> 'b * 'c) -> 'c tval folding_mapi : 'a t -> init:'b -> f:(int -> 'b -> 'a -> 'b * 'c) -> 'c tval mapi : 'a t -> f:(int -> 'a -> 'b) -> 'b tval filteri : 'a t -> f:(int -> 'a -> bool) -> 'a tval filter : 'a t -> f:('a -> bool) -> 'a tval 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 tval hd : 'a t -> 'a optionval hd_exn : 'a t -> 'aval tl : 'a t -> 'a t optionval tl_eagerly_exn : 'a t -> 'a tval find_exn : 'a t -> f:('a -> bool) -> 'aval for_alli : 'a t -> f:(int -> 'a -> bool) -> boolval append : 'a t -> 'a t -> 'a tval concat : 'a t t -> 'a tval concat_map : 'a t -> f:('a -> 'b t) -> 'b tval concat_mapi : 'a t -> f:(int -> 'a -> 'b t) -> 'b tval interleave : 'a t t -> 'a tval round_robin : 'a t list -> 'a tval zip : 'a t -> 'b t -> ('a * 'b) tval zip_full : 'a t -> 'b t -> [ `Both of 'a * 'b | `Left of 'a | `Right of 'b ] tval reduce_exn : 'a t -> f:('a -> 'a -> 'a) -> 'aval reduce : 'a t -> f:('a -> 'a -> 'a) -> 'a optionval group : 'a t -> break:('a -> 'a -> bool) -> 'a list tval find_consecutive_duplicate : 'a t -> equal:('a -> 'a -> bool) -> ('a * 'a) optionval remove_consecutive_duplicates : 'a t -> equal:('a -> 'a -> bool) -> 'a tval range : ?stride:int -> ?start:[ `exclusive | `inclusive ] -> ?stop:[ `exclusive | `inclusive ] -> int -> int -> int tval init : int -> f:(int -> 'a) -> 'a tval filter_map : 'a t -> f:('a -> 'b option) -> 'b tval filter_mapi : 'a t -> f:(int -> 'a -> 'b option) -> 'b tval filter_opt : 'a option t -> 'a tval sub : 'a t -> pos:int -> len:int -> 'a tval take : 'a t -> int -> 'a tval drop : 'a t -> int -> 'a tval drop_eagerly : 'a t -> int -> 'a tval take_while : 'a t -> f:('a -> bool) -> 'a tval drop_while : 'a t -> f:('a -> bool) -> 'a tval drop_while_option : 'a t -> f:('a -> bool) -> ('a * 'a t) optionval split_n : 'a t -> int -> 'a list * 'a tval chunks_exn : 'a t -> int -> 'a list tval shift_right : 'a t -> 'a -> 'a tval shift_right_with_list : 'a t -> 'a list -> 'a tval shift_left : 'a t -> int -> 'a t
module Infix = Base__Sequence.Infixval cartesian_product : 'a t -> 'b t -> ('a * 'b) tval interleaved_cartesian_product : 'a t -> 'b t -> ('a * 'b) tval intersperse : 'a t -> sep:'a -> 'a tval cycle_list_exn : 'a list -> 'a tval repeat : 'a -> 'a tval singleton : 'a -> 'a tval delayed_fold : 'a t -> init:'s -> f:('s -> 'a -> k:('s -> 'r) -> 'r) -> finish:('s -> 'r) -> 'rval 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_mval iter_m : bind:('unit_m -> f:(unit -> 'unit_m) -> 'unit_m) -> return:(unit -> 'unit_m) -> 'elt t -> f:('elt -> 'unit_m) -> 'unit_mval to_list_rev : 'a t -> 'a listval of_list : 'a list -> 'a tval of_lazy : 'a t Base.Lazy.t -> 'a tval memoize : 'a t -> 'a tval force_eagerly : 'a t -> 'a tval bounded_length : 'a t -> at_most:int -> [ `Greater | `Is of int ]val length_is_bounded_by : ?min:int -> ?max:int -> 'a t -> bool
module Generator = Base__Sequence.Generatormodule Expert = Base__Sequence.Expertmodule type Heap = sig ... endval merge_all : (module Heap) -> 'a t list -> compare:('a -> 'a -> int) -> 'a tMerges elements from sequences that are assumed to be sorted by
compareto 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).