diff options
author | Eduardo Julian | 2022-06-16 00:48:19 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-06-16 00:48:19 -0400 |
commit | 9e2f1e76f2c8df01ed7687d934c3210fcf676bd6 (patch) | |
tree | 115fab5bd8a5f53dc0d13ce5453095324a83496f /stdlib/source/library/lux/data/product.lux | |
parent | f92c806ee8da63f04bbefbf558f6249bacdb47ea (diff) |
De-sigil-ification: suffix : [Part 13]
Diffstat (limited to 'stdlib/source/library/lux/data/product.lux')
-rw-r--r-- | stdlib/source/library/lux/data/product.lux | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/stdlib/source/library/lux/data/product.lux b/stdlib/source/library/lux/data/product.lux index 02caab668..6e8767e04 100644 --- a/stdlib/source/library/lux/data/product.lux +++ b/stdlib/source/library/lux/data/product.lux @@ -6,7 +6,7 @@ [hash (.only Hash)]]]]) (with_template [<name>] - [(def: .public (<name> [left right]) + [(def .public (<name> [left right]) (All (_ left right) (-> [left right] <name>)) <name>)] @@ -16,14 +16,14 @@ ) ... https://en.wikipedia.org/wiki/Currying -(def: .public (curried f) +(def .public (curried f) (All (_ a b c) (-> (-> [a b] c) (-> a b c))) (function (_ x y) (f [x y]))) -(def: .public (uncurried f) +(def .public (uncurried f) (All (_ a b c) (-> (-> a b c) (-> [a b] c))) @@ -31,38 +31,38 @@ (let [[x y] xy] (f x y)))) -(def: .public (swapped [left right]) +(def .public (swapped [left right]) (All (_ left right) (-> [left right] [right left])) [right left]) -(def: .public (then f g) +(def .public (then f g) (All (_ a b c d) (-> (-> a c) (-> b d) (-> [a b] [c d]))) (function (_ [x y]) [(f x) (g y)])) -(def: .public (forked f g) +(def .public (forked f g) (All (_ a l r) (-> (-> a l) (-> a r) (-> a [l r]))) (function (_ x) [(f x) (g x)])) -(def: .public (equivalence left right) +(def .public (equivalence left right) (All (_ l r) (-> (Equivalence l) (Equivalence r) (Equivalence [l r]))) (implementation - (def: (= [rl rr] [sl sr]) + (def (= [rl rr] [sl sr]) (and (at left = rl sl) (at right = rr sr))))) -(def: .public (hash left right) +(def .public (hash left right) (All (_ l r) (-> (Hash l) (Hash r) (Hash [l r]))) (implementation - (def: equivalence + (def equivalence (..equivalence (at left equivalence) (at right equivalence))) - (def: (hash [leftV rightV]) + (def (hash [leftV rightV]) ("lux i64 +" (at left hash leftV) (at right hash rightV))))) |