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

[Merged by Bors] - chore(*): swap order of [fintype A] [decidable_eq A] #3705

Closed
wants to merge 1 commit into from

Conversation

semorrison
Copy link
Collaborator

@fpvandoorn suggested in #3603 swapping the order of some [fintype A] [decidable_eq A] arguments to solve a linter problem with slow typeclass lookup.

The reasoning is that Lean solves typeclass search problems from right to left, and

  • it's "less likely" that a type is a fintype than it has decidable_eq, so we can fail earlier if fintype comes second
  • typeclass search for [decidable_eq] can already be slow, so it's better to avoid it.

This PR applies this suggestion across the library.


@urkud
Copy link
Member

urkud commented Aug 6, 2020

LGTM

@urkud
Copy link
Member

urkud commented Aug 6, 2020

Almost forgot:
bors merge

@github-actions github-actions bot 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 Aug 6, 2020
bors bot pushed a commit that referenced this pull request Aug 6, 2020
@fpvandoorn  suggested in #3603 swapping the order of some `[fintype A] [decidable_eq A]` arguments to solve a linter problem with slow typeclass lookup.

The reasoning is that Lean solves typeclass search problems from right to left, and 
* it's "less likely" that a type is a `fintype` than it has `decidable_eq`, so we can fail earlier if `fintype` comes second
* typeclass search for `[decidable_eq]` can already be slow, so it's better to avoid it.

This PR applies this suggestion across the library.



Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@bors
Copy link

bors bot commented Aug 6, 2020

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title chore(*): swap order of [fintype A] [decidable_eq A] [Merged by Bors] - chore(*): swap order of [fintype A] [decidable_eq A] Aug 6, 2020
@bors bors bot closed this Aug 6, 2020
@bors bors bot deleted the fintype_decidable_eq branch August 6, 2020 04:55
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

2 participants