Commit 416b5b28 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Glue: a few changes for compatibility with the new ephemeron API.

parent fcf5f457
......@@ -138,28 +138,40 @@ module ArraysAsImperativeMaps (K : sig val n: int end) = struct
end
module Adapt (T : Hashtbl.S) = struct
module HashTablesAsImperativeMaps (H : HashedType) = struct
include T
(* types: [key], ['data t] *)
(* values: [clear], [iter] *)
include Hashtbl.Make(H)
(* [clear], [iter] are included *)
let create () =
T.create 1023
create 1023
let add key data table =
T.add table key data
add table key data
let find table key =
T.find key table
find key table
end
module HashTablesAsImperativeMaps (H : HashedType) =
Adapt(Hashtbl.Make(H))
module WeakHashTablesAsImperativeMaps (H : HashedType) = struct
include Ephemeron.K1.Make(H)
(* [iter] is not included because it is not supported by the new ephemeron
API in OCaml 5. *)
let create () =
create 1023
module WeakHashTablesAsImperativeMaps (H : HashedType) =
Adapt(Ephemeron.K1.Make(H))
let add key data table =
add table key data
let find table key =
find key table
end
module MinimalSemiLattice (P : SEMI_LATTICE) = struct
......
......@@ -110,8 +110,8 @@ module HashTablesAsImperativeMaps
and can therefore be unsuitable for use in some applications. *)
module WeakHashTablesAsImperativeMaps
(H : HashedType)
: IMPERATIVE_MAPS with type key = H.t
and type 'data t = 'data Ephemeron.K1.Make(H).t
: MINIMAL_IMPERATIVE_MAPS with type key = H.t
and type 'data t = 'data Ephemeron.K1.Make(H).t
(* -------------------------------------------------------------------------- *)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment