Skip to content

Commit 677d671

Browse files
authored
Merge pull request #228 from purescript/ring-law-fix
Fix Ring laws; fixes #212
2 parents 070b6eb + 0c7ea0a commit 677d671

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Data/Ring.purs

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ import Type.Data.RowList (RLProxy(..))
1515
-- | The `Ring` class is for types that support addition, multiplication,
1616
-- | and subtraction operations.
1717
-- |
18-
-- | Instances must satisfy the following law in addition to the `Semiring`
18+
-- | Instances must satisfy the following laws in addition to the `Semiring`
1919
-- | laws:
2020
-- |
21-
-- | - Additive inverse: `a - a = (zero - a) + a = zero`
21+
-- | - Additive inverse: `a - a = zero`
22+
-- | - Compatibility of `sub` and `negate`: `a - b = a + (zero - b)`
2223
class Semiring a <= Ring a where
2324
sub :: a -> a -> a
2425

0 commit comments

Comments
 (0)