Home Manual Reference Source

Function

Static Public Summary
public
public

Deep(M: *, left: *, middle: *, right: *)

public

Digit()

public

Empty(M: *)

public

Four(a: *, b: *, c: *, d: *)

public

Lazy(thunk: *)

public

Node2(v: *, a: *, b: *)

public

Node3(v: *, a: *, b: *, c: *)

public

One(a: *)

public

Single(M: *, value: *)

public

Split(left: *, middle: *, right: *)

public

Three(a: *, b: *, c: *)

public

Tree()

Base class for all implementations.

public

Two(a: *, b: *)

public

app3(A: *, list: *, B: *): *

public

append(tree: *, iterable: *): *

public

cache(M: *): *

public

deepL(M: Measure, left: Array, middle: FingerTree, right: Digit): *

public

deepR(M: Measure, left: Digit, middle: FingerTree, right: Array): *

public

delay(thunk: Function): Tree

Wraps a tree-returning function with a tree proxy that will shallow evaluate as soon as a method is called on it.

public

empty(M: *)

public

from(M: *, iterable: *): *

public

node2(M: *, a: *, b: *): *

public

node3(M: *, a: *, b: *, c: *): *

public

nodes(M: *, list: *): *

public

prepend(tree: *, iterable: *): *

Static Private Summary
private
private

_app3(A: *, B: *): *

private

_append(tree: *, list: *): *

private

_deepL(M: *, left: *, middle: *, right: *): *

private

_deepR(M: *, left: *, middle: *, right: *): *

private

_digit(list: Array): Digit

Creates a Digit from as small list.

private

_from_digit(M: *, digit: *): *

private

_from_small_list(M: *, list: *): *

private

_prepend(tree: *, list: *): *

Static Public

public CachedMeasure(M: *) source

Params:

NameTypeAttributeDescription
M *

public Deep(M: *, left: *, middle: *, right: *) source

Params:

NameTypeAttributeDescription
M *
left *
middle *
right *

public Empty(M: *) source

Params:

NameTypeAttributeDescription
M *

public Four(a: *, b: *, c: *, d: *) source

Params:

NameTypeAttributeDescription
a *
b *
c *
d *

public Lazy(thunk: *) source

Params:

NameTypeAttributeDescription
thunk *

public Node2(v: *, a: *, b: *) source

Params:

NameTypeAttributeDescription
v *
a *
b *

public Node3(v: *, a: *, b: *, c: *) source

Params:

NameTypeAttributeDescription
v *
a *
b *
c *

public One(a: *) source

Params:

NameTypeAttributeDescription
a *

public Single(M: *, value: *) source

Params:

NameTypeAttributeDescription
M *
value *

public Split(left: *, middle: *, right: *) source

Params:

NameTypeAttributeDescription
left *
middle *
right *

public Three(a: *, b: *, c: *) source

Params:

NameTypeAttributeDescription
a *
b *
c *

public Tree() source

Base class for all implementations.

public Two(a: *, b: *) source

Params:

NameTypeAttributeDescription
a *
b *

public app3(A: *, list: *, B: *): * source

Params:

NameTypeAttributeDescription
A *
list *
B *

Return:

*

public append(tree: *, iterable: *): * source

Params:

NameTypeAttributeDescription
tree *
iterable *

Return:

*

public cache(M: *): * source

Params:

NameTypeAttributeDescription
M *

Return:

*

public deepL(M: Measure, left: Array, middle: FingerTree, right: Digit): * source

Params:

NameTypeAttributeDescription
M Measure
left Array
middle FingerTree
right Digit

Return:

*

public deepR(M: Measure, left: Digit, middle: FingerTree, right: Array): * source

Params:

NameTypeAttributeDescription
M Measure
left Digit
middle FingerTree
right Array

Return:

*

public delay(thunk: Function): Tree source

Wraps a tree-returning function with a tree proxy that will shallow evaluate as soon as a method is called on it.

Params:

NameTypeAttributeDescription
thunk Function

The function that evaluates to the underlying tree.

Return:

Tree

The lazy tree.

public empty(M: *) source

Params:

NameTypeAttributeDescription
M *

public from(M: *, iterable: *): * source

Params:

NameTypeAttributeDescription
M *
iterable *

Return:

*

public node2(M: *, a: *, b: *): * source

Params:

NameTypeAttributeDescription
M *
a *
b *

Return:

*

public node3(M: *, a: *, b: *, c: *): * source

Params:

NameTypeAttributeDescription
M *
a *
b *
c *

Return:

*

public nodes(M: *, list: *): * source

Params:

NameTypeAttributeDescription
M *
list *

Return:

*

public prepend(tree: *, iterable: *): * source

Params:

NameTypeAttributeDescription
tree *
iterable *

Return:

*

Static Private

private _app3(A: *, B: *): * source

Params:

NameTypeAttributeDescription
A *
B *

Return:

*

private _append(tree: *, list: *): * source

Params:

NameTypeAttributeDescription
tree *
list *

Return:

*

private _deepL(M: *, left: *, middle: *, right: *): * source

Params:

NameTypeAttributeDescription
M *
left *
middle *
right *

Return:

*

private _deepR(M: *, left: *, middle: *, right: *): * source

Params:

NameTypeAttributeDescription
M *
left *
middle *
right *

Return:

*

private _digit(list: Array): Digit source

Creates a Digit from as small list.

It should never be called on length 4 lists since it is only called on results of splitDigit which outputs lists of length at most 3.

Params:

NameTypeAttributeDescription
list Array

A list of length 1, 2, or 3.

Return:

Digit

A digit containing the elements of list in order.

private _from_digit(M: *, digit: *): * source

Params:

NameTypeAttributeDescription
M *
digit *

Return:

*

private _from_small_list(M: *, list: *): * source

Params:

NameTypeAttributeDescription
M *
list *

Return:

*

private _prepend(tree: *, list: *): * source

Params:

NameTypeAttributeDescription
tree *
list *

Return:

*