spire.algebra
Given any Ring[A] we can construct a RingAlgebra[A, Int]. This is possible since we can define fromInt on Ring generally.
Ring[A]
RingAlgebra[A, Int]
fromInt
Ring
Defined to be equivalent to additive.sumn(one, n).
additive.sumn(one, n)
Defined to be equivalent to additive.sumn(one, n). That is, n repeated summations of this ring's one, or -one if n is negative.
n
one
-one
This is similar to Semigroup#pow, except that a pow 0 is defined to be the multiplicative identity.
Semigroup#pow
a pow 0
Given any
Ring[A]
we can construct aRingAlgebra[A, Int]
. This is possible since we can definefromInt
onRing
generally.