From 4e9f73a08e345dec28a2c93b4b3767ebe18605fc Mon Sep 17 00:00:00 2001 From: ppedrot Date: Thu, 1 Aug 2013 14:43:05 +0000 Subject: 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 --- pretyping/typeclasses.ml | 2 ++ pretyping/typeclasses.mli | 2 ++ printing/prettyp.ml | 6 +++++- 3 files changed, 9 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3