GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing reasonml.github.io — Reason · Reason lets you write simple, fast and quality type safe code while leveraging both the JavaScript & OCaml ecosystems. Module Stackmodule Stack: sig .. endLast-in first-out stacks. This module implements stacks (LIFOs), with in-place modification.
Unsynchronized accesses Unsynchronized accesses to a stack may lead to an invalid queue state.
Thus, concurrent accesses to stacks must be synchronized (for instance
with a type 'a t
The type of stacks containing elements of type exception Empty
val create : unit -> 'a t Return a new stack, initially empty. val push : 'a -> 'a t -> unit
val pop : 'a t -> 'a
val pop_opt : 'a t -> 'a option
val top : 'a t -> 'a
val top_opt : 'a t -> 'a option
val clear : 'a t -> unit Discard all elements from a stack. val copy : 'a t -> 'a t Return a copy of the given stack. val is_empty : 'a t -> bool Return val length : 'a t -> int Return the number of elements in a stack. Time complexity O(1) val iter : ('a -> unit) -> 'a t -> unit
val fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'b
Stacks and Sequencesval to_seq : 'a t -> 'a Seq.t Iterate on the stack, top to bottom. It is safe to modify the stack during iteration.
val add_seq : 'a t -> 'a Seq.t -> unit Add the elements from the sequence on the top of the stack.
val of_seq : 'a Seq.t -> 'a t Create a stack from the sequence.
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |