package bap-std

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Lazy sequence

type abbreviation for 'a Sequence.t

Lazy sequence.

This is the extension of Core_kernel@@warning "-D"'s Sequence module

@see <https://ocaml.janestreet.com/ocaml-core/latest/doc/core_kernel/Std/Sequence.mod/> Sequence

type 'a t = 'a Base.Sequence.t
include Core_kernel.Bin_prot.Binable.S1 with type 'a t := 'a t
include Ppx_sexp_conv_lib.Sexpable.S1 with type 'a t := 'a t
val t_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> Sexplib0__.Sexp.t -> 'a t
include module type of Core_kernel.Sequence with type 'a t := 'a 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 Merge_with_duplicates_element = Core_kernel.Sequence.Merge_with_duplicates_element
include module type of struct include Base.Sequence 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
val equal : ('a -> 'a -> bool) -> 'a Base.Sequence.t -> 'a Base.Sequence.t -> bool
val sexp_of_t : ('a -> Base__.Ppx_sexp_conv_lib.Sexp.t) -> 'a Base.Sequence.t -> Base__.Ppx_sexp_conv_lib.Sexp.t
type 'a sequence = 'a Base.Sequence.t
val mem : 'a Base.Sequence.t -> 'a -> equal:('a -> 'a -> bool) -> bool
val length : 'a Base.Sequence.t -> int
val iter : 'a Base.Sequence.t -> f:('a -> unit) -> unit
val fold : 'a Base.Sequence.t -> init:'accum -> f:('accum -> 'a -> 'accum) -> 'accum
val fold_result : 'a Base.Sequence.t -> init:'accum -> f:('accum -> 'a -> ('accum, 'e) Base__.Result.t) -> ('accum, 'e) Base__.Result.t
val fold_until : 'a Base.Sequence.t -> init:'accum -> f:('accum -> 'a -> ('accum, 'final) Base__Container_intf.Continue_or_stop.t) -> finish:('accum -> 'final) -> 'final
val exists : 'a Base.Sequence.t -> f:('a -> bool) -> bool
val for_all : 'a Base.Sequence.t -> f:('a -> bool) -> bool
val count : 'a Base.Sequence.t -> f:('a -> bool) -> int
val sum : (module Base__Container_intf.Summable with type t = 'sum) -> 'a Base.Sequence.t -> f:('a -> 'sum) -> 'sum
val find : 'a Base.Sequence.t -> f:('a -> bool) -> 'a option
val find_map : 'a Base.Sequence.t -> f:('a -> 'b option) -> 'b option
val to_list : 'a Base.Sequence.t -> 'a list
val to_array : 'a Base.Sequence.t -> 'a array
val min_elt : 'a Base.Sequence.t -> compare:('a -> 'a -> int) -> 'a option
val max_elt : 'a Base.Sequence.t -> compare:('a -> 'a -> int) -> 'a option
val foldi : ('a Base.Sequence.t, 'a, 'b) Base__Indexed_container_intf.foldi
val iteri : ('a Base.Sequence.t, 'a) Base__Indexed_container_intf.iteri
val existsi : 'a Base.Sequence.t -> f:(int -> 'a -> bool) -> bool
val counti : 'a Base.Sequence.t -> f:(int -> 'a -> bool) -> int
val findi : 'a Base.Sequence.t -> f:(int -> 'a -> bool) -> (int * 'a) option
val find_mapi : 'a Base.Sequence.t -> f:(int -> 'a -> 'b option) -> 'b option
val (>>=) : 'a Base.Sequence.t -> ('a -> 'b Base.Sequence.t) -> 'b Base.Sequence.t
val (>>|) : 'a Base.Sequence.t -> ('a -> 'b) -> 'b Base.Sequence.t
val bind : 'a Base.Sequence.t -> f:('a -> 'b Base.Sequence.t) -> 'b Base.Sequence.t
val return : 'a -> 'a Base.Sequence.t
val map : 'a Base.Sequence.t -> f:('a -> 'b) -> 'b Base.Sequence.t
val join : 'a Base.Sequence.t Base.Sequence.t -> 'a Base.Sequence.t
val ignore_m : 'a Base.Sequence.t -> unit Base.Sequence.t
val all : 'a Base.Sequence.t list -> 'a list Base.Sequence.t
val all_unit : unit Base.Sequence.t list -> unit Base.Sequence.t
val empty : 'a Base.Sequence.t
val next : 'a Base.Sequence.t -> ('a * 'a Base.Sequence.t) option
val unfold_step : init:'s -> f:('s -> ('a, 's) Base.Sequence.Step.t) -> 'a Base.Sequence.t
val unfold : init:'s -> f:('s -> ('a * 's) option) -> 'a Base.Sequence.t
val unfold_with : 'a Base.Sequence.t -> init:'s -> f:('s -> 'a -> ('b, 's) Base.Sequence.Step.t) -> 'b Base.Sequence.t
val unfold_with_and_finish : 'a Base.Sequence.t -> init:'s_a -> running_step:('s_a -> 'a -> ('b, 's_a) Base.Sequence.Step.t) -> inner_finished:('s_a -> 's_b) -> finishing_step:('s_b -> ('b, 's_b) Base.Sequence.Step.t) -> 'b Base.Sequence.t
val nth : 'a Base.Sequence.t -> int -> 'a option
val nth_exn : 'a Base.Sequence.t -> int -> 'a
val folding_map : 'a Base.Sequence.t -> init:'b -> f:('b -> 'a -> 'b * 'c) -> 'c Base.Sequence.t
val folding_mapi : 'a Base.Sequence.t -> init:'b -> f:(int -> 'b -> 'a -> 'b * 'c) -> 'c Base.Sequence.t
val mapi : 'a Base.Sequence.t -> f:(int -> 'a -> 'b) -> 'b Base.Sequence.t
val filteri : 'a Base.Sequence.t -> f:(int -> 'a -> bool) -> 'a Base.Sequence.t
val merge : 'a Base.Sequence.t -> 'a Base.Sequence.t -> compare:('a -> 'a -> int) -> 'a Base.Sequence.t
val merge_with_duplicates : 'a Base.Sequence.t -> 'b Base.Sequence.t -> compare:('a -> 'b -> int) -> ('a, 'b) Base.Sequence.Merge_with_duplicates_element.t Base.Sequence.t
val hd : 'a Base.Sequence.t -> 'a option
val hd_exn : 'a Base.Sequence.t -> 'a
val tl : 'a Base.Sequence.t -> 'a Base.Sequence.t option
val tl_eagerly_exn : 'a Base.Sequence.t -> 'a Base.Sequence.t
val find_exn : 'a Base.Sequence.t -> f:('a -> bool) -> 'a
val for_alli : 'a Base.Sequence.t -> f:(int -> 'a -> bool) -> bool
val append : 'a Base.Sequence.t -> 'a Base.Sequence.t -> 'a Base.Sequence.t
val concat : 'a Base.Sequence.t Base.Sequence.t -> 'a Base.Sequence.t
val concat_map : 'a Base.Sequence.t -> f:('a -> 'b Base.Sequence.t) -> 'b Base.Sequence.t
val concat_mapi : 'a Base.Sequence.t -> f:(int -> 'a -> 'b Base.Sequence.t) -> 'b Base.Sequence.t
val interleave : 'a Base.Sequence.t Base.Sequence.t -> 'a Base.Sequence.t
val round_robin : 'a Base.Sequence.t list -> 'a Base.Sequence.t
val zip : 'a Base.Sequence.t -> 'b Base.Sequence.t -> ('a * 'b) Base.Sequence.t
val zip_full : 'a Base.Sequence.t -> 'b Base.Sequence.t -> [ `Both of 'a * 'b | `Left of 'a | `Right of 'b ] Base.Sequence.t
val reduce_exn : 'a Base.Sequence.t -> f:('a -> 'a -> 'a) -> 'a
val reduce : 'a Base.Sequence.t -> f:('a -> 'a -> 'a) -> 'a option
val group : 'a Base.Sequence.t -> break:('a -> 'a -> bool) -> 'a list Base.Sequence.t
val find_consecutive_duplicate : 'a Base.Sequence.t -> equal:('a -> 'a -> bool) -> ('a * 'a) option
val remove_consecutive_duplicates : 'a Base.Sequence.t -> equal:('a -> 'a -> bool) -> 'a Base.Sequence.t
val range : ?stride:int -> ?start:[ `exclusive | `inclusive ] -> ?stop:[ `exclusive | `inclusive ] -> int -> int -> int Base.Sequence.t
val init : int -> f:(int -> 'a) -> 'a Base.Sequence.t
val filter_map : 'a Base.Sequence.t -> f:('a -> 'b option) -> 'b Base.Sequence.t
val filter_mapi : 'a Base.Sequence.t -> f:(int -> 'a -> 'b option) -> 'b Base.Sequence.t
val filter_opt : 'a option Base.Sequence.t -> 'a Base.Sequence.t
val sub : 'a Base.Sequence.t -> pos:int -> len:int -> 'a Base.Sequence.t
val take : 'a Base.Sequence.t -> int -> 'a Base.Sequence.t
val drop : 'a Base.Sequence.t -> int -> 'a Base.Sequence.t
val drop_eagerly : 'a Base.Sequence.t -> int -> 'a Base.Sequence.t
val take_while : 'a Base.Sequence.t -> f:('a -> bool) -> 'a Base.Sequence.t
val drop_while : 'a Base.Sequence.t -> f:('a -> bool) -> 'a Base.Sequence.t
val drop_while_option : 'a Base.Sequence.t -> f:('a -> bool) -> ('a * 'a Base.Sequence.t) option
val split_n : 'a Base.Sequence.t -> int -> 'a list * 'a Base.Sequence.t
val chunks_exn : 'a Base.Sequence.t -> int -> 'a list Base.Sequence.t
val shift_right : 'a Base.Sequence.t -> 'a -> 'a Base.Sequence.t
val shift_right_with_list : 'a Base.Sequence.t -> 'a list -> 'a Base.Sequence.t
val shift_left : 'a Base.Sequence.t -> int -> 'a Base.Sequence.t
val cartesian_product : 'a Base.Sequence.t -> 'b Base.Sequence.t -> ('a * 'b) Base.Sequence.t
val interleaved_cartesian_product : 'a Base.Sequence.t -> 'b Base.Sequence.t -> ('a * 'b) Base.Sequence.t
val intersperse : 'a Base.Sequence.t -> sep:'a -> 'a Base.Sequence.t
val cycle_list_exn : 'a list -> 'a Base.Sequence.t
val repeat : 'a -> 'a Base.Sequence.t
val singleton : 'a -> 'a Base.Sequence.t
val delayed_fold : 'a Base.Sequence.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 Base.Sequence.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 Base.Sequence.t -> f:('elt -> 'unit_m) -> 'unit_m
val to_list_rev : 'a Base.Sequence.t -> 'a list
val of_list : 'a list -> 'a Base.Sequence.t
val of_lazy : 'a Base.Sequence.t Base__.Lazy.t -> 'a Base.Sequence.t
val memoize : 'a Base.Sequence.t -> 'a Base.Sequence.t
val force_eagerly : 'a Base.Sequence.t -> 'a Base.Sequence.t
val bounded_length : 'a Base.Sequence.t -> at_most:int -> [ `Greater | `Is of int ]
val length_is_bounded_by : ?min:int -> ?max:int -> 'a Base.Sequence.t -> bool
val of_seq : 'a Base__.Import.Caml.Seq.t -> 'a Base.Sequence.t
val to_seq : 'a Base.Sequence.t -> 'a Base__.Import.Caml.Seq.t
module type Heap = Core_kernel.Sequence.Heap
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 by compare. 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).

val filter : 'a t -> f:('a -> bool) -> 'a t

for compatibility with Core <= 111.28

val compare : ('a -> 'b -> int) -> 'a t -> 'b t -> int
val of_array : 'a array -> 'a t
val cons : 'a -> 'a t -> 'a t
val is_empty : 'a t -> bool
OCaml

Innovation. Community. Security.