functor
  (M : sig
         type t
         val ( >= ) : t -> t -> bool
         val ( <= ) : t -> t -> bool
         val ( = ) : t -> t -> bool
         val ( > ) : t -> t -> bool
         val ( < ) : t -> t -> bool
         val ( <> ) : t -> t -> bool
         val equal : t -> t -> bool
         val compare : t -> t -> int
         val min : t -> t -> t
         val max : t -> t -> t
         val ascending : t -> t -> int
         val descending : t -> t -> int
         module Replace_polymorphic_compare :
           sig
             val ( >= ) : t -> t -> bool
             val ( <= ) : t -> t -> bool
             val ( = ) : t -> t -> bool
             val ( > ) : t -> t -> bool
             val ( < ) : t -> t -> bool
             val ( <> ) : t -> t -> bool
             val equal : t -> t -> bool
             val compare : t -> t -> int
             val min : t -> t -> t
             val max : t -> t -> t
           end
         type comparator
         val comparator : (t, comparator) Comparator.t
         module Map :
           sig
             module Key :
               sig
                 type t = t
                 val sexp_of_t : t -> Sexplib.Sexp.t
                 val t_of_sexp : Sexplib.Sexp.t -> t
                 val compare : t -> t -> int
                 type comparator = comparator
                 val comparator : (t, comparator) Comparator.t_
               end
             type 'v t = (Key.t, 'v, Key.comparator) Map.t
             val sexp_of_t : ('-> Sexplib.Sexp.t) -> 'v t -> Sexplib.Sexp.t
             val t_of_sexp : (Sexplib.Sexp.t -> 'v) -> Sexplib.Sexp.t -> 'v t
             type ('k, 'v, 'comparator) t_ = 'v t
             type 'a key_ = Key.t
             type ('a, 'b, 'c) create_options =
                 ('a, 'b, 'c) Core_map_intf.create_options_without_comparator
             val empty :
               ('k, 'comparator, ('k, 'a, 'comparator) t_) create_options
             val singleton :
               ('k, 'comparator, 'k key_ -> '-> ('k, 'v, 'comparator) t_)
               create_options
             val of_alist :
               ('k, 'comparator,
                ('k key_ * 'v) list ->
                [ `Duplicate_key of 'k key_ | `Ok of ('k, 'v, 'comparator) t_ ])
               create_options
             val of_alist_exn :
               ('k, 'comparator,
                ('k key_ * 'v) list -> ('k, 'v, 'comparator) t_)
               create_options
             val of_alist_multi :
               ('k, 'comparator,
                ('k key_ * 'v) list -> ('k, 'v list, 'comparator) t_)
               create_options
             val of_alist_fold :
               ('k, 'comparator,
                ('k key_ * 'v1) list ->
                init:'v2 ->
                f:('v2 -> 'v1 -> 'v2) -> ('k, 'v2, 'comparator) t_)
               create_options
             val of_tree :
               ('k, 'comparator,
                ('k key_, 'v, 'comparator) Map.tree ->
                ('k, 'v, 'comparator) t_)
               create_options
             val is_empty : ('a, 'b, 'c) t_ -> bool
             val length : ('a, 'b, 'c) t_ -> int
             val add :
               ('k, 'v, 'comparator) t_ ->
               key:'k key_ -> data:'-> ('k, 'v, 'comparator) t_
             val add_multi :
               ('k, 'v list, 'comparator) t_ ->
               key:'k key_ -> data:'-> ('k, 'v list, 'comparator) t_
             val change :
               ('k, 'v, 'comparator) t_ ->
               'k key_ ->
               ('v option -> 'v option) -> ('k, 'v, 'comparator) t_
             val find : ('k, 'v, 'a) t_ -> 'k key_ -> 'v option
             val find_exn : ('k, 'v, 'a) t_ -> 'k key_ -> 'v
             val remove :
               ('k, 'v, 'comparator) t_ ->
               'k key_ -> ('k, 'v, 'comparator) t_
             val mem : ('k, 'a, 'b) t_ -> 'k key_ -> bool
             val iter :
               ('k, 'v, 'a) t_ -> f:(key:'k key_ -> data:'-> unit) -> unit
             val map :
               ('k, 'v1, 'comparator) t_ ->
               f:('v1 -> 'v2) -> ('k, 'v2, 'comparator) t_
             val mapi :
               ('k, 'v1, 'comparator) t_ ->
               f:(key:'k key_ -> data:'v1 -> 'v2) ->
               ('k, 'v2, 'comparator) t_
             val fold :
               ('k, 'v, 'b) t_ ->
               init:'-> f:(key:'k key_ -> data:'-> '-> 'a) -> 'a
             val fold_right :
               ('k, 'v, 'b) t_ ->
               init:'-> f:(key:'k key_ -> data:'-> '-> 'a) -> 'a
             val filter :
               ('k, 'v, 'comparator) t_ ->
               f:(key:'k key_ -> data:'-> bool) -> ('k, 'v, 'comparator) t_
             val filter_map :
               ('k, 'v1, 'comparator) t_ ->
               f:('v1 -> 'v2 option) -> ('k, 'v2, 'comparator) t_
             val filter_mapi :
               ('k, 'v1, 'comparator) t_ ->
               f:(key:'k key_ -> data:'v1 -> 'v2 option) ->
               ('k, 'v2, 'comparator) t_
             val compare :
               ('-> '-> int) ->
               ('k, 'v, 'comparator) t_ -> ('k, 'v, 'comparator) t_ -> int
             val equal :
               ('-> '-> bool) ->
               ('k, 'v, 'comparator) t_ -> ('k, 'v, 'comparator) t_ -> bool
             val keys : ('k, 'a, 'b) t_ -> 'k key_ list
             val data : ('a, 'v, 'b) t_ -> 'v list
             val to_alist : ('k, 'v, 'a) t_ -> ('k key_ * 'v) list
             val merge :
               ('k, 'v1, 'comparator) t_ ->
               ('k, 'v2, 'comparator) t_ ->
               f:(key:'k key_ ->
                  [ `Both of 'v1 * 'v2 | `Left of 'v1 | `Right of 'v2 ] ->
                  'v3 option) ->
               ('k, 'v3, 'comparator) t_
             val min_elt : ('k, 'v, 'a) t_ -> ('k key_ * 'v) option
             val min_elt_exn : ('k, 'v, 'a) t_ -> 'k key_ * 'v
             val max_elt : ('k, 'v, 'a) t_ -> ('k key_ * 'v) option
             val max_elt_exn : ('k, 'v, 'a) t_ -> 'k key_ * 'v
             val for_all : ('k, 'v, 'a) t_ -> f:('-> bool) -> bool
             val exists : ('k, 'v, 'a) t_ -> f:('-> bool) -> bool
             val fold_range_inclusive :
               ('k, 'v, 'b) t_ ->
               min:'k key_ ->
               max:'k key_ ->
               init:'-> f:(key:'k key_ -> data:'-> '-> 'a) -> 'a
             val range_to_alist :
               ('k, 'v, 'a) t_ ->
               min:'k key_ -> max:'k key_ -> ('k key_ * 'v) list
             val prev_key :
               ('k, 'v, 'a) t_ -> 'k key_ -> ('k key_ * 'v) option
             val next_key :
               ('k, 'v, 'a) t_ -> 'k key_ -> ('k key_ * 'v) option
             val rank : ('k, 'a, 'b) t_ -> 'k key_ -> int option
             val to_tree :
               ('k, 'v, 'comparator) t_ ->
               ('k key_, 'v, 'comparator) Map.tree
           end
         module Set :
           sig
             module Elt :
               sig
                 type t = t
                 val sexp_of_t : t -> Sexplib.Sexp.t
                 val t_of_sexp : Sexplib.Sexp.t -> t
                 val compare : t -> t -> int
                 type comparator = comparator
                 val comparator : (t, comparator) Comparator.t_
               end
             type t = (Elt.t, Elt.comparator) Set.t
             val sexp_of_t : t -> Sexplib.Sexp.t
             val t_of_sexp : Sexplib.Sexp.t -> t
             type ('a, 'comparator) t_ = t
             type ('a, 'comparator) tree
             type 'a elt_ = Elt.t
             val empty :
               ('a, 'comparator, ('a, 'comparator) t_)
               Core_set_intf.create_options_without_comparator
             val singleton :
               ('a, 'comparator, 'a elt_ -> ('a, 'comparator) t_)
               Core_set_intf.create_options_without_comparator
             val union_list :
               ('a, 'comparator,
                ('a, 'comparator) t_ list -> ('a, 'comparator) t_)
               Core_set_intf.create_options_without_comparator
             val of_list :
               ('a, 'comparator, 'a elt_ list -> ('a, 'comparator) t_)
               Core_set_intf.create_options_without_comparator
             val of_array :
               ('a, 'comparator, 'a elt_ array -> ('a, 'comparator) t_)
               Core_set_intf.create_options_without_comparator
             val stable_dedup_list :
               ('a, 'b, 'a elt_ list -> 'a elt_ list)
               Core_set_intf.create_options_without_comparator
             val map :
               ('b, 'comparator,
                ('a, 'c) Set.t ->
                f:('-> 'b elt_) -> ('b, 'comparator) t_)
               Core_set_intf.create_options_without_comparator
             val filter_map :
               ('b, 'comparator,
                ('a, 'c) Set.t ->
                f:('-> 'b elt_ option) -> ('b, 'comparator) t_)
               Core_set_intf.create_options_without_comparator
             val of_tree :
               ('a, 'comparator,
                ('a elt_, 'comparator) tree -> ('a, 'comparator) t_)
               Core_set_intf.create_options_without_comparator
             val length : ('a, 'b) t_ -> int
             val is_empty : ('a, 'b) t_ -> bool
             val iter : ('a, 'b) t_ -> f:('a elt_ -> unit) -> unit
             val fold :
               ('a, 'b) t_ ->
               init:'accum -> f:('accum -> 'a elt_ -> 'accum) -> 'accum
             val exists : ('a, 'b) t_ -> f:('a elt_ -> bool) -> bool
             val for_all : ('a, 'b) t_ -> f:('a elt_ -> bool) -> bool
             val count : ('a, 'b) t_ -> f:('a elt_ -> bool) -> int
             val find : ('a, 'b) t_ -> f:('a elt_ -> bool) -> 'a elt_ option
             val find_map :
               ('a, 'c) t_ -> f:('a elt_ -> 'b option) -> 'b option
             val to_list : ('a, 'b) t_ -> 'a elt_ list
             val to_array : ('a, 'b) t_ -> 'a elt_ array
             val mem : ('a, 'b) t_ -> 'a elt_ -> bool
             val add :
               ('a, 'comparator) t_ -> 'a elt_ -> ('a, 'comparator) t_
             val remove :
               ('a, 'comparator) t_ -> 'a elt_ -> ('a, 'comparator) t_
             val union :
               ('a, 'comparator) t_ ->
               ('a, 'comparator) t_ -> ('a, 'comparator) t_
             val inter :
               ('a, 'comparator) t_ ->
               ('a, 'comparator) t_ -> ('a, 'comparator) t_
             val diff :
               ('a, 'comparator) t_ ->
               ('a, 'comparator) t_ -> ('a, 'comparator) t_
             val compare :
               ('a, 'comparator) t_ -> ('a, 'comparator) t_ -> int
             val equal : ('a, 'comparator) t_ -> ('a, 'comparator) t_ -> bool
             val subset :
               ('a, 'comparator) t_ -> ('a, 'comparator) t_ -> bool
             val fold_until :
               ('a, 'c) t_ ->
               init:'->
               f:('-> 'a elt_ -> [ `Continue of '| `Stop of 'b ]) -> 'b
             val fold_right :
               ('a, 'c) t_ -> init:'-> f:('a elt_ -> '-> 'b) -> 'b
             val filter :
               ('a, 'comparator) t_ ->
               f:('a elt_ -> bool) -> ('a, 'comparator) t_
             val partition_tf :
               ('a, 'comparator) t_ ->
               f:('a elt_ -> bool) ->
               ('a, 'comparator) t_ * ('a, 'comparator) t_
             val elements : ('a, 'b) t_ -> 'a elt_ list
             val min_elt : ('a, 'b) t_ -> 'a elt_ option
             val min_elt_exn : ('a, 'b) t_ -> 'a elt_
             val max_elt : ('a, 'b) t_ -> 'a elt_ option
             val max_elt_exn : ('a, 'b) t_ -> 'a elt_
             val choose : ('a, 'b) t_ -> 'a elt_ option
             val choose_exn : ('a, 'b) t_ -> 'a elt_
             val split :
               ('a, 'comparator) t_ ->
               'a elt_ -> ('a, 'comparator) t_ * bool * ('a, 'comparator) t_
             val group_by :
               ('a, 'comparator) t_ ->
               equiv:('a elt_ -> 'a elt_ -> bool) ->
               ('a, 'comparator) t_ list
             val find_exn : ('a, 'b) t_ -> f:('a elt_ -> bool) -> 'a elt_
             val find_index : ('a, 'b) t_ -> int -> 'a elt_ option
             val remove_index :
               ('a, 'comparator) t_ -> int -> ('a, 'comparator) t_
             val to_tree :
               ('a, 'comparator) t_ -> ('a elt_, 'comparator) tree
           end
         val sexp_of_t : t -> Sexplib.Sexp.t
         val t_of_sexp : Sexplib.Sexp.t -> t
         val bin_size_t : t Bin_prot.Size.sizer
         val bin_write_t : t Bin_prot.Map_to_safe.writer
         val bin_write_t_ : t Bin_prot.Unsafe_write_c.writer
         val bin_read_t : t Bin_prot.Read_ml.reader
         val bin_read_t_ : t Bin_prot.Unsafe_read_c.reader
         val bin_read_t__ : (int -> t) Bin_prot.Unsafe_read_c.reader
         val bin_writer_t : t Bin_prot.Type_class.writer
         val bin_reader_t : t Bin_prot.Type_class.reader
         val bin_t : t Bin_prot.Type_class.t
       end->
  sig
    type t
    val sexp_of_t : t -> Sexplib.Sexp.t
    val t_of_sexp : Sexplib.Sexp.t -> t
    val bin_size_t : t Bin_prot.Size.sizer
    val bin_write_t : t Bin_prot.Write_ml.writer
    val bin_write_t_ : t Bin_prot.Unsafe_write_c.writer
    val bin_writer_t : t Bin_prot.Type_class.writer
    val bin_read_t : t Bin_prot.Read_ml.reader
    val bin_read_t_ : t Bin_prot.Unsafe_read_c.reader
    val bin_read_t__ : (int -> t) Bin_prot.Unsafe_read_c.reader
    val bin_reader_t : t Bin_prot.Type_class.reader
    val bin_t : t Bin_prot.Type_class.t
    type 'a poly_t = M.t t
    val sexp_of_poly_t :
      ('-> Sexplib.Sexp.t) -> 'a poly_t -> Sexplib.Sexp.t
    val poly_t_of_sexp :
      (Sexplib.Sexp.t -> 'a) -> Sexplib.Sexp.t -> 'a poly_t
    val bin_size_poly_t :
      'Bin_prot.Size.sizer -> 'a poly_t Bin_prot.Size.sizer
    val bin_write_poly_t :
      'Bin_prot.Unsafe_write_c.writer -> 'a poly_t Bin_prot.Write_ml.writer
    val bin_write_poly_t_ :
      'Bin_prot.Unsafe_write_c.writer ->
      'a poly_t Bin_prot.Unsafe_write_c.writer
    val bin_writer_poly_t :
      'Bin_prot.Type_class.writer -> 'a poly_t Bin_prot.Type_class.writer
    val bin_read_poly_t :
      'Bin_prot.Unsafe_read_c.reader -> 'a poly_t Bin_prot.Read_ml.reader
    val bin_read_poly_t_ :
      'Bin_prot.Unsafe_read_c.reader ->
      'a poly_t Bin_prot.Unsafe_read_c.reader
    val bin_read_poly_t__ :
      'Bin_prot.Unsafe_read_c.reader ->
      (int -> 'a poly_t) Bin_prot.Unsafe_read_c.reader
    val bin_reader_poly_t :
      'Bin_prot.Type_class.reader -> 'a poly_t Bin_prot.Type_class.reader
    val bin_poly_t :
      'Bin_prot.Type_class.t -> 'a poly_t Bin_prot.Type_class.t
    type interval = t
    type bound = M.t
    module T : sig type 'a bound = bound type 'a t = t end
    val create : 'T.bound -> 'T.bound -> 'T.t
    val empty : 'T.t
    val intersect : 'T.t -> 'T.t -> 'T.t
    val is_empty : 'T.t -> bool
    val is_empty_or_singleton : 'T.t -> bool
    val bounds : 'T.t -> ('T.bound * 'T.bound) option
    val lbound : 'T.t -> 'T.bound option
    val ubound : 'T.t -> 'T.bound option
    val bounds_exn : 'T.t -> 'T.bound * 'T.bound
    val lbound_exn : 'T.t -> 'T.bound
    val ubound_exn : 'T.t -> 'T.bound
    val contains : 'T.t -> 'T.bound -> bool
    val compare_value :
      'T.t ->
      'T.bound -> [ `Above | `Below | `Interval_is_empty | `Within ]
    val bound : 'T.t -> 'T.bound -> 'T.bound option
    val is_superset : 'T.t -> of_:'T.t -> bool
    val is_subset : 'T.t -> of_:'T.t -> bool
    val map : f:('T.bound -> 'T.bound) -> 'T.t -> 'T.t
    val are_disjoint : 'T.t list -> bool
    val are_disjoint_as_open_intervals : 'T.t list -> bool
    val list_intersect : 'T.t list -> 'T.t list -> 'T.t list
    val half_open_intervals_are_a_partition : 'T.t list -> bool
    val to_poly : t -> bound poly_t
    module Set :
      sig
        type t
        val sexp_of_t : t -> Sexplib.Sexp.t
        val t_of_sexp : Sexplib.Sexp.t -> t
        val bin_size_t : t Bin_prot.Size.sizer
        val bin_write_t : t Bin_prot.Write_ml.writer
        val bin_write_t_ : t Bin_prot.Unsafe_write_c.writer
        val bin_writer_t : t Bin_prot.Type_class.writer
        val bin_read_t : t Bin_prot.Read_ml.reader
        val bin_read_t_ : t Bin_prot.Unsafe_read_c.reader
        val bin_read_t__ : (int -> t) Bin_prot.Unsafe_read_c.reader
        val bin_reader_t : t Bin_prot.Type_class.reader
        val bin_t : t Bin_prot.Type_class.t
        type 'a poly_t
        val sexp_of_poly_t :
          ('-> Sexplib.Sexp.t) -> 'a poly_t -> Sexplib.Sexp.t
        val poly_t_of_sexp :
          (Sexplib.Sexp.t -> 'a) -> Sexplib.Sexp.t -> 'a poly_t
        val bin_size_poly_t :
          'Bin_prot.Size.sizer -> 'a poly_t Bin_prot.Size.sizer
        val bin_write_poly_t :
          'Bin_prot.Unsafe_write_c.writer ->
          'a poly_t Bin_prot.Write_ml.writer
        val bin_write_poly_t_ :
          'Bin_prot.Unsafe_write_c.writer ->
          'a poly_t Bin_prot.Unsafe_write_c.writer
        val bin_writer_poly_t :
          'Bin_prot.Type_class.writer ->
          'a poly_t Bin_prot.Type_class.writer
        val bin_read_poly_t :
          'Bin_prot.Unsafe_read_c.reader ->
          'a poly_t Bin_prot.Read_ml.reader
        val bin_read_poly_t_ :
          'Bin_prot.Unsafe_read_c.reader ->
          'a poly_t Bin_prot.Unsafe_read_c.reader
        val bin_read_poly_t__ :
          'Bin_prot.Unsafe_read_c.reader ->
          (int -> 'a poly_t) Bin_prot.Unsafe_read_c.reader
        val bin_reader_poly_t :
          'Bin_prot.Type_class.reader ->
          'a poly_t Bin_prot.Type_class.reader
        val bin_poly_t :
          'Bin_prot.Type_class.t -> 'a poly_t Bin_prot.Type_class.t
        module T :
          sig
            type 'a t = t
            type 'a bound = bound
            type 'a interval = interval
          end
        val create : ('T.bound * 'T.bound) list -> 'T.t
        val create_from_intervals : 'T.interval list -> 'T.t
        val contains : 'T.t -> 'T.bound -> bool
        val contains_set : container:'T.t -> contained:'T.t -> bool
        val ubound_exn : 'T.t -> 'T.bound
        val lbound_exn : 'T.t -> 'T.bound
        val ubound : 'T.t -> 'T.bound option
        val lbound : 'T.t -> 'T.bound option
        val to_poly : t -> bound poly_t
      end
  end