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: lemmas for ReaderT and StateT #373

Merged
merged 3 commits into from
Nov 20, 2023

Conversation

fgdorais
Copy link
Collaborator

Handy lemmas extracted from #85 before closing that old PR.

@fgdorais fgdorais added the awaiting-review This PR is ready for review; the author thinks it is ready to be merged. label Nov 18, 2023
Comment on lines 7 to 8
@[simp] theorem run_failure [Monad m] [Alternative m] (ctx : ρ) :
(failure : ReaderT ρ m α).run ctx = failure := rfl
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell the naming conventions as written are silent on whether this should be run_failure or failure_run.

I think we should start becoming more consistent about this, and really hope that we can go with failure_run here:

  • We all use dot notation, and basic principle is "important fragments of the statement, read left to right".
  • This is obviously a theorem about failure more than it is a theorem about run, so failure deserves top billing.

Obviously we should not hold up this PR for such a discussion, of course. :-)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last time this came up, we ended up with "mostly prefix, but binary operators are infix" for a not-completely-defined notion of what constitutes a binary operator. Here run could conceivably be interpreted as a binary operator, but I lean toward not doing so because it doesn't have an associated notation.

@digama0 digama0 merged commit 15b5d94 into leanprover-community:main Nov 20, 2023
1 check passed
@fgdorais fgdorais deleted the control_lemmas branch November 20, 2023 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review This PR is ready for review; the author thinks it is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants