Skip to content

Semiring incorrect, needs to be re-designed #11

@bkase

Description

@bkase

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions