aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/math/modular.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-08-27 20:59:34 -0400
committerEduardo Julian2021-08-27 20:59:34 -0400
commitc5b61d2f46ac19bf511197f3a537c4be0f47df33 (patch)
treecd62d188403e9b3998ba293dc5308719a430f1fe /stdlib/source/library/lux/math/modular.lux
parente814f667aed509a70bd386dcd54628929134def4 (diff)
Updates to the Ruby compiler.
Diffstat (limited to 'stdlib/source/library/lux/math/modular.lux')
-rw-r--r--stdlib/source/library/lux/math/modular.lux20
1 files changed, 10 insertions, 10 deletions
diff --git a/stdlib/source/library/lux/math/modular.lux b/stdlib/source/library/lux/math/modular.lux
index acfdbab2d..5b462ccfd 100644
--- a/stdlib/source/library/lux/math/modular.lux
+++ b/stdlib/source/library/lux/math/modular.lux
@@ -35,13 +35,13 @@
#value Int})
(def: .public (modular modulus value)
- (All [%] (-> (Modulus %) Int (Mod %)))
+ (All (_ %) (-> (Modulus %) Int (Mod %)))
(:abstraction {#modulus modulus
#value (i.mod (//.divisor modulus) value)}))
(template [<name> <type> <side>]
[(def: .public <name>
- (All [%] (-> (Mod %) <type>))
+ (All (_ %) (-> (Mod %) <type>))
(|>> :representation <side>))]
[modulus (Modulus %) product.left]
@@ -63,7 +63,7 @@
(<text>.and (<text>.one_of "-+") (<text>.many <text>.decimal))))
(implementation: .public (codec expected)
- (All [%] (-> (Modulus %) (Codec Text (Mod %))))
+ (All (_ %) (-> (Modulus %) (Codec Text (Mod %))))
(def: (encoded modular)
(let [[_ value] (:representation modular)]
@@ -82,7 +82,7 @@
(template [<name> <op>]
[(def: .public (<name> reference subject)
- (All [%] (-> (Mod %) (Mod %) Bit))
+ (All (_ %) (-> (Mod %) (Mod %) Bit))
(let [[_ reference] (:representation reference)
[_ subject] (:representation subject)]
(<op> reference subject)))]
@@ -95,19 +95,19 @@
)
(implementation: .public equivalence
- (All [%] (Equivalence (Mod %)))
+ (All (_ %) (Equivalence (Mod %)))
(def: = ..=))
(implementation: .public order
- (All [%] (Order (Mod %)))
+ (All (_ %) (Order (Mod %)))
(def: &equivalence ..equivalence)
(def: < ..<))
(template [<name> <op>]
[(def: .public (<name> param subject)
- (All [%] (-> (Mod %) (Mod %) (Mod %)))
+ (All (_ %) (-> (Mod %) (Mod %) (Mod %)))
(let [[modulus param] (:representation param)
[_ subject] (:representation subject)]
(:abstraction {#modulus modulus
@@ -122,7 +122,7 @@
(template [<composition> <identity> <monoid>]
[(implementation: .public (<monoid> modulus)
- (All [%] (-> (Modulus %) (Monoid (Mod %))))
+ (All (_ %) (-> (Modulus %) (Monoid (Mod %))))
(def: identity
(..modular modulus <identity>))
@@ -134,7 +134,7 @@
)
(def: .public (inverse modular)
- (All [%] (-> (Mod %) (Maybe (Mod %))))
+ (All (_ %) (-> (Mod %) (Maybe (Mod %))))
(let [[modulus value] (:representation modular)
[[vk mk] gcd] (i.extended_gcd value (//.divisor modulus))]
(case gcd
@@ -149,7 +149,7 @@
["Subject" (i\encoded (//.divisor subject))]))
(def: .public (adapter reference subject)
- (All [r% s%]
+ (All (_ r% s%)
(-> (Modulus r%) (Modulus s%)
(Try (-> (Mod s%) (Mod r%)))))
(if (//.= reference subject)