Skip to content
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

feat: enable pp.fieldNotation.generalized globally #3744

Merged
merged 3 commits into from
Mar 23, 2024

Conversation

kmill
Copy link
Collaborator

@kmill kmill commented Mar 23, 2024

Sets the default value to pp.fieldNotation.generalized to true. Updates tests, and fixes some minor flaws in the implementation of the generalized field notation pretty printer.

Now generalized field notation won't be used for any function that has a motive argument. This is intended to prevent recursors from pretty printing using it as (1) recursors are more like control flow structures than actual functions and (2) generalized field notation tends to cause elaboration problems for recursors.

Note: be sure functions that have an @[app_unexpander] use @[pp_nodot] if applicable. For example, List.toArray needs @[pp_nodot] to ensure the unexpander prints it using #[...] notation.

kmill added 2 commits March 22, 2024 17:07
Fixes tests, and fixes some minor flaws in the implementation of the
generalized field notation pretty printer.

Now generalized field notation won't be used for any function that
has a `motive` argument. This prevents recursors from using it for
example, as (1) recursors are more like control flow structures than
actual functions and (2) generalized field notation tends to cause
elaboration problems for recursors.

Note: be sure functions that have an `@[app_unexpander]` use
`@[pp_nodot]` if they can be used with dot notation. For example,
`List.toArray` needed `@[pp_nodot]` to ensure the unexpander prints it
using `#[...]` notation.
@kmill kmill requested a review from kim-em as a code owner March 23, 2024 00:27
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Mar 23, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

Mathlib CI status (docs):

  • ❗ Std/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 8ce98e62ac82379caaa4e76243e8f4ac3fccf366 --onto d5a1dce0ae92475c73a9c24fc8fb2c8e0d4acbcd. (2024-03-23 00:47:49)

@kmill kmill added this pull request to the merge queue Mar 23, 2024
Merged via the queue into leanprover:master with commit d39b041 Mar 23, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants