Module Int_set
An implementation of compressed integer sets using lists of integer ranges. Operations such as adding and membership are O(n) where n is the number of contiguous ranges in the set. For data that is mostly serial, n should remain very small.
Note that when n gets very large, in addition to poor performance, these operations may throw exceptions since some of the code is not tail-recursive.
val empty : tval to_string : t -> stringval add_range : t -> int -> int -> tadd_range t i jadds all the numbers betweeniandj(inclusive) to the set. Note that it doesn't matter which orderiandjare specified in; either way the effect is the same.
val mem : t -> int -> boolmem t itests whetheriis a member of the set.
val ranges : t -> (int * int) listranges treturns a list of all ranges that make up the set.