Module Batteries.FingerTree

module FingerTree: BatFingerTree

type 'a monoid = {
   zero :'a; (*The neutral element of the monoid.*)
   combine :'a -> 'a -> 'a; (*combine should be associative, and have zero as neutral element.*)
}
The type of the element of a monoid.
exception Empty
An exception that is thrown by various operations when trying to get a non existing element.
module type S = sig .. end
module Generic: sig .. end
type 'a t 
include BatFingerTree.S
val size : 'a t -> int
size 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 t
split_at is equivalent to List.split_at.
Raises Invalid_argument when the index is out of bounds.

O(log(n)).

val get : 'a t -> int -> 'a
get t i returns the i-th element of t.
Raises Invalid_argument when the index is out of bounds.

O(log(n)).

val set : 'a t -> int -> 'a -> 'a t
set t i v returns t where the i-th element is now v.
Raises Invalid_argument when the index is out of bounds.

O(log(n)).

val update : 'a t -> int -> ('a -> 'a) -> 'a t
update t i f returns t where the i-th element is now f (get i t).
Raises Invalid_argument when the index is out of bounds.

O(log(n)).