diff options
Diffstat (limited to 'stdlib/source/library/lux/meta')
26 files changed, 174 insertions, 173 deletions
diff --git a/stdlib/source/library/lux/meta/compiler/default/init.lux b/stdlib/source/library/lux/meta/compiler/default/init.lux index 2999dad49..d4c342829 100644 --- a/stdlib/source/library/lux/meta/compiler/default/init.lux +++ b/stdlib/source/library/lux/meta/compiler/default/init.lux @@ -107,7 +107,7 @@ dictionary.entries (monad.each ! (function (_ [name handler]) - (///declaration.lifted_analysis + (///declaration.of_analysis (moduleA.override_definition [.prelude name] [true {.#Default [.Analysis handler]}])))))] (in []))) @@ -119,7 +119,7 @@ dictionary.entries (monad.each ! (function (_ [name handler]) - (///declaration.lifted_analysis + (///declaration.of_analysis (moduleA.override_definition [.prelude name] [true {.#Default [.Synthesis handler]}])))))] (in []))) @@ -132,7 +132,7 @@ dictionary.entries (monad.each ! (function (_ [name handler]) - (///declaration.lifted_analysis + (///declaration.of_analysis (moduleA.override_definition [.prelude name] [true {.#Default [.Translation handler]}])))))] (in []))) @@ -146,7 +146,7 @@ (monad.each ! (function (_ [name handler]) (do ! - [_ (///declaration.lifted_analysis + [_ (///declaration.of_analysis (moduleA.override_definition [.prelude name] [true {.#Default [.Declaration handler]}]))] (in [])))))] (in []))) @@ -183,10 +183,10 @@ (do ///phase.monad [.let [module (the ///.#module input)] _ (///declaration.set_current_module module) - _ (///declaration.lifted_analysis + _ (///declaration.of_analysis (moduleA.create hash module)) _ (with_defaults module all_extensions)] - (///declaration.lifted_analysis + (///declaration.of_analysis (do [! ///phase.monad] [_ (monad.each ! moduleA.import dependencies) .let [source (///analysis.source (the ///.#module input) (the ///.#code input))] @@ -199,14 +199,14 @@ (All (_ anchor expression declaration) (///declaration.Operation anchor expression declaration [.Module (Payload declaration)]))) (do ///phase.monad - [_ (///declaration.lifted_analysis + [_ (///declaration.of_analysis (moduleA.set_compiled module)) analysis_module (<| (is (Operation .Module)) - ///declaration.lifted_analysis + ///declaration.of_analysis meta.current_module) - final_buffer (///declaration.lifted_translation + final_buffer (///declaration.of_translation ///translation.buffer) - final_registry (///declaration.lifted_translation + final_registry (///declaration.of_translation ///translation.get_registry)] (in [analysis_module [final_buffer final_registry]]))) @@ -218,9 +218,9 @@ (///declaration.Operation anchor expression declaration (Payload declaration)))) (do ///phase.monad - [buffer (///declaration.lifted_translation + [buffer (///declaration.of_translation ///translation.buffer) - registry (///declaration.lifted_translation + registry (///declaration.of_translation ///translation.get_registry)] (in [buffer registry]))) @@ -232,9 +232,9 @@ [Requirements (Payload declaration)]))) (do ///phase.monad [.let [[pre_buffer pre_registry] pre_payoad] - _ (///declaration.lifted_translation + _ (///declaration.of_translation (///translation.set_buffer pre_buffer)) - _ (///declaration.lifted_translation + _ (///declaration.of_translation (///translation.set_registry pre_registry)) requirements (let [execute! (declarationP.phase wrapper extender expander)] (execute! archive code)) @@ -247,7 +247,7 @@ (///declaration.Operation anchor expression declaration [Source Requirements (Payload declaration)]))) (do ///phase.monad - [[source code] (///declaration.lifted_analysis + [[source code] (///declaration.of_analysis (..read source reader)) [requirements post_payload] (process_declaration wrapper archive extender expander pre_payload code)] (in [source requirements post_payload]))) @@ -258,7 +258,7 @@ (///declaration.Operation anchor expression declaration (Maybe [Source Requirements (Payload declaration)])))) (do ///phase.monad - [reader (///declaration.lifted_analysis + [reader (///declaration.of_analysis (..reader module aliases source))] (function (_ state) (when (///phase.result' state (..iteration' wrapper archive extender expander reader source pre_payload)) @@ -293,7 +293,7 @@ @self (///translation.learn [///program.name {.#None}] true (set.has @program (set.empty unit.hash))) |program| (global archive [program_module program_definition]) - @module (///phase.lifted (archive.id program_module archive))] + @module (///phase.of_try (archive.id program_module archive))] (///translation.save! @self {.#None} (program [@module @self] |program|)))) (def .public (compiler program global wrapper extender expander prelude write_declaration program_module program_definition @@ -327,7 +327,7 @@ [_ (if (text#= program_module module) (when program_definition {.#Some program_definition} - (///declaration.lifted_translation + (///declaration.of_translation (define_program! archive program global program_module program_definition)) {.#None} @@ -358,11 +358,11 @@ (again (<| (///phase.result' state) (do [! ///phase.monad] [analysis_module (<| (is (Operation .Module)) - ///declaration.lifted_analysis + ///declaration.of_analysis meta.current_module) - _ (///declaration.lifted_translation + _ (///declaration.of_translation (///translation.set_buffer temporary_buffer)) - _ (///declaration.lifted_translation + _ (///declaration.of_translation (///translation.set_registry temporary_registry)) _ (|> requirements (the ///declaration.#referrals) diff --git a/stdlib/source/library/lux/meta/compiler/default/platform.lux b/stdlib/source/library/lux/meta/compiler/default/platform.lux index 0e56f0d61..0f95c121a 100644 --- a/stdlib/source/library/lux/meta/compiler/default/platform.lux +++ b/stdlib/source/library/lux/meta/compiler/default/platform.lux @@ -178,10 +178,10 @@ (///declaration.Operation <type_vars> [Archive (archive.Entry .Module)]))) (do phase.monad - [[registry payload] (///declaration.lifted_translation + [[registry payload] (///declaration.of_translation (..compile_runtime! platform)) .let [entry [..runtime_module payload registry]] - archive (phase.lifted (if (archive.reserved? archive descriptor.runtime) + archive (phase.of_try (if (archive.reserved? archive descriptor.runtime) (archive.has descriptor.runtime entry archive) (do try.monad [[_ archive] (archive.reserve descriptor.runtime archive)] @@ -193,7 +193,7 @@ (-> .Lux (//init.Extensions <type_vars>) (///declaration.Operation <type_vars> Any))) (do [! phase.monad] - [_ (///declaration.lifted_analysis + [_ (///declaration.of_analysis (///analysis.set_state analysis_state))] (//init.with_defaults .prelude all_extensions))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/evaluation.lux b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/evaluation.lux index 0a6cd7660..8ef79556a 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/analysis/evaluation.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/analysis/evaluation.lux @@ -57,7 +57,7 @@ (analysis archive exprC)) module meta.current_module_name lux meta.compiler_state] - (<| phase.lifted + (<| phase.of_try (do try.monad [exprS (|> exprA (synthesis lux archive) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/declaration.lux b/stdlib/source/library/lux/meta/compiler/language/lux/declaration.lux index 43c7d23a4..b0e7db3c2 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/declaration.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/declaration.lux @@ -90,14 +90,14 @@ (phase.sub [(the [<component> ..#state]) (has [<component> ..#state])]))] - [lifted_analysis ..#analysis analysis.Operation] - [lifted_synthesis ..#synthesis synthesis.Operation] - [lifted_translation ..#translation (translation.Operation anchor expression declaration)] + [of_analysis ..#analysis analysis.Operation] + [of_synthesis ..#synthesis synthesis.Operation] + [of_translation ..#translation (translation.Operation anchor expression declaration)] ) (def .public (set_current_module module) (All (_ anchor expression declaration) (-> Module (Operation anchor expression declaration Any))) (do phase.monad - [_ (..lifted_analysis (analysis.set_current_module module))] - (..lifted_translation (translation.enter_module module)))) + [_ (..of_analysis (analysis.set_current_module module))] + (..of_translation (translation.enter_module module)))) 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 0c6da0e7b..7646655c1 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 @@ -70,7 +70,7 @@ function_term (do phase.monad - [[type analysis] (/.lifted_analysis + [[type analysis] (/.of_analysis (analysis/type.inferring (analysis archive function_term)))] (when analysis @@ -109,10 +109,10 @@ (|>> {#Done}) (function (_ _) {.#Some (do ! - [macro (/.lifted_analysis (meta.macro macro|extension))] + [macro (/.of_analysis (meta.macro macro|extension))] (when macro {.#Some macro} - (/.lifted_analysis + (/.of_analysis (do ! [expansion (analysis/macro.expansion expander macro|extension macro inputs)] (in {#More expansion}))) 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 f6da727d8..86f8c8a90 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 @@ -181,7 +181,7 @@ (def (ensure_fresh_class! class_loader name) (-> java/lang/ClassLoader External (Operation Any)) (do phase.monad - [class (phase.lifted (reflection!.load class_loader name))] + [class (phase.of_try (reflection!.load class_loader name))] (phase.assertion ..deprecated_class [name] (|> class java/lang/Class::getDeclaredAnnotations @@ -446,7 +446,7 @@ (|> objectJ ..signature (<text>.result parser.array) - phase.lifted))) + phase.of_try))) (def (primitive_array_length_handler primitive_type) (-> (Type Primitive) (-> Text Handler)) @@ -863,7 +863,7 @@ [exceptionT exceptionA] (typeA.inferring (analyse archive exceptionC)) [exception_class _] (check_object exceptionT) - ? (phase.lifted (reflection!.sub? class_loader "java.lang.Throwable" exception_class)) + ? (phase.of_try (reflection!.sub? class_loader "java.lang.Throwable" exception_class)) _ (is (Operation Any) (if ? (in []) @@ -880,7 +880,7 @@ (do phase.monad [_ (..ensure_fresh_class! class_loader class) _ (typeA.inference {.#Primitive "java.lang.Class" (list {.#Primitive class (list)})}) - _ (phase.lifted (reflection!.load class_loader class)) + _ (phase.of_try (reflection!.load class_loader class)) @ meta.location] (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] (list (/////analysis.text @ class))}])))])) @@ -896,7 +896,7 @@ [objectT objectA] (typeA.inferring (analyse archive objectC)) [object_class _] (check_object objectT) - ? (phase.lifted (reflection!.sub? class_loader object_class sub_class)) + ? (phase.of_try (reflection!.sub? class_loader object_class sub_class)) @ meta.location] (if ? (in [@ {/////analysis.#Extension [.prelude (%.format extension_name "|translation")] @@ -906,14 +906,14 @@ (def (class_candidate_parents class_loader from_name fromT to_name to_class) (-> java/lang/ClassLoader External .Type External (java/lang/Class java/lang/Object) (Operation (List [[Text .Type] Bit]))) (do [! phase.monad] - [from_class (phase.lifted (reflection!.load class_loader from_name)) - mapping (phase.lifted (reflection!.correspond from_class fromT))] + [from_class (phase.of_try (reflection!.load class_loader from_name)) + mapping (phase.of_try (reflection!.correspond from_class fromT))] (monad.each ! (function (_ superJT) (do ! - [superJT (phase.lifted (reflection!.type superJT)) + [superJT (phase.of_try (reflection!.type superJT)) .let [super_name (..reflection superJT)] - super_class (phase.lifted (reflection!.load class_loader super_name)) + super_class (phase.of_try (reflection!.load class_loader super_name)) superT (reflection_type mapping superJT)] (in [[super_name superT] (java/lang/Class::isAssignableFrom super_class to_class)]))) (when (java/lang/Class::getGenericSuperclass from_class) @@ -964,8 +964,8 @@ (not (dictionary.key? ..boxes from_name))) _ (phase.assertion ..primitives_are_not_objects [to_name] (not (dictionary.key? ..boxes to_name))) - to_class (phase.lifted (reflection!.load class_loader to_name)) - from_class (phase.lifted (reflection!.load class_loader from_name))] + to_class (phase.of_try (reflection!.load class_loader to_name)) + from_class (phase.of_try (reflection!.load class_loader from_name))] (if (java/lang/Class::isAssignableFrom from_class to_class) (loop (again [[current_name currentT] [from_name fromT]]) (if (text#= to_name current_name) @@ -1014,7 +1014,7 @@ (function (_ extension_name analyse archive [class field]) (do phase.monad [_ (..ensure_fresh_class! class_loader class) - [final? deprecated? fieldJT] (phase.lifted + [final? deprecated? fieldJT] (phase.of_try (do try.monad [class (reflection!.load class_loader class)] (reflection!.static_field field class))) @@ -1036,7 +1036,7 @@ (do phase.monad [_ (..ensure_fresh_class! class_loader class) _ (typeA.inference Any) - [final? deprecated? fieldJT] (phase.lifted + [final? deprecated? fieldJT] (phase.of_try (do try.monad [class (reflection!.load class_loader class)] (reflection!.static_field field class))) @@ -1063,7 +1063,7 @@ [_ (..ensure_fresh_class! class_loader class) [objectT objectA] (typeA.inferring (analyse archive objectC)) - [deprecated? mapping fieldJT] (phase.lifted + [deprecated? mapping fieldJT] (phase.of_try (do try.monad [class (reflection!.load class_loader class) [final? deprecated? fieldJT] (reflection!.virtual_field field class) @@ -1090,7 +1090,7 @@ [objectT objectA] (typeA.inferring (analyse archive objectC)) _ (typeA.inference objectT) - [final? deprecated? mapping fieldJT] (phase.lifted + [final? deprecated? mapping fieldJT] (phase.of_try (do try.monad [class (reflection!.load class_loader class) [final? deprecated? fieldJT] (reflection!.virtual_field field class) @@ -1153,7 +1153,7 @@ [parameters (|> (java/lang/reflect/Method::getGenericParameterTypes method) (array.list {.#None}) (monad.each try.monad reflection!.type) - phase.lifted) + phase.of_try) .let [modifiers (java/lang/reflect/Method::getModifiers method) correct_class? (java/lang/Class::isAssignableFrom class (java/lang/reflect/Method::getDeclaringClass method)) correct_method? (text#= method_name (java/lang/reflect/Method::getName method)) @@ -1187,7 +1187,7 @@ [parameters (|> (java/lang/reflect/Constructor::getGenericParameterTypes constructor) (array.list {.#None}) (monad.each try.monad reflection!.type) - phase.lifted)] + phase.of_try)] (in (and (java/lang/Object::equals class (java/lang/reflect/Constructor::getDeclaringClass constructor)) (n.= (list.size inputsJT) (list.size parameters)) (list.every? (function (_ [expectedJC actualJC]) @@ -1255,19 +1255,19 @@ (do [! phase.monad] [inputsT (|> (java/lang/reflect/Method::getGenericParameterTypes method) (array.list {.#None}) - (monad.each ! (|>> reflection!.type phase.lifted)) + (monad.each ! (|>> reflection!.type phase.of_try)) (phase#each (monad.each ! (..reflection_type mapping))) phase#conjoint) outputT (|> method ..return_type - phase.lifted + phase.of_try (phase#each (..reflection_return mapping)) phase#conjoint) .let [concrete_exceptions (..concrete_method_exceptions method)] concrete_exceptions (monad.each ! (..reflection_type mapping) concrete_exceptions) generic_exceptions (|> (java/lang/reflect/Method::getGenericExceptionTypes method) (array.list {.#None}) - (monad.each ! (|>> reflection!.type phase.lifted)) + (monad.each ! (|>> reflection!.type phase.of_try)) (phase#each (monad.each ! (..reflection_type mapping))) phase#conjoint) .let [methodT (<| (type.univ_q (dictionary.size mapping)) @@ -1298,14 +1298,14 @@ (do [! phase.monad] [inputsT (|> (java/lang/reflect/Constructor::getGenericParameterTypes constructor) (array.list {.#None}) - (monad.each ! (|>> reflection!.type phase.lifted)) + (monad.each ! (|>> reflection!.type phase.of_try)) (phase#each (monad.each ! (reflection_type mapping))) phase#conjoint) .let [concrete_exceptions (..concrete_constructor_exceptions constructor)] concrete_exceptions (monad.each ! (..reflection_type mapping) concrete_exceptions) generic_exceptions (|> (java/lang/reflect/Constructor::getGenericExceptionTypes constructor) (array.list {.#None}) - (monad.each ! (|>> reflection!.type phase.lifted)) + (monad.each ! (|>> reflection!.type phase.of_try)) (phase#each (monad.each ! (reflection_type mapping))) phase#conjoint) .let [objectT {.#Primitive (java/lang/Class::getName owner) owner_tvarsT} @@ -1391,7 +1391,7 @@ (def (method_candidate allow_inheritance? class_loader actual_class_tvars class_name actual_method_tvars method_name method_style inputsJT) (-> Bit java/lang/ClassLoader (List (Type Var)) External (List (Type Var)) Text Method_Style (List (Type Value)) (Operation Method_Signature)) (do [! phase.monad] - [class (phase.lifted (reflection!.load class_loader class_name)) + [class (phase.of_try (reflection!.load class_loader class_name)) .let [expected_class_tvars (class_type_variables class)] candidates (|> (if allow_inheritance? (all_declared_methods class) @@ -1426,7 +1426,7 @@ (def (constructor_candidate class_loader actual_class_tvars class_name actual_method_tvars inputsJT) (-> java/lang/ClassLoader (List (Type Var)) External (List (Type Var)) (List (Type Value)) (Operation Method_Signature)) (do [! phase.monad] - [class (phase.lifted (reflection!.load class_loader class_name)) + [class (phase.of_try (reflection!.load class_loader class_name)) .let [expected_class_tvars (class_type_variables class)] candidates (|> class java/lang/Class::getConstructors @@ -1559,7 +1559,7 @@ (do phase.monad [_ (..ensure_fresh_class! class_loader class_name) .let [argsT (list#each product.left argsTC)] - class (phase.lifted (reflection!.load class_loader class_name)) + class (phase.of_try (reflection!.load class_loader class_name)) _ (phase.assertion non_interface class_name (java/lang/reflect/Modifier::isInterface (java/lang/Class::getModifiers class))) [methodT deprecated? exceptionsT] (..method_candidate true class_loader class_tvars class_name method_tvars method {#Interface} argsT) @@ -2272,14 +2272,14 @@ [parent_parameters (|> parent_parameters (monad.each maybe.monad parser.var?) try.of_maybe - phase.lifted)] + phase.of_try)] (|> super_parameters (monad.each ! (..reflection_type mapping)) (at ! each (|>> (list.zipped_2 parent_parameters))))) - (phase.lifted (exception.except ..mismatched_super_parameters [parent_name expected_count actual_count])))) + (phase.of_try (exception.except ..mismatched_super_parameters [parent_name expected_count actual_count])))) {.#None} - (phase.lifted (exception.except ..unknown_super [parent_name supers]))))) + (phase.of_try (exception.except ..unknown_super [parent_name supers]))))) (def .public (with_override_mapping supers parent_type mapping) (-> (List (Type Class)) (Type Class) Mapping (Operation Mapping)) @@ -2371,7 +2371,7 @@ (-> java/lang/ClassLoader (Type Class) (Operation Aliasing)) (do phase.monad [.let [[name actual_parameters] (parser.read_class class)] - jvm_class (phase.lifted (reflection!.load class_loader name)) + jvm_class (phase.of_try (reflection!.load class_loader name)) .let [expected_parameters (|> (java/lang/Class::getTypeParameters jvm_class) (array.list {.#None}) (list#each (|>> java/lang/reflect/TypeVariable::getName)))] @@ -2397,8 +2397,8 @@ (def .public (require_complete_method_concretion class_loader supers methods) (-> java/lang/ClassLoader (List (Type Class)) (List (Overriden_Method Code)) (Operation Any)) (do [! phase.monad] - [required_abstract_methods (phase.lifted (all_abstract_methods class_loader supers)) - available_methods (phase.lifted (all_methods class_loader supers)) + [required_abstract_methods (phase.of_try (all_abstract_methods class_loader supers)) + available_methods (phase.of_try (all_methods class_loader supers)) overriden_methods (monad.each ! (function (_ [parent_type method_name strict_fp? annotations type_vars self_name arguments return exceptions @@ -2673,7 +2673,7 @@ id meta.seed] (in (..anonymous_class_name where id))) .let [selfT {.#Primitive self_name (list)}] - mock (<| phase.lifted + mock (<| phase.of_try (..mock [self_name parameters] super_class super_interfaces @@ -2681,7 +2681,7 @@ (list) (list#each (|>> {#Overriden_Method}) methods))) ... Necessary for reflection to work properly during analysis. - _ (phase.lifted (at host execute mock)) + _ (phase.of_try (at host execute mock)) mapping (typeA.check (..class_mapping parameters)) super_classT (typeA.check (luxT.check (luxT.class mapping) (..signature super_class))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/jvm.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/jvm.lux index 63c16cafa..bd02f425d 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/jvm.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/declaration/jvm.lux @@ -462,7 +462,7 @@ bodyS (when (list.size arguments) 0 (host.without_fake_parameter bodyS) _ bodyS)]) - declaration.lifted_translation + declaration.of_translation (do [! phase.monad] [constructor_argumentsG (monad.each ! (|>> product.right (translate archive)) constructor_argumentsS) @@ -536,7 +536,7 @@ bodyS (when (list.size arguments) 0 (host.without_fake_parameter bodyS) _ bodyS)]) - declaration.lifted_translation + declaration.of_translation (do [! phase.monad] [bodyG (translate archive bodyS) .let [argumentsT (list#each product.right arguments)]] @@ -561,7 +561,7 @@ bodyS (when (list.size arguments) 0 (host.without_fake_parameter bodyS) _ bodyS)]) - declaration.lifted_translation + declaration.of_translation (do [! phase.monad] [bodyG (translate archive bodyS) .let [argumentsT (list#each product.right arguments)]] @@ -586,7 +586,7 @@ (<| (let [[method_name privacy strict_floating_point? annotations method_tvars arguments returnJ exceptionsJ bodyS] method]) - declaration.lifted_translation + declaration.of_translation (do [! phase.monad] [bodyG (translate archive bodyS) .let [argumentsT (list#each product.right arguments)]] @@ -646,7 +646,7 @@ (function (_ methodC) (do phase.monad [methodA (is (Operation Analysis) - (declaration.lifted_analysis + (declaration.of_analysis (when methodC {#Constructor method} (jvm.analyse_constructor_method analyse archive selfT mapping method) @@ -663,14 +663,14 @@ {#Abstract_Method method} (jvm.analyse_abstract_method analyse archive method)))) methodS (is (Operation Synthesis) - (declaration.lifted_synthesis + (declaration.of_synthesis (synthesize archive methodA))) - dependencies (declaration.lifted_translation + dependencies (declaration.of_translation (cache.dependencies archive methodS)) methodS' (|> methodS list (<synthesis>.result ..method_synthesis) - phase.lifted) + phase.of_try) methodG (method_translation translate archive super methodS')] (in [dependencies methodG])))) @@ -836,14 +836,14 @@ (Parser <type>) (do [! <>.monad] [raw <code>.text] - (<>.lifted (<text>.result <parser> raw))))] + (<>.of_try (<text>.result <parser> raw))))] [class_declaration [External (List (Type Var))] parser.declaration'] ) (def (save_class! name bytecode dependencies) (-> Text Binary (Set unit.ID) (Operation Any)) - (declaration.lifted_translation + (declaration.of_translation (do [! phase.monad] [.let [artifact [name bytecode]] artifact_id (translation.learn_custom name dependencies) @@ -877,7 +877,7 @@ type_declaration (signature.inheritance (list#each type.signature parameters) (type.signature super) (list#each type.signature interfaces))] - mock (<| phase.lifted + mock (<| phase.of_try (..mock class_declaration super interfaces @@ -885,9 +885,9 @@ fields methods)) ... Necessary for reflection to work properly during analysis. - _ (declaration.lifted_translation + _ (declaration.of_translation (translation.execute! mock)) - parameters (declaration.lifted_analysis + parameters (declaration.of_analysis (typeA.check (jvm.parameter_types parameters))) .let [mapping (list#mix (function (_ [parameterJ parameterT] mapping) (dictionary.has (parser.name parameterJ) parameterT mapping)) @@ -903,7 +903,7 @@ methods) .let [all_dependencies (cache.all (list#each product.left methods))] bytecode (<| (at ! each (\\format.result class.format)) - phase.lifted + phase.of_try (class.class version.v6_0 (all modifier#composite class.public @@ -939,10 +939,10 @@ (<code>.tuple (<>.some ..annotation)) (<>.some jvm.method_declaration)) (function (_ phase archive [[name parameters] supers annotations method_declarations]) - (declaration.lifted_translation + (declaration.of_translation (do [! phase.monad] [bytecode (<| (at ! each (\\format.result class.format)) - phase.lifted + phase.of_try (class.class version.v6_0 (all modifier#composite class.public 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 f9df8a9c7..c024f832a 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 @@ -88,7 +88,7 @@ Type Synthesis (Operation anchor expression declaration [Type expression Any]))) - (/////declaration.lifted_translation + (/////declaration.of_translation (do phase.monad [module /////translation.module id /////translation.next @@ -106,12 +106,12 @@ analysis (the [/////declaration.#analysis /////declaration.#phase] state) synthesis ((the [/////declaration.#synthesis /////declaration.#phase] state) analysis_state) translation ((the [/////declaration.#translation /////declaration.#phase] state) analysis_state)] - [_ codeA] (<| /////declaration.lifted_analysis + [_ codeA] (<| /////declaration.of_analysis scope.with typeA.fresh (typeA.expecting type) (analysis archive codeC)) - codeS (/////declaration.lifted_synthesis + codeS (/////declaration.of_synthesis (synthesis archive codeA))] (evaluate!' archive translation type codeS))) @@ -124,7 +124,7 @@ Type Synthesis (Operation anchor expression declaration [Type expression Any]))) - (/////declaration.lifted_translation + (/////declaration.of_translation (do phase.monad [dependencies (cache/artifact.dependencies archive codeS) [interim_artifacts codeG] (/////translation.with_interim_artifacts archive @@ -137,7 +137,7 @@ _ {.#None})] - @module (phase.lifted (archive.id module archive)) + @module (phase.of_try (archive.id module archive)) @self (/////translation.learn [name @abstraction] false (list#mix set.has dependencies interim_artifacts)) [target_name value declaration] (/////translation.define! [@module @self] {.#None} [(maybe#each product.right @abstraction) codeG]) _ (/////translation.save! @self {.#None} declaration)] @@ -153,7 +153,7 @@ analysis (the [/////declaration.#analysis /////declaration.#phase] state) synthesis ((the [/////declaration.#synthesis /////declaration.#phase] state) analysis_state) translation ((the [/////declaration.#translation /////declaration.#phase] state) analysis_state)] - [_ code//type codeA] (/////declaration.lifted_analysis + [_ code//type codeA] (/////declaration.of_analysis (scope.with (typeA.fresh (when expected @@ -169,7 +169,7 @@ [codeA (<| (typeA.expecting expected) (analysis archive codeC))] (in [expected codeA])))))) - codeS (/////declaration.lifted_synthesis + codeS (/////declaration.of_synthesis (synthesis archive codeA))] (definition' archive translation name code//type codeS))) @@ -184,13 +184,13 @@ Synthesis (Operation anchor expression declaration [expression Any]))) (do phase.monad - [current_module (/////declaration.lifted_analysis meta.current_module_name)] - (/////declaration.lifted_translation + [current_module (/////declaration.of_analysis meta.current_module_name)] + (/////declaration.of_translation (do phase.monad [dependencies (cache/artifact.dependencies archive codeS) [interim_artifacts codeG] (/////translation.with_interim_artifacts archive (translation archive codeS)) - @module (phase.lifted (archive.id current_module archive)) + @module (phase.of_try (archive.id current_module archive)) @self (<learn> extension (list#mix set.has dependencies interim_artifacts)) [target_name value declaration] (/////translation.define! [@module @self] {.#None} [{.#None} codeG]) _ (/////translation.save! @self {.#None} declaration)] @@ -206,12 +206,12 @@ analysis (the [/////declaration.#analysis /////declaration.#phase] state) synthesis ((the [/////declaration.#synthesis /////declaration.#phase] state) analysis_state) translation ((the [/////declaration.#translation /////declaration.#phase] state) analysis_state)] - [_ codeA] (<| /////declaration.lifted_analysis + [_ codeA] (<| /////declaration.of_analysis scope.with typeA.fresh (typeA.expecting codeT) (analysis archive codeC)) - codeS (/////declaration.lifted_synthesis + codeS (/////declaration.of_synthesis (synthesis archive codeA))] (<partial> archive translation extension codeT codeS)))] @@ -232,7 +232,7 @@ (the [/////declaration.#synthesis /////declaration.#phase] state)] [(the [/////declaration.#translation /////declaration.#state] state) (the [/////declaration.#translation /////declaration.#phase] state)])] - _ (/////declaration.lifted_analysis + _ (/////declaration.of_analysis (do ! [_ (moduleA.override_definition [.prelude "is#"] [true {.#Default [.Analysis (analysisE.is#_extension eval "is#")]}]) _ (moduleA.override_definition [.prelude "as#"] [true {.#Default [.Analysis (analysisE.as#_extension eval "as#")]}])] @@ -242,7 +242,7 @@ (def (announce_definition! short type) (All (_ anchor expression declaration) (-> Text Type (Operation anchor expression declaration Any))) - (/////declaration.lifted_translation + (/////declaration.of_translation (/////translation.log! (format short " : " (%.type type))))) (def lux::def @@ -256,7 +256,7 @@ [_ ..refresh state phase.state .let [analysis (the [/////declaration.#analysis /////declaration.#phase] state)] - [code//type codeA] (<| /////declaration.lifted_analysis + [code//type codeA] (<| /////declaration.of_analysis typeA.fresh typeA.inferring (analysis archive valueC)) @@ -267,18 +267,18 @@ _ (undefined))] - _ (/////declaration.lifted_analysis + _ (/////declaration.of_analysis (moduleA.define short_name [(as Bit exported?) {.#Alias original}]))] (in /////declaration.no_requirements)) _ (do phase.monad [_ ..refresh - current_module (/////declaration.lifted_analysis meta.current_module_name) + current_module (/////declaration.of_analysis meta.current_module_name) .let [full_name [current_module short_name]] [type valueT value] (..definition archive full_name {.#None} valueC) [_ _ exported?] (evaluate! archive Bit exported?C) - _ (/////declaration.lifted_analysis + _ (/////declaration.of_analysis (moduleA.define short_name [(as Bit exported?) {.#Definition [type value]}])) _ (..announce_definition! short_name type)] (in /////declaration.no_requirements))))])) @@ -295,7 +295,7 @@ [..imports (function (_ phase archive imports) (do [! phase.monad] - [_ (/////declaration.lifted_analysis + [_ (/////declaration.of_analysis (monad.each ! (function (_ [module alias]) (do ! [_ (moduleA.import module)] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/jvm/host.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/jvm/host.lux index c2eafe2a2..57d0c3bbc 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/jvm/host.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/translation/jvm/host.lux @@ -1333,7 +1333,7 @@ (list#each (normalized_method global_mapping)) (monad.each ! (method_definition translate archive artifact_id))) bytecode (<| (at ! each (\\format.result class.format)) - //////.lifted + //////.of_try (class.class version.v6_0 (all modifier#composite class.public class.final) (name.internal anonymous_class_name) {.#None} diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis.lux index a840feeb8..825a2e8d6 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis.lux @@ -106,4 +106,4 @@ (-> Extender Lux Phase) (do phase.monad [synthesis (..optimization extender lux archive analysis)] - (phase.lifted (/variable.optimization synthesis)))) + (phase.of_try (/variable.optimization synthesis)))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/when.lux index 98248e985..2a9141d88 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/synthesis/when.lux @@ -297,7 +297,7 @@ path (///#in (when input (/.branch/get @ [sub_path sub_input]) - (/.branch/get @ [(list#composite path sub_path) sub_input]) + (/.branch/get @ [(list#composite sub_path path) sub_input]) _ (/.branch/get @ [path input]))))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/when.lux index 2e959853a..44ea85f03 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/js/when.lux @@ -105,7 +105,7 @@ (//runtime.tuple//left (_.i32 (.int (the member.#lefts side)))))] (method source))) valueO - (list.reversed pathP))))) + pathP)))) (def @savepoint (_.var "lux_pm_cursor_savepoint")) (def @cursor (_.var "lux_pm_cursor")) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function.lux index f009e3fe3..33135b11a 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/function.lux @@ -121,7 +121,7 @@ .let [function_class (//runtime.class_name function_context)] [fields methods instance] (..with translate archive @begin function_class environment arity bodyG) module translation.module - class (phase.lifted (class.class version.v6_0 + class (phase.of_try (class.class version.v6_0 ..modifier (name.internal function_class) {.#None} diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/when.lux index 7629e3031..04f4efff7 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm/when.lux @@ -310,7 +310,7 @@ so_far! next!))) record! - (list.reversed path))))) + path)))) (def .public (when phase archive [valueS path]) (Translator [Synthesis Path]) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/when.lux index 318fde486..d9ada6190 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/when.lux @@ -91,7 +91,7 @@ (//runtime.tuple//left (_.int (.int (the member.#lefts side)))))] (method source))) valueO - (list.reversed pathP))))) + pathP)))) (def .public (if expression archive [testS thenS elseS]) (Translator [Synthesis Synthesis Synthesis]) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/when.lux index 3bab8fc81..098cd0d48 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/when.lux @@ -95,7 +95,7 @@ [.#Right //runtime.tuple//right]))] (method source))) valueG - (list.reversed pathP))))) + pathP)))) (def @savepoint (_.var "lux_pm_savepoint")) (def @cursor (_.var "lux_pm_cursor")) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/when.lux index 9dadc3fab..b1fbb6fec 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/python/when.lux @@ -119,7 +119,7 @@ (method (_.int (.int (the member.#lefts side))) source))) valueO - (list.reversed pathP))))) + pathP)))) (def @savepoint (_.var "lux_pm_savepoint")) (def @cursor (_.var "lux_pm_cursor")) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/when.lux index 09638b0f5..1f0b1b16a 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/when.lux @@ -77,7 +77,7 @@ [.#Right //runtime.tuple::right]))] (method source))) valueO - (list.reversed pathP))))) + pathP)))) (def $savepoint (_.var "lux_pm_cursor_savepoint")) (def $cursor (_.var "lux_pm_cursor")) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/when.lux index 9e6575e64..ab9c20baa 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/ruby/when.lux @@ -117,7 +117,7 @@ (//runtime.tuple//left (_.int (.int (the member.#lefts side)))))] (method source))) valueO - (list.reversed pathP))))) + pathP)))) (def @savepoint (_.local "lux_pm_savepoint")) (def @cursor (_.local "lux_pm_cursor")) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/when.lux index 9e6baef9a..ad7e4ca51 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/scheme/when.lux @@ -75,7 +75,7 @@ [.#Right //runtime.tuple//right]))] (method source))) valueO - (list.reversed pathP))))) + pathP)))) (def @savepoint (_.var "lux_pm_cursor_savepoint")) (def @cursor (_.var "lux_pm_cursor")) 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 3068bb35a..8778ecd01 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 @@ -74,7 +74,7 @@ .let [expected (key.signature key)] _ (if (signature#= expected actual) (in []) - (<>.lifted (exception.except ..invalid_signature [expected actual]))) + (<>.of_try (exception.except ..invalid_signature [expected actual]))) it it] (in (abstraction [actual it])))) ) diff --git a/stdlib/source/library/lux/meta/compiler/phase.lux b/stdlib/source/library/lux/meta/compiler/phase.lux index d67fb5633..ee0f650f0 100644 --- a/stdlib/source/library/lux/meta/compiler/phase.lux +++ b/stdlib/source/library/lux/meta/compiler/phase.lux @@ -102,8 +102,10 @@ (All (_ e) (-> (Exception e) e Operation)) (..failure (exception.error exception parameters))) -(def .public (lifted error) - (All (_ s a) (-> (Try a) (Operation s a))) +(def .public (of_try error) + (All (_ state of) + (-> (Try of) + (Operation state of))) (function (_ state) (try#each (|>> [state]) error))) diff --git a/stdlib/source/library/lux/meta/extension.lux b/stdlib/source/library/lux/meta/extension.lux index 9d43881f1..1f1569c5b 100644 --- a/stdlib/source/library/lux/meta/extension.lux +++ b/stdlib/source/library/lux/meta/extension.lux @@ -1,58 +1,57 @@ -(.`` (.`` (.require - [library - [lux (.except) - [abstract - ["[0]" monad]] - [control - ["<>" parser (.use "[1]#[0]" monad)]] - [data - ["[0]" product] - [collection - ["[0]" list (.use "[1]#[0]" functor)]]] - [meta - ["@" target (.only) - (.,, (.for "JVM" - [jvm - ["_" bytecode (.only Bytecode)]] +(.`` (.require + [library + [lux (.except) + [abstract + ["[0]" monad]] + [control + ["<>" parser (.use "[1]#[0]" monad)]] + [data + ["[0]" product] + [collection + ["[0]" list (.use "[1]#[0]" functor)]]] + [meta + ["@" target (.only) + (.,, (.for "JVM" + [jvm + ["_" bytecode (.only Bytecode)]] - ... else - [/]))] - ["[0]" code (.only) - ["<c>" \\parser (.only Parser)]] - [macro (.only with_symbols) - [syntax (.only syntax)] - ["[0]" template]] - [compiler - ["[0]" phase] - [language - [lux - ["[0]" analysis (.only) - ["<a>" \\parser]] - ["[0]" synthesis (.only) - ["<s>" \\parser]] - ["[0]" translation] - ["[0]" declaration] - [phase - [translation - (.,, (.for "JVM" - ["[0]" jvm - ["[1]" runtime]] + ... else + [/]))] + ["[0]" code (.only) + ["<c>" \\parser (.only Parser)]] + [macro (.only with_symbols) + [syntax (.only syntax)] + ["[0]" template]] + [compiler + ["[0]" phase] + [language + [lux + ["[0]" analysis (.only) + ["<a>" \\parser]] + ["[0]" synthesis (.only) + ["<s>" \\parser]] + ["[0]" translation] + ["[0]" declaration] + [phase + [translation + (.,, (.for "{old}" + ["[0]" jvm + ["[1]" runtime]] - "JavaScript" - ["[0]" js - ["[1]" runtime]] + "JVM" + ["[0]" jvm + ["[1]" runtime]] - "Lua" - ["[0]" lua - ["[1]" runtime]] - - "Python" - ["[0]" python - ["[1]" runtime]] - - "Ruby" - ["[0]" ruby - ["[1]" runtime]]))]]]]]]]]))) + ... else + [/])) + ["[0]" js + ["[1]" runtime]] + ["[0]" lua + ["[1]" runtime]] + ["[0]" python + ["[1]" runtime]] + ["[0]" ruby + ["[1]" runtime]]]]]]]]]])) (with_template [<any> <end> <and> <result> <name> <extension_type> <handler_type>] [(def .public <name> diff --git a/stdlib/source/library/lux/meta/macro/syntax/definition.lux b/stdlib/source/library/lux/meta/macro/syntax/definition.lux index 6c58ff992..5fdd016f9 100644 --- a/stdlib/source/library/lux/meta/macro/syntax/definition.lux +++ b/stdlib/source/library/lux/meta/macro/syntax/definition.lux @@ -70,7 +70,7 @@ me_raw (|> raw expansion.total (meta.result compiler) - <>.lifted)] + <>.of_try)] (<| (<code>.locally me_raw) <code>.form (<>.after (<code>.this_symbol ..extension)) @@ -95,5 +95,5 @@ (in []) {.#Right _} - (<>.lifted (exception.except ..lacks_type [definition])))] + (<>.of_try (exception.except ..lacks_type [definition])))] (in definition))) diff --git a/stdlib/source/library/lux/meta/type.lux b/stdlib/source/library/lux/meta/type.lux index a024a45bc..da2463a52 100644 --- a/stdlib/source/library/lux/meta/type.lux +++ b/stdlib/source/library/lux/meta/type.lux @@ -474,7 +474,7 @@ (-> Lux (Parser Typed)) (do <>.monad [it <code>.any - type_check (<>.lifted (meta.result lux (expansion.complete it)))] + type_check (<>.of_try (meta.result lux (expansion.complete it)))] (<| (<code>.locally type_check) <code>.form (<>.after (<code>.this (` .is#))) diff --git a/stdlib/source/library/lux/meta/type/row.lux b/stdlib/source/library/lux/meta/type/row.lux index 3d3ac324d..b33924a27 100644 --- a/stdlib/source/library/lux/meta/type/row.lux +++ b/stdlib/source/library/lux/meta/type/row.lux @@ -151,7 +151,7 @@ (` (, record_slot))))))))) (list.zipped_2 slots slots')) ))))) - (meta.lifted (exception.except ..cannot_repeat_slot_names [slot_names])))))) + (meta.of_try (exception.except ..cannot_repeat_slot_names [slot_names])))))) (def .public the (syntax (_ [slot ?code.symbol @@ -210,7 +210,7 @@ ..#extra (, extra)])) {.#None} - (meta.lifted (exception.except ..missing_level [level])))) + (meta.of_try (exception.except ..missing_level [level])))) (` []) (|> (dictionary.size levels) list.indices |