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.
571571Instances must satisfy the following law in addition to the ` Semiring `
572572laws:
573573
574- - Additive inverse: ` a + (-a) = (- a) + a = zero `
574+ - Additive inverse: ` a - a = (zero - a) + a = zero `
575575
576576#### ` (-) `
577577
@@ -587,6 +587,8 @@ laws:
587587negate :: forall a. (Ring a) => a -> a
588588```
589589
590+ ` negate x ` can be used as a shorthand for ` zero - x ` .
591+
590592#### ` ModuloSemiring `
591593
592594``` purescript
@@ -977,4 +979,3 @@ string `show x` be executable PureScript code which evaluates to the same
977979value as the expression ` x ` .
978980
979981
980-
Original file line number Diff line number Diff line change @@ -483,7 +483,7 @@ infixl 6 -
483483-- | Instances must satisfy the following law in addition to the `Semiring`
484484-- | laws:
485485-- |
486- -- | - Additive inverse: `a + (-a) = (- a) + a = zero`
486+ -- | - Additive inverse: `a - a = (zero - a) + a = zero`
487487class (Semiring a ) <= Ring a where
488488 sub :: a -> a -> a
489489
@@ -500,6 +500,7 @@ instance ringUnit :: Ring Unit where
500500(-) :: forall a . (Ring a ) => a -> a -> a
501501(-) = sub
502502
503+ -- | `negate x` can be used as a shorthand for `zero - x`.
503504negate :: forall a . (Ring a ) => a -> a
504505negate a = zero - a
505506
You can’t perform that action at this time.
0 commit comments