Skip to content

Commit

Permalink
Add Stdlib type equality to Set.Make, Map.Make and Hashtbl.Make (#1132)
Browse files Browse the repository at this point in the history
* Add Stdlib type equality to Set, Map and Hashtbl

* Add PR #1132 to ChangeLog
  • Loading branch information
sim642 authored May 7, 2024
1 parent c4dfc61 commit 87f35e1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

## NEXT_RELEASE

- Add Stdlib type equality to Set.Make, Map.Make and Hashtbl.Make
#1132
(Simmo Saan)

## v3.8.0 (minor release)

- support OCaml 5.2
Expand Down
2 changes: 1 addition & 1 deletion src/batHashtbl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ sig
end


module Make(H: HashedType): (S with type key = H.t) =
module Make(H: HashedType): (S with type key = H.t and type 'a t = 'a Hashtbl.Make (H).t) =
struct
include Hashtbl.Make(H)
external to_hash : 'a t -> (key, 'a) Hashtbl.t = "%identity"
Expand Down
2 changes: 1 addition & 1 deletion src/batHashtbl.mli
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ sig
end
(** The output signature of the functor {!Hashtbl.Make}. *)

module Make (H : HashedType) : S with type key = H.t
module Make (H : HashedType) : S with type key = H.t and type 'a t = 'a Hashtbl.Make (H).t
(** Functor building an implementation of the hashtable structure.
The functor [Hashtbl.Make] returns a structure containing
a type [key] of keys and a type ['a t] of hash tables
Expand Down
2 changes: 1 addition & 1 deletion src/batMap.mli
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ sig
end


module Make (Ord : BatInterfaces.OrderedType) : S with type key = Ord.t
module Make (Ord : BatInterfaces.OrderedType) : S with type key = Ord.t with type 'a t = 'a Map.Make (Ord).t
(** Functor building an implementation of the map structure
given a totally ordered type.
*)
Expand Down
2 changes: 1 addition & 1 deletion src/batSet.mli
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ module IRopeSet : S with type elt = BatRope.t
*)

module Make (Ord : OrderedType) : S with type elt = Ord.t
module Make (Ord : OrderedType) : S with type elt = Ord.t and type t = Set.Make (Ord).t
(** Functor building an implementation of the set structure
given a totally ordered type.
Expand Down

0 comments on commit 87f35e1

Please sign in to comment.