Okasaki v1.0.0 Okasaki.Protocols.Deque protocol View Source

Link to this section Summary

Functions

True if the deque is empty

Inserts a new item to the left end of the deque

Inserts a new item to the right end of the deque

Checks if a certain element is part of the deque

Removes an item from the left side of the deque

Removes an item from the right side of the deque

Returns the number of elements currently in the queue

Converts the deque to a list

Link to this section Types

Link to this section Functions

Link to this function empty?(deque) View Source
empty?(t) :: boolean

True if the deque is empty.

Link to this function insert_left(deque, item) View Source
insert_left(t, item :: any) :: t

Inserts a new item to the left end of the deque.

Link to this function insert_right(deque, item) View Source
insert_right(t, item :: any) :: t

Inserts a new item to the right end of the deque.

Link to this function member?(queue, item) View Source
member?(t, item :: any) :: boolean

Checks if a certain element is part of the deque.

Link to this function remove_left(deque) View Source
remove_left(t) :: {:ok, {item :: any, t}} | {:error, :empty}

Removes an item from the left side of the deque.

Link to this function remove_right(deque) View Source
remove_right(t) :: {:ok, {item :: any, t}} | {:error, :empty}

Removes an item from the right side of the deque.

Link to this function size(deque) View Source
size(t) :: non_neg_integer

Returns the number of elements currently in the queue.

Link to this function to_list(deque) View Source
to_list(t) :: list

Converts the deque to a list.