package server-reason-react
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=b97fbe6a7c3e5e1a7775e0f6498f257acaaa7e272177a9a3e0e50b7a49408d7c
sha512=b27a94618c367c80efef83a41c2a59c9cc7848fd753049ed40fa1f2cface1ef34cf3a995835bf08e2eb59c3186911f429b4706ed07dcb9724df6af5eb012a31d
doc/server-reason-react.belt/Belt/MutableQueue/index.html
Module Belt.MutableQueue
An FIFO(first in first out) queue data structure
First-in first-out queues.
This module implements queues (FIFOs), with in-place modification.
val make : unit -> 'a tval clear : 'a t -> unitDiscard all elements from the queue.
val isEmpty : 'a t -> boolval fromArray : 'a array -> 'a tfromArray a is equivalent to Array.forEach a (add q a)
val add : 'a t -> 'a -> unitadd q x adds the element x at the end of the queue q.
val peek : 'a t -> 'a optionpeekOpt q returns the first element in queue q, without removing it from the queue.
val peekUndefined : 'a t -> 'a Js.undefinedpeekUndefined q returns undefined if not found
val peekExn : 'a t -> 'apeekExn q
raise an exception if q is empty
val pop : 'a t -> 'a optionpop q removes and returns the first element in queue q.
val popUndefined : 'a t -> 'a Js.undefinedpopUndefined q removes and returns the first element in queue q. it will return undefined if it is already empty
val popExn : 'a t -> 'apopExn q
raise an exception if q is empty
val size : 'a t -> intval forEachU : 'a t -> ('a -> unit) -> unitval forEach : 'a t -> ('a -> unit) -> unitforEach q f applies f in turn to all elements of q, from the least recently entered to the most recently entered. The queue itself is unchanged.
val reduceU : 'a t -> 'b -> ('b -> 'a -> 'b) -> 'bval reduce : 'a t -> 'b -> ('b -> 'a -> 'b) -> 'breduce q accu f is equivalent to List.reduce l accu f, where l is the list of q's elements. The queue remains unchanged.
transfer q1 q2 adds all of q1's elements at the end of the queue q2, then clears q1. It is equivalent to the sequence forEach (fun x -> add x q2) q1; clear q1, but runs in constant time.
val toArray : 'a t -> 'a arrayFirst added will be in the beginning of the array