aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/abstract
diff options
context:
space:
mode:
authorEduardo Julian2020-03-05 21:32:13 -0400
committerEduardo Julian2020-03-05 21:32:13 -0400
commit71c99d63a313d497c3881ab06752f05e3af33350 (patch)
tree1170c040d4dcfb2077a62fa26acbad7702cc2785 /stdlib/source/lux/abstract
parente5153db14981fa7da2c34058bed494a8662496c8 (diff)
Test for equivalence + adjustments to Lua-generation code.
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/abstract/equivalence.lux16
1 files changed, 8 insertions, 8 deletions
diff --git a/stdlib/source/lux/abstract/equivalence.lux b/stdlib/source/lux/abstract/equivalence.lux
index eacb4a48f..ccfc55928 100644
--- a/stdlib/source/lux/abstract/equivalence.lux
+++ b/stdlib/source/lux/abstract/equivalence.lux
@@ -8,13 +8,6 @@
(: (-> a a Bit)
=))
-(def: #export (product left right)
- (All [l r] (-> (Equivalence l) (Equivalence r) (Equivalence [l r])))
- (structure
- (def: (= [a b] [x y])
- (and (:: left = a x)
- (:: right = b y)))))
-
(def: #export (sum left right)
(All [l r] (-> (Equivalence l) (Equivalence r) (Equivalence (| l r))))
(structure
@@ -29,11 +22,18 @@
_
false))))
+(def: #export (product left right)
+ (All [l r] (-> (Equivalence l) (Equivalence r) (Equivalence [l r])))
+ (structure
+ (def: (= [a b] [x y])
+ (and (:: left = a x)
+ (:: right = b y)))))
+
(def: #export (rec sub)
(All [a] (-> (-> (Equivalence a) (Equivalence a)) (Equivalence a)))
(structure
(def: (= left right)
- (sub (rec sub) left right))))
+ (sub = left right))))
(structure: #export contravariant
(Contravariant Equivalence)