Skip to content

Commit

Permalink
Merge pull request #40 from thizanne/ps/rr/remove__infix__operations
Browse files Browse the repository at this point in the history
remove [Infix] operations
  • Loading branch information
thizanne authored Jan 8, 2022
2 parents bb01c38 + 961abb4 commit 2d5e536
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
10 changes: 0 additions & 10 deletions lib/hamt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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) :
Expand Down Expand Up @@ -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)
Expand Down
11 changes: 0 additions & 11 deletions lib/hamt.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2d5e536

Please sign in to comment.