Batteries user guide : Batteries.FingerTree

`sig
type 'a monoid =
'a BatFingerTree.monoid = {
zero : 'a;
combine : 'a -> 'a -> 'a;
}
exception Empty
module type S =
sig
type ('a, 'm) fg
type ('wrapped_type, 'a, 'm) wrap
val empty : ('a, 'm) fg
val singleton : 'a -> ('a, 'm) fg
val cons : (('a, 'm) fg -> 'a -> ('a, 'm) fg, 'a, 'm) wrap
val snoc : (('a, 'm) fg -> 'a -> ('a, 'm) fg, 'a, 'm) wrap
val front : (('a, 'm) fg -> (('a, 'm) fg * 'a) option, 'a, 'm) wrap
val front_exn : (('a, 'm) fg -> ('a, 'm) fg * 'a, 'a, 'm) wrap
val head : ('a, 'm) fg -> 'a option
val head_exn : ('a, 'm) fg -> 'a
val last : ('a, 'm) fg -> 'a option
val last_exn : ('a, 'm) fg -> 'a
val tail : (('a, 'm) fg -> ('a, 'm) fg option, 'a, 'm) wrap
val tail_exn : (('a, 'm) fg -> ('a, 'm) fg, 'a, 'm) wrap
val init : (('a, 'm) fg -> ('a, 'm) fg option, 'a, 'm) wrap
val init_exn : (('a, 'm) fg -> ('a, 'm) fg, 'a, 'm) wrap
val rear : (('a, 'm) fg -> (('a, 'm) fg * 'a) option, 'a, 'm) wrap
val rear_exn : (('a, 'm) fg -> ('a, 'm) fg * 'a, 'a, 'm) wrap
val size : ('a, 'm) fg -> int
val is_empty : ('a, 'm) fg -> bool
val fold_left : ('acc -> 'a -> 'acc) -> 'acc -> ('a, 'm) fg -> 'acc
val fold_right : ('acc -> 'a -> 'acc) -> 'acc -> ('a, 'm) fg -> 'acc
val iter : ('a -> unit) -> ('a, 'm) fg -> unit
val iter_right : ('a -> unit) -> ('a, 'm) fg -> unit
val compare : ('a -> 'a -> int) -> ('a, 'm) fg -> ('a, 'm) fg -> int
val equal : ('a -> 'a -> bool) -> ('a, 'm) fg -> ('a, 'm) fg -> bool
val enum : ('a, 'm) fg -> 'a BatEnum.t
val backwards : ('a, 'm) fg -> 'a BatEnum.t
val to_list : ('a, 'm) fg -> 'a list
val to_list_backwards : ('a, 'm) fg -> 'a list
val of_enum : ('a BatEnum.t -> ('a, 'm) fg, 'a, 'm) wrap
val of_backwards : ('a BatEnum.t -> ('a, 'm) fg, 'a, 'm) wrap
val of_list : ('a list -> ('a, 'm) fg, 'a, 'm) wrap
val of_list_backwards : ('a list -> ('a, 'm) fg, 'a, 'm) wrap
val map : (('a -> 'b) -> ('a, 'm) fg -> ('b, 'm) fg, 'b, 'm) wrap
val map_right : (('a -> 'b) -> ('a, 'm) fg -> ('b, 'm) fg, 'b, 'm) wrap
val append : (('a, 'm) fg -> ('a, 'm) fg -> ('a, 'm) fg, 'a, 'm) wrap
val reverse : (('a, 'm) fg -> ('a, 'm) fg, 'a, 'm) wrap
val print :
?first:string ->
?last:string ->
?sep:string ->
('a, 'b) BatIO.printer -> (('a, 'c) fg, 'b) BatIO.printer
end
module Generic :
sig
type ('a, 'm) fg = ('a, 'm) BatFingerTree.Generic.fg
type ('wrapped_type, 'a, 'm) wrap =
monoid:'m monoid -> measure:('a -> 'm) -> 'wrapped_type
val empty : ('a, 'm) fg
val singleton : 'a -> ('a, 'm) fg
val cons : (('a, 'm) fg -> 'a -> ('a, 'm) fg, 'a, 'm) wrap
val snoc : (('a, 'm) fg -> 'a -> ('a, 'm) fg, 'a, 'm) wrap
val front : (('a, 'm) fg -> (('a, 'm) fg * 'a) option, 'a, 'm) wrap
val front_exn : (('a, 'm) fg -> ('a, 'm) fg * 'a, 'a, 'm) wrap
val head : ('a, 'm) fg -> 'a option
val head_exn : ('a, 'm) fg -> 'a
val last : ('a, 'm) fg -> 'a option
val last_exn : ('a, 'm) fg -> 'a
val tail : (('a, 'm) fg -> ('a, 'm) fg option, 'a, 'm) wrap
val tail_exn : (('a, 'm) fg -> ('a, 'm) fg, 'a, 'm) wrap
val init : (('a, 'm) fg -> ('a, 'm) fg option, 'a, 'm) wrap
val init_exn : (('a, 'm) fg -> ('a, 'm) fg, 'a, 'm) wrap
val rear : (('a, 'm) fg -> (('a, 'm) fg * 'a) option, 'a, 'm) wrap
val rear_exn : (('a, 'm) fg -> ('a, 'm) fg * 'a, 'a, 'm) wrap
val size : ('a, 'm) fg -> int
val is_empty : ('a, 'm) fg -> bool
val fold_left : ('acc -> 'a -> 'acc) -> 'acc -> ('a, 'm) fg -> 'acc
val fold_right : ('acc -> 'a -> 'acc) -> 'acc -> ('a, 'm) fg -> 'acc
val iter : ('a -> unit) -> ('a, 'm) fg -> unit
val iter_right : ('a -> unit) -> ('a, 'm) fg -> unit
val compare : ('a -> 'a -> int) -> ('a, 'm) fg -> ('a, 'm) fg -> int
val equal : ('a -> 'a -> bool) -> ('a, 'm) fg -> ('a, 'm) fg -> bool
val enum : ('a, 'm) fg -> 'a BatEnum.t
val backwards : ('a, 'm) fg -> 'a BatEnum.t
val to_list : ('a, 'm) fg -> 'a list
val to_list_backwards : ('a, 'm) fg -> 'a list
val of_enum : ('a BatEnum.t -> ('a, 'm) fg, 'a, 'm) wrap
val of_backwards : ('a BatEnum.t -> ('a, 'm) fg, 'a, 'm) wrap
val of_list : ('a list -> ('a, 'm) fg, 'a, 'm) wrap
val of_list_backwards : ('a list -> ('a, 'm) fg, 'a, 'm) wrap
val map : (('a -> 'b) -> ('a, 'm) fg -> ('b, 'm) fg, 'b, 'm) wrap
val map_right : (('a -> 'b) -> ('a, 'm) fg -> ('b, 'm) fg, 'b, 'm) wrap
val append : (('a, 'm) fg -> ('a, 'm) fg -> ('a, 'm) fg, 'a, 'm) wrap
val reverse : (('a, 'm) fg -> ('a, 'm) fg, 'a, 'm) wrap
val print :
?first:string ->
?last:string ->
?sep:string ->
('a, 'b) BatIO.printer -> (('a, 'c) fg, 'b) BatIO.printer
val lookup : (('m -> bool) -> ('a, 'm) fg -> 'a, 'a, 'm) wrap
val measure : (('a, 'm) fg -> 'm, 'a, 'm) wrap
val split :
(('m -> bool) -> ('a, 'm) fg -> ('a, 'm) fg * ('a, 'm) fg, 'a, 'm)
wrap
end
type 'a t = 'a BatFingerTree.t
type ('a, 'm) fg = 'a t
type ('wrapped_type, 'a, 'm) wrap = 'wrapped_type
val empty : ('a, 'm) fg
val singleton : 'a -> ('a, 'm) fg
val cons : (('a, 'm) fg -> 'a -> ('a, 'm) fg, 'a, 'm) wrap
val snoc : (('a, 'm) fg -> 'a -> ('a, 'm) fg, 'a, 'm) wrap
val front : (('a, 'm) fg -> (('a, 'm) fg * 'a) option, 'a, 'm) wrap
val front_exn : (('a, 'm) fg -> ('a, 'm) fg * 'a, 'a, 'm) wrap
val head : ('a, 'm) fg -> 'a option
val head_exn : ('a, 'm) fg -> 'a
val last : ('a, 'm) fg -> 'a option
val last_exn : ('a, 'm) fg -> 'a
val tail : (('a, 'm) fg -> ('a, 'm) fg option, 'a, 'm) wrap
val tail_exn : (('a, 'm) fg -> ('a, 'm) fg, 'a, 'm) wrap
val init : (('a, 'm) fg -> ('a, 'm) fg option, 'a, 'm) wrap
val init_exn : (('a, 'm) fg -> ('a, 'm) fg, 'a, 'm) wrap
val rear : (('a, 'm) fg -> (('a, 'm) fg * 'a) option, 'a, 'm) wrap
val rear_exn : (('a, 'm) fg -> ('a, 'm) fg * 'a, 'a, 'm) wrap
val is_empty : ('a, 'm) fg -> bool
val fold_left : ('acc -> 'a -> 'acc) -> 'acc -> ('a, 'm) fg -> 'acc
val fold_right : ('acc -> 'a -> 'acc) -> 'acc -> ('a, 'm) fg -> 'acc
val iter : ('a -> unit) -> ('a, 'm) fg -> unit
val iter_right : ('a -> unit) -> ('a, 'm) fg -> unit
val compare : ('a -> 'a -> int) -> ('a, 'm) fg -> ('a, 'm) fg -> int
val equal : ('a -> 'a -> bool) -> ('a, 'm) fg -> ('a, 'm) fg -> bool
val enum : ('a, 'm) fg -> 'a BatEnum.t
val backwards : ('a, 'm) fg -> 'a BatEnum.t
val to_list : ('a, 'm) fg -> 'a list
val to_list_backwards : ('a, 'm) fg -> 'a list
val of_enum : ('a BatEnum.t -> ('a, 'm) fg, 'a, 'm) wrap
val of_backwards : ('a BatEnum.t -> ('a, 'm) fg, 'a, 'm) wrap
val of_list : ('a list -> ('a, 'm) fg, 'a, 'm) wrap
val of_list_backwards : ('a list -> ('a, 'm) fg, 'a, 'm) wrap
val map : (('a -> 'b) -> ('a, 'm) fg -> ('b, 'm) fg, 'b, 'm) wrap
val map_right : (('a -> 'b) -> ('a, 'm) fg -> ('b, 'm) fg, 'b, 'm) wrap
val append : (('a, 'm) fg -> ('a, 'm) fg -> ('a, 'm) fg, 'a, 'm) wrap
val reverse : (('a, 'm) fg -> ('a, 'm) fg, 'a, 'm) wrap
val print :
?first:string ->
?last:string ->
?sep:string -> ('a, 'b) BatIO.printer -> (('a, 'c) fg, 'b) BatIO.printer
val size : 'a t -> int
val split_at : 'a t -> int -> 'a t * 'a t
val get : 'a t -> int -> 'a
val set : 'a t -> int -> 'a -> 'a t
val update : 'a t -> int -> ('a -> 'a) -> 'a t
val of_list_for_test : 'a list -> 'a t
val verify_measure : 'a t -> 'a t
val invariants : 'a t -> unit
end`