Zulip Chat Archive

Stream: PR reviews

Topic: doc-gen#163 - reverse instance lookup


Eric Wieser (Apr 11 2022 at 13:11):

Over at doc-gen#163, I've tried a rough attempt at showing what instances are available for a given type. See the PR comments for some screenshots.

Eric Wieser (Apr 11 2022 at 13:12):

The heuristics for choosing what to display are overly generous, mainly because I don't know how to work with binders effectively in meta code

Kevin Buzzard (Apr 11 2022 at 14:54):

Oh nice!

Eric Wieser (Apr 11 2022 at 14:57):

Ideally instances about list.lex wouldn't show up under the list of instances for list

Eric Wieser (Apr 11 2022 at 14:58):

But that would need something that notices when type arguments to typeclasses are used as indices to later type arguments to typeclasses

Eric Wieser (Apr 11 2022 at 14:58):

Unrelatedly, we might want a special page that lists instances on pi, Type, Prop, and Sort

Eric Wieser (Apr 11 2022 at 14:58):

Generating that page would be easy, it's just a question of how to present it and where to put it

Eric Wieser (Apr 21 2022 at 16:38):

Any more thoughts on this?

Jireh Loreaux (Apr 21 2022 at 16:48):

ummm... I love it? :heart:

Eric Wieser (Apr 21 2022 at 16:52):

For bikeshedding: Any better suggestions than "Available typeclasses" for the heading?

Eric Rodriguez (Apr 21 2022 at 16:53):

Instances?

Eric Rodriguez (Apr 21 2022 at 16:53):

or related instances?

Yaël Dillies (Apr 21 2022 at 16:55):

"Fulfilled instances"?

Eric Wieser (Apr 21 2022 at 16:55):

"Instances" is the heading we use under class for the things that are instances _of_ it

Eric Wieser (Apr 21 2022 at 16:56):

/poll What should the heading be called

Eric Wieser (Apr 21 2022 at 17:09):

In hindsight typeclass was a bad word to use, since it lists the instances not their types (classes)

Eric Wieser (Apr 22 2022 at 10:14):

I've gone with "Available instances"

Eric Wieser (May 08 2022 at 16:07):

This ended up changing to "instances for foo" in review, but is now merged. See docs#nat and docs#lp for examples

Eric Wieser (Nov 04 2022 at 10:35):

Eric Wieser said:

Unrelatedly, we might want a special page that lists instances on pi, Type, Prop, and Sort

(done, see https://leanprover-community.github.io/mathlib_docs_demo/foundational_types.html#pi-types-code%CF%80-a--%CE%B1-%CE%B2-acode)

Kevin Buzzard (Nov 04 2022 at 18:41):

Are there any instances on Type which aren't also instances on Type u?


Last updated: Dec 20 2023 at 11:08 UTC