package regular

  1. Overview
  2. Docs

Lazy sequence.

This is the extension of Core_kernel's Sequence module

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

type 'a t = 'a Core_kernel.Std.Sequence.t
include sig ... end
val t_of_sexp : (Sexplib.Sexp.t -> 'a) -> Sexplib.Sexp.t -> 'a t
val bin_t : 'a Core_kernel.Std.Bin_prot.Type_class.t -> 'a t Core_kernel.Std.Bin_prot.Type_class.t
val bin_read_t : 'a Core_kernel.Std.Bin_prot.Read.reader -> 'a t Core_kernel.Std.Bin_prot.Read.reader
val __bin_read_t__ : 'a Core_kernel.Std.Bin_prot.Read.reader -> (int -> 'a t) Core_kernel.Std.Bin_prot.Read.reader
val bin_reader_t : 'a Core_kernel.Std.Bin_prot.Type_class.reader -> 'a t Core_kernel.Std.Bin_prot.Type_class.reader
val bin_size_t : 'a Core_kernel.Std.Bin_prot.Size.sizer -> 'a t Core_kernel.Std.Bin_prot.Size.sizer
val bin_write_t : 'a Core_kernel.Std.Bin_prot.Write.writer -> 'a t Core_kernel.Std.Bin_prot.Write.writer
val bin_writer_t : 'a Core_kernel.Std.Bin_prot.Type_class.writer -> 'a t Core_kernel.Std.Bin_prot.Type_class.writer
include module type of Core_kernel.Std.Sequence with type 'a t := 'a t
val sexp_of_t : ('a -> Sexplib.Sexp.t) -> 'a t -> Sexplib.Sexp.t
type 'a sequence = 'a t
val mem : ?equal:('a -> 'a -> bool) -> 'a t -> 'a -> bool
val length : 'a t -> int
val iter : 'a t -> f:('a -> unit) -> unit
val fold : 'a t -> init:'accum -> f:('accum -> 'a -> 'accum) -> 'accum
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 Core_kernel.Commutative_group.S 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_array : 'a t -> 'a array
val min_elt : 'a t -> cmp:('a -> 'a -> int) -> 'a option
val max_elt : 'a t -> cmp:('a -> 'a -> int) -> 'a option
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
val (>>|) : 'a t -> ('a -> 'b) -> 'b t
module Monad_infix : sig ... end
val bind : 'a t -> ('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_ignore : unit t list -> unit t
module Let_syntax : sig ... end
val empty : 'a t
val next : 'a t -> ('a * 'a t) option
module Step : sig ... end
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 mapi : 'a t -> f:(int -> 'a -> 'b) -> 'b t
val filteri : 'a t -> f:(int -> 'a -> bool) -> 'a t
val merge : 'a t -> 'a t -> cmp:('a -> 'a -> int) -> 'a t
module Merge_with_duplicates_element : sig ... end
val merge_with_duplicates : 'a t -> 'a t -> cmp:('a -> 'a -> int) -> 'a 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 findi : 'a t -> f:(int -> 'a -> bool) -> (int * 'a) option
val find_exn : 'a t -> f:('a -> bool) -> 'a
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 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 iteri : 'a t -> f:(int -> 'a -> unit) -> unit
val foldi : 'a t -> f:(int -> 'b -> 'a -> 'b) -> init:'b -> 'b
val reduce_exn : 'a t -> f:('a -> 'a -> 'a) -> 'a
val reduce : 'a t -> f:('a -> 'a -> 'a) -> 'a option
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 split_n_eagerly : 'a t -> int -> 'a t * 'a t
  • deprecated [since 2015-11] Use {!Sequence.split_n} instead.
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 : sig ... end
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 to_list : 'a t -> 'a list
val to_list_rev : 'a t -> 'a list
val of_list : 'a list -> '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
module Generator : sig ... end
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
val pp : 'a printer -> 'a t printer