package core_kernel

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

A stack implemented with a list.

This module has nearly the same interface as Stack. If you need O(1) copy and to_list, use Linked_stack. Otherwise, Stack is usually faster.

include Stack.S
type 'a t
val t_of_sexp : (Base__.Sexp.t -> 'a) -> Base__.Sexp.t -> 'a t
val sexp_of_t : ('a -> Base__.Sexp.t) -> 'a t -> Base__.Sexp.t
val invariant : 'a Base__.Invariant_intf.inv -> 'a t Base__.Invariant_intf.inv
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 of_list : 'a list -> 'a t
val create : unit -> 'a t
val singleton : 'a -> 'a t
val push : 'a t -> 'a -> unit
val pop : 'a t -> 'a option
val pop_exn : 'a t -> 'a
val top : 'a t -> 'a option
val top_exn : 'a t -> 'a
val clear : 'a t -> unit
val copy : 'a t -> 'a t
val until_empty : 'a t -> ('a -> unit) -> unit
OCaml

Innovation. Community. Security.