Uh oh!
There was an error while loading. Please reload this page.
Add Semiring instance - #59
Conversation
JordanMartinez
commented
Nov 6, 2021
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. |
ozkutuk
commented
Nov 6, 2021
I don't think having a let a = Just5
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: