flist v0.2.2-dev 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

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 extract_at(t, i) View Source
extract_at(t(), non_neg_integer()) :: {any(), t()}

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

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

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.

Link to this function move_to_front(t, i) View Source
move_to_front(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 set_at(t, i, x) View Source
set_at(t(), non_neg_integer(), any()) :: t()

Update the element at the pointed position.

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 split_at(arg, i) View Source
split_at(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 to_list(t) View Source
to_list(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.