package interval-map

  1. Overview
  2. Docs

Module Make.IntervalSource

Sourcetype t = private {
  1. low : Bound.t;
  2. high : Bound.t;
}
Sourceval create : Bound.t -> Bound.t -> t

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

Sourceval 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.

Sourceval 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.

Sourceval overlaps : t -> t -> bool

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