git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Alter `ModuloSemiring` case
87ff526Gary Burgess
prelude/README.md+5−5
@@ -64,7 +64,7 @@
64Ring where every nonzero element has a multiplicative inverse (possibly
64Ring where every nonzero element has a multiplicative inverse (possibly
65a non-commutative field) so that ```a `mod` b = zero```
65a non-commutative field) so that ```a `mod` b = zero```
66
66
67− class (Ring a, ModuloSemiRing a) <= DivisionRing a where
67+ class (Ring a, ModuloSemiring a) <= DivisionRing a where
68
68
69#### `Eq`
69#### `Eq`
70
70
@@ -77,12 +77,12 @@ a non-commutative field) so that ```a `mod` b = zero```
77 class Functor f where
77 class Functor f where
78 (<$>) :: forall a b. (a -> b) -> f a -> f b
78 (<$>) :: forall a b. (a -> b) -> f a -> f b
79
79
80−#### `ModuloSemiRing`
80+#### `ModuloSemiring`
81
81
82Semiring with modulo operation and division where
82Semiring with modulo operation and division where
83```a / b * b + (a `mod` b) = a```
83```a / b * b + (a `mod` b) = a```
84
84
85− class (Semiring a) <= ModuloSemiRing a where
85+ class (Semiring a) <= ModuloSemiring a where
86 (/) :: a -> a -> a
86 (/) :: a -> a -> a
87 mod :: a -> a -> a
87 mod :: a -> a -> a
88
88
@@ -192,9 +192,9 @@ Addition and multiplication
192
192
193 instance functorArr :: Functor (Prim.Function r)
193 instance functorArr :: Functor (Prim.Function r)
194
194
195−#### `moduloSemiRingNumber`
195+#### `moduloSemiringNumber`
196
196
197− instance moduloSemiRingNumber :: ModuloSemiRing Number
197+ instance moduloSemiringNumber :: ModuloSemiring Number
198
198
199#### `monadArr`
199#### `monadArr`
200
200
prelude/images/Prelude.png

Binary file not shown.

prelude/prelude.purs+4−4
@@ -14,7 +14,7 @@ module Prelude
14 , Bind, (>>=)
14 , Bind, (>>=)
15 , Monad, return, liftM1, ap
15 , Monad, return, liftM1, ap
16 , Semiring, (+), zero, (*), one
16 , Semiring, (+), zero, (*), one
17− , ModuloSemiRing, (/), mod
17+ , ModuloSemiring, (/), mod
18 , Ring, (-)
18 , Ring, (-)
19 , (%)
19 , (%)
20 , negate
20 , negate
@@ -219,7 +219,7 @@ module Prelude
219
219
220 -- | Semiring with modulo operation and division where
220 -- | Semiring with modulo operation and division where
221 -- | ```a / b * b + (a `mod` b) = a```
221 -- | ```a / b * b + (a `mod` b) = a```
222− class (Semiring a) <= ModuloSemiRing a where
222+ class (Semiring a) <= ModuloSemiring a where
223 (/) :: a -> a -> a
223 (/) :: a -> a -> a
224 mod :: a -> a -> a
224 mod :: a -> a -> a
225
225
@@ -232,7 +232,7 @@ module Prelude
232
232
233 -- | Ring where every nonzero element has a multiplicative inverse (possibly
233 -- | Ring where every nonzero element has a multiplicative inverse (possibly
234 -- | a non-commutative field) so that ```a `mod` b = zero```
234 -- | 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
236
236
237 -- | A commutative field
237 -- | A commutative field
238 class (DivisionRing a) <= Num a
238 class (DivisionRing a) <= Num a
@@ -293,7 +293,7 @@ module Prelude
293 instance ringNumber :: Ring Number where
293 instance ringNumber :: Ring Number where
294 (-) = numSub
294 (-) = numSub
295
295
296− instance moduloSemiRingNumber :: ModuloSemiRing Number where
296+ instance moduloSemiringNumber :: ModuloSemiring Number where
297 (/) = numDiv
297 (/) = numDiv
298 mod _ _ = 0
298 mod _ _ = 0
299
299
src/Language/PureScript/CodeGen/JS/Optimizer/Inliner.hs+1−1
@@ -105,7 +105,7 @@ inlineCommonOperators = applyAll $
105 , binary C.semiringNumber (C.*) Multiply
105 , binary C.semiringNumber (C.*) Multiply
106 , binary C.ringNumber (C.-) Subtract
106 , binary C.ringNumber (C.-) Subtract
107 , unary C.ringNumber C.negate Negate
107 , unary C.ringNumber C.negate Negate
108− , binary C.moduloSemiRingNumber (C./) Divide
108+ , binary C.moduloSemiringNumber (C./) Divide
109
109
110 , binary C.ordNumber (C.<) LessThan
110 , binary C.ordNumber (C.<) LessThan
111 , binary C.ordNumber (C.>) GreaterThan
111 , binary C.ordNumber (C.>) GreaterThan
src/Language/PureScript/Constants.hs+2−2
@@ -175,8 +175,8 @@ semiringNumber = "semiringNumber"
175ringNumber :: String
175ringNumber :: String
176ringNumber = "ringNumber"
176ringNumber = "ringNumber"
177
177
178−moduloSemiRingNumber :: String
178+moduloSemiringNumber :: String
179−moduloSemiRingNumber = "moduloSemiRingNumber"
179+moduloSemiringNumber = "moduloSemiringNumber"
180
180
181numNumber :: String
181numNumber :: String
182numNumber = "numNumber"
182numNumber = "numNumber"