Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove [Infix] operations #40

Merged
merged 1 commit into from
Jan 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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