Module BatSet


module BatSet: sig .. end
Sets over ordered types.

This module implements the set data structure, given a total ordering function over the set elements. All operations over sets are purely applicative (no side-effects). The implementation uses balanced binary trees, and is therefore reasonably efficient: insertion and membership take time logarithmic in the size of the set, for instance.

Note OCaml, Batteries Included, provides two implementations of sets: polymorphic sets (module PSet) and functorized sets (this module). Module Set offers a more complex and slightly poorer set of features but stronger type-safety. Module PSet is easier to use and has a few more powerful features but makes it easier to shoot yourself in the foot. In case of doubt, use Set.

This module is built upon Stdlib's Set module, but provides the complete interface.
Author(s): Xavier Leroy (Base module), David Teller


module type OrderedType = BatInterfaces.OrderedType
Input signature of the functor Set.Make.
module type S = sig .. end
Output signature of the functor Set.Make.
module StringSet: S  with type elt = String.t
A set of strings.
module IStringSet: S  with type elt = String.t
A set of strings.
module NumStringSet: S  with type elt = String.t
A set of strings.
module RopeSet: S  with type elt = BatRope.t
A set of ropes.
module IRopeSet: S  with type elt = BatRope.t
A set of ropes.
module IntSet: S  with type elt = BatInt.t
A set of integers.
module Make: 
functor (Ord : OrderedType) -> S with type elt = Ord.t
Functor building an implementation of the set structure given a totally ordered type.