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

Invariant[Fractional] #4032

Merged
merged 3 commits into from
Nov 4, 2021
Merged

Conversation

tmccarthy
Copy link
Contributor

Fixes #3794.

This PR adds Invariant[Fractional], and follows on from #3773, where Invariant[Numeric] and Invariant[Integral] were added.

@@ -70,3 +70,5 @@ trait AllInstancesBinCompat6 extends SortedSetInstancesBinCompat1 with SortedMap
trait AllInstancesBinCompat7 extends SeqInstances

trait AllInstancesBinCompat8 extends DeadlineInstances

trait AllInstancesBinCompat9 extends InvariantInstances with InvariantInstancesBinCompat0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that in 2.12 we were missing InvariantInstances as part of cats.instances.all prior to this PR.

implicit protected def eqFractional[A: Eq: Arbitrary]: Eq[Fractional[A]] = {
// This deprecated instance is required since there is not `ExhaustiveCheck` for any types for which a `Fractional`
// can easily be defined
import DeprecatedEqInstances.catsLawsEqForFn1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that we need to use this instance since there is no type for which both ExhaustiveCheck and Fractional are defined. I attempted to fix this in #3813 with a new MiniFloat type but that made the PR to big.

@LukaJCB LukaJCB merged commit 1a7b9d8 into typelevel:main Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Invariant[Fractional]
3 participants