package qcow

  1. Overview
  2. Docs

A discrete interval encoding tree: a set of elements optimised for cases where large numbers of contiguous elements are in the set.

Parameters

module Elt : ELT

Signature

type elt = Elt.t

The type of the set elements

include sig ... end
val elt_of_sexp : Sexplib.Sexp.t -> elt
val sexp_of_elt : elt -> Sexplib.Sexp.t
type interval

An interval: a range (x, y) of set values where all the elements from x to y inclusive are in the set

module Interval : sig ... end
type t

The type of sets

include sig ... end
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
val empty : t

The empty set

val is_empty : t -> bool

Test whether a set is empty or not

val mem : elt -> t -> bool

mem elt t tests whether elt is in set t

val fold : (interval -> 'a -> 'a) -> t -> 'a -> 'a

fold f t acc folds f across all the intervals in t

val add : interval -> t -> t

add interval t returns the set consisting of t plus interval

val remove : interval -> t -> t

remove interval t returns the set consisting of t minus interval

val min_elt : t -> interval

min_elt t returns the smallest (in terms of the ordering) interval in t, or raises Not_found if the set is empty.

val max_elt : t -> interval

max_elt t returns the largest (in terms of the ordering) interval in t, or raises Not_found if the set is empty.

val choose : t -> interval

choose t returns one interval, or raises Not_found if the set is empty

val union : t -> t -> t

set union

val diff : t -> t -> t

set difference

val inter : t -> t -> t

set intersection

OCaml

Innovation. Community. Security.