Okasaki v1.0.0 Okasaki.Implementations.ConstantDeque View Source

Deque is an implementation of Chris Okasaki’s Purely Functional Deque

This means that pushing and popping to both ends of the double-ended-queue happen in constant (O(1)) time.

For the paper upon which this is based: http://www.westpoint.edu/eecs/SiteAssets/SitePages/Faculty%20Publication%20Documents/Okasaki/jfp95queue.pdf

Link to this section Summary

Link to this section Types

Link to this section Functions

Link to this function empty(opts \\ []) View Source
empty(opts :: keyword) :: t
Link to this function empty?(constant_deque) View Source
empty?(t) :: boolean
Link to this function insert_left(deque, item) View Source
insert_left(t, item :: any) :: t
Link to this function insert_right(deque, item) View Source
insert_right(t, item :: any) :: t
Link to this function map(deque, fun) View Source
map(t, (any -> any)) :: t
Link to this function member?(queue, item) View Source
member?(t, item :: any) :: boolean
Link to this function remove_left(deque) View Source
remove_left(t) :: {:ok, {any, t}} | {:error, :empty}
Link to this function remove_right(deque) View Source
remove_right(t) :: {:ok, {any, t}} | {:error, :empty}
Link to this function size(deque) View Source
size(t) :: non_neg_integer
Link to this function to_list(deque) View Source
to_list(t) :: list