Zulip Chat Archive
Stream: general
Topic: class inductive
Mario Carneiro (Sep 25 2020 at 14:20):
Check out the definition of nonempty:
class inductive nonempty (α : Sort u) : Prop
| intro (val : α) : nonempty
Even the syntax highlighter didn't know class inductive
was a thing
Mario Carneiro (Sep 25 2020 at 14:21):
not zulip's highlighter but I think it doesn't understand definition structure
Mario Carneiro (Sep 25 2020 at 14:36):
(Personally I don't think it should be a thing, since @[class] inductive
works just as well)
Jireh Loreaux (May 11 2023 at 19:45):
what are some useful examples of @[class] inductive
?
Frédéric Dupuis (May 11 2023 at 20:03):
I guess you could imagine something like
@[class] inductive IsROrC (𝕜 : Type _) [Field 𝕜]
| real (e : 𝕜 ≃+* ℝ)
| complex (e : 𝕜 ≃+* ℂ)
Eric Wieser (May 11 2023 at 20:04):
I think we used to have more of these, but we eliminated them in favor of using structures containing more primitive inductive types as fields
Henrik Böving (May 11 2023 at 20:25):
The most useful one by far is of course docs4#Decidable !
Eric Wieser (May 11 2023 at 20:28):
Off-topic, but is it easy to fix the docs for that so that the docstrings for the constructors are not monospaced?
Henrik Böving (May 11 2023 at 20:33):
That should be a simple :tm: CSS fix yes
Henrik Böving (May 11 2023 at 20:37):
Should be fixed on the next build
Jireh Loreaux (May 11 2023 at 21:05):
@Frédéric Dupuis that's actually exactly the application I was considering!
Kevin Buzzard (May 11 2023 at 21:38):
[insert my canonical moan about how it shouldn't be Is
because it's not a Prop]
Henrik Böving (May 12 2023 at 09:28):
Eric Wieser said:
Off-topic, but is it easy to fix the docs for that so that the docstrings for the constructors are not monospaced?
better?^^
Notification Bot (May 12 2023 at 13:48):
14 messages were moved from this topic to #general > inductive types in documentation by Kyle Miller.
Last updated: Dec 20 2023 at 11:08 UTC