package interval-map

  1. Overview
  2. Docs
type t = private {
  1. low : Bound.t;
  2. high : Bound.t;
}
val create : Bound.t -> Bound.t -> t

create low high creates an interval from the low bound and the high bound. Raises Invalid_interval if low is not less than high.

val compare : t -> t -> int

compare ivl_a ivl_b compares two intervals. Intervals are compared using their low bounds. If the lower bounds are equal, the high bound are compared. Two bounds are equal iff both their bounds are equal.

val overlap_interval : t -> t -> t option

overlap_interval ivl_a ivl_b calculates the interval that is the overlap between the two intervals. If there is no overlap, None is returned.

val overlaps : t -> t -> bool

overlaps ivl_a ivl_b returns true if the two intervals overlap, false otherwise.

OCaml

Innovation. Community. Security.