-
Notifications
You must be signed in to change notification settings - Fork 562
chore: deprecate variants other than inductive ... where
#5533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Deprecates `inductive ... :=`. Also, makes `where` required if there is at least one constructor. Currently produces a warning, controlled by `linter.deprecated`. We don't require `where` when there are no constructors. Closes leanprover#5236
Mathlib CI status (docs):
|
Out of curiosity, why should |
(where of course "forbidden" means "deprecated for a long long time" in this context) |
I think having it be optional is defensible:
That is, downstream style guides could go either way on this, and we shouldn't try to fight with either option. |
My concern here is only making the language surface area smaller, making it easier to learn the whole thing. An optional Though I do disagree about downstream style guides - "the fewer style guides, the better" is an important lesson that Go taught us! |
Aw man |
inductive Expr where | ||
| var (x : Nat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #5236 I thought the argument was leaning towards banning where
for consistency with pattern-matched def
s.
On the other hand, I guess match _ with |
is already inconsistent when compared to inductive _ where |
and def _ : _ |
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current state: This is a draft since there are some questions about whether no-
where
should be disallowed. #5542 deprecates just the:=
variant.Deprecates
inductive ... :=
. Also, makeswhere
required if there is at least one constructor. Currently produces a warning, controlled bylinter.deprecated
.We don't require
where
when there are no constructors.Closes #5236