package bogue

  1. Overview
  2. Docs

Module Bogue.SelectionSource

Unions of ranges of integers

Example

We define two sets, s=[0..5; 10..20] and r=[4..15], and we compute their union and intersection.

open Bogue.Selection;;
# let s = of_list [(0,5); (10,20)];;
val s : t = <abstr>
# sprint s;;
- : string = "{0..5, 10..20}"
# let r = of_list [(4,15)];;
val r : t = <abstr>
# sprint (union s r);;
- : string = "{0..20}"
# sprint (intersect s r);;
- : string = "{4..5, 10..15}"
Dependency graph
Sourcetype t
Sourceval to_list : t -> (int * int) list
Sourceval of_list : (int * int) list -> t
Sourceval mem : t -> int -> bool
Sourceval toggle : t -> int -> t
Sourceval remove : t -> int -> t
Sourceval add : t -> int -> t
Sourceval union : t -> t -> t
Sourceval intersect : t -> t -> t
Sourceval sprint : t -> string
Sourceval iter : (int -> unit) -> t -> unit
OCaml

Innovation. Community. Security.