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(tactic/core): derive handler for simple instances #1475

Merged
merged 4 commits into from Sep 23, 2019
Merged

Conversation

robertylewis
Copy link
Member

https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/deriving.20instances

This is a simple derive handler for adding instances that can be found just by unfolding a new definition.

TO CONTRIBUTORS:

Make sure you have:

  • reviewed and applied the coding style: coding, naming
  • reviewed and applied the documentation requirements
  • for tactics:
  • make sure definitions and lemmas are put in the right files
  • make sure definitions and lemmas are not redundant

If this PR is related to a discussion on Zulip, please include a link in the discussion.

For reviewers: code review check list

@robertylewis robertylewis requested a review from a team as a code owner September 23, 2019 14:16
@cipher1024
Copy link
Collaborator

This is a good idea but the name is wrong. It is very much inline with Haskell's DeriveNewtype extension, that is deriving instances for type synonyms. Whether it is algebraic or not should not matter.

@robertylewis robertylewis changed the title feat(tactic/core): derive handler for simple algebraic instances feat(tactic/core): derive handler for simple instances Sep 23, 2019
@robertylewis
Copy link
Member Author

I changed the PR title and doc string to remove the word "algebraic."

@cipher1024
Copy link
Collaborator

Good :) Why do you make the definition of the instance an abbreviation?

@robertylewis
Copy link
Member Author

Oh, no good reason. I don't know what the default values for reducibility_hints.regular are, do you?

@cipher1024
Copy link
Collaborator

I would use mk_definition in init/meta/declaration.lean as an exemplar. It uses 1 and tt.

@robertylewis
Copy link
Member Author

Changed to use mk_definition directly.

src/tactic/core.lean Outdated Show resolved Hide resolved
Co-Authored-By: Johan Commelin <johan@commelin.net>
@fpvandoorn fpvandoorn added the ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) label Sep 23, 2019
@mergify mergify bot merged commit 87d1240 into master Sep 23, 2019
@mergify mergify bot deleted the delta_instance branch September 23, 2019 17:37
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 15, 2020
…mmunity#1475)

* feat(tactic/core): derive handler for simple algebraic instances

* change comment

* use mk_definition

* Update src/tactic/core.lean

Co-Authored-By: Johan Commelin <johan@commelin.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants