Hood Melville Queue v0.1.0 HoodMelville View Source

Documentation for HoodMelville.

Link to this section Summary

Link to this section Types

Link to this type

rotation_state()

View Source
rotation_state() ::
  {:reversing, integer(), [term()], [term()], [term()], [term()]}
  | {:idle}
  | {:appending, integer(), [term()], [term()]}
  | {:done, [term()]}

Link to this section Functions

Link to this function

from_list(list)

View Source
from_list(list()) :: queue()

See HoodMelville.head/1.

Link to this function

head(arg)

View Source
head(queue()) :: term() | {:error, :empty_queue}

See HoodMelville.snoc/2.

Link to this function

is_empty(arg)

View Source
is_empty(queue()) :: boolean()

See HoodMelville.empty/0.

Link to this function

tail(arg)

View Source
tail(queue()) :: queue() | {:error, :empty_queue}
Link to this function

to_list(arg)

View Source
to_list(queue()) :: list()
Link to this function

to_list_naive(queue, acc \\ [])

View Source
Link to this function

uncons(arg)

View Source
uncons(queue()) :: {:ok, term(), queue()} | {:error, :empty_queue}