sig
type 'a sequence = ('a -> unit) -> unit
type 'a klist = unit -> [ `Cons of 'a * 'a CCArray.klist | `Nil ]
type 'a gen = unit -> 'a option
type 'a equal = 'a -> 'a -> bool
type 'a ord = 'a -> 'a -> int
type 'a random_gen = Random.State.t -> 'a
module type S =
sig
type 'a t
val empty : 'a CCArray.S.t
val equal : 'a CCArray.equal -> 'a CCArray.S.t CCArray.equal
val compare : 'a CCArray.ord -> 'a CCArray.S.t CCArray.ord
val get : 'a CCArray.S.t -> int -> 'a
val get_safe : 'a CCArray.S.t -> int -> 'a option
val set : 'a CCArray.S.t -> int -> 'a -> unit
val length : 'a CCArray.S.t -> int
val fold : ('a -> 'b -> 'a) -> 'a -> 'b CCArray.S.t -> 'a
val foldi : ('a -> int -> 'b -> 'a) -> 'a -> 'b CCArray.S.t -> 'a
val fold_while :
('a -> 'b -> 'a * [ `Continue | `Stop ]) ->
'a -> 'b CCArray.S.t -> 'a
val iter : ('a -> unit) -> 'a CCArray.S.t -> unit
val iteri : (int -> 'a -> unit) -> 'a CCArray.S.t -> unit
val blit :
'a CCArray.S.t -> int -> 'a CCArray.S.t -> int -> int -> unit
val reverse_in_place : 'a CCArray.S.t -> unit
val find : ('a -> 'b option) -> 'a CCArray.S.t -> 'b option
val findi : (int -> 'a -> 'b option) -> 'a CCArray.S.t -> 'b option
val find_idx : ('a -> bool) -> 'a CCArray.S.t -> (int * 'a) option
val lookup : ?cmp:'a CCArray.ord -> 'a -> 'a CCArray.S.t -> int option
val lookup_exn : ?cmp:'a CCArray.ord -> 'a -> 'a CCArray.S.t -> int
val bsearch :
?cmp:('a -> 'a -> int) ->
'a ->
'a CCArray.S.t ->
[ `All_bigger | `All_lower | `At of int | `Empty | `Just_after of int ]
val for_all : ('a -> bool) -> 'a CCArray.S.t -> bool
val for_all2 :
('a -> 'a -> bool) -> 'a CCArray.S.t -> 'a CCArray.S.t -> bool
val exists : ('a -> bool) -> 'a CCArray.S.t -> bool
val exists2 :
('a -> 'a -> bool) -> 'a CCArray.S.t -> 'a CCArray.S.t -> bool
val shuffle : 'a CCArray.S.t -> unit
val shuffle_with : Random.State.t -> 'a CCArray.S.t -> unit
val random_choose : 'a CCArray.S.t -> 'a CCArray.random_gen
val to_seq : 'a CCArray.S.t -> 'a CCArray.sequence
val to_gen : 'a CCArray.S.t -> 'a CCArray.gen
val to_klist : 'a CCArray.S.t -> 'a CCArray.klist
val pp :
?sep:string ->
(Buffer.t -> 'a -> unit) -> Buffer.t -> 'a CCArray.S.t -> unit
val pp_i :
?sep:string ->
(Buffer.t -> int -> 'a -> unit) -> Buffer.t -> 'a CCArray.S.t -> unit
val print :
?sep:string ->
(Format.formatter -> 'a -> unit) ->
Format.formatter -> 'a CCArray.S.t -> unit
end
type 'a t = 'a array
val empty : 'a t
val equal : 'a equal -> 'a t equal
val compare : 'a ord -> 'a t ord
val get : 'a t -> int -> 'a
val get_safe : 'a t -> int -> 'a option
val set : 'a t -> int -> 'a -> unit
val length : 'a t -> int
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a
val foldi : ('a -> int -> 'b -> 'a) -> 'a -> 'b t -> 'a
val fold_while :
('a -> 'b -> 'a * [ `Continue | `Stop ]) -> 'a -> 'b t -> 'a
val iter : ('a -> unit) -> 'a t -> unit
val iteri : (int -> 'a -> unit) -> 'a t -> unit
val blit : 'a t -> int -> 'a t -> int -> int -> unit
val reverse_in_place : 'a t -> unit
val find : ('a -> 'b option) -> 'a t -> 'b option
val findi : (int -> 'a -> 'b option) -> 'a t -> 'b option
val find_idx : ('a -> bool) -> 'a t -> (int * 'a) option
val lookup : ?cmp:'a ord -> 'a -> 'a t -> int option
val lookup_exn : ?cmp:'a ord -> 'a -> 'a t -> int
val bsearch :
?cmp:('a -> 'a -> int) ->
'a ->
'a t ->
[ `All_bigger | `All_lower | `At of int | `Empty | `Just_after of int ]
val for_all : ('a -> bool) -> 'a t -> bool
val for_all2 : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val exists : ('a -> bool) -> 'a t -> bool
val exists2 : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val shuffle : 'a t -> unit
val shuffle_with : Random.State.t -> 'a t -> unit
val random_choose : 'a t -> 'a random_gen
val to_seq : 'a t -> 'a sequence
val to_gen : 'a t -> 'a gen
val to_klist : 'a t -> 'a klist
val pp :
?sep:string -> (Buffer.t -> 'a -> unit) -> Buffer.t -> 'a t -> unit
val pp_i :
?sep:string ->
(Buffer.t -> int -> 'a -> unit) -> Buffer.t -> 'a t -> unit
val print :
?sep:string ->
(Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unit
val map : ('a -> 'b) -> 'a CCArray.t -> 'b CCArray.t
val filter : ('a -> bool) -> 'a CCArray.t -> 'a CCArray.t
val filter_map : ('a -> 'b option) -> 'a CCArray.t -> 'b CCArray.t
val flat_map : ('a -> 'b CCArray.t) -> 'a CCArray.t -> 'b array
val ( >>= ) : 'a CCArray.t -> ('a -> 'b CCArray.t) -> 'b CCArray.t
val ( >>| ) : 'a CCArray.t -> ('a -> 'b) -> 'b CCArray.t
val ( >|= ) : 'a CCArray.t -> ('a -> 'b) -> 'b CCArray.t
val except_idx : 'a CCArray.t -> int -> 'a list
val ( -- ) : int -> int -> int CCArray.t
val ( --^ ) : int -> int -> int CCArray.t
val random : 'a CCArray.random_gen -> 'a CCArray.t CCArray.random_gen
val random_non_empty :
'a CCArray.random_gen -> 'a CCArray.t CCArray.random_gen
val random_len :
int -> 'a CCArray.random_gen -> 'a CCArray.t CCArray.random_gen
module Sub :
sig
type 'a t
val make : 'a array -> int -> len:int -> 'a CCArray.Sub.t
val of_slice : 'a array * int * int -> 'a CCArray.Sub.t
val to_slice : 'a CCArray.Sub.t -> 'a array * int * int
val full : 'a array -> 'a CCArray.Sub.t
val underlying : 'a CCArray.Sub.t -> 'a array
val copy : 'a CCArray.Sub.t -> 'a array
val sub : 'a CCArray.Sub.t -> int -> int -> 'a CCArray.Sub.t
val empty : 'a t
val equal : 'a equal -> 'a t equal
val compare : 'a ord -> 'a t ord
val get : 'a t -> int -> 'a
val get_safe : 'a t -> int -> 'a option
val set : 'a t -> int -> 'a -> unit
val length : 'a t -> int
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a
val foldi : ('a -> int -> 'b -> 'a) -> 'a -> 'b t -> 'a
val fold_while :
('a -> 'b -> 'a * [ `Continue | `Stop ]) -> 'a -> 'b t -> 'a
val iter : ('a -> unit) -> 'a t -> unit
val iteri : (int -> 'a -> unit) -> 'a t -> unit
val blit : 'a t -> int -> 'a t -> int -> int -> unit
val reverse_in_place : 'a t -> unit
val find : ('a -> 'b option) -> 'a t -> 'b option
val findi : (int -> 'a -> 'b option) -> 'a t -> 'b option
val find_idx : ('a -> bool) -> 'a t -> (int * 'a) option
val lookup : ?cmp:'a ord -> 'a -> 'a t -> int option
val lookup_exn : ?cmp:'a ord -> 'a -> 'a t -> int
val bsearch :
?cmp:('a -> 'a -> int) ->
'a ->
'a t ->
[ `All_bigger | `All_lower | `At of int | `Empty | `Just_after of int ]
val for_all : ('a -> bool) -> 'a t -> bool
val for_all2 : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val exists : ('a -> bool) -> 'a t -> bool
val exists2 : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val shuffle : 'a t -> unit
val shuffle_with : Random.State.t -> 'a t -> unit
val random_choose : 'a t -> 'a random_gen
val to_seq : 'a t -> 'a sequence
val to_gen : 'a t -> 'a gen
val to_klist : 'a t -> 'a klist
val pp :
?sep:string -> (Buffer.t -> 'a -> unit) -> Buffer.t -> 'a t -> unit
val pp_i :
?sep:string ->
(Buffer.t -> int -> 'a -> unit) -> Buffer.t -> 'a t -> unit
val print :
?sep:string ->
(Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unit
end
module type MONO_ARRAY =
sig
type elt
type t
val length : CCArray.MONO_ARRAY.t -> int
val get : CCArray.MONO_ARRAY.t -> int -> CCArray.MONO_ARRAY.elt
val set : CCArray.MONO_ARRAY.t -> int -> CCArray.MONO_ARRAY.elt -> unit
end
val sort_generic :
(module CCArray.MONO_ARRAY with type elt = 'elt and type t = 'arr) ->
?cmp:('elt -> 'elt -> int) -> 'arr -> unit
end