diff options
author | Eduardo Julian | 2017-05-17 20:23:02 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-05-17 20:23:02 -0400 |
commit | 8bd1d1b3a4750b26f1540717839c1aa196f2a520 (patch) | |
tree | cc9d595998c3bf4d15e434480f5505fd491e39b0 /new-luxc/source/luxc/module | |
parent | 824482b2e8b13e42a524a5e4945ea3e172395c9e (diff) |
- Renamed "Error" to "Result".
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/module.lux | 20 | ||||
-rw-r--r-- | new-luxc/source/luxc/module/descriptor/type.lux | 4 |
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))) |