aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/module
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/module.lux20
-rw-r--r--new-luxc/source/luxc/module/descriptor/type.lux4
2 files changed, 12 insertions, 12 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]
diff --git a/new-luxc/source/luxc/module/descriptor/type.lux b/new-luxc/source/luxc/module/descriptor/type.lux
index d661aa385..dd11a163f 100644
--- a/new-luxc/source/luxc/module/descriptor/type.lux
+++ b/new-luxc/source/luxc/module/descriptor/type.lux
@@ -7,7 +7,7 @@
["l" lexer "l/" Monad<Lexer>])
[char]
[number]
- error
+ ["R" result]
(coll [list "L/" Functor<List>]))
[type "Type/" Eq<Type>])
["&" ../common])
@@ -136,7 +136,7 @@
)))))
(def: (decode-type input)
- (-> Text (Error Type))
+ (-> Text (R;Result Type))
(|> type-decoder
(l;before l;end)
(l;run input)))