Zulip Chat Archive

Stream: lean4

Topic: determine priority of instance


Eric Wieser (Nov 17 2023 at 12:15):

If I have a declaration Foo.toBar, how can I find out:

  • Whether it is an instance?
  • What the priority is if it is one?

In lean 3, the answer was #print Foo.toBar which would show all the attributes

Jun Yoshida (Nov 17 2023 at 12:25):

A little bit hacky, but the following does the trick:

#eval Lean.Meta.getInstancePriority? `Foo.toBar

Eric Wieser (Nov 17 2023 at 15:26):

Thanks! That was enough for me to me to open lean4#2905

Kevin Buzzard (Nov 17 2023 at 16:31):

Oh nice! It will be interesting to see a benchmark for how mathlib changes if this is indeed considered a bug and is fixed.


Last updated: Dec 20 2023 at 11:08 UTC