package rangeSet

  1. Overview
  2. Docs

Module Continuous.MakeSource

Functor building an implementation of the RangeSet.Continuous structure given a totally ordered type.

Parameters

module Ord : OrderedType

Signature

Sourcetype t

The type of the sets.

Sourcetype point =
  1. | Inc of Ord.t
    (*

    including endpoint

    *)
  2. | Exc of Ord.t
    (*

    excluding endpoint

    *)

The type of the point of a range. A point can be either closed or open, respectively Inc elt or Exc elt where elt is of type elt

Sourcetype range = {
  1. start : point;
  2. stop : point;
}

The type of the range. A range consists of start and end endpoint.

Sourceval point_to_string : point -> string

point_to_string point is the written representation of point.

Sourceval range_to_string : range -> string

range_to_string range is the written representation of range.

Sourceval to_string : t -> string

to_string set is the written representation of set.

Sourceval empty : t

The empty set.

Sourceval is_empty : t -> bool

is_empty t tests whether t is empty or not.

Sourceval mem : Ord.t -> t -> bool

mem x s tests whether x belongs to the set s.

Sourceval add : Ord.t -> t -> t

add x s returns a set containing all elements of s, plus x. If x was already in s, s is returned unchanged.

Sourceval singleton : Ord.t -> t

singleton x returns the one-element set containing only x.

Sourceval of_point : point -> point -> t

of_point p1 p2 returns the set containing a range from p1 to p2.

Sourceval of_range : range -> t

of_range r returns the set containing only the range.

Sourceval of_ranges : range list -> t

of_ranges rs returns the set containing all the ranges in rs.

Sourceval remove : Ord.t -> t -> t

remove x s returns a set containing all elements of s, except x.

Sourceval merge : range -> t -> t

merge r s returns a set containing all elements of s , plus range r.

Sourceval unmerge : range -> t -> t

unmerge r s returns a set containing all elements of s, except those in range r.

Sourceval cover : range -> t -> t

cover r s returns a set containing elements both belongs to range r and set s.

Sourceval union : t -> t -> t

Set union.

Sourceval diff : t -> t -> t

Set difference: diff s1 s2 contains the elements of s1 that are not in s2.

Sourceval inter : t -> t -> t

Set intersection.

OCaml

Innovation. Community. Security.