Module PatriciaTree.MakeHeterogeneousSet

A set containing different keys, very similar to Set_S, but with simple type elt being replaced by type constructor 'a elt.

Parameters

Signature

The main changes from Set_S are:

type 'a elt = 'a Key.t

Elements of the set

module BaseMap : HeterogeneousMap_S with type 'a key = 'a elt and type (_, _) value = unit

Underlying basemap, for cross map/set operations

type t = unit BaseMap.t
type 'a key = 'a elt

Alias for elements, for compatibility with other PatriciaTrees

type any_elt =
  1. | Any : 'a elt -> any_elt
val empty : t
val is_empty : t -> bool
val mem : 'a elt -> t -> bool
val add : 'a elt -> t -> t
val singleton : 'a elt -> t
val cardinal : t -> int
val is_singleton : t -> any_elt option
val remove : 'a elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val disjoint : t -> t -> bool
val equal : t -> t -> bool
val subset : t -> t -> bool
val split : 'a elt -> t -> t * bool * t
type polyiter = {
  1. f : 'a. 'a elt -> unit;
}
val iter : polyiter -> t -> unit
type polypredicate = {
  1. f : 'a. 'a elt -> bool;
}
val filter : polypredicate -> t -> t
val for_all : polypredicate -> t -> bool
type 'acc polyfold = {
  1. f : 'a. 'a elt -> 'acc -> 'acc;
}
val fold : 'acc polyfold -> t -> 'acc -> 'acc
val min_elt : t -> any_elt
val max_elt : t -> any_elt
val pop_minimum : t -> (any_elt * t) option
val pop_maximum : t -> (any_elt * t) option
type polypretty = {
  1. f : 'a. Stdlib.Format.formatter -> 'a elt -> unit;
}
val pretty : ?pp_sep:(Stdlib.Format.formatter -> unit -> unit) -> polypretty -> Stdlib.Format.formatter -> t -> unit

pp_sep defaults to Format.pp_print_cut

Conversion functions

val to_seq : t -> any_elt Stdlib.Seq.t
val to_rev_seq : t -> any_elt Stdlib.Seq.t
val add_seq : any_elt Stdlib.Seq.t -> t -> t
val of_seq : any_elt Stdlib.Seq.t -> t
val of_list : any_elt list -> t
val to_list : t -> any_elt list