diff options
author | Eduardo Julian | 2022-08-11 04:15:07 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-08-11 04:15:07 -0400 |
commit | 065e8a4d8122d4616b570496915d2c0e2c78cd6b (patch) | |
tree | f2bbdc3e40b796b34026ab04c9a478d8a3f082d5 /stdlib/source/polytypic | |
parent | 68d78235694c633c956bb9e8a007cad7d65370bc (diff) |
Re-named the "case" macro to "when".
Diffstat (limited to 'stdlib/source/polytypic')
-rw-r--r-- | stdlib/source/polytypic/lux/abstract/equivalence.lux | 2 | ||||
-rw-r--r-- | stdlib/source/polytypic/lux/abstract/functor.lux | 4 | ||||
-rw-r--r-- | stdlib/source/polytypic/lux/data/format/json.lux | 4 |
3 files changed, 5 insertions, 5 deletions
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 (<type>.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)}) |