diff options
| author | ppedrot | 2013-08-01 14:43:05 +0000 |
|---|---|---|
| committer | ppedrot | 2013-08-01 14:43:05 +0000 |
| commit | 4e9f73a08e345dec28a2c93b4b3767ebe18605fc (patch) | |
| tree | cd5918f13184656eb5531d397c0fedf2f82e4c14 | |
| parent | 588cae6376261a8794e30ba5c31f0a9701153715 (diff) | |
Added printing of instance priority to the Print Instances command.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16647 85f007b7-540e-0410-9357-904b9bb8a0f7
| -rw-r--r-- | pretyping/typeclasses.ml | 2 | ||||
| -rw-r--r-- | pretyping/typeclasses.mli | 2 | ||||
| -rw-r--r-- | printing/prettyp.ml | 6 |
3 files changed, 9 insertions, 1 deletions
diff --git a/pretyping/typeclasses.ml b/pretyping/typeclasses.ml index 6da6624228..9046be4d27 100644 --- a/pretyping/typeclasses.ml +++ b/pretyping/typeclasses.ml @@ -71,6 +71,8 @@ type instances = (instance Refmap.t) Refmap.t let instance_impl is = is.is_impl +let instance_priority is = is.is_pri + let new_instance cl pri glob impl = let global = if glob then Lib.sections_depth () diff --git a/pretyping/typeclasses.mli b/pretyping/typeclasses.mli index 028e393f2f..0fe22bcce3 100644 --- a/pretyping/typeclasses.mli +++ b/pretyping/typeclasses.mli @@ -67,6 +67,8 @@ val class_of_constr : constr -> (rel_context * (typeclass * constr list)) option val instance_impl : instance -> global_reference +val instance_priority : instance -> int option + val is_class : global_reference -> bool val is_instance : global_reference -> bool diff --git a/printing/prettyp.ml b/printing/prettyp.ml index d7d7bd97db..9a084adc48 100644 --- a/printing/prettyp.ml +++ b/printing/prettyp.ml @@ -772,7 +772,11 @@ let print_typeclasses () = let pr_instance env i = (* gallina_print_constant_with_infos i.is_impl *) (* lighter *) - print_ref false (instance_impl i) + print_ref false (instance_impl i) ++ + begin match instance_priority i with + | None -> mt () + | Some i -> spc () ++ str "|" ++ spc () ++ int i + end let print_all_instances () = let env = Global.env () in |
