Page
Library
Module
Module type
Parameter
Class
Class type
Source
Sek.MakeSourceThe functor Make constructs an implementation of the signature SEK, and allows the user to choose the value of the parameters described above. Be warned, however, that the number and types of the parameters of this functor may change in the future. Users who want maximum forward compatibility should not use this functor.
module O : OVERWRITE_EMPTY_SLOTSA side appears as a parameter to several operations, such as push and pop, which can operate at either end of a sequence.
A direction appears as a parameter to several operations, such as iter, which can traverse the sequence either forward (from front to back) or backward (from back to front).
The exception Empty is raised by pop and peek operations when applied to an empty sequence.
The submodule Ephemeral, also available under the name E, offers an implementation of ephemeral (mutable) sequences.
The submodule Persistent, also available under the name P, offers an implementation of persistent (immutable) sequences.
P is a short name for the submodule Persistent.
The following functions offer fast conversions between ephemeral and persistent sequences.
snapshot s constructs and returns a persistent sequence whose elements are the elements of s. It is less efficient than snapshot_and_clear, whose use should be preferred, when possible.
snapshot_and_clear s constructs and returns a persistent sequence whose elements are the elements of s. As a side effect, it clears s.
edit s constructs and returns a new ephemeral sequence whose elements are the elements of s.
The submodule Queue is a replacement for OCaml's standard Queue module, where a queue is implemented as an ephemeral sequence. Elements are enqueued at the back end of the sequence and dequeued at the front end.
The submodule Stack is a replacement for OCaml's standard Stack module, where a stack is implemented as an ephemeral sequence. Elements are pushed and popped at the front end of the sequence.
The function call released() does nothing if the library was compiled in release mode, and fails (with an assertion failure) if the library was compiled with assertions enabled.