exqueue v0.1.2 FList.FTree View Source

In this module, we define the bottom data structure fingertree, which is used by FList. Similarly, if you are not to customize your own FingerTree wrapper, it is recommended to used the methods defined in the module of FList rather that those defined here.

Link to this section Summary

Types

t()

FList.FTree.t stands for the data structure of fingertree

Functions

Concat two list tree

Add an element to the front

Get a new tree with the element at the pointed position deleted

Generate a tree from a list

Get the element from a tree at the pointed position

Get the first element

Get the list tree with the back element popped

Get the last element

Get a new list tree with the element at the pointed position moved to the front

Update the element at the pointed position

Reture the size of a tree

Add an element to the back

Split the list tree at the pointed position

Get the list tree with the front element popped

Turn the given tree to a normal list

Pop the front element and return a tuple

Pop the element in the back and return a tuple

Link to this section Types

Link to this type t() View Source
t ::
  :Empty |
  {:Lf, FList.FNode.t} |
  {:Tr, non_neg_integer, [FList.FNode.t], t, [FList.FNode.t]}

FList.FTree.t stands for the data structure of fingertree.

Link to this section Functions

Link to this function concat(t1, t2) View Source
concat(t, t) :: t

Concat two list tree.

Link to this function cons(t, a) View Source
cons(t, any) :: t

Add an element to the front.

Link to this function extractAt(t, i) View Source
extractAt(t, non_neg_integer) :: {any, t}

Get a new tree with the element at the pointed position deleted.

Link to this function fromList(l) View Source
fromList(list) :: t

Generate a tree from a list

Link to this function getAt(t, i) View Source
getAt(t, non_neg_integer) :: any

Get the element from a tree at the pointed position.

Get the first element.

Get the list tree with the back element popped.

Get the last element.

Link to this function moveToFront(t, i) View Source
moveToFront(t, non_neg_integer) :: t

Get a new list tree with the element at the pointed position moved to the front.

Link to this function setAt(t, i, x) View Source
setAt(t, non_neg_integer, any) :: t

Update the element at the pointed position.

Link to this function sizeT(arg1) View Source
sizeT(t) :: non_neg_integer

Reture the size of a tree.

Link to this function snoc(t, a) View Source
snoc(t, any) :: t

Add an element to the back.

Link to this function splitAt(arg, i) View Source
splitAt(t, non_neg_integer) :: {t, any, t}

Split the list tree at the pointed position.

Get the list tree with the front element popped.

Link to this function toList(t) View Source
toList(t) :: list

Turn the given tree to a normal list.

Link to this function uncons(ts) View Source
uncons(t) :: {any, t}

Pop the front element and return a tuple.

Link to this function unsnoc(ts) View Source
unsnoc(t) :: {t, any}

Pop the element in the back and return a tuple.