File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -571,7 +571,7 @@ and subtraction operations.
571
571
Instances must satisfy the following law in addition to the ` Semiring `
572
572
laws:
573
573
574
- - Additive inverse: ` a + (-a) = (- a) + a = zero `
574
+ - Additive inverse: ` a - a = (zero - a) + a = zero `
575
575
576
576
#### ` (-) `
577
577
@@ -587,6 +587,8 @@ laws:
587
587
negate :: forall a. (Ring a) => a -> a
588
588
```
589
589
590
+ ` negate x ` can be used as a shorthand for ` zero - x ` .
591
+
590
592
#### ` ModuloSemiring `
591
593
592
594
``` purescript
@@ -977,4 +979,3 @@ string `show x` be executable PureScript code which evaluates to the same
977
979
value as the expression ` x ` .
978
980
979
981
980
-
Original file line number Diff line number Diff line change @@ -483,7 +483,7 @@ infixl 6 -
483
483
-- | Instances must satisfy the following law in addition to the `Semiring`
484
484
-- | laws:
485
485
-- |
486
- -- | - Additive inverse: `a + (-a) = (- a) + a = zero`
486
+ -- | - Additive inverse: `a - a = (zero - a) + a = zero`
487
487
class (Semiring a ) <= Ring a where
488
488
sub :: a -> a -> a
489
489
@@ -500,6 +500,7 @@ instance ringUnit :: Ring Unit where
500
500
(-) :: forall a . (Ring a ) => a -> a -> a
501
501
(-) = sub
502
502
503
+ -- | `negate x` can be used as a shorthand for `zero - x`.
503
504
negate :: forall a . (Ring a ) => a -> a
504
505
negate a = zero - a
505
506
You can’t perform that action at this time.
0 commit comments