package hector

  1. Overview
  2. Docs

This module offers the same API as the standard library module Stdlib.Stack, but is implemented using vectors.

type t = vector
exception Empty
val create : unit -> t
val push : element -> t -> unit
val pop : t -> element
val pop_opt : t -> element option
val drop : t -> unit
val top : t -> element
val top_opt : t -> element option
val clear : t -> unit
val copy : t -> t
val is_empty : t -> bool
val length : t -> int
val iter : (element -> unit) -> t -> unit
val fold : ('s -> element -> 's) -> 's -> t -> 's
val to_seq : t -> element Seq.t
val add_seq : t -> element Seq.t -> unit
val of_seq : element Seq.t -> t
OCaml

Innovation. Community. Security.