Skip to content

Commit

Permalink
feat: Add MultiplicativeMonoid and MultiplicativeGroup instances
Browse files Browse the repository at this point in the history
  • Loading branch information
Iltotore committed Oct 14, 2024
1 parent 4efa76c commit f89b46b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cats/src/io/github/iltotore/iron/instances.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import io.github.iltotore.iron.constraint.numeric.*
import scala.util.NotGiven
import _root_.cats.Functor
import algebra.instances.all.*
import algebra.ring.{AdditiveCommutativeMonoid, AdditiveCommutativeSemigroup}
import algebra.ring.{AdditiveCommutativeMonoid, AdditiveCommutativeSemigroup, MultiplicativeGroup, MultiplicativeMonoid}

/**
* Represent all Cats' typeclass instances for Iron.
Expand Down Expand Up @@ -113,4 +113,8 @@ private trait RefinedTypeOpsCatsLowPriority:
given negFloatAdditiveCommutativeMonoid: AdditiveCommutativeMonoid[Float :| Negative0] = additiveCommutativeMonoid[Float, Negative0]
given negDoubleAdditiveCommutativeMonoid: AdditiveCommutativeMonoid[Double :| Negative0] = additiveCommutativeMonoid[Double, Negative0]


given multiplicativeMonoid[A, C](using inner: MultiplicativeMonoid[A]): MultiplicativeMonoid[A :| C] =
inner.assumeAll[C]

given multiplicativeGroup[A, C](using inner: MultiplicativeGroup[A]): MultiplicativeGroup[A :| C] =
inner.assumeAll[C]

0 comments on commit f89b46b

Please sign in to comment.