From 065e8a4d8122d4616b570496915d2c0e2c78cd6b Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 11 Aug 2022 04:15:07 -0400 Subject: Re-named the "case" macro to "when". --- stdlib/source/polytypic/lux/abstract/equivalence.lux | 2 +- stdlib/source/polytypic/lux/abstract/functor.lux | 4 ++-- stdlib/source/polytypic/lux/data/format/json.lux | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'stdlib/source/polytypic') diff --git a/stdlib/source/polytypic/lux/abstract/equivalence.lux b/stdlib/source/polytypic/lux/abstract/equivalence.lux index 8de4a0a7a..a79fd9c2a 100644 --- a/stdlib/source/polytypic/lux/abstract/equivalence.lux +++ b/stdlib/source/polytypic/lux/abstract/equivalence.lux @@ -115,7 +115,7 @@ g!right (code.local "_____________right")]] (in (` (is (, (@Equivalence inputT)) (function ((, g!_) (, g!left) (, g!right)) - (case [(, g!left) (, g!right)] + (when [(, g!left) (, g!right)] (,* (list#conjoint (list#each (function (_ [tag g!eq]) (if (nat.= last tag) (list (` [{(, (code.nat (-- tag))) #1 (, g!left)} diff --git a/stdlib/source/polytypic/lux/abstract/functor.lux b/stdlib/source/polytypic/lux/abstract/functor.lux index 31a53d407..415c0da6e 100644 --- a/stdlib/source/polytypic/lux/abstract/functor.lux +++ b/stdlib/source/polytypic/lux/abstract/functor.lux @@ -54,7 +54,7 @@ [_ (in []) membersC (.variant (<>.many (Arg valueC))) .let [last (-- (list.size membersC))]] - (in (` (case (, valueC) + (in (` (when (, valueC) (,* (list#conjoint (list#each (function (_ [tag memberC]) (if (n.= last tag) (list (` {(, (code.nat (-- tag))) #1 (, valueC)}) @@ -75,7 +75,7 @@ (again (++ idx) (list#composite pairsCC (list [slotC memberC]))))) (in pairsCC)))))] - (in (` (case (, valueC) + (in (` (when (, valueC) [(,* (list#each product.left pairsCC))] [(,* (list#each product.right pairsCC))])))) ... Functions diff --git a/stdlib/source/polytypic/lux/data/format/json.lux b/stdlib/source/polytypic/lux/data/format/json.lux index 53eba2b21..333f0c323 100644 --- a/stdlib/source/polytypic/lux/data/format/json.lux +++ b/stdlib/source/polytypic/lux/data/format/json.lux @@ -85,7 +85,7 @@ (def .public (nullable format) (All (_ a) (-> (-> a JSON) (-> (Maybe a) JSON))) (function (_ elem) - (case elem + (when elem {.#None} {/.#Null} {.#Some value} (format value)))) @@ -175,7 +175,7 @@ .let [last (-- (list.size members))]] (in (` (is (, (@JSON#encoded inputT)) (function ((, g!_) (, g!input)) - (case (, g!input) + (when (, g!input) (,* (list#conjoint (list#each (function (_ [tag g!encoded]) (if (n.= last tag) (.list (` {(, (code.nat (-- tag))) #1 (, g!input)}) -- cgit v1.2.3