functor (Key : Key->
  sig
    module Key :
      sig
        type t = Key.t
        val compare : t -> t -> int
        val hash : t -> int
        val t_of_sexp : Sexplib.Sexp.t -> t
        val sexp_of_t : t -> Sexplib.Sexp.t
      end
    type 'a t
    val length : 'a t -> int
    val is_empty : 'a t -> bool
    val iter : 'a t -> f:('-> unit) -> unit
    val fold : 'a t -> init:'accum -> f:('accum -> '-> 'accum) -> 'accum
    val exists : 'a t -> f:('-> bool) -> bool
    val for_all : 'a t -> f:('-> bool) -> bool
    val count : 'a t -> f:('-> bool) -> int
    val find : 'a t -> f:('-> bool) -> 'a option
    val find_map : 'a t -> f:('-> 'b option) -> 'b option
    val to_list : 'a t -> 'a list
    val to_array : 'a t -> 'a array
    val invariant : 'a t -> unit
    val create : unit -> 'a t
    val clear : 'a t -> unit
    val mem : 'a t -> Key.t -> bool
    val lookup : 'a t -> Key.t -> 'a option
    val lookup_exn : 'a t -> Key.t -> 'a
    val enqueue : 'a t -> Key.t -> '-> [ `Key_already_present | `Ok ]
    val enqueue_exn : 'a t -> Key.t -> '-> unit
    val first : 'a t -> 'a option
    val keys : 'a t -> Key.t list
    val dequeue : 'a t -> 'a option
    val dequeue_exn : 'a t -> 'a
    val dequeue_with_key : 'a t -> (Key.t * 'a) option
    val dequeue_with_key_exn : 'a t -> Key.t * 'a
    val dequeue_all : 'a t -> f:('-> unit) -> unit
    val remove : 'a t -> Key.t -> [ `No_such_key | `Ok ]
    val remove_exn : 'a t -> Key.t -> unit
    val replace : 'a t -> Key.t -> '-> [ `No_such_key | `Ok ]
    val replace_exn : 'a t -> Key.t -> '-> unit
    val iteri : 'a t -> f:(key:Key.t -> data:'-> unit) -> unit
    val foldi : 'a t -> init:'-> f:('-> key:Key.t -> data:'-> 'b) -> 'b
  end