diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/data/sum.lux | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/stdlib/source/library/lux/data/sum.lux b/stdlib/source/library/lux/data/sum.lux index 03e26b25d..0ed2931d1 100644 --- a/stdlib/source/library/lux/data/sum.lux +++ b/stdlib/source/library/lux/data/sum.lux @@ -19,7 +19,7 @@ (-> (-> a c) (-> b c) (-> (Or a b) c))) (function (_ input) - (case input + (when input {0 #0 l} (on_left l) {0 #1 r} (on_right r)))) @@ -28,14 +28,14 @@ (-> (-> l l') (-> r r') (-> (Or l r) (Or l' r')))) (function (_ input) - (case input + (when input {0 #0 l} {0 #0 (on_left l)} {0 #1 r} {0 #1 (on_right r)}))) (with_template [<name> <side> <right?>] [(def .public (<name> items) (All (_ a b) (-> (List (Or a b)) (List <side>))) - (case items + (when items {.#End} {.#End} @@ -51,13 +51,13 @@ (def .public (partition xs) (All (_ a b) (-> (List (Or a b)) [(List a) (List b)])) - (case xs + (when xs {.#End} [{.#End} {.#End}] {.#Item x xs'} (let [[lefts rights] (partition xs')] - (case x + (when x {0 #0 x'} [{.#Item x' lefts} rights] {0 #1 x'} [lefts {.#Item x' rights}])))) @@ -65,7 +65,7 @@ (All (_ l r) (-> (Equivalence l) (Equivalence r) (Equivalence (Or l r)))) (implementation (def (= reference sample) - (case [reference sample] + (when [reference sample] [{.#Left reference} {.#Left sample}] (at left = reference sample) @@ -82,7 +82,7 @@ (..equivalence (at left equivalence) (at right equivalence))) (def (hash value) - (.nat (case value + (.nat (when value {.#Left value} ("lux i64 *" +2 (.int (at left hash value))) |