diff options
author | Eduardo Julian | 2022-03-15 22:45:49 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-03-15 22:45:49 -0400 |
commit | b0093a3849baaeb5e12692b2cf6ac65ba74bbd54 (patch) | |
tree | 26db4a468c2f75c64ba16e8b7dbf20f135d369fc /stdlib/source/library/lux/debug.lux | |
parent | bc36487224f670c23002cc4575c0dba3e5dc1be1 (diff) |
Leaner syntax for library/lux/control/exception.report
Diffstat (limited to 'stdlib/source/library/lux/debug.lux')
-rw-r--r-- | stdlib/source/library/lux/debug.lux | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/stdlib/source/library/lux/debug.lux b/stdlib/source/library/lux/debug.lux index c4bf1f96a..d4665f058 100644 --- a/stdlib/source/library/lux/debug.lux +++ b/stdlib/source/library/lux/debug.lux @@ -23,7 +23,7 @@ ["[0]" json]] [collection ["[0]" array] - ["[0]" list ("[1]#[0]" functor)] + ["[0]" list ("[1]#[0]" monad)] ["[0]" dictionary]]] [macro ["^" pattern] @@ -382,7 +382,7 @@ (exception: .public (cannot_represent_value [type Type]) (exception.report - ["Type" (%.type type)])) + "Type" (%.type type))) (type: Representation (-> Any Text)) @@ -535,8 +535,8 @@ (exception: .public (type_hole [location Location type Type]) (exception.report - ["Location" (%.location location)] - ["Type" (%.type type)])) + "Location" (%.location location) + "Type" (%.type type))) (syntax: .public (:hole []) (do meta.monad @@ -556,7 +556,7 @@ (exception: .public (unknown_local_binding [name Text]) (exception.report - ["Name" (%.text name)])) + "Name" (%.text name))) (syntax: .public (here [targets (: (<code>.Parser (List Target)) (|> ..target @@ -588,13 +588,14 @@ (in (list (` (..log! ("lux text concat" (~ (code.text (%.format (%.location location) text.new_line))) ((~! exception.report) - (~+ (list#each (function (_ [name format]) - (let [format (case format - {.#None} - (` (~! ..inspection)) - - {.#Some format} - format)] - (` [(~ (code.text name)) - ((~ format) (~ (code.local_symbol name)))]))) - targets)))))))))) + (~+ (|> targets + (list#each (function (_ [name format]) + (let [format (case format + {.#None} + (` (~! ..inspection)) + + {.#Some format} + format)] + (list (code.text name) + (` ((~ format) (~ (code.local_symbol name)))))))) + list#conjoint)))))))))) |