Commit eb3ff8f2 authored by Raphaël Proust's avatar Raphaël Proust

Stdlib: removing unused functions from Registry

parent e8af0329
......@@ -30,14 +30,10 @@ module type S = sig
val register : k -> v -> unit
val alter : k -> (v -> v) -> unit
val remove : k -> unit
val query : k -> v option
val iter_p : (k -> v -> unit Lwt.t) -> unit Lwt.t
val fold : (k -> v -> 'a -> 'a) -> 'a -> 'a
end
......@@ -56,18 +52,9 @@ end) : S with type k = M.t and type v = M.v = struct
let register k v = registry := Reg.add k v !registry
let alter k f =
match Reg.find_opt k !registry with
| None ->
()
| Some v ->
registry := Reg.add k (f v) !registry
let remove k = registry := Reg.remove k !registry
let query k = Reg.find_opt k !registry
let iter_p f = Lwt.join (Reg.fold (fun k v acc -> f k v :: acc) !registry [])
let fold f a = Reg.fold f !registry a
end
......@@ -32,14 +32,10 @@ module type S = sig
val register : k -> v -> unit
val alter : k -> (v -> v) -> unit
val remove : k -> unit
val query : k -> v option
val iter_p : (k -> v -> unit Lwt.t) -> unit Lwt.t
val fold : (k -> v -> 'a -> 'a) -> 'a -> 'a
end
......
Markdown is supported
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