module FingerTree: BatFingerTreetype 'a monoid = {
|
zero : |
(* |
The neutral element of the monoid.
| *) |
|
combine : |
(* | combine should be associative, and have zero as neutral element. | *) |
exception Empty
module type S =sig..end
module Generic:sig..end
type 'a t
include BatFingerTree.S
val size : 'a t -> intsize t returns the number of elements in the sequence.
Unlike the generic size on finger trees, this one has complexity O(1).
val split_at : 'a t -> int -> 'a t * 'a tsplit_at is equivalent to List.split_at.Invalid_argument when the index is out of bounds.
O(log(n)).
val get : 'a t -> int -> 'aget t i returns the i-th element of t.Invalid_argument when the index is out of bounds.
O(log(n)).
val set : 'a t -> int -> 'a -> 'a tset t i v returns t where the i-th element is now v.Invalid_argument when the index is out of bounds.
O(log(n)).
val update : 'a t -> int -> ('a -> 'a) -> 'a tupdate t i f returns t where the i-th element is now f (get i t).Invalid_argument when the index is out of bounds.
O(log(n)).