diff options
| -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 |
