aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/control/exception.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/control/exception.lux')
-rw-r--r--stdlib/source/lux/control/exception.lux18
1 files changed, 9 insertions, 9 deletions
diff --git a/stdlib/source/lux/control/exception.lux b/stdlib/source/lux/control/exception.lux
index 66214f90c..fc5cf9c64 100644
--- a/stdlib/source/lux/control/exception.lux
+++ b/stdlib/source/lux/control/exception.lux
@@ -1,7 +1,7 @@
-(;module: {#;doc "Exception-handling functionality built on top of the Error type."}
+(;module: {#;doc "Exception-handling functionality built on top of the Result type."}
lux
(lux (control monad)
- (data [error #- fail]
+ (data [result #- fail]
[text])
[macro]
(macro [code]
@@ -23,8 +23,8 @@
If no exception was detected, or a different one from the one being checked, then pass along the original value."}
(All [a]
- (-> Exception (-> Text a) (Error a)
- (Error a)))
+ (-> Exception (-> Text a) (Result a)
+ (Result a)))
(case try
(#;Right output)
(#;Right output)
@@ -37,7 +37,7 @@
(def: #export (otherwise to-do try)
{#;doc "If no handler could be found to catch the exception, then run a function as a last-resort measure."}
(All [a]
- (-> (-> Text a) (Error a) a))
+ (-> (-> Text a) (Result a) a))
(case try
(#;Right output)
output
@@ -46,13 +46,13 @@
(to-do error)))
(def: #export (return value)
- {#;doc "A way to lift normal values into the error-handling context."}
- (All [a] (-> a (Error a)))
+ {#;doc "A way to lift normal values into the result-handling context."}
+ (All [a] (-> a (Result a)))
(#;Right value))
(def: #export (throw exception message)
- {#;doc "Decorate an error message with an Exception and lift it into the error-handling context."}
- (All [a] (-> Exception Text (Error a)))
+ {#;doc "Decorate an error message with an Exception and lift it into the result-handling context."}
+ (All [a] (-> Exception Text (Result a)))
(#;Left (exception message)))
(syntax: #export (exception: [_ex-lev common;export-level] [name s;local-symbol])