lean4 icon indicating copy to clipboard operation
lean4 copied to clipboard

chore: deprecate variants other than `inductive ... where`

Open kmill opened this issue 1 year ago • 6 comments

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, 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 #5236

kmill avatar Sep 30 '24 03:09 kmill

Mathlib CI status (docs):

Out of curiosity, why should where be optional in the case of no constructors, rather than making it either mandatory or forbidden?

david-christiansen avatar Sep 30 '24 08:09 david-christiansen

(where of course "forbidden" means "deprecated for a long long time" in this context)

david-christiansen avatar Sep 30 '24 08:09 david-christiansen

I think having it be optional is defensible:

  • It should be allowed to be omitted because there is a legitimate aesthetic/readability argument against it (inductive Foo where looks like an unfinished sentence)
  • It should be allowed to be included because it is more regular (it makes editing easier if lists of 0+ things can be added or removed without requiring surrounding edits as well)

That is, downstream style guides could go either way on this, and we shouldn't try to fight with either option.

digama0 avatar Sep 30 '24 13:09 digama0

My concern here is only making the language surface area smaller, making it easier to learn the whole thing.

An optional where on constructorless types is not a huge increase.

Though I do disagree about downstream style guides - "the fewer style guides, the better" is an important lesson that Go taught us!

david-christiansen avatar Sep 30 '24 14:09 david-christiansen

Aw man

Thermotronica avatar Sep 30 '24 14:09 Thermotronica