Add Semiring instance#59
Add Semiring instance#59JordanMartinez merged 2 commits intopurescript:masterfrom ozkutuk:add-semiring-instance
Conversation
|
In #18,
I'm assuming the 'other laws' are in reference to the By adding this instance back, are either type classes (e.g. Otherwise, LGTM. |
|
I don't think having a let a = Just 5
a' = negate a -- Just (-5)
in a + a' -- Just 0 ≠ NothingAnd since all other ring related classes require |
JordanMartinez
left a comment
There was a problem hiding this comment.
Makes sense. Thanks for clarifying.
Description of the change
Semiringinstance was removed by #20 with response to #18, due to it not satisfying all the semiring laws. This PR re-adds the instance with an implementation that satisfies the laws. The instance passed all the tests provided byTest.QuickCheck.Laws.Data.Semiring. The implementation is roughly the same as the instance from thesemiringspackage on Hackage.Checklist: