aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/abstract/comonad.lux
diff options
context:
space:
mode:
authorEduardo Julian2022-03-16 08:37:23 -0400
committerEduardo Julian2022-03-16 08:37:23 -0400
commitbf53ee92fc3c33a4885aa227e55d24f7ba3cb2c4 (patch)
tree49683a62ae8e110c62b42a9a6386bb2ddb3c47c6 /stdlib/source/library/lux/abstract/comonad.lux
parentd710d9f4fc098e7c243c8a5f23cd42683f13e07f (diff)
De-sigil-ification: prefix :
Diffstat (limited to 'stdlib/source/library/lux/abstract/comonad.lux')
-rw-r--r--stdlib/source/library/lux/abstract/comonad.lux60
1 files changed, 30 insertions, 30 deletions
diff --git a/stdlib/source/library/lux/abstract/comonad.lux b/stdlib/source/library/lux/abstract/comonad.lux
index b5c1598d2..a0dd97014 100644
--- a/stdlib/source/library/lux/abstract/comonad.lux
+++ b/stdlib/source/library/lux/abstract/comonad.lux
@@ -14,48 +14,48 @@
(type: .public (CoMonad w)
(Interface
- (: (Functor w)
- &functor)
- (: (All (_ a)
- (-> (w a) a))
- out)
- (: (All (_ a)
- (-> (w a) (w (w a))))
- disjoint)))
+ (is (Functor w)
+ &functor)
+ (is (All (_ a)
+ (-> (w a) a))
+ out)
+ (is (All (_ a)
+ (-> (w a) (w (w a))))
+ disjoint)))
(macro: .public (be tokens state)
- (case (: (Maybe [(Maybe Text) Code (List Code) Code])
- (case tokens
- (pattern (list [_ {.#Tuple (list [_ {.#Symbol ["" name]}] comonad)}] [_ {.#Tuple bindings}] body))
- {.#Some [{.#Some name} comonad bindings body]}
-
- (pattern (list comonad [_ {.#Tuple bindings}] body))
- {.#Some [{.#None} comonad bindings body]}
+ (case (is (Maybe [(Maybe Text) Code (List Code) Code])
+ (case tokens
+ (pattern (list [_ {.#Tuple (list [_ {.#Symbol ["" name]}] comonad)}] [_ {.#Tuple bindings}] body))
+ {.#Some [{.#Some name} comonad bindings body]}
+
+ (pattern (list comonad [_ {.#Tuple bindings}] body))
+ {.#Some [{.#None} comonad bindings body]}
- _
- {.#None}))
+ _
+ {.#None}))
{.#Some [?name comonad bindings body]}
(case (list.pairs bindings)
{.#Some bindings}
(let [[module short] (symbol ..be)
- symbol (: (-> Text Code)
- (|>> ($_ "lux text concat" module " " short " ") [""] {.#Symbol} [location.dummy]))
+ symbol (is (-> Text Code)
+ (|>> ($_ "lux text concat" module " " short " ") [""] {.#Symbol} [location.dummy]))
g!_ (symbol "_")
g!each (symbol "each")
g!disjoint (symbol "disjoint")
- body' (list#mix (: (-> [Code Code] Code Code)
- (function (_ binding body')
- (with_expansions [<default> (` (|> (~ value) (~ g!disjoint) ((~ g!each) (function ((~ g!_) (~ var)) (~ body')))))]
- (let [[var value] binding]
- (case var
- [_ {.#Symbol ["" _]}]
- <default>
+ body' (list#mix (is (-> [Code Code] Code Code)
+ (function (_ binding body')
+ (with_expansions [<default> (` (|> (~ value) (~ g!disjoint) ((~ g!each) (function ((~ g!_) (~ var)) (~ body')))))]
+ (let [[var value] binding]
+ (case var
+ [_ {.#Symbol ["" _]}]
+ <default>
- [_ {.#Symbol _}]
- (` ((~ var) (~ value) (~ body')))
+ [_ {.#Symbol _}]
+ (` ((~ var) (~ value) (~ body')))
- _
- <default>)))))
+ _
+ <default>)))))
body
(list.reversed bindings))]
{.#Right [state (list (case ?name