aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--lib/util.ml4
-rw-r--r--lib/util.mli2
-rw-r--r--pretyping/miscops.ml4
3 files changed, 6 insertions, 4 deletions
diff --git a/lib/util.ml b/lib/util.ml
index 16b5f4615..531e4fe7d 100644
--- a/lib/util.ml
+++ b/lib/util.ml
@@ -124,3 +124,7 @@ let delayed_force f = f ()
type ('a, 'b) union = ('a, 'b) CSig.union = Inl of 'a | Inr of 'b
type 'a until = 'a CSig.until = Stop of 'a | Cont of 'a
+
+let map_union f g = function
+ | Inl a -> Inl (f a)
+ | Inr b -> Inr (g b)
diff --git a/lib/util.mli b/lib/util.mli
index fd766a30f..86720fe47 100644
--- a/lib/util.mli
+++ b/lib/util.mli
@@ -100,6 +100,8 @@ val delayed_force : 'a delayed -> 'a
type ('a, 'b) union = ('a, 'b) CSig.union = Inl of 'a | Inr of 'b
(** Union type *)
+val map_union : ('a -> 'c) -> ('b -> 'd) -> ('a, 'b) union -> ('c, 'd) union
+
type 'a until = 'a CSig.until = Stop of 'a | Cont of 'a
(** Used for browsable-until structures. *)
diff --git a/pretyping/miscops.ml b/pretyping/miscops.ml
index 3e5f7577b..882ebafe1 100644
--- a/pretyping/miscops.ml
+++ b/pretyping/miscops.ml
@@ -46,10 +46,6 @@ let map_flags f flags =
let map_occs f (occ,e) = (occ,f e)
-let map_union f g = function
- | Inl a -> Inl (f a)
- | Inr b -> Inr (g b)
-
let map_red_expr_gen f g h = function
| Fold l -> Fold (List.map f l)
| Pattern occs_l -> Pattern (List.map (map_occs f) occs_l)