diff options
Diffstat (limited to 'stdlib/source/lux/abstract')
-rw-r--r-- | stdlib/source/lux/abstract/equivalence.lux | 21 | ||||
-rw-r--r-- | stdlib/source/lux/abstract/hash.lux | 25 |
2 files changed, 0 insertions, 46 deletions
diff --git a/stdlib/source/lux/abstract/equivalence.lux b/stdlib/source/lux/abstract/equivalence.lux index a467f0b50..3948d12bd 100644 --- a/stdlib/source/lux/abstract/equivalence.lux +++ b/stdlib/source/lux/abstract/equivalence.lux @@ -9,27 +9,6 @@ (: (-> a a Bit) =)) -(def: #export (sum left right) - (All [l r] (-> (Equivalence l) (Equivalence r) (Equivalence (| l r)))) - (structure - (def: (= reference sample) - (case [reference sample] - [(#.Left reference) (#.Left sample)] - (\ left = reference sample) - - [(#.Right reference) (#.Right sample)] - (\ right = reference sample) - - _ - 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 diff --git a/stdlib/source/lux/abstract/hash.lux b/stdlib/source/lux/abstract/hash.lux index fe994497b..ae1290edc 100644 --- a/stdlib/source/lux/abstract/hash.lux +++ b/stdlib/source/lux/abstract/hash.lux @@ -10,28 +10,3 @@ &equivalence) (: (-> a Nat) hash)) - -(def: #export (sum left right) - (All [l r] (-> (Hash l) (Hash r) (Hash (| l r)))) - (structure - (def: &equivalence - (equivalence.sum (\ left &equivalence) - (\ right &equivalence))) - (def: (hash value) - (case value - (#.Left value) - (\ left hash value) - - (#.Right value) - (\ right hash value))))) - -(def: #export (product left right) - (All [l r] (-> (Hash l) (Hash r) (Hash (& l r)))) - (structure - (def: &equivalence - (equivalence.product (\ left &equivalence) - (\ right &equivalence))) - (def: (hash [leftV rightV]) - ("lux i64 +" - (\ left hash leftV) - (\ right hash rightV))))) |