git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Alter `ModuloSemiring` case
commit87ff5269bb0f306100542d11825874a088d4544f authorGary Burgess <gary.burgess@gmail.com> dateMon 16 Feb 2015, 00:41 (12 years ago) parent21eea0d
5 files changed+12−12
prelude/README.md+5−5 prelude/images/Prelude.png prelude/prelude.purs+4−4 src/Language/PureScript/CodeGen/JS/Optimizer/Inliner.hs+1−1 src/Language/PureScript/Constants.hs+2−2
prelude/README.md+5−5
@@ -64,7 +64,7 @@
6464Ring where every nonzero element has a multiplicative inverse (possibly
6565a non-commutative field) so that ```a `mod` b = zero```
6666
67− class (Ring a, ModuloSemiRing a) <= DivisionRing a where
67+ class (Ring a, ModuloSemiring a) <= DivisionRing a where
6868
6969#### `Eq`
7070
@@ -77,12 +77,12 @@ a non-commutative field) so that ```a `mod` b = zero```
7777 class Functor f where
7878 (<$>) :: forall a b. (a -> b) -> f a -> f b
7979
80−#### `ModuloSemiRing`
80+#### `ModuloSemiring`
8181
8282Semiring with modulo operation and division where
8383```a / b * b + (a `mod` b) = a```
8484
85− class (Semiring a) <= ModuloSemiRing a where
85+ class (Semiring a) <= ModuloSemiring a where
8686 (/) :: a -> a -> a
8787 mod :: a -> a -> a
8888
@@ -192,9 +192,9 @@ Addition and multiplication
192192
193193 instance functorArr :: Functor (Prim.Function r)
194194
195−#### `moduloSemiRingNumber`
195+#### `moduloSemiringNumber`
196196
197− instance moduloSemiRingNumber :: ModuloSemiRing Number
197+ instance moduloSemiringNumber :: ModuloSemiring Number
198198
199199#### `monadArr`
200200
prelude/images/Prelude.png

Binary file not shown.

prelude/prelude.purs+4−4
@@ -14,7 +14,7 @@ module Prelude
1414 , Bind, (>>=)
1515 , Monad, return, liftM1, ap
1616 , Semiring, (+), zero, (*), one
17− , ModuloSemiRing, (/), mod
17+ , ModuloSemiring, (/), mod
1818 , Ring, (-)
1919 , (%)
2020 , negate
@@ -219,7 +219,7 @@ module Prelude
219219
220220 -- | Semiring with modulo operation and division where
221221 -- | ```a / b * b + (a `mod` b) = a```
222− class (Semiring a) <= ModuloSemiRing a where
222+ class (Semiring a) <= ModuloSemiring a where
223223 (/) :: a -> a -> a
224224 mod :: a -> a -> a
225225
@@ -232,7 +232,7 @@ module Prelude
232232
233233 -- | Ring where every nonzero element has a multiplicative inverse (possibly
234234 -- | a non-commutative field) so that ```a `mod` b = zero```
235− class (Ring a, ModuloSemiRing a) <= DivisionRing a
235+ class (Ring a, ModuloSemiring a) <= DivisionRing a
236236
237237 -- | A commutative field
238238 class (DivisionRing a) <= Num a
@@ -293,7 +293,7 @@ module Prelude
293293 instance ringNumber :: Ring Number where
294294 (-) = numSub
295295
296− instance moduloSemiRingNumber :: ModuloSemiRing Number where
296+ instance moduloSemiringNumber :: ModuloSemiring Number where
297297 (/) = numDiv
298298 mod _ _ = 0
299299
src/Language/PureScript/CodeGen/JS/Optimizer/Inliner.hs+1−1
@@ -105,7 +105,7 @@ inlineCommonOperators = applyAll $
105105 , binary C.semiringNumber (C.*) Multiply
106106 , binary C.ringNumber (C.-) Subtract
107107 , unary C.ringNumber C.negate Negate
108− , binary C.moduloSemiRingNumber (C./) Divide
108+ , binary C.moduloSemiringNumber (C./) Divide
109109
110110 , binary C.ordNumber (C.<) LessThan
111111 , binary C.ordNumber (C.>) GreaterThan
src/Language/PureScript/Constants.hs+2−2
@@ -175,8 +175,8 @@ semiringNumber = "semiringNumber"
175175ringNumber :: String
176176ringNumber = "ringNumber"
177177
178−moduloSemiRingNumber :: String
179−moduloSemiRingNumber = "moduloSemiRingNumber"
178+moduloSemiringNumber :: String
179+moduloSemiringNumber = "moduloSemiringNumber"
180180
181181numNumber :: String
182182numNumber = "numNumber"