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

Innovation. Community. Security.