OrdSeq

sealed abstract
class OrdSeq[A] extends Ops[FingerTree[A @@ LastVal, A]]

Ordered sequences, based on scalaz.FingerTree

a has a higher priority than b if Order[A].greaterThan(a, b).

insert and ++ maintains the ordering.

The measure is calculated with a Semigroup[A @@ LastVal], whose append operation favours the first argument. Accordingly, the measure of a node is the item with the highest priority contained recursively below that node.

Companion
object
trait Ops[FingerTree[A @@ LastVal, A]]
class Object
trait Matchable
class Any

Value members

Abstract methods

def fold[B](empty: => B, single: (V, A) => B, deep: (V, Finger[V, A], => FingerTree[V, Node[V, A]], Finger[V, A]) => B): B
Implicitly added by unwrap

Fold over the structure of the tree. The given functions correspond to the three possible variations of the finger tree.

Fold over the structure of the tree. The given functions correspond to the three possible variations of the finger tree.

Value Params
deep

otherwise, convert the measure, the two fingers, and the sub tree to a B.

empty

value to return if the tree is empty

single

if the tree contains a single element, convert the measure and this element to a B

Concrete methods

def ++(xs: OrdSeq[A]): OrdSeq[A]

Append xs to this sequence, reordering elements to

Append xs to this sequence, reordering elements to

def +:(a: A): FingerTree[V, A]
Implicitly added by unwrap

Prepends an element to the left of the tree. O(1).

Prepends an element to the left of the tree. O(1).

def :+(a: => A): FingerTree[V, A]
Implicitly added by unwrap

Appends an element to the right of the tree. O(1).

Appends an element to the right of the tree. O(1).

def :-|(a: => A): FingerTree[V, A]
Implicitly added by unwrap

Replace the last element of the tree with the given value. O(1)

Replace the last element of the tree with the given value. O(1)

def <++>(right: => FingerTree[V, A]): FingerTree[V, A]
Implicitly added by unwrap

Appends the given finger tree to the right of this tree.

Appends the given finger tree to the right of this tree.

def add1(n: A, right: => FingerTree[V, A]): FingerTree[V, A]
Implicitly added by unwrap
def add2(n1t: => A, n2t: => A, right: => FingerTree[V, A]): FingerTree[V, A]
Implicitly added by unwrap
def add3(n1t: => A, n2t: => A, n3t: => A, right: => FingerTree[V, A]): FingerTree[V, A]
Implicitly added by unwrap
def add4(n1t: => A, n2t: => A, n3t: => A, n4t: => A, right: => FingerTree[V, A]): FingerTree[V, A]
Implicitly added by unwrap
def addDigits0(m1: FingerTree[V, Node[V, A]], dig1: Finger[V, A], dig2: Finger[V, A], m2: => FingerTree[V, Node[V, A]]): FingerTree[V, Node[V, A]]
Implicitly added by unwrap
def addDigits1(m1: FingerTree[V, Node[V, A]], d1: Finger[V, A], xt: => A, d2: Finger[V, A], m2t: => FingerTree[V, Node[V, A]]): FingerTree[V, Node[V, A]]
Implicitly added by unwrap
def addDigits2(m1: FingerTree[V, Node[V, A]], d1: Finger[V, A], xt: => A, yt: => A, d2: Finger[V, A], m2t: => FingerTree[V, Node[V, A]]): FingerTree[V, Node[V, A]]
Implicitly added by unwrap
def addDigits3(m1: FingerTree[V, Node[V, A]], d1: Finger[V, A], xt: => A, yt: => A, zt: => A, d2: Finger[V, A], m2t: => FingerTree[V, Node[V, A]]): FingerTree[V, Node[V, A]]
Implicitly added by unwrap
def addDigits4(m1: FingerTree[V, Node[V, A]], d1: Finger[V, A], xt: => A, yt: => A, zt: => A, wt: => A, d2: Finger[V, A], m2t: => FingerTree[V, Node[V, A]]): FingerTree[V, Node[V, A]]
Implicitly added by unwrap
def foldLeft[B](b: B)(f: (B, A) => B): B
Implicitly added by unwrap
def foldMap[B](f: A => B)(implicit s: Monoid[B]): B
Implicitly added by unwrap
def foldRight[B](z: => B)(f: (A, => B) => B): B
Implicitly added by unwrap
def foreach(f: A => Unit): Unit
Implicitly added by unwrap

Execute the provided side effect for each element in the tree.

Execute the provided side effect for each element in the tree.

