aboutsummaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2020-02-12 17:08:24 +0100
committerPierre-Marie Pédrot2020-02-12 17:08:24 +0100
commit713f8a1af8c5e053ea6dc7b58a4a2b04a1e67c2f (patch)
tree430b6be9f424f3055f12c7754ed444d2d8e9fb75 /library
parent99a0e8f01fd2570672e5e9d133d5a9472eef406b (diff)
parenta5f9b0ea89c9a595ce47c549a2ebb976b0ac3aa2 (diff)
Merge PR #11544: Cleanup some globref related manipulations
Reviewed-by: herbelin Reviewed-by: ppedrot
Diffstat (limited to 'library')
-rw-r--r--library/globnames.ml8
-rw-r--r--library/globnames.mli2
2 files changed, 3 insertions, 7 deletions
diff --git a/library/globnames.ml b/library/globnames.ml
index 63cb2c69bd..e55a7b5499 100644
--- a/library/globnames.ml
+++ b/library/globnames.ml
@@ -73,13 +73,7 @@ let global_of_constr c = match kind c with
| Var id -> VarRef id
| _ -> raise Not_found
-let is_global c t =
- match c, kind t with
- | ConstRef c, Const (c', _) -> Constant.equal c c'
- | IndRef i, Ind (i', _) -> eq_ind i i'
- | ConstructRef i, Construct (i', _) -> eq_constructor i i'
- | VarRef id, Var id' -> Id.equal id id'
- | _ -> false
+let is_global = Constr.isRefX
let printable_constr_of_global = function
| VarRef id -> mkVar id
diff --git a/library/globnames.mli b/library/globnames.mli
index d61cdd2b64..fb59cbea4e 100644
--- a/library/globnames.mli
+++ b/library/globnames.mli
@@ -32,6 +32,7 @@ val destIndRef : GlobRef.t -> inductive
val destConstructRef : GlobRef.t -> constructor
val is_global : GlobRef.t -> constr -> bool
+[@@ocaml.deprecated "Use [Constr.isRefX] instead."]
val subst_constructor : substitution -> constructor -> constructor
val subst_global : substitution -> GlobRef.t -> GlobRef.t * constr Univ.univ_abstracted option
@@ -44,6 +45,7 @@ val printable_constr_of_global : GlobRef.t -> constr
(** Turn a construction denoting a global reference into a global reference;
raise [Not_found] if not a global reference *)
val global_of_constr : constr -> GlobRef.t
+[@@ocaml.deprecated "Use [Constr.destRef] instead (throws DestKO instead of Not_found)."]
(** {6 Extended global references } *)