aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/module.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/module.lux20
1 files changed, 10 insertions, 10 deletions
diff --git a/new-luxc/source/luxc/module.lux b/new-luxc/source/luxc/module.lux
index 1e6174143..237fda3b9 100644
--- a/new-luxc/source/luxc/module.lux
+++ b/new-luxc/source/luxc/module.lux
@@ -3,7 +3,7 @@
(lux (control monad)
(data [text "T/" Eq<Text>]
text/format
- ["E" error]))
+ ["R" result]))
(luxc ["&" base]))
(def: (new-module hash)
@@ -25,7 +25,7 @@
(#;Some module)
(case (&;pl-get def-name (get@ #;defs module))
#;None
- (#E;Success [(update@ #;modules
+ (#R;Success [(update@ #;modules
(&;pl-put module-name
(update@ #;defs
(: (-> (List [Text Def]) (List [Text Def]))
@@ -35,16 +35,16 @@
[]])
(#;Some already-existing)
- (#E;Error (format "Cannot re-define definiton: " (%ident full-name))))
+ (#R;Error (format "Cannot re-define definiton: " (%ident full-name))))
#;None
- (#E;Error (format "Cannot define in unknown module: " module-name)))))
+ (#R;Error (format "Cannot define in unknown module: " module-name)))))
(def: #export (create hash name)
(-> Nat Text (Lux Module))
(function [compiler]
(let [module (new-module hash)]
- (#E;Success [(update@ #;modules
+ (#R;Success [(update@ #;modules
(&;pl-put name module)
compiler)
module]))))
@@ -59,26 +59,26 @@
#;Active true
_ false)]
(if active?
- (#E;Success [(update@ #;modules
+ (#R;Success [(update@ #;modules
(&;pl-put module-name (set@ #;module-state <tag> module))
compiler)
[]])
- (#E;Error "Can only change the state of a currently-active module.")))
+ (#R;Error "Can only change the state of a currently-active module.")))
#;None
- (#E;Error (format "Module does not exist: " module-name)))))
+ (#R;Error (format "Module does not exist: " module-name)))))
(def: #export (<asker> module-name)
(-> Text (Lux Bool))
(function [compiler]
(case (|> compiler (get@ #;modules) (&;pl-get module-name))
(#;Some module)
- (#E;Success [compiler
+ (#R;Success [compiler
(case (get@ #;module-state module)
<tag> true
_ false)])
#;None
- (#E;Error (format "Module does not exist: " module-name)))
+ (#R;Error (format "Module does not exist: " module-name)))
))]
[flag-active! active? #;Active]