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: flatten parent projections when pretty printing structure instance notation #3749

Merged
merged 3 commits into from
Mar 23, 2024

Conversation

kmill
Copy link
Collaborator

@kmill kmill commented Mar 23, 2024

Given

structure A where
  x : Nat

structure B extends A where
  y : Nat

rather than pretty printing { x := 1, y := 2 : B } as { toA := { x := 1 }, y := 2 }, it now pretty prints as { x := 1, y := 2 }.

The option pp.structureInstances.flatten controls whether to flatten structure instances like this.

kmill added 2 commits March 23, 2024 01:29
…nce notation

Given
```lean
structure A where
  x : Nat

structure B extends A where
  y : Nat
```
rather than pretty printing `{ x := 1, y := 2 : B }` as `{ toA := { x := 1 }, y := 2 }`,
it not pretty prints as `{ x := 1, y := 2 }`.

The option `pp.structureInstances.flatten` controls whether to flatten structure instances like this.
@kmill kmill requested a review from kim-em as a code owner March 23, 2024 08:35
@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 d39b0415f002c7a885fd3e02a853babcc2c031ff --onto d5a1dce0ae92475c73a9c24fc8fb2c8e0d4acbcd. (2024-03-23 08:52:02)

@kmill kmill added this pull request to the merge queue Mar 23, 2024
Merged via the queue into leanprover:master with commit 655ec96 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