-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
With the current definition of Semiring
, that is:
protocol Semiring: Multiplicative, Additive { }
There is no notion of defining a separate plus
and times
, as Multiplicative
and Additive
both inherit from Semigroup
and Magma
and so only have a single <>
operation defined on them.
I propose we rename Additive
-> Monoid
and make Multiplicative
use a new operator for the times
operation. We can alias <+>
to <>
as in the Haskell Semiring package.
Since <.>
can't be defined in Swift (what's used in Haskell's Semiring) and <*>
is apply, maybe we use <**>
?
Metadata
Metadata
Assignees
Labels
No labels