package core_kernel

  1. Overview
  2. Docs
Industrial strength alternative to OCaml's standard library

Install

Dune Dependency

Authors

Maintainers

Sources

core_kernel-v0.15.0.tar.gz
sha256=34a0288f16027c6b90e4ad16cb5cc677d7063d310faf918748ce70f1745116c0

doc/core_kernel.int_set/Int_set/index.html

Module Int_setSource

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.

Sourcetype t
Sourceval empty : t
Sourceval to_string : t -> string
Sourceval add_range : t -> int -> int -> t

add_range t i j adds all the numbers between i and j (inclusive) to the set. Note that it doesn't matter which order i and j are specified in; either way the effect is the same.

Sourceval add : t -> int -> t

add t i adds i to the set.

Sourceval mem : t -> int -> bool

mem t i tests whether i is a member of the set.

Sourceval ranges : t -> (int * int) list

ranges t returns a list of all ranges that make up the set.

Sourceval max : t -> int option
Sourceval min : t -> int option
OCaml

Innovation. Community. Security.