Module type Prime_retraction.S

type key
type elt
type t
val empty : t
val singleton : elt -> t
val is_empty : t -> bool
val cardinal : t -> int
val elements : t -> elt list

Element Inspection

val mem : key -> t -> bool
val mem_elt : elt -> t -> bool
val app : t -> key -> elt option
val find : key -> t -> elt
val locate : key -> t -> bool * int
val locate_elt : elt -> t -> bool * int
val get : t -> int -> elt
val min_exn : t -> elt
val max_exn : t -> elt
val pred_exn : t -> key -> elt
val succ_exn : t -> key -> elt
val elt_pred_exn : t -> elt -> elt
val elt_succ_exn : t -> elt -> elt

Element Updates

val add : elt -> t -> t
val pop : key -> t -> (elt * t) option
val pop_min_exn : t -> elt * t
val pop_max_exn : t -> elt * t
val remove : key -> t -> t
val cut : key -> t -> elt option * t * t

Iteration

val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
val fold_rev : (elt -> 'a -> 'a) -> t -> 'a -> 'a
val iter : (elt -> unit) -> t -> unit
val for_all : (elt -> bool) -> t -> bool
val exists : (elt -> bool) -> t -> bool
val filter : (elt -> bool) -> t -> t

Algebra

val compare : t -> t -> int
val equal : t -> t -> bool
val finter : (elt -> elt -> elt option) -> t -> t -> t
val funion : (elt -> elt -> elt option) -> t -> t -> t
val fcompl : (elt -> elt -> elt option) -> t -> t -> t