Commit 2020-08-06 03:47 5cba21d8
View on Github →chore(*): swap order of [fintype A] [decidable_eq A] (#3705)
@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 hasdecidable_eq
, so we can fail earlier iffintype
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.