diff options
Diffstat (limited to 'stdlib/source/library/lux/control/exception.lux')
-rw-r--r-- | stdlib/source/library/lux/control/exception.lux | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/stdlib/source/library/lux/control/exception.lux b/stdlib/source/library/lux/control/exception.lux index 455318e39..bf7cabd0e 100644 --- a/stdlib/source/library/lux/control/exception.lux +++ b/stdlib/source/library/lux/control/exception.lux @@ -7,13 +7,13 @@ [monad {"+" [do]}]] [control ["[0]" maybe] - ["<>" parser ("[1]\[0]" monad) + ["<>" parser ("[1]#[0]" monad) ["<[0]>" code {"+" [Parser]}]]] [data ["[0]" product] - ["[0]" text ("[1]\[0]" monoid)] + ["[0]" text ("[1]#[0]" monoid)] [collection - ["[0]" list ("[1]\[0]" functor mix)]]] + ["[0]" list ("[1]#[0]" functor mix)]]] [macro ["[0]" code] [syntax {"+" [syntax:]} @@ -22,7 +22,7 @@ ["|[1]_[0]|" variable]]]] [math [number - ["n" nat ("[1]\[0]" decimal)]]]]] + ["n" nat ("[1]#[0]" decimal)]]]]] [// ["//" try {"+" [Try]}]]) @@ -82,34 +82,34 @@ ($_ <>.and (<>.else (list) (<code>.tuple (<>.some |type_variable|.parser))) (<>.either (<code>.form (<>.and <code>.local_identifier |input|.parser)) - (<>.and <code>.local_identifier (<>\in (list)))) + (<>.and <code>.local_identifier (<>#in (list)))) (<>.maybe <code>.any) ))] ($_ <>.either (<>.and <code>.any private) - (<>.and (<>\in (` .private)) private) + (<>.and (<>#in (` .private)) private) ))) (syntax: .public (exception: [[export_policy t_vars [name inputs] body] ..exception]) (macro.with_identifiers [g!_ g!descriptor] (do meta.monad [current_module meta.current_module_name - .let [descriptor ($_ text\composite "{" current_module "." name "}" text.new_line) + .let [descriptor ($_ text#composite "{" current_module "." name "}" text.new_line) g!self (code.local_identifier name)]] (in (list (` (def: (~ export_policy) (~ g!self) - (All ((~ g!_) (~+ (list\each |type_variable|.format t_vars))) - (..Exception [(~+ (list\each (value@ |input|.#type) inputs))])) + (All ((~ g!_) (~+ (list#each |type_variable|.format t_vars))) + (..Exception [(~+ (list#each (value@ |input|.#type) inputs))])) (let [(~ g!descriptor) (~ (code.text descriptor))] [..#label (~ g!descriptor) - ..#constructor (function ((~ g!self) [(~+ (list\each (value@ |input|.#binding) inputs))]) - ((~! text\composite) (~ g!descriptor) + ..#constructor (function ((~ g!self) [(~+ (list#each (value@ |input|.#binding) inputs))]) + ((~! text#composite) (~ g!descriptor) (~ (maybe.else (' "") body))))])))))))) (def: (report' entries) (-> (List [Text Text]) Text) (let [header_separator ": " - largest_header_size (list\mix (function (_ [header _] max) + largest_header_size (list#mix (function (_ [header _] max) (n.max (text.size header) max)) 0 entries) @@ -117,7 +117,7 @@ (list.repeated (n.+ (text.size header_separator) largest_header_size)) text.together - (text\composite text.new_line)) + (text#composite text.new_line)) on_entry (: (-> [Text Text] Text) (function (_ [header message]) (let [padding (|> " " @@ -126,29 +126,29 @@ text.together)] (|> message (text.replaced text.new_line on_new_line) - ($_ text\composite padding header header_separator)))))] + ($_ text#composite padding header header_separator)))))] (case entries {.#End} "" {.#Item head tail} - (list\mix (function (_ post pre) - ($_ text\composite pre text.new_line (on_entry post))) + (list#mix (function (_ post pre) + ($_ text#composite pre text.new_line (on_entry post))) (on_entry head) tail)))) (syntax: .public (report [entries (<>.many (<code>.tuple (<>.and <code>.any <code>.any)))]) (in (list (` ((~! ..report') (list (~+ (|> entries - (list\each (function (_ [header message]) + (list#each (function (_ [header message]) (` [(~ header) (~ message)]))))))))))) (def: .public (listing format entries) (All (_ a) (-> (-> a Text) (List a) Text)) (|> entries - (list\mix (function (_ entry [index next]) + (list#mix (function (_ entry [index next]) [(++ index) - {.#Item [(n\encoded index) (format entry)] + {.#Item [(n#encoded index) (format entry)] next}]) [0 {.#End}]) product.right |