aboutsummaryrefslogtreecommitdiff
path: root/clib
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2019-05-04 19:27:40 +0200
committerPierre-Marie Pédrot2019-05-04 19:27:40 +0200
commit69466c61e5f6315599669fa7255aa5ac37d7b91a (patch)
tree95e88ad90441787b768b2931a027c50f54552937 /clib
parentc05bc427be4455d8fb9341c858ea7e3317ee784e (diff)
parent48b86574606b9500864a79ddc6a0a668e1aaf295 (diff)
Merge PR #9996: Fix #5752: `Hint Mode` ignored for type classes that appear as assumptions
Ack-by: RalfJung Ack-by: SkySkimmer Reviewed-by: Zimmi48 Ack-by: maximedenes Reviewed-by: ppedrot Ack-by: robbertkrebbers
Diffstat (limited to 'clib')
-rw-r--r--clib/cSig.mli2
-rw-r--r--clib/hMap.ml8
2 files changed, 10 insertions, 0 deletions
diff --git a/clib/cSig.mli b/clib/cSig.mli
index 859018ca4b..0012bcef17 100644
--- a/clib/cSig.mli
+++ b/clib/cSig.mli
@@ -68,6 +68,8 @@ sig
val remove: key -> 'a t -> 'a t
val merge:
(key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t
+ val union:
+ (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a t
val compare: ('a -> 'a -> int) -> 'a t -> 'a t -> int
val equal: ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val iter: (key -> 'a -> unit) -> 'a t -> unit
diff --git a/clib/hMap.ml b/clib/hMap.ml
index 09ffb39c21..db59ef47b0 100644
--- a/clib/hMap.ml
+++ b/clib/hMap.ml
@@ -290,6 +290,14 @@ struct
in
Int.Map.merge fm s1 s2
+ let union f s1 s2 =
+ let fm h m1 m2 =
+ let m = Map.union f m1 m2 in
+ if Map.is_empty m then None
+ else Some m
+ in
+ Int.Map.union fm s1 s2
+
let compare f s1 s2 =
let fc m1 m2 = Map.compare f m1 m2 in
Int.Map.compare fc s1 s2