MutableStack

First in last out stack. This module implements stacks, with in-place modification.

clear

RES
let clear: t<'a> => unit

Discard all elements from the stack.

copy

RES
let copy: t<'a> => t<'a>

copy(x) O(1) operation, return a new stack.

dynamicPopIter

RES
let dynamicPopIter: (t<'a>, 'a => unit) => unit

dynamicPopIter(s, f) apply f to each element of s. The item is poped before applying f, s will be empty after this opeartion. This function is useful for worklist algorithm.

dynamicPopIterU

Deprecated

Use dynamicPopIter instead

RES
let dynamicPopIterU: (t<'a>, 'a => unit) => unit

forEach

RES
let forEach: (t<'a>, 'a => unit) => unit

forEachU

Deprecated

Use forEach instead

RES
let forEachU: (t<'a>, 'a => unit) => unit

isEmpty

RES
let isEmpty: t<'a> => bool

make

RES
let make: unit => t<'a>

Returns a new stack, initially empty.

pop

RES
let pop: t<'a> => option<'a>

popOrThrow

RES
let popOrThrow: t<'a> => 'a

push

RES
let push: (t<'a>, 'a) => unit

size

RES
let size: t<'a> => int

t

RES
type t<'a>

top

RES
let top: t<'a> => option<'a>