def head: A
Implicitly added by unwrap

Selects the first element in the tree.

Selects the first element in the tree.

Throws
if

the tree is empty

def init: FingerTree[V, A]
Implicitly added by unwrap

Selects a subtree containing all elements except the last

Selects a subtree containing all elements except the last

Throws
if

the tree is empty

def insert(a: A): OrdSeq[A]

Insert a at a the first point that all elements to the left are of higher priority

Insert a at a the first point that all elements to the left are of higher priority

def isEmpty: Boolean
Implicitly added by unwrap
def iterator: Iterator[A]
Implicitly added by unwrap

An iterator that visits each element in the tree.

An iterator that visits each element in the tree.

def last: A
Implicitly added by unwrap

Selects the last element in the tree.

Selects the last element in the tree.

Throws
if

the tree is empty

def map[B, V2](f: A => B)(implicit r: Reducer[B, V2]): FingerTree[V2, B]
Implicitly added by unwrap

Maps the given function across the tree, annotating nodes in the resulting tree according to the provided Reducer.

Maps the given function across the tree, annotating nodes in the resulting tree according to the provided Reducer.

def measure: Maybe[V]
Implicitly added by unwrap
def partition(a: A): (OrdSeq[A], OrdSeq[A])
Returns

(higher, lowerOrEqual) The sub-sequences that contain elements of higher and of lower-than-or-equal priority than a, and of lower or equal priority respectively.

def reduceTo[M : Monoid]: M
Implicitly added by unwrap

Convert the leaves of the tree to an M

Convert the leaves of the tree to an M

def reverseIterator: Iterator[A]
Implicitly added by unwrap

An iterator that visits each element in the tree in reverse order.

An iterator that visits each element in the tree in reverse order.

def split(pred: V => Boolean): (FingerTree[V, A], FingerTree[V, A])
Implicitly added by unwrap

Splits this tree into a pair of subtrees at the point where the given predicate, based on the measure, changes from false to true. O(log(min(i,n-i)))

Splits this tree into a pair of subtrees at the point where the given predicate, based on the measure, changes from false to true. O(log(min(i,n-i)))

Value Params
pred

predicate on node measures. Must be a semigroup homomorphism from the semigroup V of node measures to the semigroup of Booleans with || as the semigroup operation. Namely, it must hold that pred(v1 |+| v2) = pred(v1) || pred(v2).

Returns

(as, bs), where - as: the subtree containing elements before the point where pred first holds - bs: the subtree containing elements at and after the point where pred first holds. Empty if pred never holds.

def split1(pred: V => Boolean): (FingerTree[V, A], A, FingerTree[V, A])
Implicitly added by unwrap

Like split, but returns the element where pred first holds separately

Like split, but returns the element where pred first holds separately

Throws
if

the tree is empty.

def tail: FingerTree[V, A]
Implicitly added by unwrap

Selects a subtree containing all elements except the first

Selects a subtree containing all elements except the first

Throws
if

the tree is empty

def to[F[_]](implicit R: Reducer[A, F[A]], M: Monoid[F[A]]): F[A]
Implicitly added by unwrap

Convert the leaves of the tree to an F[A]

Convert the leaves of the tree to an F[A]

def toIList: IList[A]
Implicitly added by unwrap

Convert the leaves of the tree to a scalaz.IList

Convert the leaves of the tree to a scalaz.IList

def toList: List[A]
Implicitly added by unwrap

Convert the leaves of the tree to a scala.List

Convert the leaves of the tree to a scala.List

def toStream: Stream[A]
Implicitly added by unwrap

Convert the leaves of the tree to a scala.Stream

Convert the leaves of the tree to a scala.Stream

def traverseTree[F[_], V2, B](f: A => F[B])(implicit ms: Reducer[B, V2], F: Applicative[F]): F[FingerTree[V2, B]]
Implicitly added by unwrap

Like traverse, but with a more constraint type: we need the additional measure to construct the new tree.

Like traverse, but with a more constraint type: we need the additional measure to construct the new tree.

def viewl: ViewL[[_] =>> FingerTree[V, _$9], A]
Implicitly added by unwrap
def viewr: ViewR[[_] =>> FingerTree[V, _$14], A]
Implicitly added by unwrap
def |-:(a: A): FingerTree[V, A]
Implicitly added by unwrap

Replace the first element of the tree with the given value. O(1)

Replace the first element of the tree with the given value. O(1)

Inherited methods

Inherited from
Ops

Implicits

Implicits

implicit
val ord: Order[A]