Append xs
to this sequence, reordering elements to
Insert a
at a the first point that all elements to the left are of higher priority
(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.
Ordered sequences, based on scalaz.FingerTree
a
has a higher priority thanb
ifOrder[A].greaterThan(a, b)
.insert
and++
maintains the ordering.The measure is calculated with a
Monoid[Option[A] @@ Last]
, whoseappend
operation favours the first argument. Accordingly, the measuer of a node is the item with the highest priority contained recursively below that node.