From 961abb4ee019c4d4f20888d74e50492bc2b9fcb6 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Sat, 8 Jan 2022 13:40:36 -0700 Subject: [PATCH] remove [Infix] operations They are not standard across OCaml libraries and the convenience offered is very minor. ps-id: 3B7E8656-2EA0-4BE6-9888-DA8AC62A932D --- lib/hamt.ml | 10 ---------- lib/hamt.mli | 11 ----------- 2 files changed, 21 deletions(-) diff --git a/lib/hamt.ml b/lib/hamt.ml index bf388de..58c6ff2 100644 --- a/lib/hamt.ml +++ b/lib/hamt.ml @@ -199,11 +199,6 @@ module type S = sig val find : key -> 'a t -> 'a option val choose : 'a t -> (key * 'a) option end - - module Infix : sig - val ( --> ) : 'a t -> key -> 'a - val ( <-- ) : 'a t -> key * 'a -> 'a t - end end module Make (Config : CONFIG) (Key : Hashtbl.HashedType) : @@ -830,11 +825,6 @@ module Make (Config : CONFIG) (Key : Hashtbl.HashedType) : let find k hamt = find_opt k hamt let choose hamt = try Some (choose hamt) with Not_found -> None end - - module Infix = struct - let ( --> ) hamt k = find k hamt - let ( <-- ) hamt (k, v) = add k v hamt - end end module Make' = Make (StdConfig) diff --git a/lib/hamt.mli b/lib/hamt.mli index 0dc1d88..31ab5f3 100644 --- a/lib/hamt.mli +++ b/lib/hamt.mli @@ -290,17 +290,6 @@ module type S = sig val find : key -> 'a t -> 'a option val choose : 'a t -> (key * 'a) option end - - (** Infix operations. *) - module Infix : sig - val ( --> ) : 'a t -> key -> 'a - (** [t --> k] returns the current binding of [k] in [t], or - raises [Not_found]. Strictly equivalent to [find_exn k t]. *) - - val ( <-- ) : 'a t -> key * 'a -> 'a t - (** [t <-- (k, v)] adds to [t] a binding from [k] to [v] and - returns the result. Strictly equivalent to [add k v Hamt]. *) - end end (** Functor building an implementation of the Hamt structure,