aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/control/exception.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/control/exception.lux62
1 files changed, 31 insertions, 31 deletions
diff --git a/stdlib/source/library/lux/control/exception.lux b/stdlib/source/library/lux/control/exception.lux
index 5e78a155e..942ebbfd8 100644
--- a/stdlib/source/library/lux/control/exception.lux
+++ b/stdlib/source/library/lux/control/exception.lux
@@ -1,30 +1,30 @@
(.using
- [library
- [lux "*"
- ["[0]" macro]
- ["[0]" meta]
- [abstract
- [monad {"+" do}]]
- [control
- ["[0]" maybe]
- ["<>" parser ("[1]#[0]" monad)
- ["<[0]>" code {"+" Parser}]]]
- [data
- ["[0]" product]
- ["[0]" text ("[1]#[0]" monoid)]
- [collection
- ["[0]" list ("[1]#[0]" functor mix)]]]
- [macro
- ["[0]" code]
- [syntax {"+" syntax:}
- ["|[0]|" input]
- ["[0]" type "_"
- ["|[1]_[0]|" variable]]]]
- [math
- [number
- ["n" nat ("[1]#[0]" decimal)]]]]]
- [//
- ["//" try {"+" Try}]])
+ [library
+ [lux "*"
+ ["[0]" macro]
+ ["[0]" meta]
+ [abstract
+ [monad {"+" do}]]
+ [control
+ ["[0]" maybe]
+ ["<>" parser ("[1]#[0]" monad)
+ ["<[0]>" code {"+" Parser}]]]
+ [data
+ ["[0]" product]
+ ["[0]" text ("[1]#[0]" monoid)]
+ [collection
+ ["[0]" list ("[1]#[0]" functor mix)]]]
+ [macro
+ ["[0]" code]
+ [syntax {"+" syntax:}
+ ["|[0]|" input]
+ ["[0]" type "_"
+ ["|[1]_[0]|" variable]]]]
+ [math
+ [number
+ ["n" nat ("[1]#[0]" decimal)]]]]]
+ [//
+ ["//" try {"+" Try}]])
(type: .public (Exception a)
(Record
@@ -33,7 +33,7 @@
(def: .public (match? exception error)
(All (_ e) (-> (Exception e) Text Bit))
- (text.starts_with? (value@ #label exception) error))
+ (text.starts_with? (the #label exception) error))
(def: .public (when exception then try)
(All (_ e a)
@@ -44,7 +44,7 @@
{//.#Success output}
{//.#Failure error}
- (let [reference (value@ #label exception)]
+ (let [reference (the #label exception)]
(if (text.starts_with? reference error)
{//.#Success (|> error
(text.clip_since (text.size reference))
@@ -64,7 +64,7 @@
(def: .public (error exception message)
(All (_ e) (-> (Exception e) e Text))
- ((value@ ..#constructor exception) message))
+ ((the ..#constructor exception) message))
(def: .public (except exception message)
(All (_ e a) (-> (Exception e) e (Try a)))
@@ -99,10 +99,10 @@
(in (list (` (def: (~ export_policy)
(~ g!self)
(All ((~ g!_) (~+ (list#each |type_variable|.format t_vars)))
- (..Exception [(~+ (list#each (value@ |input|.#type) inputs))]))
+ (..Exception [(~+ (list#each (the |input|.#type) inputs))]))
(let [(~ g!descriptor) (~ (code.text descriptor))]
[..#label (~ g!descriptor)
- ..#constructor (function ((~ g!self) [(~+ (list#each (value@ |input|.#binding) inputs))])
+ ..#constructor (function ((~ g!self) [(~+ (list#each (the |input|.#binding) inputs))])
((~! text#composite) (~ g!descriptor)
(~ (maybe.else (' "") body))))]))))))))