public final class Empty<V,A> extends FingerTree<V,A>
| Modifier and Type | Method and Description |
|---|---|
FingerTree<V,A> |
append(FingerTree<V,A> t)
Appends one finger tree to another.
|
FingerTree<V,A> |
cons(A a)
Adds the given element to this tree as the first element.
|
<B> B |
foldLeft(F<B,F<A,B>> bff,
B z)
Folds the tree to the left with the given function and the given initial element.
|
<B> B |
foldRight(F<A,F<B,B>> aff,
B z)
Folds the tree to the right with the given function and the given initial element.
|
A |
head()
The first element of this tree.
|
FingerTree<V,A> |
init()
The tree without the last element.
|
A |
last()
The last element of this tree.
|
int |
length() |
P2<java.lang.Integer,A> |
lookup(F<V,java.lang.Integer> o,
int i) |
<B> FingerTree<V,B> |
map(F<A,B> abf,
Measured<V,B> m)
Maps the given function across this tree, measuring with the given Measured instance.
|
<B> B |
match(F<Empty<V,A>,B> empty,
F<Single<V,A>,B> single,
F<Deep<V,A>,B> deep)
Pattern matching on the structure of this tree.
|
V |
measure()
Returns zero.
|
A |
reduceLeft(F<A,F<A,A>> aff)
Folds the tree to the left with the given function.
|
A |
reduceRight(F<A,F<A,A>> aff)
Folds the tree to the right with the given function.
|
FingerTree<V,A> |
snoc(A a)
Adds the given element to this tree as the last element.
|
FingerTree<V,A> |
tail()
The tree without the first element.
|
Stream<A> |
toStream() |
java.lang.String |
toString() |
empty, emptyIntAddition, emptyIntMax, filter, foldLeft, foldRight, headOption, isEmpty, measured, measured, mkTree, split, split1, unconspublic FingerTree<V,A> cons(A a)
FingerTreecons in class FingerTree<V,A>a - The element to add to the front of this tree.public FingerTree<V,A> snoc(A a)
FingerTreesnoc in class FingerTree<V,A>a - The element to add to the end of this tree.public A head()
FingerTreehead in class FingerTree<V,A>public A last()
FingerTreelast in class FingerTree<V,A>public FingerTree<V,A> tail()
FingerTreetail in class FingerTree<V,A>public FingerTree<V,A> init()
FingerTreeinit in class FingerTree<V,A>public FingerTree<V,A> append(FingerTree<V,A> t)
FingerTreeappend in class FingerTree<V,A>t - A finger tree to append to this one.public P2<java.lang.Integer,A> lookup(F<V,java.lang.Integer> o, int i)
lookup in class FingerTree<V,A>public int length()
length in class FingerTree<V,A>public <B> B foldRight(F<A,F<B,B>> aff, B z)
FingerTreefoldRight in class FingerTree<V,A>aff - A function with which to fold the tree.z - An initial element to apply to the fold.public A reduceRight(F<A,F<A,A>> aff)
FingerTreereduceRight in class FingerTree<V,A>aff - A function with which to fold the tree.public <B> B foldLeft(F<B,F<A,B>> bff, B z)
FingerTreefoldLeft in class FingerTree<V,A>bff - A function with which to fold the tree.z - An initial element to apply to the fold.public A reduceLeft(F<A,F<A,A>> aff)
FingerTreereduceLeft in class FingerTree<V,A>aff - A function with which to fold the tree.public <B> FingerTree<V,B> map(F<A,B> abf, Measured<V,B> m)
FingerTreemap in class FingerTree<V,A>abf - A function to map across the values of this tree.m - A measuring with which to annotate the tree.public V measure()
measure in class FingerTree<V,A>public <B> B match(F<Empty<V,A>,B> empty, F<Single<V,A>,B> single, F<Deep<V,A>,B> deep)
match in class FingerTree<V,A>empty - The function to apply to this empty tree.single - A function to apply if this tree contains a single element.deep - A function to apply if this tree contains more than one element.public java.lang.String toString()
toString in class java.lang.Object