diff options
Diffstat (limited to 'stdlib/source/library/lux/meta')
54 files changed, 331 insertions, 317 deletions
diff --git a/stdlib/source/library/lux/meta/compiler.lux b/stdlib/source/library/lux/meta/compiler.lux index 8f9150839..64f5a38fd 100644 --- a/stdlib/source/library/lux/meta/compiler.lux +++ b/stdlib/source/library/lux/meta/compiler.lux @@ -4,7 +4,7 @@ [control ["<>" parser (.only)] ["[0]" try (.only Try)] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" text] ["[0]" binary (.only Binary) @@ -54,6 +54,7 @@ (type .public (Instancer s d o) (-> (Key d) (List Parameter) (Compiler s d o))) -(exception .public (cannot_compile [module Module]) +(exception.def .public (cannot_compile module) + (Exception Module) (exception.report (list ["Module" module]))) diff --git a/stdlib/source/library/lux/meta/compiler/default/platform.lux b/stdlib/source/library/lux/meta/compiler/default/platform.lux index 12b6c63f1..d3a60d7b4 100644 --- a/stdlib/source/library/lux/meta/compiler/default/platform.lux +++ b/stdlib/source/library/lux/meta/compiler/default/platform.lux @@ -8,7 +8,7 @@ ["[0]" function] ["[0]" maybe] ["[0]" try (.only Try) (.use "[1]#[0]" monad)] - ["[0]" exception (.only exception)] + ["[0]" exception (.only Exception)] [concurrency ["[0]" async (.only Async Resolver) (.use "[1]#[0]" monad)] ["[0]" stm (.only Var STM)]]] @@ -387,18 +387,19 @@ (or (dependence? import (the #depends_on) module) (dependence? module (the #depended_by) import)))) - (exception .public (module_cannot_import_itself [module descriptor.Module]) + (exception.def .public (module_cannot_import_itself module) + (Exception descriptor.Module) (exception.report (list ["Module" (%.text module)]))) - (exception .public (cannot_import_circular_dependency [importer descriptor.Module - importee descriptor.Module]) + (exception.def .public (cannot_import_circular_dependency [importer importee]) + (Exception [descriptor.Module descriptor.Module]) (exception.report (list ["Importer" (%.text importer)] ["Importee" (%.text importee)]))) - (exception .public (cannot_import_twice [importer descriptor.Module - duplicates (Set descriptor.Module)]) + (exception.def .public (cannot_import_twice [importer duplicates]) + (Exception [descriptor.Module (Set descriptor.Module)]) (exception.report (list ["Importer" (%.text importer)] ["Duplicates" (%.list %.text (set.list duplicates))]))) @@ -414,7 +415,8 @@ ... else {try.#Success []})) - (exception .public (cannot_overwrite_extension [extension extension.Name]) + (exception.def .public (cannot_overwrite_extension extension) + (Exception extension.Name) (exception.report (list ["Extension" (%.text extension)]))) @@ -841,8 +843,8 @@ Type (type_literal (-> (List Text) (Try ///.Custom)))) - (exception .public (invalid_custom_compiler [definition Symbol - type Type]) + (exception.def .public (invalid_custom_compiler [definition type]) + (Exception [Symbol Type]) (exception.report (list ["Definition" (%.symbol definition)] ["Expected type" (%.type ..Custom)] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/coverage.lux b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/coverage.lux index 3403461fb..8799f8b57 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/coverage.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/coverage.lux @@ -7,7 +7,7 @@ [control ["[0]" maybe (.use "[1]#[0]" monoid monad)] ["[0]" try (.only Try)] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" bit (.use "[1]#[0]" equivalence)] ["[0]" text (.only) @@ -158,7 +158,8 @@ {#Exhaustive} "*")) -(exception .public (invalid_tuple [size Nat]) +(exception.def .public (invalid_tuple size) + (Exception Nat) (exception.report (list ["Expected size" ">= 2"] ["Actual size" (%.nat size)]))) @@ -235,14 +236,14 @@ ... always be a pattern prior to them that would match the input. ... Because of that, the presence of redundant patterns is assumed to ... be a bug, likely due to programmer carelessness. -(exception .public (redundancy [so_far Coverage - addition Coverage]) +(exception.def .public (redundancy [so_far addition]) + (Exception [Coverage Coverage]) (exception.report (list ["Coverage so-far" (format so_far)] ["Additional coverage" (format addition)]))) -(exception .public (variant_mismatch [expected Nat - mismatched Nat]) +(exception.def .public (variant_mismatch [expected mismatched]) + (Exception [Nat Nat]) (exception.report (list ["Expected cases" (%.nat expected)] ["Mismatched cases" (%.nat mismatched)]))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/inference.lux b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/inference.lux index d85a576cd..5765aa7a9 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/inference.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/inference.lux @@ -7,7 +7,7 @@ ["[0]" pipe] ["[0]" maybe] ["[0]" try] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" text (.only) ["%" \\format (.only format)]] @@ -32,20 +32,21 @@ [meta [archive (.only Archive)]]]]]) -(exception .public (cannot_infer [type Type - arguments (List Code)]) +(exception.def .public (cannot_infer [type arguments]) + (Exception [Type (List Code)]) (exception.report (list ["Type" (%.type type)] ["Arguments" (exception.listing %.code arguments)]))) -(exception .public (cannot_infer_argument [type Type - argument Code]) +(exception.def .public (cannot_infer_argument [type argument]) + (Exception [Type Code]) (exception.report (list ["Type" (%.type type)] ["Argument" (%.code argument)]))) (with_template [<name>] - [(exception .public (<name> [type Type]) + [(exception.def .public (<name> type) + (Exception Type) (exception.report (list ["Type" (%.type type)])))] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/macro.lux b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/macro.lux index b8bf793ec..7abe0bc57 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/macro.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/macro.lux @@ -6,24 +6,22 @@ [monad (.only do)]] [control ["[0]" try (.only Try)] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" text ["%" \\format (.only format)]]]]] [///// ["[0]" phase]]) -(exception .public (expansion_failed [macro Symbol - inputs (List Code) - error Text]) +(exception.def .public (expansion_failed [macro inputs error]) + (Exception [Symbol (List Code) Text]) (exception.report (list ["Macro" (%.symbol macro)] ["Inputs" (exception.listing %.code inputs)] ["Error" error]))) -(exception .public (must_have_single_expansion [macro Symbol - inputs (List Code) - outputs (List Code)]) +(exception.def .public (must_have_single_expansion [macro inputs outputs]) + (Exception [Symbol (List Code) (List Code)]) (exception.report (list ["Macro" (%.symbol macro)] ["Inputs" (exception.listing %.code inputs)] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/module.lux b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/module.lux index b7a808dbf..e6f531191 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/module.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/module.lux @@ -7,7 +7,7 @@ [control ["[0]" pipe] ["[0]" try] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" text (.use "[1]#[0]" equivalence) ["%" \\format (.only format)]] @@ -24,13 +24,14 @@ (type .public Label Text) -(exception .public (unknown_module [module Text]) +(exception.def .public (unknown_module module) + (Exception Text) (exception.report (list ["Module" module]))) (with_template [<name>] - [(exception .public (<name> [labels (List Label) - owner Type]) + [(exception.def .public (<name> [labels owner]) + (Exception [(List Label) Type]) (exception.report (list ["Labels" (text.interposed " " labels)] ["Type" (%.type owner)])))] @@ -39,8 +40,8 @@ [cannot_declare_labels_for_foreign_type] ) -(exception .public (cannot_define_more_than_once [name Symbol - already_existing Global]) +(exception.def .public (cannot_define_more_than_once [name already_existing]) + (Exception [Symbol Global]) (exception.report (list ["Definition" (%.symbol name)] ["Original" (when already_existing @@ -59,8 +60,8 @@ {.#Slot _} (format "slot " (%.symbol name)))]))) -(exception .public (can_only_change_state_of_active_module [module Text - state Module_State]) +(exception.def .public (can_only_change_state_of_active_module [module state]) + (Exception [Text Module_State]) (exception.report (list ["Module" module] ["Desired state" (when state diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/scope.lux b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/scope.lux index c7d17b9cb..ba360a38b 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/scope.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/scope.lux @@ -6,7 +6,7 @@ [control ["[0]" maybe (.use "[1]#[0]" monad)] ["[0]" try] - ["[0]" exception (.only exception)]] + ["[0]" exception]] [data ["[0]" text (.use "[1]#[0]" equivalence)] ["[0]" product] @@ -105,8 +105,8 @@ {.#Some [ref_type ref]}]}) ))))) -(exception .public no_scope) -(exception .public drained) +(exception.def .public no_scope) +(exception.def .public drained) (def .public (with_local [name type] action) (All (_ a) (-> [Text Type] (Operation a) (Operation a))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/generation.lux b/stdlib/source/library/lux/meta/compiler/language/lux/generation.lux index 1b9dbb961..93e1420f8 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/generation.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/generation.lux @@ -5,7 +5,7 @@ [monad (.only do)]] [control ["[0]" try (.only Try)] - ["[0]" exception (.only exception)] + ["[0]" exception (.only Exception)] ["[0]" function]] [data [binary (.only Binary)] @@ -42,12 +42,14 @@ (type .public (Buffer declaration) (Sequence [artifact.ID (Maybe Text) declaration])) -(exception .public (cannot_interpret [error Text]) +(exception.def .public (cannot_interpret error) + (Exception Text) (exception.report (list ["Error" error]))) (with_template [<name>] - [(exception .public (<name> [it artifact.ID]) + [(exception.def .public (<name> it) + (Exception artifact.ID) (exception.report (list ["Artifact ID" (%.nat it)])))] @@ -119,7 +121,7 @@ (with_template [<tag> <with_declaration> <with_type> <with_value> <set> <get> <get_type> <exception>] - [(exception .public <exception>) + [(exception.def .public <exception>) (def .public <with_declaration> (All (_ anchor expression declaration output) <with_type>) @@ -267,8 +269,8 @@ [Text #0 [] [] learn_declaration registry.declaration] ) -(exception .public (unknown_definition [name Symbol - known_definitions (List category.Definition)]) +(exception.def .public (unknown_definition [name known_definitions]) + (Exception [Symbol (List category.Definition)]) (exception.report (list ["Definition" (symbol.short name)] ["Module" (symbol.module name)] @@ -312,7 +314,7 @@ {.#Some [@artifact def]} {try.#Success [stateE [[@module @artifact] def]]}))))) -(exception .public no_context) +(exception.def .public no_context) (def .public (module_id module archive) (All (_ anchor expression declaration) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis.lux index 9ea79eab0..2775a6787 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis.lux @@ -4,7 +4,7 @@ [abstract [monad (.only do)]] [control - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data [text ["%" \\format (.only format)]] @@ -36,7 +36,8 @@ [meta [archive (.only Archive)]]]]]]) -(exception .public (invalid [syntax Code]) +(exception.def .public (invalid syntax) + (Exception Code) (exception.report (list ["Syntax" (%.code syntax)]))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/complex.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/complex.lux index 42d01ad16..21c5fba14 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/complex.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/complex.lux @@ -6,7 +6,7 @@ [control ["[0]" maybe] ["[0]" try] - ["[0]" exception (.only exception)] + ["[0]" exception (.only Exception)] ["[0]" state]] [data ["[0]" product] @@ -37,13 +37,14 @@ [meta [archive (.only Archive)]]]]]]) -(exception .public (not_a_quantified_type [type Type]) +(exception.def .public (not_a_quantified_type type) + (Exception Type) (exception.report (list ["Type" (%.type type)]))) (with_template [<name>] - [(exception .public (<name> [type Type - members (List Code)]) + [(exception.def .public (<name> [type members]) + (Exception [Type (List Code)]) (exception.report (list ["Type" (%.type type)] ["Expression" (%.code (` [(,* members)]))])))] @@ -53,10 +54,8 @@ ) (with_template [<name>] - [(exception .public (<name> [type Type - lefts Nat - right? Bit - code Code]) + [(exception.def .public (<name> [type lefts right? code]) + (Exception [Type Nat Bit Code]) (exception.report (list ["Type" (%.type type)] ["Lefts" (%.nat lefts)] @@ -68,16 +67,15 @@ [cannot_infer_sum] ) -(exception .public (cannot_analyse_variant [type Type - tag Symbol - code Code]) +(exception.def .public (cannot_analyse_variant [type tag code]) + (Exception [Type Symbol Code]) (exception.report (list ["Type" (%.type type)] ["Tag" (%.symbol tag)] ["Expression" (%.code code)]))) -(exception .public (cannot_repeat_slot [key Symbol - record (List [Symbol Code])]) +(exception.def .public (cannot_repeat_slot [key record]) + (Exception [Symbol (List [Symbol Code])]) (exception.report (list ["Slot" (%.code (code.symbol key))] ["Record" (%.code (code.tuple (|> record @@ -85,16 +83,14 @@ (list (code.symbol keyI) valC))) list#conjoint)))]))) -(exception .public (slot_does_not_belong_to_record [key Symbol - type Type]) +(exception.def .public (slot_does_not_belong_to_record [key type]) + (Exception [Symbol Type]) (exception.report (list ["Slot" (%.code (code.symbol key))] ["Type" (%.type type)]))) -(exception .public (record_size_mismatch [expected Nat - actual Nat - type Type - record (List [Symbol Code])]) +(exception.def .public (record_size_mismatch [expected actual type record]) + (Exception [Nat Nat Type (List [Symbol Code])]) (exception.report (list ["Expected" (%.nat expected)] ["Actual" (%.nat actual)] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/function.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/function.lux index 7864fd3d5..30f87ec84 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/function.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/function.lux @@ -6,7 +6,7 @@ [control ["[0]" maybe] ["[0]" try] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" product] ["[0]" text (.only) @@ -31,19 +31,16 @@ [reference (.only) [variable (.only)]]]]]) -(exception .public (cannot_analyse [expected Type - function Text - argument Text - body Code]) +(exception.def .public (cannot_analyse [expected function argument body]) + (Exception [Type Text Text Code]) (exception.report (list ["Type" (%.type expected)] ["Function" function] ["Argument" argument] ["Body" (%.code body)]))) -(exception .public (cannot_apply [:function: Type - functionC Code - arguments (List Code)]) +(exception.def .public (cannot_apply [:function: functionC arguments]) + (Exception [Type Code (List Code)]) (exception.report (list ["Function type" (%.type :function:)] ["Function" (%.code functionC)] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/reference.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/reference.lux index d71fa4ad0..51816df59 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/reference.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/reference.lux @@ -4,7 +4,7 @@ [abstract [monad (.only do)]] [control - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" text (.use "[1]#[0]" equivalence) ["%" \\format (.only format)]]] @@ -22,21 +22,21 @@ ["[1][0]" reference] ["[1]" phase]]]]]) -(exception .public (foreign_module_has_not_been_imported [current Text - foreign Text - quoted Text - definition Symbol]) +(exception.def .public (foreign_module_has_not_been_imported [current foreign quoted definition]) + (Exception [Text Text Text Symbol]) (exception.report (list ["Current" current] ["Foreign" foreign] ["Quoted" quoted] ["Definition" (%.symbol definition)]))) -(exception .public (definition_has_not_been_exported [definition Symbol]) +(exception.def .public (definition_has_not_been_exported definition) + (Exception Symbol) (exception.report (list ["Definition" (%.symbol definition)]))) -(exception .public (labels_are_not_definitions [definition Symbol]) +(exception.def .public (labels_are_not_definitions definition) + (Exception Symbol) (exception.report (list ["Label" (%.symbol definition)]))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/when.lux index ceb60e374..84fd24cc2 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/when.lux @@ -6,7 +6,7 @@ [control ["[0]" maybe] ["[0]" try] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" product] [text @@ -38,29 +38,30 @@ [/// ["[1]" phase]]]]]]) -(exception .public (mismatch [type Type - pattern Code]) +(exception.def .public (mismatch [type pattern]) + (Exception [Type Code]) (exception.report (list ["Type" (%.type type)] ["Pattern" (%.code pattern)]))) -(exception .public (sum_has_no_case [case Nat - type Type]) +(exception.def .public (sum_has_no_case [case type]) + (Exception [Nat Type]) (exception.report (list ["Case" (%.nat case)] ["Type" (%.type type)]))) -(exception .public (invalid [it Code]) +(exception.def .public (invalid it) + (Exception Code) (exception.report (list ["Pattern" (%.code it)]))) -(exception .public (non_tuple [type Type]) +(exception.def .public (non_tuple type) + (Exception Type) (exception.report (list ["Type" (%.type type)]))) -(exception .public (non_exhaustive [input Code - branches (List [Code Code]) - coverage Coverage]) +(exception.def .public (non_exhaustive [input branches coverage]) + (Exception [Code (List [Code Code]) Coverage]) (exception.report (list ["Input" (%.code input)] ["Branches" (%.code (code.tuple (|> branches @@ -69,7 +70,7 @@ list#conjoint)))] ["Coverage" (/coverage.format coverage)]))) -(exception .public empty_branches) +(exception.def .public empty_branches) (def (quantified envs baseT) (-> (List (List Type)) Type Type) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/declaration.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/declaration.lux index cd102ce48..832944c9c 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/declaration.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/declaration.lux @@ -6,7 +6,7 @@ ["[0]" monad (.only do)]] [control ["[0]" try] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data [text ["%" \\format (.only format)]] @@ -28,15 +28,18 @@ [meta [archive (.only Archive)]]]]]) -(exception .public (not_a_declaration [code Code]) +(exception.def .public (not_a_declaration code) + (Exception Code) (exception.report (list ["Declaration" (%.code code)]))) -(exception .public (invalid_macro_call [code Code]) +(exception.def .public (invalid_macro_call code) + (Exception Code) (exception.report (list ["Code" (%.code code)]))) -(exception .public (macro_was_not_found [name Symbol]) +(exception.def .public (macro_was_not_found name) + (Exception Symbol) (exception.report (list ["Name" (%.symbol name)]))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension.lux index 0ad49b88e..aa15450d3 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension.lux @@ -8,7 +8,7 @@ [control ["[0]" function] ["[0]" try (.only Try)] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" product] ["[0]" text (.use "[1]#[0]" order) @@ -64,27 +64,26 @@ (type .public (Phase s i o) (//.Phase (State s i o) i o)) -(exception .public (cannot_overwrite [name Name]) +(exception.def .public (cannot_overwrite name) + (Exception Name) (exception.report (list ["Extension" (%.text name)]))) -(exception .public (incorrect_arity [name Name - arity Nat - args Nat]) +(exception.def .public (incorrect_arity [name arity args]) + (Exception [Name Nat Nat]) (exception.report (list ["Extension" (%.text name)] ["Expected" (%.nat arity)] ["Actual" (%.nat args)]))) -(exception .public [a] (invalid_syntax [name Name - %format (Format a) - inputs (List a)]) +(exception.def .public (invalid_syntax [name %format inputs]) + (All (_ a) (Exception [Name (Format a) (List a)])) (exception.report (list ["Extension" (%.text name)] ["Inputs" (exception.listing %format inputs)]))) -(exception .public [s i o] (unknown [name Name - bundle (Bundle s i o)]) +(exception.def .public (unknown [name bundle]) + (All (_ s i o) (Exception [Name (Bundle s i o)])) (exception.report (list ["Extension" (%.text name)] ["Available" (|> bundle diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux index 9b8eabe1b..eecfece1f 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux @@ -9,7 +9,7 @@ ["[0]" pipe] ["[0]" maybe (.use "[1]#[0]" functor)] ["[0]" try (.only Try) (.use "[1]#[0]" monad)] - ["[0]" exception (.only exception)] + ["[0]" exception] [function ["[0]" predicate]]] [data @@ -157,8 +157,8 @@ (getInterfaces [] [(java/lang/Class java/lang/Object)])) (with_template [<name>] - [(exception .public (<name> [class External - field Text]) + [(exception.def .public (<name> [class field]) + (exception.Exception [External Text]) (exception.report (list ["Class" (%.text class)] ["Field" (%.text field)])))] @@ -167,15 +167,15 @@ [deprecated_field] ) -(exception .public (deprecated_method [class External - method Text - type .Type]) +(exception.def .public (deprecated_method [class method type]) + (exception.Exception [External Text .Type]) (exception.report (list ["Class" (%.text class)] ["Method" (%.text method)] ["Type" (%.type type)]))) -(exception .public (deprecated_class [class External]) +(exception.def .public (deprecated_class class) + (exception.Exception External) (exception.report (list ["Class" (%.text class)]))) @@ -244,7 +244,8 @@ #throws (List .Type)])) (with_template [<name>] - [(exception .public (<name> [type .Type]) + [(exception.def .public (<name> type) + (exception.Exception .Type) (exception.report (list ["Type" (%.type type)])))] @@ -255,7 +256,8 @@ ) (with_template [<name>] - [(exception .public (<name> [class External]) + [(exception.def .public (<name> class) + (exception.Exception External) (exception.report (list ["Class/type" (%.text class)])))] @@ -265,12 +267,8 @@ ) (with_template [<name>] - [(exception .public (<name> [class_variables (List (Type Var)) - class External - method Text - method_variables (List (Type Var)) - inputsJT (List (Type Value)) - hints (List Method_Signature)]) + [(exception.def .public (<name> [class_variables class method method_variables inputsJT hints]) + (exception.Exception [(List (Type Var)) External Text (List (Type Var)) (List (Type Value)) (List Method_Signature)]) (exception.report (list ["Class Variables" (exception.listing ..signature class_variables)] ["Class" class] @@ -283,22 +281,20 @@ [too_many_candidates] ) -(exception .public (cannot_cast [from (Type Value) - to (Type Value) - value Code]) +(exception.def .public (cannot_cast [from to value]) + (exception.Exception [(Type Value) (Type Value) Code]) (exception.report (list ["From" (..signature from)] ["To" (..signature to)] ["Value" (%.code value)]))) (with_template [<name>] - [(exception .public (<name> [message Text]) + [(exception.def .public (<name> message) + (exception.Exception Text) message)] [primitives_cannot_have_type_parameters] - [cannot_possibly_be_an_instance] - [unknown_type_var] ) @@ -1747,8 +1743,9 @@ ) (with_template [<name>] - [(exception .public (<name> [expected (List [(Type Class) Text (Type Method)]) - actual (List [(Type Class) Text (Type Method)])]) + [(exception.def .public (<name> [expected actual]) + (exception.Exception [(List [(Type Class) Text (Type Method)]) + (List [(Type Class) Text (Type Method)])]) (let [%method (is (%.Format [(Type Class) Text (Type Method)]) (function (_ [super name type]) (format (..signature super) " :: " (%.text name) " " (..signature type))))] @@ -2257,15 +2254,14 @@ <code>.any ))) -(exception .public (unknown_super [name Text - supers (List (Type Class))]) +(exception.def .public (unknown_super [name supers]) + (exception.Exception [Text (List (Type Class))]) (exception.report (list ["Name" (%.text name)] ["Available" (exception.listing (|>> parser.read_class product.left) supers)]))) -(exception .public (mismatched_super_parameters [name Text - expected Nat - actual Nat]) +(exception.def .public (mismatched_super_parameters [name expected actual]) + (exception.Exception [Text Nat Nat]) (exception.report (list ["Name" (%.text name)] ["Expected" (%.nat expected)] @@ -2372,10 +2368,8 @@ (not (list.any? (matched? sub) super_set))) sub_set)) -(exception .public (class_parameter_mismatch [name Text - declaration (Type Class) - expected (List Text) - actual (List (Type Parameter))]) +(exception.def .public (class_parameter_mismatch [name declaration expected actual]) + (exception.Exception [Text (Type Class) (List Text) (List (Type Parameter))]) (exception.report (list ["Class" (%.text name)] ["Declaration" (signature.signature (jvm.signature declaration))] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux index 98912da07..981d1a7a1 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lux.lux @@ -7,7 +7,7 @@ ["<>" parser] ["[0]" maybe] ["[0]" try] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" text (.only) ["%" \\format (.only format)]] @@ -83,7 +83,8 @@ ... TODO: Get rid of this ASAP (these - (exception .public (char_text_must_be_size_1 [text Text]) + (exception.def .public (char_text_must_be_size_1 text) + (Exception Text) (exception.report (list ["Text" (%.text text)]))) @@ -203,7 +204,8 @@ (<| (typeA.expecting input) (phase archive valueC))))])) -(exception .public (not_a_type [symbol Symbol]) +(exception.def .public (not_a_type symbol) + (Exception Symbol) (exception.report (list ["Symbol" (%.symbol symbol)]))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/lux.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/lux.lux index c917dd6a0..050c6263d 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/lux.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/lux.lux @@ -8,7 +8,7 @@ ["<>" parser] ["[0]" maybe (.use "[1]#[0]" functor)] ["[0]" try] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" binary] ["[0]" product] @@ -332,16 +332,15 @@ (in [/////declaration.#imports imports /////declaration.#referrals (list)])))])) -(exception .public (cannot_alias_an_alias [local Alias - foreign Alias - target Symbol]) +(exception.def .public (cannot_alias_an_alias [local foreign target]) + (Exception [Alias Alias Symbol]) (exception.report (list ["Local alias" (%.symbol local)] ["Foreign alias" (%.symbol foreign)] ["Target definition" (%.symbol target)]))) -(exception .public (cannot_alias_a_label [local Alias - foreign Alias]) +(exception.def .public (cannot_alias_a_label [local foreign]) + (Exception [Alias Alias]) (exception.report (list ["Alias" (%.symbol local)] ["Label" (%.symbol foreign)]))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/jvm/host.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/jvm/host.lux index 0d7953920..88906a74f 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/jvm/host.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/generation/jvm/host.lux @@ -6,7 +6,7 @@ [control ["<>" parser] ["[0]" maybe (.use "[1]#[0]" functor)] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" product] [binary @@ -364,7 +364,8 @@ (-> (Type category) Text)) (|>> type.signature signature.signature)) -(exception .public (not_an_object_array [arrayJT (Type Array)]) +(exception.def .public (not_an_object_array arrayJT) + (Exception (Type Array)) (exception.report (list ["JVM type" (..signature arrayJT)]))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js.lux index 009b99257..911215b10 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js.lux @@ -4,7 +4,7 @@ [abstract [monad (.only do)]] [control - ["[0]" exception (.only exception)]] + ["[0]" exception]] [meta [macro ["^" pattern]] @@ -33,7 +33,7 @@ [reference (.only) [variable (.only)]]]]]]]) -(exception .public cannot_recur_as_an_expression) +(exception.def .public cannot_recur_as_an_expression) (def (expression archive synthesis) Phase diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/host.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/host.lux index 973ab7cad..a7f0a8444 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/host.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/jvm/host.lux @@ -7,7 +7,7 @@ [control ["[0]" maybe] ["[0]" try (.only Try)] - ["[0]" exception (.only exception)] + ["[0]" exception (.only Exception)] ["[0]" io (.only IO io)] [concurrency ["[0]" atom (.only Atom atom)]]] @@ -66,21 +66,21 @@ (def init::type (type.method [(list) (list) type.void (list)])) (def init::modifier (all modifier#composite method.public method.static method.strict)) -(exception .public (cannot_load [class Text - error Text]) +(exception.def .public (cannot_load [class error]) + (Exception [Text Text]) (exception.report (list ["Class" class] ["Error" error]))) -(exception .public (invalid_field [class Text - field Text - error Text]) +(exception.def .public (invalid_field [class field error]) + (Exception [Text Text Text]) (exception.report (list ["Class" class] ["Field" field] ["Error" error]))) -(exception .public (invalid_value [class Text]) +(exception.def .public (invalid_value class) + (Exception Text) (exception.report (list ["Class" class]))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua.lux index 08fbc07cf..ef70e5688 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua.lux @@ -4,7 +4,7 @@ [abstract [monad (.only do)]] [control - ["[0]" exception (.only exception)]] + ["[0]" exception]] [meta [macro ["^" pattern]] @@ -33,7 +33,7 @@ [reference (.only) [variable (.only)]]]]]]]) -(exception .public cannot_recur_as_an_expression) +(exception.def .public cannot_recur_as_an_expression) (def (expression archive synthesis) Phase diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php.lux index 12e2dffd3..b78a425d9 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/php.lux @@ -4,7 +4,7 @@ [abstract [monad (.only do)]] [control - ["[0]" exception (.only exception)]] + ["[0]" exception]] [meta [macro ["^" pattern]] @@ -66,7 +66,7 @@ (//////phase#each _.return (/function.function statement expression archive abstraction)) )) -(exception .public cannot_recur_as_an_expression) +(exception.def .public cannot_recur_as_an_expression) (def .public (expression archive synthesis) Phase diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python.lux index b2692261f..4f2ead520 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/python.lux @@ -4,7 +4,7 @@ [abstract [monad (.only do)]] [control - ["[0]" exception (.only exception)]] + ["[0]" exception]] [meta [macro ["^" pattern]] @@ -33,7 +33,7 @@ [reference (.only) [variable (.only)]]]]]]]) -(exception .public cannot_recur_as_an_expression) +(exception.def .public cannot_recur_as_an_expression) (def .public (expression archive synthesis) Phase diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/procedure/common.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/procedure/common.lux index f57141564..f1ce04dee 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/procedure/common.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/r/procedure/common.lux @@ -2,7 +2,7 @@ lux (lux (control [library [monad (.only do)]] - ["ex" exception (.only exception)] + ["ex" exception] ["p" parser]) (data ["e" error] [text] @@ -62,7 +62,8 @@ Unary (runtimeT.lux//try riskyO)) -(exception .public (Wrong_Syntax [message Text]) +(exception.def .public (Wrong_Syntax message) + (Exception Text) message) (def .public (wrong_syntax procedure args) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby.lux index 9c2719467..8d89f45cd 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby.lux @@ -4,7 +4,7 @@ [abstract [monad (.only do)]] [control - ["[0]" exception (.only exception)]] + ["[0]" exception]] [meta [macro ["^" pattern]] @@ -33,7 +33,7 @@ [reference (.only) [variable (.only)]]]]]]]) -(exception .public cannot_recur_as_an_expression) +(exception.def .public cannot_recur_as_an_expression) (def (expression archive synthesis) Phase diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/function.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/function.lux index c1a6184d1..95fc2cc39 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/function.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/function.lux @@ -7,7 +7,7 @@ [control ["[0]" pipe] ["[0]" maybe (.use "[1]#[0]" functor)] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data [text ["%" \\format (.only format)]] @@ -31,8 +31,8 @@ ["[1][0]" reference (.only) ["[1]/[0]" variable (.only Register Variable)]]]]]) -(exception .public (cannot_find_foreign_variable_in_environment [foreign Register - environment (Environment Synthesis)]) +(exception.def .public (cannot_find_foreign_variable_in_environment [foreign environment]) + (Exception [Register (Environment Synthesis)]) (exception.report (list ["Foreign" (%.nat foreign)] ["Environment" (exception.listing /.%synthesis environment)]))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/variable.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/variable.lux index 0f0d88bdd..553a7e662 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/variable.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/variable.lux @@ -6,7 +6,7 @@ [control ["[0]" maybe (.use "[1]#[0]" functor)] ["[0]" try (.only Try)] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" product] ["[0]" text (.only) @@ -218,7 +218,8 @@ {.#Item head tail}]))))) (with_template [<name>] - [(exception .public (<name> [register Register]) + [(exception.def .public (<name> register) + (Exception Register) (exception.report (list ["Register" (%.nat register)])))] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/program.lux b/stdlib/source/library/lux/meta/compiler/language/lux/program.lux index 864a8f817..0024c1fca 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/program.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/program.lux @@ -6,7 +6,7 @@ [control ["[0]" maybe] ["[0]" try (.only Try)] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" product] [text @@ -28,7 +28,8 @@ Text "") -(exception .public (cannot_find_program [modules (List descriptor.Module)]) +(exception.def .public (cannot_find_program modules) + (Exception (List descriptor.Module)) (exception.report (list ["Modules" (exception.listing %.text modules)]))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/syntax.lux b/stdlib/source/library/lux/meta/compiler/language/lux/syntax.lux index bbf548818..c74188b26 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/syntax.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/syntax.lux @@ -32,7 +32,7 @@ [control ["<>" parser] ["[0]" maybe] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" text (.only) [\\parser (.only Offset)] @@ -162,7 +162,8 @@ [symbol.separator symbol_separator] ) -(exception .public (end_of_file [module Text]) +(exception.def .public (end_of_file module) + (Exception Text) (exception.report (list ["Module" (%.text module)]))) @@ -173,10 +174,8 @@ (let [end (|> start (!n/+ amount_of_input_shown) (n.min ("lux text size" input)))] (!clip start end input))) -(exception .public (unrecognized_input [[file line column] Location - context Text - input Text - offset Offset]) +(exception.def .public (unrecognized_input [[file line column] context input offset]) + (Exception [Location Text Text Offset]) (exception.report (list ["File" file] ["Line" (%.nat line)] @@ -184,7 +183,8 @@ ["Context" (%.text context)] ["Input" (input_at offset input)]))) -(exception .public (text_cannot_contain_new_lines [text Text]) +(exception.def .public (text_cannot_contain_new_lines text) + (Exception Text) (exception.report (list ["Text" (%.text text)]))) diff --git a/stdlib/source/library/lux/meta/compiler/meta/archive.lux b/stdlib/source/library/lux/meta/compiler/meta/archive.lux index bcbdcaff4..f492ed908 100644 --- a/stdlib/source/library/lux/meta/compiler/meta/archive.lux +++ b/stdlib/source/library/lux/meta/compiler/meta/archive.lux @@ -8,7 +8,7 @@ ["<>" parser] ["[0]" maybe] ["[0]" try (.only Try)] - ["[0]" exception (.only exception)] + ["[0]" exception (.only Exception)] ["[0]" function]] [data ["[0]" product] @@ -42,22 +42,22 @@ (type .public Output (Sequence [artifact.ID (Maybe Text) Binary])) -(exception .public (unknown_document [module descriptor.Module - known_modules (List descriptor.Module)]) +(exception.def .public (unknown_document [module known_modules]) + (Exception [descriptor.Module (List descriptor.Module)]) (exception.report (list ["Module" (%.text module)] ["Known Modules" (exception.listing %.text known_modules)]))) -(exception .public (cannot_replace_document [module descriptor.Module - old (Document Any) - new (Document Any)]) +(exception.def .public (cannot_replace_document [module old new]) + (Exception [descriptor.Module (Document Any) (Document Any)]) (exception.report (list ["Module" (%.text module)] ["Old key" (signature.description (document.signature old))] ["New key" (signature.description (document.signature new))]))) (with_template [<name>] - [(exception .public (<name> [it descriptor.Module]) + [(exception.def .public (<name> it) + (Exception descriptor.Module) (exception.report (list ["Module" (%.text it)])))] @@ -246,8 +246,8 @@ [version /#next] (\\format.result ..format)))) - (exception .public (version_mismatch [expected Version - actual Version]) + (exception.def .public (version_mismatch [expected actual]) + (Exception [Version Version]) (exception.report (list ["Expected" (%.nat expected)] ["Actual" (%.nat actual)]))) diff --git a/stdlib/source/library/lux/meta/compiler/meta/archive/module/document.lux b/stdlib/source/library/lux/meta/compiler/meta/archive/module/document.lux index 3baa41932..3c0df9cbc 100644 --- a/stdlib/source/library/lux/meta/compiler/meta/archive/module/document.lux +++ b/stdlib/source/library/lux/meta/compiler/meta/archive/module/document.lux @@ -6,7 +6,7 @@ [control ["<>" parser] ["[0]" try (.only Try)] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data [collection ["[0]" dictionary (.only Dictionary)]] @@ -20,8 +20,8 @@ ["[0]" signature (.only Signature) (.use "[1]#[0]" equivalence)] ["[0]" key (.only Key)]]) -(exception .public (invalid_signature [expected Signature - actual Signature]) +(exception.def .public (invalid_signature [expected actual]) + (Exception [Signature Signature]) (exception.report (list ["Expected" (signature.description expected)] ["Actual" (signature.description actual)]))) diff --git a/stdlib/source/library/lux/meta/compiler/meta/archive/registry.lux b/stdlib/source/library/lux/meta/compiler/meta/archive/registry.lux index 9f1e240d9..e3d675ec0 100644 --- a/stdlib/source/library/lux/meta/compiler/meta/archive/registry.lux +++ b/stdlib/source/library/lux/meta/compiler/meta/archive/registry.lux @@ -7,7 +7,7 @@ ["<>" parser] ["[0]" pipe] ["[0]" maybe (.use "[1]#[0]" functor)] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" product] ["[0]" binary @@ -145,7 +145,8 @@ dependencies])) artifacts))) - (exception .public (invalid_category [tag Nat]) + (exception.def .public (invalid_category tag) + (Exception Nat) (exception.report (list ["Tag" (%.nat tag)]))) diff --git a/stdlib/source/library/lux/meta/compiler/meta/cache/module.lux b/stdlib/source/library/lux/meta/compiler/meta/cache/module.lux index 619e3db90..a78ddc424 100644 --- a/stdlib/source/library/lux/meta/compiler/meta/cache/module.lux +++ b/stdlib/source/library/lux/meta/compiler/meta/cache/module.lux @@ -6,7 +6,7 @@ [control ["[0]" pipe] ["[0]" try (.only Try)] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data [binary (.only Binary)] ["[0]" product] @@ -25,9 +25,8 @@ [archive ["[0]" module]]]]) -(exception .public (cannot_enable [archive file.Path - @module module.ID - error Text]) +(exception.def .public (cannot_enable [archive @module error]) + (Exception [file.Path module.ID Text]) (exception.report (list ["Archive" archive] ["Module ID" (%.nat @module)] diff --git a/stdlib/source/library/lux/meta/compiler/meta/import.lux b/stdlib/source/library/lux/meta/compiler/meta/import.lux index 500de0a6f..334c2aa13 100644 --- a/stdlib/source/library/lux/meta/compiler/meta/import.lux +++ b/stdlib/source/library/lux/meta/compiler/meta/import.lux @@ -6,7 +6,7 @@ [control ["<>" parser] ["[0]" try (.only Try)] - ["[0]" exception (.only exception)] + ["[0]" exception (.only Exception)] [concurrency ["[0]" async (.only Async)]]] [data @@ -29,10 +29,10 @@ (def Action (type_literal (All (_ a) (Async (Try a))))) -(exception .public useless_tar_entry) +(exception.def .public useless_tar_entry) -(exception .public (duplicate [library Library - module Module]) +(exception.def .public (duplicate [library module]) + (Exception [Library Module]) (exception.report (list ["Module" (%.text module)] ["Library" (%.text library)]))) diff --git a/stdlib/source/library/lux/meta/compiler/meta/io/context.lux b/stdlib/source/library/lux/meta/compiler/meta/io/context.lux index e6a80f7a5..ae87b57af 100644 --- a/stdlib/source/library/lux/meta/compiler/meta/io/context.lux +++ b/stdlib/source/library/lux/meta/compiler/meta/io/context.lux @@ -6,7 +6,7 @@ [control ["[0]" maybe] ["[0]" try (.only Try)] - ["[0]" exception (.only exception)] + ["[0]" exception (.only Exception)] [concurrency ["[0]" async (.only Async) (.use "[1]#[0]" monad)]] [function @@ -32,13 +32,14 @@ [module [descriptor (.only Module)]]]]]) -(exception .public (cannot_find_module [importer Module - module Module]) +(exception.def .public (cannot_find_module [importer module]) + (Exception [Module Module]) (exception.report (list ["Module" (%.text module)] ["Importer" (%.text importer)]))) -(exception .public (cannot_read_module [module Module]) +(exception.def .public (cannot_read_module module) + (Exception Module) (exception.report (list ["Module" (%.text module)]))) diff --git a/stdlib/source/library/lux/meta/configuration.lux b/stdlib/source/library/lux/meta/configuration.lux index b98d92ee1..d8bf76a9a 100644 --- a/stdlib/source/library/lux/meta/configuration.lux +++ b/stdlib/source/library/lux/meta/configuration.lux @@ -8,7 +8,7 @@ [control ["<>" parser] ["[0]" maybe (.use "[1]#[0]" functor)] - ["[0]" exception (.only exception)]] + ["[0]" exception]] [data ["[0]" text (.use "[1]#[0]" equivalence) ["%" \\format] @@ -66,7 +66,7 @@ (<text>.slice (<text>.some! (<text>.none_of! ..end)))))] (<>.some (<>.and parser' parser')))) -(exception .public invalid) +(exception.def .public invalid) (def configuration (<code>.Parser Configuration) diff --git a/stdlib/source/library/lux/meta/macro/context.lux b/stdlib/source/library/lux/meta/macro/context.lux index 5a347775d..dc2911506 100644 --- a/stdlib/source/library/lux/meta/macro/context.lux +++ b/stdlib/source/library/lux/meta/macro/context.lux @@ -5,7 +5,7 @@ [monad (.only do)]] [control ["?" parser] - ["[0]" exception (.only exception)] + ["[0]" exception (.only Exception)] ["[0]" maybe] [function [predicate (.only Predicate)]]] @@ -24,7 +24,8 @@ (type .public Stack List) -(exception .public (no_definition [it Symbol]) +(exception.def .public (no_definition it) + (Exception Symbol) (exception.report (list ["Definition" (symbol#encoded it)]))) @@ -44,7 +45,7 @@ {.#None} (meta.failure (exception.error ..no_definition [it]))))) -(exception .public no_active_context) +(exception.def .public no_active_context) (.def .public (peek' _ context) (All (_ a) (-> (Stack a) Symbol (Meta a))) @@ -63,7 +64,7 @@ (syntax (_ [g!it (at ?.monad each code.symbol ?code.global)]) (in (list (` (..peek' (, g!it) (.symbol (, g!it)))))))) -(exception .public no_example) +(exception.def .public no_example) (.def .public (search' _ ? context) (All (_ a) (-> (Stack a) (Predicate a) Symbol (Meta a))) diff --git a/stdlib/source/library/lux/meta/macro/local.lux b/stdlib/source/library/lux/meta/macro/local.lux index c69b32f95..48ca7db43 100644 --- a/stdlib/source/library/lux/meta/macro/local.lux +++ b/stdlib/source/library/lux/meta/macro/local.lux @@ -6,7 +6,7 @@ [control ["<>" parser] ["[0]" try (.only Try)] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" product] ["[0]" text] @@ -19,13 +19,14 @@ ["[0]" // (.only) [syntax (.only syntax)]]) -(exception .public (unknown_module [module Text]) +(exception.def .public (unknown_module module) + (Exception Text) (exception.report (list ["Module" (text.format module)]))) (with_template [<name>] - [(exception .public (<name> [module Text - definition Text]) + [(exception.def .public (<name> [module definition]) + (Exception [Text Text]) (exception.report (list ["Module" (text.format module)] ["Definition" (text.format definition)])))] diff --git a/stdlib/source/library/lux/meta/macro/syntax/definition.lux b/stdlib/source/library/lux/meta/macro/syntax/definition.lux index 0f6be7510..0db62599f 100644 --- a/stdlib/source/library/lux/meta/macro/syntax/definition.lux +++ b/stdlib/source/library/lux/meta/macro/syntax/definition.lux @@ -6,7 +6,7 @@ [monad (.only do)]] [control ["<>" parser] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" sum] ["[0]" product] @@ -81,7 +81,8 @@ <code>.bit )))) -(exception .public (lacks_type [definition Definition]) +(exception.def .public (lacks_type definition) + (Exception Definition) (exception.report (list ["Definition" (%.code (..format definition))]))) diff --git a/stdlib/source/library/lux/meta/macro/syntax/export.lux b/stdlib/source/library/lux/meta/macro/syntax/export.lux index 04e5c730a..98db6124e 100644 --- a/stdlib/source/library/lux/meta/macro/syntax/export.lux +++ b/stdlib/source/library/lux/meta/macro/syntax/export.lux @@ -9,30 +9,34 @@ ["[0]" code ["<[1]>" \\parser (.only Parser)]]]]]) -(def .public default_policy - Code +(type .public Policy + Code) + +(def .public default + Policy (` .private)) (`` (def policy - (Parser Code) + (Parser Policy) (do [! <>.monad] [candidate <code>.next] (when candidate [_ {.#Symbol ["" _]}] - (in default_policy) + (in default) - (,, (with_template [<pattern>] - [<pattern> + (,, (with_template [<tag>] + [[_ {<tag> _}] (do ! [_ <code>.any] (in candidate))] - [[_ {.#Bit _}]] - [[_ {.#Symbol _}]])) + [.#Bit] + [.#Symbol] + )) _ - (in default_policy))))) + (in default))))) (def .public parser - (All (_ a) (-> (Parser a) (Parser [Code a]))) + (All (_ a) (-> (Parser a) (Parser [Policy a]))) (<>.and ..policy)) diff --git a/stdlib/source/library/lux/meta/macro/template.lux b/stdlib/source/library/lux/meta/macro/template.lux index a045bd235..829c971cf 100644 --- a/stdlib/source/library/lux/meta/macro/template.lux +++ b/stdlib/source/library/lux/meta/macro/template.lux @@ -6,7 +6,7 @@ [control ["<>" parser (.use "[1]#[0]" functor)] ["[0]" try (.only Try)] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" bit (.use "[1]#[0]" codec)] ["[0]" text] @@ -127,8 +127,8 @@ #parameters (List Text) #template (List Code)])) -(exception .public (irregular_arguments [expected Nat - actual Nat]) +(exception.def .public (irregular_arguments [expected actual]) + (Exception [Nat Nat]) (exception.report (list ["Expected" (at nat.decimal encoded expected)] ["Actual" (at nat.decimal encoded actual)]))) diff --git a/stdlib/source/library/lux/meta/macro/vocabulary.lux b/stdlib/source/library/lux/meta/macro/vocabulary.lux index 3f54c9db4..ce47d7f96 100644 --- a/stdlib/source/library/lux/meta/macro/vocabulary.lux +++ b/stdlib/source/library/lux/meta/macro/vocabulary.lux @@ -7,7 +7,7 @@ [monad (.only do)]] [control ["?" parser (.use "[1]#[0]" functor)] - ["[0]" exception (.only exception)]]]] + ["[0]" exception (.only Exception)]]]] ["[0]" // (.only) [syntax (.only syntax) ["[0]" export]] @@ -17,8 +17,8 @@ ["[0]" type (.only) [primitive (.except)]]]]) -(exception .public (invalid_type [expected Type - actual Type]) +(exception.def .public (invalid_type [expected actual]) + (Exception [Type Type]) (exception.report (list ["Expected" (type.format expected)] ["Actual" (type.format actual)]))) diff --git a/stdlib/source/library/lux/meta/target/jvm/bytecode.lux b/stdlib/source/library/lux/meta/target/jvm/bytecode.lux index 57ea8caf8..fb54ac19a 100644 --- a/stdlib/source/library/lux/meta/target/jvm/bytecode.lux +++ b/stdlib/source/library/lux/meta/target/jvm/bytecode.lux @@ -11,7 +11,7 @@ ["[0]" state (.only +State)] ["[0]" maybe] ["[0]" try (.only Try) (.use "[1]#[0]" monad)] - ["[0]" exception (.only exception)]] + ["[0]" exception]] [data ["[0]" product] [text @@ -129,15 +129,13 @@ [..relative#identity (the #next tracker)]]})) -(exception .public (label_has_already_been_set [label Label]) +(exception.def .public (label_has_already_been_set label) + (exception.Exception Label) (exception.report (list ["Label" (%.nat label)]))) -(exception .public (mismatched_environments [instruction Symbol - label Label - address Address - expected Stack - actual Stack]) +(exception.def .public (mismatched_environments [instruction label address expected actual]) + (exception.Exception [Symbol Label Address Stack Stack]) (exception.report (list ["Instruction" (%.symbol instruction)] ["Label" (%.nat label)] @@ -679,7 +677,8 @@ _ (..arbitrary_double value)))) -(exception .public (invalid_register [id Nat]) +(exception.def .public (invalid_register id) + (exception.Exception Nat) (exception.report (list ["ID" (%.nat id)]))) @@ -781,13 +780,13 @@ [$0 $1 sipush _.sipush S2] ) -(exception .public (unknown_label [label Label]) +(exception.def .public (unknown_label label) + (exception.Exception Label) (exception.report (list ["Label" (%.nat label)]))) -(exception .public (cannot_do_a_big_jump [label Label - @from Address - jump Big_Jump]) +(exception.def .public (cannot_do_a_big_jump [label @from jump]) + (exception.Exception [Label Address Big_Jump]) (exception.report (list ["Label" (%.nat label)] ["Start" (|> @from /address.value //unsigned.value %.nat)] @@ -809,7 +808,8 @@ (try#each (|>> {.#Left}) (//signed.s4 jump)) (try#each (|>> {.#Right}) (//signed.s2 jump))))) -(exception .public (unset_label [label Label]) +(exception.def .public (unset_label label) + (exception.Exception Label) (exception.report (list ["Label" (%.nat label)]))) @@ -938,7 +938,7 @@ {.#Right small} (/jump.lifted small))) -(exception .public invalid_tableswitch) +(exception.def .public invalid_tableswitch) (def .public (tableswitch minimum default [at_minimum afterwards]) (-> S4 Label [Label (List Label)] (Bytecode Any)) @@ -976,7 +976,7 @@ (exception.except ..invalid_tableswitch [])))) []]])))))) -(exception .public invalid_lookupswitch) +(exception.def .public invalid_lookupswitch) (def .public (lookupswitch default cases) (-> Label (List [S4 Label]) (Bytecode Any)) @@ -1042,7 +1042,8 @@ [register (..register register)] (..bytecode $0 $0 (/registry.for register) _.iinc [register increase]))) -(exception .public (multiarray_cannot_be_zero_dimensional [class (Type Object)]) +(exception.def .public (multiarray_cannot_be_zero_dimensional class) + (exception.Exception (Type Object)) (exception.report (list ["Class" (..reflection class)]))) @@ -1128,8 +1129,8 @@ [putfield $2 _.putfield/1 $3 _.putfield/2] ) -(exception .public (invalid_range_for_try [start Address - end Address]) +(exception.def .public (invalid_range_for_try [start end]) + (exception.Exception [Address Address]) (exception.report (list ["Start" (|> start /address.value //unsigned.value %.nat)] ["End" (|> end /address.value //unsigned.value %.nat)]))) diff --git a/stdlib/source/library/lux/meta/target/jvm/bytecode/environment.lux b/stdlib/source/library/lux/meta/target/jvm/bytecode/environment.lux index dd33b7853..a7e687751 100644 --- a/stdlib/source/library/lux/meta/target/jvm/bytecode/environment.lux +++ b/stdlib/source/library/lux/meta/target/jvm/bytecode/environment.lux @@ -6,7 +6,7 @@ [monoid (.only Monoid)]] [control ["[0]" try (.only Try)] - ["[0]" exception (.only exception)]]]] + ["[0]" exception (.only Exception)]]]] [/ ["/[0]" limit (.only Limit) ["/[0]" stack (.only Stack)] @@ -49,7 +49,7 @@ [environment (left environment)] (right environment)))))) -(exception .public discontinuity) +(exception.def .public discontinuity) (def .public (stack environment) (-> Environment (Try Stack)) @@ -64,8 +64,8 @@ (-> Environment Environment) (.has ..#stack {.#None})) -(exception .public (mismatched_stacks [expected Stack - actual Stack]) +(exception.def .public (mismatched_stacks [expected actual]) + (Exception [Stack Stack]) (exception.report (list ["Expected" (/stack.text expected)] ["Actual" (/stack.text actual)]))) diff --git a/stdlib/source/library/lux/meta/target/jvm/encoding/signed.lux b/stdlib/source/library/lux/meta/target/jvm/encoding/signed.lux index 430263c8d..11a43668f 100644 --- a/stdlib/source/library/lux/meta/target/jvm/encoding/signed.lux +++ b/stdlib/source/library/lux/meta/target/jvm/encoding/signed.lux @@ -6,7 +6,7 @@ [order (.only Order)]] [control ["[0]" try (.only Try)] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data [text ["%" \\format (.only format)]] @@ -43,8 +43,8 @@ (def (< reference sample) (i.< (representation reference) (representation sample))))) - (exception .public (value_exceeds_the_scope [value Int - scope Nat]) + (exception.def .public (value_exceeds_the_scope [value scope]) + (Exception [Int Nat]) (exception.report (list ["Value" (%.int value)] ["Scope (in bytes)" (%.nat scope)]))) diff --git a/stdlib/source/library/lux/meta/target/jvm/encoding/unsigned.lux b/stdlib/source/library/lux/meta/target/jvm/encoding/unsigned.lux index 1c2bc77a6..0c6e7cde3 100644 --- a/stdlib/source/library/lux/meta/target/jvm/encoding/unsigned.lux +++ b/stdlib/source/library/lux/meta/target/jvm/encoding/unsigned.lux @@ -6,7 +6,7 @@ [order (.only Order)]] [control ["[0]" try (.only Try)] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data [text ["%" \\format (.only format)]] @@ -44,18 +44,15 @@ (n.< (representation reference) (representation sample))))) - (exception .public (value_exceeds_the_maximum [type Symbol - value Nat - maximum (Unsigned Any)]) + (exception.def .public (value_exceeds_the_maximum [type value maximum]) + (Exception [Symbol Nat (Unsigned Any)]) (exception.report (list ["Type" (%.symbol type)] ["Value" (%.nat value)] ["Maximum" (%.nat (representation maximum))]))) - (exception .public [brand] (subtraction_cannot_yield_negative_value - [type Symbol - parameter (Unsigned brand) - subject (Unsigned brand)]) + (exception.def .public (subtraction_cannot_yield_negative_value [type parameter subject]) + (All (_ brand) (Exception [Symbol (Unsigned brand) (Unsigned brand)])) (exception.report (list ["Type" (%.symbol type)] ["Parameter" (%.nat (representation parameter))] diff --git a/stdlib/source/library/lux/meta/target/jvm/loader.lux b/stdlib/source/library/lux/meta/target/jvm/loader.lux index c8d70c482..3f2c4dd39 100644 --- a/stdlib/source/library/lux/meta/target/jvm/loader.lux +++ b/stdlib/source/library/lux/meta/target/jvm/loader.lux @@ -6,7 +6,7 @@ [monad (.only do)]] [control ["[0]" try (.only Try)] - ["[0]" exception (.only exception)] + ["[0]" exception (.only Exception)] ["[0]" io (.only IO)] [concurrency ["[0]" atom (.only Atom)]]] @@ -23,16 +23,18 @@ (type .public Library (Atom (Dictionary Text Binary))) -(exception .public (already_stored [class Text]) +(exception.def .public (already_stored class) + (Exception Text) (exception.report (list ["Class" class]))) -(exception .public (unknown [class Text]) +(exception.def .public (unknown class) + (Exception Text) (exception.report (list ["Class" class]))) -(exception .public (cannot_define [class Text - error Text]) +(exception.def .public (cannot_define [class error]) + (Exception [Text Text]) (exception.report (list ["Class" class] ["Error" error]))) diff --git a/stdlib/source/library/lux/meta/target/jvm/reflection.lux b/stdlib/source/library/lux/meta/target/jvm/reflection.lux index a33bc6507..2a0ad37a8 100644 --- a/stdlib/source/library/lux/meta/target/jvm/reflection.lux +++ b/stdlib/source/library/lux/meta/target/jvm/reflection.lux @@ -6,7 +6,7 @@ ["[0]" monad (.only do)]] [control ["[0]" try (.only Try) (.use "[1]#[0]" functor)] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" text (.use "[1]#[0]" equivalence) ["%" \\format (.only format)] @@ -96,12 +96,14 @@ (isArray [] boolean) (getComponentType [] (java/lang/Class java/lang/Object))) -(exception .public (unknown_class [class External]) +(exception.def .public (unknown_class class) + (Exception External) (exception.report (list ["Class" (%.text class)]))) (with_template [<name>] - [(exception .public (<name> [jvm_type java/lang/reflect/Type]) + [(exception.def .public (<name> jvm_type) + (Exception java/lang/reflect/Type) (exception.report (list ["Type" (java/lang/reflect/Type::getTypeName jvm_type)] ["Class" (|> jvm_type java/lang/Object::getClass java/lang/Object::toString)])))] @@ -267,23 +269,22 @@ {.#None} <else>))) -(exception .public (cannot_correspond [class (java/lang/Class java/lang/Object) - type Type]) +(exception.def .public (cannot_correspond [class type]) + (Exception [(java/lang/Class java/lang/Object) Type]) (exception.report (list ["Class" (java/lang/Object::toString class)] ["Type" (%.type type)]))) -(exception .public (type_parameter_mismatch [expected Nat - actual Nat - class (java/lang/Class java/lang/Object) - type Type]) +(exception.def .public (type_parameter_mismatch [expected actual class type]) + (Exception [Nat Nat (java/lang/Class java/lang/Object) Type]) (exception.report (list ["Expected" (%.nat expected)] ["Actual" (%.nat actual)] ["Class" (java/lang/Object::toString class)] ["Type" (%.type type)]))) -(exception .public (non_jvm_type [type Type]) +(exception.def .public (non_jvm_type type) + (Exception Type) (exception.report (list ["Type" (%.type type)]))) @@ -327,17 +328,16 @@ _ (exception.except ..non_jvm_type [type]))) -(exception .public (mistaken_field_owner [field java/lang/reflect/Field - owner (java/lang/Class java/lang/Object) - target (java/lang/Class java/lang/Object)]) +(exception.def .public (mistaken_field_owner [field owner target]) + (Exception [java/lang/reflect/Field (java/lang/Class java/lang/Object) (java/lang/Class java/lang/Object)]) (exception.report (list ["Field" (java/lang/Object::toString field)] ["Owner" (java/lang/Object::toString owner)] ["Target" (java/lang/Object::toString target)]))) (with_template [<name>] - [(exception .public (<name> [field Text - class (java/lang/Class java/lang/Object)]) + [(exception.def .public (<name> [field class]) + (Exception [Text (java/lang/Class java/lang/Object)]) (exception.report (list ["Field" (%.text field)] ["Class" (java/lang/Object::toString class)])))] diff --git a/stdlib/source/library/lux/meta/target/jvm/type/lux.lux b/stdlib/source/library/lux/meta/target/jvm/type/lux.lux index 4f6d9076f..89639ce4d 100644 --- a/stdlib/source/library/lux/meta/target/jvm/type/lux.lux +++ b/stdlib/source/library/lux/meta/target/jvm/type/lux.lux @@ -6,7 +6,7 @@ [control ["<>" parser (.use "[1]#[0]" monad)] ["[0]" try] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" product] ["[0]" text (.use "[1]#[0]" equivalence) @@ -44,7 +44,8 @@ Mapping (dictionary.empty text.hash)) -(exception .public (unknown_var [var Text]) +(exception.def .public (unknown_var var) + (Exception Text) (exception.report (list ["Var" (%.text var)]))) diff --git a/stdlib/source/library/lux/meta/type/check.lux b/stdlib/source/library/lux/meta/type/check.lux index 184864469..718f27931 100644 --- a/stdlib/source/library/lux/meta/type/check.lux +++ b/stdlib/source/library/lux/meta/type/check.lux @@ -8,7 +8,7 @@ [control ["[0]" maybe] ["[0]" try (.only Try)] - ["[0]" exception (.only Exception exception)]] + ["[0]" exception (.only Exception)]] [data ["[0]" product] ["[0]" text (.use "[1]#[0]" monoid equivalence)] @@ -32,30 +32,31 @@ (template (_ reference subject) [("lux text =" reference subject)])) -(exception .public (unknown_type_var [id Nat]) - (exception.report - (list ["ID" (n#encoded id)]))) +(with_template [<name>] + [(exception.def .public (<name> id) + (Exception Nat) + (exception.report + (list ["ID" (n#encoded id)])))] -(exception .public (unbound_type_var [id Nat]) - (exception.report - (list ["ID" (n#encoded id)]))) + [unknown_type_var] + [unbound_type_var] + ) -(exception .public (invalid_type_application [funcT Type - argT Type]) +(exception.def .public (invalid_type_application [funcT argT]) + (Exception [Type Type]) (exception.report (list ["Type function" (//.format funcT)] ["Type argument" (//.format argT)]))) -(exception .public (cannot_rebind_var [id Nat - type Type - bound Type]) +(exception.def .public (cannot_rebind_var [id type bound]) + (Exception [Nat Type Type]) (exception.report (list ["Var" (n#encoded id)] ["Wanted type" (//.format type)] ["Current type" (//.format bound)]))) -(exception .public (type_check_failed [expected Type - actual Type]) +(exception.def .public (type_check_failed [expected actual]) + (Exception [Type Type]) (exception.report (list ["Expected" (//.format expected)] ["Actual" (//.format actual)]))) @@ -338,7 +339,8 @@ (set.member? it @1)) (..ring @0))) -(exception .public (cannot_identify [var Var]) +(exception.def .public (cannot_identify var) + (Exception Var) (exception.report (list ["Var" (n#encoded var)]))) diff --git a/stdlib/source/library/lux/meta/type/dynamic.lux b/stdlib/source/library/lux/meta/type/dynamic.lux index a10d24530..6c69e7417 100644 --- a/stdlib/source/library/lux/meta/type/dynamic.lux +++ b/stdlib/source/library/lux/meta/type/dynamic.lux @@ -4,7 +4,7 @@ ["[0]" debug] [control ["[0]" try (.only Try)] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data [text ["%" \\format]]] @@ -16,8 +16,8 @@ ["[0]" // (.only) ["[0]" primitive (.only primitive)]]) -(exception .public (wrong_type [expected Type - actual Type]) +(exception.def .public (wrong_type [expected actual]) + (Exception [Type Type]) (exception.report (list ["Expected" (%.type expected)] ["Actual" (%.type actual)]))) diff --git a/stdlib/source/library/lux/meta/type/resource.lux b/stdlib/source/library/lux/meta/type/resource.lux index 7b1a83195..904ee3129 100644 --- a/stdlib/source/library/lux/meta/type/resource.lux +++ b/stdlib/source/library/lux/meta/type/resource.lux @@ -7,7 +7,7 @@ [control ["<>" parser] ["[0]" maybe] - ["[0]" exception (.only exception)]] + ["[0]" exception (.only Exception)]] [data [text ["%" \\format (.only format)]] @@ -102,11 +102,12 @@ (at monad in [keys (representation resource)]))) ) -(exception .public (index_cannot_be_repeated [index Nat]) +(exception.def .public (index_cannot_be_repeated index) + (Exception Nat) (exception.report (list ["Index" (%.nat index)]))) -(exception .public amount_cannot_be_zero) +(exception.def .public amount_cannot_be_zero) (def indices (Parser (List Nat)) diff --git a/stdlib/source/library/lux/meta/version.lux b/stdlib/source/library/lux/meta/version.lux index af8da3bce..b25439e57 100644 --- a/stdlib/source/library/lux/meta/version.lux +++ b/stdlib/source/library/lux/meta/version.lux @@ -5,7 +5,7 @@ [monad (.only do)]] [control ["<>" parser] - ["[0]" exception (.only exception)]] + ["[0]" exception]] [data ["[0]" text (.use "[1]#[0]" equivalence)] [collection @@ -28,7 +28,7 @@ [it meta.version] (in (list (code.text it)))))) -(exception .public invalid) +(exception.def .public invalid) (def .public for (syntax (_ [specializations (<>.some (<>.and <code>.text <code>.any)) |