public final class Deep<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.
|
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 tree.
|
V |
measure()
Returns the sum of the measurements of this tree's elements, according to the monoid.
|
FingerTree<V,Node<V,A>> |
middle()
Returns a finger tree of the inner nodes of this tree.
|
Digit<V,A> |
prefix()
Returns the first few elements of this tree.
|
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.
|
Digit<V,A> |
suffix()
Returns the last few elements of this tree.
|
isEmpty, measured, mkTree
public Digit<V,A> prefix()
public FingerTree<V,Node<V,A>> middle()
public Digit<V,A> suffix()
public <B> B foldRight(F<A,F<B,B>> aff, B z)
FingerTree
foldRight
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)
FingerTree
reduceRight
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)
FingerTree
foldLeft
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)
FingerTree
reduceLeft
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)
FingerTree
map
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 FingerTree<V,A> cons(A a)
FingerTree
cons
in class FingerTree<V,A>
a
- The element to add to the front of this tree.public FingerTree<V,A> snoc(A a)
FingerTree
snoc
in class FingerTree<V,A>
a
- The element to add to the end of this tree.public FingerTree<V,A> append(FingerTree<V,A> t)
FingerTree
append
in class FingerTree<V,A>
t
- A finger tree to append to this one.