From a97927ff14998e3c5baab2982e302861b3ea0f7d Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 13 Feb 2024 02:09:57 -0400 Subject: [PATCH] Exponentiation for multiple numbers and primality testing. --- lux-ruby/source/program.lux | 4 +- stdlib/source/documentation/lux.lux | 4 +- .../source/documentation/lux/data/binary.lux | 4 +- stdlib/source/documentation/lux/data/text.lux | 2 +- stdlib/source/documentation/lux/meta.lux | 8 +- .../meta/compiler/language/lux/analysis.lux | 6 +- .../lux/meta/{location.lux => provenance.lux} | 4 +- stdlib/source/injection/lux/data/binary.lux | 13 +- stdlib/source/library/lux.lux | 154 +++++++++--------- .../source/library/lux/abstract/comonad.lux | 4 +- stdlib/source/library/lux/abstract/monad.lux | 6 +- .../source/library/lux/concurrency/event.lux | 7 +- .../source/library/lux/concurrency/thread.lux | 7 +- stdlib/source/library/lux/control/error.lux | 4 +- .../control/function/polymorphism/aspect.lux | 11 +- stdlib/source/library/lux/control/maybe.lux | 4 +- .../source/library/lux/control/projection.lux | 4 +- .../library/lux/data/collection/array.lux | 6 +- .../lux/data/collection/dictionary.lux | 4 +- .../data/collection/dictionary/ordered.lux | 8 +- .../library/lux/data/collection/list.lux | 4 +- .../lux/data/collection/list/property.lux | 4 +- .../library/lux/data/collection/queue.lux | 4 +- .../lux/data/collection/queue/priority.lux | 4 +- .../lux/data/collection/set/ordered.lux | 4 +- .../lux/data/collection/tree/zipper.lux | 8 +- .../source/library/lux/data/format/json.lux | 13 +- stdlib/source/library/lux/data/format/tar.lux | 8 +- stdlib/source/library/lux/debug.lux | 18 +- stdlib/source/library/lux/documentation.lux | 40 ++--- .../library/lux/documentation/remember.lux | 7 +- stdlib/source/library/lux/ffi.lux | 16 +- stdlib/source/library/lux/math.lux | 36 ++-- .../library/lux/math/arithmetic/modular.lux | 2 +- .../library/lux/math/number/decimal.lux | 4 +- .../library/lux/math/number/fraction.lux | 40 +++-- stdlib/source/library/lux/math/number/i64.lux | 4 +- .../library/lux/math/number/integer.lux | 27 +++ .../library/lux/math/number/natural.lux | 73 ++++++++- .../library/lux/math/number/rational.lux | 75 ++++++--- stdlib/source/library/lux/meta.lux | 10 +- stdlib/source/library/lux/meta/binding.lux | 6 +- .../source/library/lux/meta/binding/local.lux | 4 +- stdlib/source/library/lux/meta/code.lux | 12 +- .../lux/meta/compiler/default/init.lux | 6 +- .../meta/compiler/language/lux/analysis.lux | 66 ++++---- .../lux/meta/compiler/language/lux/phase.lux | 4 - .../compiler/language/lux/phase/analysis.lux | 10 +- .../language/lux/phase/analysis/complex.lux | 10 +- .../language/lux/phase/analysis/function.lux | 2 +- .../language/lux/phase/analysis/simple.lux | 4 +- .../language/lux/phase/analysis/when.lux | 40 ++--- .../language/lux/phase/declaration.lux | 2 +- .../lux/phase/extension/analysis/js.lux | 24 +-- .../lux/phase/extension/analysis/jvm.lux | 76 ++++----- .../lux/phase/extension/analysis/lua.lux | 26 +-- .../lux/phase/extension/analysis/lux.lux | 16 +- .../lux/phase/extension/analysis/python.lux | 24 +-- .../lux/phase/extension/analysis/ruby.lux | 20 +-- .../lux/phase/extension/synthesis/lux.lux | 4 +- .../phase/extension/translation/jvm/host.lux | 4 +- .../language/lux/phase/synthesis/function.lux | 4 +- .../language/lux/phase/synthesis/when.lux | 6 +- .../lux/phase/translation/c++/when.lux | 4 +- .../phase/translation/common_lisp/runtime.lux | 3 +- .../language/lux/phase/translation/jvm.lux | 2 +- .../lux/phase/translation/lua/runtime.lux | 2 +- .../lux/phase/translation/php/runtime.lux | 3 +- .../lux/phase/translation/r/runtime.lux | 3 +- .../lux/meta/compiler/language/lux/syntax.lux | 56 +++---- .../meta/compiler/language/lux/synthesis.lux | 4 +- .../compiler/language/lux/translation.lux | 2 +- .../library/lux/meta/compiler/meta/export.lux | 6 +- .../library/lux/meta/compiler/target/js.lux | 2 +- .../library/lux/meta/compiler/target/lua.lux | 2 +- .../library/lux/meta/compiler/target/php.lux | 2 +- .../lux/meta/compiler/target/python.lux | 2 +- .../library/lux/meta/compiler/target/ruby.lux | 2 +- .../library/lux/meta/macro/expansion.lux | 6 +- .../lux/meta/macro/syntax/definition.lux | 8 +- stdlib/source/library/lux/meta/module.lux | 4 +- .../lux/meta/{location.lux => provenance.lux} | 22 +-- stdlib/source/library/lux/meta/type.lux | 8 +- .../source/library/lux/meta/type/function.lux | 4 +- .../source/library/lux/meta/type/record.lux | 6 +- stdlib/source/library/lux/test/benchmark.lux | 7 +- stdlib/source/library/lux/test/property.lux | 8 +- .../source/library/lux/{world => }/time.lux | 0 .../library/lux/{world => }/time/date.lux | 0 .../library/lux/{world => }/time/day.lux | 0 .../library/lux/{world => }/time/duration.lux | 0 .../library/lux/{world => }/time/instant.lux | 0 .../library/lux/{world => }/time/month.lux | 0 .../library/lux/{world => }/time/solar.lux | 0 .../library/lux/{world => }/time/year.lux | 0 .../source/library/lux/web/css/property.lux | 3 +- stdlib/source/library/lux/web/css/value.lux | 2 +- .../source/library/lux/web/html/attribute.lux | 4 +- stdlib/source/library/lux/world/file.lux | 9 +- .../source/library/lux/world/file/watch.lux | 5 +- stdlib/source/library/lux/world/logging.lux | 6 +- .../library/lux/world/net/http/cookie.lux | 15 +- .../polytypic/lux/abstract/equivalence.lux | 13 +- .../source/polytypic/lux/data/format/json.lux | 13 +- stdlib/source/program/aedifex/input.lux | 4 +- stdlib/source/projection/lux/data/binary.lux | 13 +- stdlib/source/projection/lux/meta/code.lux | 4 +- stdlib/source/projection/lux/program.lux | 4 +- stdlib/source/test/lux.lux | 8 +- stdlib/source/test/lux/abstract/interval.lux | 4 +- stdlib/source/test/lux/concurrency/async.lux | 7 +- stdlib/source/test/lux/concurrency/thread.lux | 7 +- .../source/test/lux/control/function/memo.lux | 7 +- .../control/function/polymorphism/aspect.lux | 2 +- stdlib/source/test/lux/data/binary.lux | 21 ++- stdlib/source/test/lux/data/format/json.lux | 13 +- stdlib/source/test/lux/data/format/tar.lux | 7 +- stdlib/source/test/lux/debug.lux | 8 +- .../test/lux/documentation/remember.lux | 9 +- .../source/test/lux/math/number/fraction.lux | 37 ++++- .../source/test/lux/math/number/integer.lux | 86 +++++----- .../source/test/lux/math/number/natural.lux | 101 ++++++++++-- .../source/test/lux/math/number/rational.lux | 69 ++++++-- stdlib/source/test/lux/meta.lux | 50 +++--- stdlib/source/test/lux/meta/binding.lux | 18 +- stdlib/source/test/lux/meta/binding/local.lux | 6 +- stdlib/source/test/lux/meta/code.lux | 8 +- .../meta/compiler/language/lux/analysis.lux | 56 +++---- .../lux/phase/translation/jvm/complex.lux | 14 +- .../translation/jvm/function/abstract.lux | 1 - .../jvm/function/field/variable/count.lux | 1 - .../lux/phase/translation/jvm/reference.lux | 1 - .../lux/meta/compiler/language/lux/syntax.lux | 18 +- .../test/lux/meta/compiler/meta/import.lux | 6 +- stdlib/source/test/lux/meta/extension.lux | 12 +- stdlib/source/test/lux/meta/label.lux | 6 +- stdlib/source/test/lux/meta/macro.lux | 6 +- .../test/lux/meta/macro/syntax/definition.lux | 6 +- stdlib/source/test/lux/meta/module.lux | 6 +- stdlib/source/test/lux/meta/module/import.lux | 6 +- .../lux/meta/{location.lux => provenance.lux} | 14 +- stdlib/source/test/lux/meta/type/row.lux | 9 +- stdlib/source/test/lux/test/benchmark.lux | 5 +- stdlib/source/test/lux/{world => }/time.lux | 0 .../source/test/lux/{world => }/time/date.lux | 0 .../source/test/lux/{world => }/time/day.lux | 0 .../test/lux/{world => }/time/duration.lux | 0 .../test/lux/{world => }/time/instant.lux | 0 .../test/lux/{world => }/time/month.lux | 0 .../test/lux/{world => }/time/solar.lux | 0 .../source/test/lux/{world => }/time/year.lux | 0 stdlib/source/test/lux/world.lux | 2 - stdlib/source/test/lux/world/file.lux | 5 +- .../test/lux/world/finance/interest/rate.lux | 2 +- stdlib/source/test/lux/world/logging.lux | 5 +- .../source/test/lux/world/net/http/cookie.lux | 7 +- .../test/lux/world/net/http/version.lux | 10 +- .../unsafe/lux/data/collection/array.lux | 6 +- 158 files changed, 1098 insertions(+), 872 deletions(-) rename stdlib/source/documentation/lux/meta/{location.lux => provenance.lux} (85%) rename stdlib/source/library/lux/meta/{location.lux => provenance.lux} (81%) rename stdlib/source/library/lux/{world => }/time.lux (100%) rename stdlib/source/library/lux/{world => }/time/date.lux (100%) rename stdlib/source/library/lux/{world => }/time/day.lux (100%) rename stdlib/source/library/lux/{world => }/time/duration.lux (100%) rename stdlib/source/library/lux/{world => }/time/instant.lux (100%) rename stdlib/source/library/lux/{world => }/time/month.lux (100%) rename stdlib/source/library/lux/{world => }/time/solar.lux (100%) rename stdlib/source/library/lux/{world => }/time/year.lux (100%) rename stdlib/source/test/lux/meta/{location.lux => provenance.lux} (81%) rename stdlib/source/test/lux/{world => }/time.lux (100%) rename stdlib/source/test/lux/{world => }/time/date.lux (100%) rename stdlib/source/test/lux/{world => }/time/day.lux (100%) rename stdlib/source/test/lux/{world => }/time/duration.lux (100%) rename stdlib/source/test/lux/{world => }/time/instant.lux (100%) rename stdlib/source/test/lux/{world => }/time/month.lux (100%) rename stdlib/source/test/lux/{world => }/time/solar.lux (100%) rename stdlib/source/test/lux/{world => }/time/year.lux (100%) diff --git a/lux-ruby/source/program.lux b/lux-ruby/source/program.lux index 126f287c85..02a71ab440 100644 --- a/lux-ruby/source/program.lux +++ b/lux-ruby/source/program.lux @@ -865,13 +865,13 @@ (monad.each ! (|>> (ffi.is java/lang/Object) ..read)))]) (when inputs ... It seems that org/jruby/runtime/Block::call can misbehave when getting called with a Lux state value. - (list info source location current_module modules scopes type_context expected seed scope_type_vars extensions eval host) + (list info source provenance current_module modules scopes type_context expected seed scope_type_vars extensions eval host) (when partial_application (list partial/0 partial/1) (in (..to_host ((as (-> Any Any Any Any) phase) partial/0 partial/1 - [info source location current_module modules scopes type_context expected seed scope_type_vars extensions eval host]))) + [info source provenance current_module modules scopes type_context expected seed scope_type_vars extensions eval host]))) _ (exception.except ..invaid_phase_application [partial_application inputs])) diff --git a/stdlib/source/documentation/lux.lux b/stdlib/source/documentation/lux.lux index 6817ec1efd..55507a29fe 100644 --- a/stdlib/source/documentation/lux.lux +++ b/stdlib/source/documentation/lux.lux @@ -83,8 +83,8 @@ ($.definition /.Type "This type represents the data-structures that are used to specify types themselves.") - ($.definition /.Location - "Locations are for specifying the location of Code nodes in Lux files during compilation.") + ($.definition /.Provenance + "Provenances are for specifying the provenance of Code nodes in Lux files during compilation.") ($.definition (/.Annotated meta_data datum) "The type of things that can be annotated with meta-data of arbitrary types.") diff --git a/stdlib/source/documentation/lux/data/binary.lux b/stdlib/source/documentation/lux/data/binary.lux index 722dd0b060..eba0537e6d 100644 --- a/stdlib/source/documentation/lux/data/binary.lux +++ b/stdlib/source/documentation/lux/data/binary.lux @@ -41,7 +41,7 @@ ($.definition \\projection.set_elements_are_not_unique) ($.definition \\projection.name) ($.definition \\projection.type) - ($.definition \\projection.location) + ($.definition \\projection.provenance) ($.definition \\projection.code) ($.definition \\projection.segment @@ -151,7 +151,7 @@ ($.definition \\injection.set) ($.definition \\injection.name) ($.definition \\injection.type) - ($.definition \\injection.location) + ($.definition \\injection.provenance) ($.definition \\injection.code) ($.definition \\injection.segment diff --git a/stdlib/source/documentation/lux/data/text.lux b/stdlib/source/documentation/lux/data/text.lux index 04b6058842..3329fbb039 100644 --- a/stdlib/source/documentation/lux/data/text.lux +++ b/stdlib/source/documentation/lux/data/text.lux @@ -33,7 +33,7 @@ ($.definition \\injection.ratio) ($.definition \\injection.name) - ($.definition \\injection.location) + ($.definition \\injection.provenance) ($.definition \\injection.code) ($.definition \\injection.type) diff --git a/stdlib/source/documentation/lux/meta.lux b/stdlib/source/documentation/lux/meta.lux index 9e44c2a799..db95bc446d 100644 --- a/stdlib/source/documentation/lux/meta.lux +++ b/stdlib/source/documentation/lux/meta.lux @@ -14,7 +14,7 @@ ["[0]" /]] ["[0]" / ["[1][0]" code] - ["[1][0]" location] + ["[1][0]" provenance] ["[1][0]" name] ["[1][0]" type] ["[1][0]" macro] @@ -110,8 +110,8 @@ "All the tags associated with a type definition." ($.example (' (tags_of type_name)))) - ($.definition /.location - "The location of the current expression being analyzed.") + ($.definition /.provenance + "The provenance of the current expression being analyzed.") ($.definition /.expected_type "The expected type of the current expression being analyzed.") @@ -196,7 +196,7 @@ ../compiler /code.documentation - /location.documentation + /provenance.documentation /name.documentation /type.documentation /macro.documentation diff --git a/stdlib/source/documentation/lux/meta/compiler/language/lux/analysis.lux b/stdlib/source/documentation/lux/meta/compiler/language/lux/analysis.lux index 41f5fe40c0..ccc74d770c 100644 --- a/stdlib/source/documentation/lux/meta/compiler/language/lux/analysis.lux +++ b/stdlib/source/documentation/lux/meta/compiler/language/lux/analysis.lux @@ -98,7 +98,7 @@ ($.definition /.Bundle) ($.definition /.with_source_code) ($.definition /.with_current_module) - ($.definition /.with_location) + ($.definition /.with_provenance) ($.definition /.failure) ($.definition /.except) ($.definition /.assertion) @@ -106,8 +106,8 @@ ($.definition /.set_state) ($.definition /.set_source_code) ($.definition /.set_current_module) - ($.definition /.set_location) - ($.definition /.location) + ($.definition /.set_provenance) + ($.definition /.provenance) ($.definition /.source) ($.definition /.info) ($.definition /.state) diff --git a/stdlib/source/documentation/lux/meta/location.lux b/stdlib/source/documentation/lux/meta/provenance.lux similarity index 85% rename from stdlib/source/documentation/lux/meta/location.lux rename to stdlib/source/documentation/lux/meta/provenance.lux index 8e2e48c20f..a778b43b98 100644 --- a/stdlib/source/documentation/lux/meta/location.lux +++ b/stdlib/source/documentation/lux/meta/provenance.lux @@ -18,10 +18,10 @@ ($.definition /.injection) ($.definition /.here - "The Location of the current form." + "The Provenance of the current form." ($.example (' (here)))) ($.definition /.with "" - ($.example (' (with location error)))) + ($.example (' (with provenance error)))) )) diff --git a/stdlib/source/injection/lux/data/binary.lux b/stdlib/source/injection/lux/data/binary.lux index 94e4efc2a4..7e2ee015ff 100644 --- a/stdlib/source/injection/lux/data/binary.lux +++ b/stdlib/source/injection/lux/data/binary.lux @@ -29,10 +29,9 @@ [meta [macro ["[0]" template]]] - [world - [time - ["[0]" instant (.only Instant)] - ["[0]" duration (.only Duration)]]]]] + [time + ["[0]" instant (.only Instant)] + ["[0]" duration (.only Duration)]]]] ["[0]" \\unsafe (.only Binary)] ["" \\projection (.only Offset Size)]) @@ -311,8 +310,8 @@ [10 .#Named (..and ..name again)])) ))))))) -(the .public location - (Injection Location) +(the .public provenance + (Injection Provenance) (all ..and ..text ..natural @@ -324,7 +323,7 @@ (..rec (function (_ again) (let [sequence (..list again)] - (..and ..location + (..and ..provenance (function (_ altV) (`` (when altV (,, (template.with [ ] diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index 3063bdf0e9..f25b60a609 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -1,7 +1,7 @@ ... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. ... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. -(.def# location#dummy +(.def# provenance#dummy ["" 0 0] #0) @@ -297,26 +297,26 @@ (.def# #Reification (..tag [{#Some [9 #0 ..type_tags]} Type]) #1) (.def# #Named (..tag [{#Some [9 #1 ..type_tags]} Type]) #1) -... (every .public Location +... (every .public Provenance ... (Record ... [#module Text ... #line Natural ... #column Natural])) -(.def# Location +(.def# Provenance (.is# Type - {#Named [..prelude "Location"] + {#Named [..prelude "Provenance"] {#Product Text {#Product Natural Natural}}}) #1) -(.def# location_slots +(.def# provenance_slots (.is# {#Reification Name List} {#Item [..prelude "#module"] {#Item [..prelude "#line"] {#Item [..prelude "#column"] {#End}}}}) #0) -(.def# #module (slot [{#Some [0 #0 ..location_slots]} Location]) #1) -(.def# #line (slot [{#Some [1 #0 ..location_slots]} Location]) #1) -(.def# #column (slot [{#Some [1 #1 ..location_slots]} Location]) #1) +(.def# #module (slot [{#Some [0 #0 ..provenance_slots]} Provenance]) #1) +(.def# #line (slot [{#Some [1 #0 ..provenance_slots]} Provenance]) #1) +(.def# #column (slot [{#Some [1 #1 ..provenance_slots]} Provenance]) #1) ... (every .public (Annotated m v) ... (Record @@ -422,11 +422,11 @@ (.def# #Tuple (tag [{#Some [8 #1 ..code'_tags]} Code']) #1) ... (every .public Code -... (Annotated Location (Code' (Annotated Location)))) +... (Annotated Provenance (Code' (Annotated Provenance)))) (.def# Code (.is# Type {#Named [..prelude "Code"] - (.when# (.is# Type {#Reification Location Annotated}) + (.when# (.is# Type {#Reification Provenance Annotated}) w {#Reification {#Reification w Code'} w})}) #1) @@ -448,10 +448,10 @@ #1) (.def# annotated - (.is# {#Function {#Reification {#Reification Location Annotated} Code'} + (.is# {#Function {#Reification {#Reification Provenance Annotated} Code'} Code} (.function# _ data - [location#dummy data])) + [provenance#dummy data])) #0) (.def# as_bit @@ -684,11 +684,11 @@ (.def# #Right (tag [{#Some [0 #1 ..either_tags]} Either]) .public) ... (every .public Source -... [Location Natural Text]) +... [Provenance Natural Text]) (.def# Source (.is# Type {#Named [..prelude "Source"] - {#Product Location {#Product Natural Text}}}) + {#Product Provenance {#Product Natural Text}}}) .public) ... (every .public Module_State @@ -859,7 +859,7 @@ ... (Record ... [#info Info ... #source Source -... #location Location +... #provenance Provenance ... #current_module (Maybe Text) ... #modules (List [Text Module]) ... #scopes (List Scope) @@ -884,8 +884,8 @@ ... source Source {#Product - ... location - Location + ... provenance + Provenance {#Product ... current_module {#Reification Text Maybe} @@ -924,7 +924,7 @@ (.is# {#Reification Name List} {#Item [..prelude "#info"] {#Item [..prelude "#source"] - {#Item [..prelude "#location"] + {#Item [..prelude "#provenance"] {#Item [..prelude "#current_module"] {#Item [..prelude "#modules"] {#Item [..prelude "#scopes"] @@ -939,7 +939,7 @@ #0) (.def# #info (slot [{#Some [0 #0 ..lux_slots]} Lux]) .public) (.def# #source (slot [{#Some [1 #0 ..lux_slots]} Lux]) .public) -(.def# #location (slot [{#Some [2 #0 ..lux_slots]} Lux]) .public) +(.def# #provenance (slot [{#Some [2 #0 ..lux_slots]} Lux]) .public) (.def# #current_module (slot [{#Some [3 #0 ..lux_slots]} Lux]) .public) (.def# #modules (slot [{#Some [4 #0 ..lux_slots]} Lux]) .public) (.def# #scopes (slot [{#Some [5 #0 ..lux_slots]} Lux]) .public) @@ -1425,7 +1425,7 @@ (.when# lux [..#info _ ..#source _ ..#current_module _ ..#modules _ ..#scopes scopes ..#type_context _ ..#host _ - ..#seed _ ..#expected _ ..#location _ ..#extensions _ + ..#seed _ ..#expected _ ..#provenance _ ..#extensions _ ..#scope_type_vars _ ..#eval _] (list#mix (function'' [scope verdict] (.when# verdict @@ -1662,8 +1662,8 @@ [#1] #1 [#0] (any? p xs')))) -(def' .private (with_location @ content) - (-> Location Code +(def' .private (with_provenance @ content) + (-> Provenance Code Code) (let' [[module line column] @] (as_tuple (list (as_tuple (list (as_text module) (as_natural line) (as_natural column))) @@ -1955,7 +1955,7 @@ (let' [[module name] full_name [..#info info ..#source source ..#current_module _ ..#modules modules ..#scopes scopes ..#type_context types ..#host host - ..#seed seed ..#expected expected ..#location location ..#extensions extensions + ..#seed seed ..#expected expected ..#provenance provenance ..#extensions extensions ..#scope_type_vars scope_type_vars ..#eval _eval] state] (.when# (property#value module modules) {#Some [..#module_hash _ ..#module_aliases _ ..#definitions definitions ..#imports _ ..#module_state _]} @@ -1988,7 +1988,7 @@ (def' .private (untemplated_text value) (-> Text Code) - (with_location ..location#dummy + (with_provenance ..provenance#dummy (as_variant (list (as_name [..prelude "#Text"]) (as_text value))))) (def' .public UnQuote @@ -2042,7 +2042,7 @@ ($ Maybe Type)) (let' [[..#info info ..#source source ..#current_module _ ..#modules modules ..#scopes scopes ..#type_context types ..#host host - ..#seed seed ..#expected expected ..#location location ..#extensions extensions + ..#seed seed ..#expected expected ..#provenance provenance ..#extensions extensions ..#scope_type_vars scope_type_vars ..#eval _eval] state] (list#one (.is# (-> Scope ($ Maybe Type)) (function' [env] @@ -2084,7 +2084,7 @@ ..#host host ..#seed seed ..#expected expected - ..#location location + ..#provenance provenance ..#extensions extensions ..#scope_type_vars scope_type_vars ..#eval _eval] state] @@ -2251,7 +2251,7 @@ (.when# state [..#info info ..#source source ..#current_module current_module ..#modules modules ..#scopes scopes ..#type_context types ..#host host - ..#seed seed ..#expected expected ..#location location ..#extensions extensions + ..#seed seed ..#expected expected ..#provenance provenance ..#extensions extensions ..#scope_type_vars scope_type_vars ..#eval _eval] (.when# current_module {#Some module_name} @@ -2273,7 +2273,7 @@ (meta#in name))) (def' .private (untemplated_composite tag @composite untemplated replace? subst elements) - (-> Text Location (-> Bit Text Code ($ Meta Code)) Bit Text ($ List Code) + (-> Text Provenance (-> Bit Text Code ($ Meta Code)) Bit Text ($ List Code) ($ Meta Code)) (do meta#monad [.let' [cons (.is# (-> Code Code ($ Meta Code)) @@ -2309,22 +2309,22 @@ (do meta#monad [=elements (monad#each#meta (untemplated replace? subst) elements)] (in (untemplated_list =elements)))) - .let' [[_ output'] (with_location ..location#dummy + .let' [[_ output'] (with_provenance ..provenance#dummy (as_variant (list (as_name [..prelude tag]) output)))]] (in [@composite output']))) (def' .private untemplated_form - (-> Location (-> Bit Text Code ($ Meta Code)) Bit Text ($ List Code) + (-> Provenance (-> Bit Text Code ($ Meta Code)) Bit Text ($ List Code) ($ Meta Code)) (untemplated_composite "#Form")) (def' .private untemplated_variant - (-> Location (-> Bit Text Code ($ Meta Code)) Bit Text ($ List Code) + (-> Provenance (-> Bit Text Code ($ Meta Code)) Bit Text ($ List Code) ($ Meta Code)) (untemplated_composite "#Variant")) (def' .private untemplated_tuple - (-> Location (-> Bit Text Code ($ Meta Code)) Bit Text ($ List Code) + (-> Provenance (-> Bit Text Code ($ Meta Code)) Bit Text ($ List Code) ($ Meta Code)) (untemplated_composite "#Tuple")) @@ -2333,23 +2333,23 @@ ($ Meta Code)) (.when# [replace? token] [_ [@token {#Bit value}]] - (meta#in (with_location ..location#dummy + (meta#in (with_provenance ..provenance#dummy (as_variant (list (as_name [..prelude "#Bit"]) (as_bit value))))) [_ [@token {#Natural value}]] - (meta#in (with_location ..location#dummy + (meta#in (with_provenance ..provenance#dummy (as_variant (list (as_name [..prelude "#Natural"]) (as_natural value))))) [_ [@token {#Integer value}]] - (meta#in (with_location ..location#dummy + (meta#in (with_provenance ..provenance#dummy (as_variant (list (as_name [..prelude "#Integer"]) (as_integer value))))) [_ [@token {#Revolution value}]] - (meta#in (with_location ..location#dummy + (meta#in (with_provenance ..provenance#dummy (as_variant (list (as_name [..prelude "#Revolution"]) (as_revolution value))))) [_ [@token {#Decimal value}]] - (meta#in (with_location ..location#dummy + (meta#in (with_provenance ..provenance#dummy (as_variant (list (as_name [..prelude "#Decimal"]) (as_decimal value))))) [_ [@token {#Text value}]] @@ -2366,11 +2366,11 @@ _ (in [module name])) .let' [[module name] real_name]] - (meta#in (with_location [module 0 0] + (meta#in (with_provenance [module 0 0] (as_variant (list (as_name [..prelude "#Name"]) (as_tuple (list (as_text module) (as_text name)))))))) [#0 [@token {#Name [module name]}]] - (meta#in (with_location @token + (meta#in (with_provenance @token (as_variant (list (as_name [..prelude "#Name"]) (as_tuple (list (as_text module) (as_text name))))))) [#1 [@composite {#Form {#Item [@name {#Name global}] parameters}}]] @@ -2838,7 +2838,7 @@ [..#info info ..#source source ..#current_module _ ..#modules modules ..#scopes scopes ..#type_context types ..#host host ..#seed seed ..#expected expected - ..#location location ..#extensions extensions + ..#provenance provenance ..#extensions extensions ..#scope_type_vars scope_type_vars ..#eval _eval] lux]) (meta#return lux (named_macro' modules current_module module name)))) @@ -2999,7 +2999,7 @@ "The expansion of the type-syntax has to yield a single element.") (def' .private (expanded_type_reification normal_type @ binding parameters) - (-> (-> Code ($ Meta Code)) Location Name ($ List Code) + (-> (-> Code ($ Meta Code)) Provenance Name ($ List Code) ($ Meta Code)) (<| (function' [lux]) (meta#let lux [binding (normal binding)]) @@ -3114,7 +3114,7 @@ ..#host host/pre ..#seed seed/pre ..#expected expected/pre - ..#location location/pre + ..#provenance provenance/pre ..#extensions extensions/pre ..#scope_type_vars scope_type_vars/pre ..#eval eval/pre] lux] @@ -3133,7 +3133,7 @@ ..#host host/pre ..#seed seed/pre ..#expected expected/pre - ..#location location/pre + ..#provenance provenance/pre ..#extensions extensions/pre ..#scope_type_vars scope_type_vars/pre ..#eval eval/pre]) @@ -3147,7 +3147,7 @@ ..#host host/post ..#seed seed/post ..#expected expected/post - ..#location location/post + ..#provenance provenance/post ..#extensions extensions/post ..#scope_type_vars scope_type_vars/post ..#eval eval/post] lux/post] @@ -3160,7 +3160,7 @@ ..#host host/post ..#seed seed/post ..#expected expected/post - ..#location location/post + ..#provenance provenance/post ..#extensions extensions/post ..#scope_type_vars scope_type_vars/post ..#eval eval/post] @@ -3240,12 +3240,12 @@ [..#info info ..#source source ..#current_module _ ..#modules modules ..#scopes scopes ..#type_context types ..#host host ..#seed seed ..#expected expected - ..#location location ..#extensions extensions + ..#provenance provenance ..#extensions extensions ..#scope_type_vars scope_type_vars ..#eval _eval] {#Right [..#info info ..#source source ..#current_module _ ..#modules modules ..#scopes scopes ..#type_context types ..#host host ..#seed (.i64_+# 1 seed) ..#expected expected - ..#location location ..#extensions extensions + ..#provenance provenance ..#extensions extensions ..#scope_type_vars scope_type_vars ..#eval _eval] (as_local (.text_composite# "__gensym__" prefix (natural#injection seed)))})) @@ -3445,7 +3445,7 @@ (.as# Macro' it)) (def' .private (total_expansion' total_expansion @name name args) - (-> (-> Code ($ Meta ($ List Code))) Location Name ($ List Code) + (-> (-> Code ($ Meta ($ List Code))) Provenance Name ($ List Code) ($ Meta ($ List Code))) (<| (function' [lux]) (meta#let lux [name' (normal name)]) @@ -3967,7 +3967,7 @@ (macro (_ tokens state) (when tokens (list else maybe) - (let ['temp (is Code [location#dummy {#Name ["" ""]}]) + (let ['temp (is Code [provenance#dummy {#Name ["" ""]}]) code (` (when (, maybe) {.#Some (, 'temp)} (, 'temp) @@ -4108,7 +4108,7 @@ (function (_ state) (let [[..#info info ..#source source ..#current_module _ ..#modules modules ..#scopes scopes ..#type_context types ..#host host - ..#seed seed ..#expected expected ..#location location ..#extensions extensions + ..#seed seed ..#expected expected ..#provenance provenance ..#extensions extensions ..#scope_type_vars scope_type_vars ..#eval _eval] state] (when (property#value name modules) {#Some module} @@ -4218,7 +4218,7 @@ (function (_ state) (let [[..#info info ..#source source ..#current_module _ ..#modules modules ..#scopes scopes ..#type_context types ..#host host - ..#seed seed ..#expected expected ..#location location ..#extensions extensions + ..#seed seed ..#expected expected ..#provenance provenance ..#extensions extensions ..#scope_type_vars scope_type_vars ..#eval _eval] state] (when expected {#Some type} @@ -4231,8 +4231,8 @@ Text (.int_char# +10)) -(the (location#injection it) - (-> Location +(the (provenance#injection it) + (-> Provenance Text) (let [... https://en.wikipedia.org/wiki/Delimiter delimiter "," @@ -4242,13 +4242,13 @@ (natural#injection line) delimiter (natural#injection column)))) -(the (location#with location error) - (-> Location Text +(the (provenance#with provenance error) + (-> Provenance Text Text) - (.text_composite# (location#injection location) \n + (.text_composite# (provenance#injection provenance) \n error)) -(the location#here +(the provenance#here (macro (_ tokens compiler) (when tokens {.#End} @@ -4261,24 +4261,24 @@ ..#host _ ..#seed _ ..#expected _ - ..#location location + ..#provenance provenance ..#extensions _ ..#scope_type_vars _ ..#eval _] compiler - [.#module module .#line line .#column column] location] + [.#module module .#line line .#column column] provenance] {.#Right [compiler - (list (` (.is .Location - [.#module (, [..location#dummy {.#Text module}]) - .#line (, [..location#dummy {.#Natural line}]) - .#column (, [..location#dummy {.#Natural column}])])))]}) + (list (` (.is .Provenance + [.#module (, [..provenance#dummy {.#Text module}]) + .#line (, [..provenance#dummy {.#Natural line}]) + .#column (, [..provenance#dummy {.#Natural column}])])))]}) _ {.#Left ..wrong_syntax}))) (the .public invalid_implementation_member Error - (location#with (location#here) - "Invalid implementation member.")) + (provenance#with (provenance#here) + "Invalid implementation member.")) (the .public implementation (macro (_ tokens) @@ -4423,8 +4423,8 @@ (the .public improper_type_definition Error - (location#with (location#here) - "Improper type definition syntax.")) + (provenance#with (provenance#here) + "Improper type definition syntax.")) (the (type_declaration it) (-> Code @@ -4780,7 +4780,7 @@ (let [[current_module modules] (when state [..#info info ..#source source ..#current_module current_module ..#modules modules ..#scopes scopes ..#type_context types ..#host host - ..#seed seed ..#expected expected ..#location location ..#extensions extensions + ..#seed seed ..#expected expected ..#provenance provenance ..#extensions extensions ..#scope_type_vars scope_type_vars ..#eval _eval] [current_module modules])] (when (property#value module modules) @@ -4916,7 +4916,7 @@ (let [[expected_module expected_proper] name [..#info info ..#source source ..#current_module _ ..#modules modules ..#scopes scopes ..#type_context types ..#host host - ..#seed seed ..#expected expected ..#location location ..#extensions extensions + ..#seed seed ..#expected expected ..#provenance provenance ..#extensions extensions ..#scope_type_vars scope_type_vars ..#eval _eval] state] (when (property#value expected_module modules) {#None} @@ -5035,7 +5035,7 @@ {#Right [compiler temp]} (let [[..#info _ ..#source _ ..#current_module _ ..#modules _ ..#scopes _ ..#type_context type_context ..#host _ - ..#seed _ ..#expected _ ..#location _ ..#extensions extensions + ..#seed _ ..#expected _ ..#provenance _ ..#extensions extensions ..#scope_type_vars _ ..#eval _eval] compiler [..#ex_counter _ ..#var_counter _ ..#var_bindings var_bindings] type_context] {#Right [compiler (clean_type var_bindings temp)]}) @@ -5710,8 +5710,8 @@ (list target)) (with_template#pattern [] - [[location { elems}] - (list [location { (list#conjoint (list#each (expansion#let' label tokens) elems))}])]) + [[provenance { elems}] + (list [provenance { (list#conjoint (list#each (expansion#let' label tokens) elems))}])]) ([#Form] [#Variant] [#Tuple]))))] @@ -5766,15 +5766,15 @@ (failure ..wrong_syntax)))) (the .public undefined - (let [location (is (Meta Location) - (function (_ compiler) - {#Right [compiler (its #location compiler)]}))] + (let [provenance (is (Meta Provenance) + (function (_ compiler) + {#Right [compiler (its #provenance compiler)]}))] (macro (_ tokens) (when tokens {#End} (do meta#monad - [location location - .let [message (.text_composite# "Undefined behavior at " (location#injection location))]] + [provenance provenance + .let [message (.text_composite# "Undefined behavior at " (provenance#injection provenance))]] (exec (.log!# (.text_composite# "WARNING: " message)) (in (list (` (..halt! (, (as_text message)))))))) diff --git a/stdlib/source/library/lux/abstract/comonad.lux b/stdlib/source/library/lux/abstract/comonad.lux index 016683fd30..192dfb4abe 100644 --- a/stdlib/source/library/lux/abstract/comonad.lux +++ b/stdlib/source/library/lux/abstract/comonad.lux @@ -13,7 +13,7 @@ [number ["n" natural]]] [meta - ["[0]" location] + ["[0]" provenance] [macro ["[0]" expansion]]]]] [// @@ -73,7 +73,7 @@ (list.reversed bindings))] (in (list (when ?name {.#Some name} - (let [name [location.dummy {.#Name ["" name]}]] + (let [name [provenance.dummy {.#Name ["" name]}]] (` (.when (, comonad) (, name) (.when (, name) diff --git a/stdlib/source/library/lux/abstract/monad.lux b/stdlib/source/library/lux/abstract/monad.lux index 262a4e60f3..9636249a90 100644 --- a/stdlib/source/library/lux/abstract/monad.lux +++ b/stdlib/source/library/lux/abstract/monad.lux @@ -5,7 +5,7 @@ [library [lux (.except all only) [meta - ["[0]" location]]]] + ["[0]" provenance]]]] [// [functor (.only Functor)]]) @@ -91,7 +91,7 @@ 'conjoint (_generated_name "'conjoint")] (let [[module proper] (name ..do) name (is (-> Text Code) - (|>> (.text_composite# module " " proper " ") [""] {.#Name} [location.dummy])) + (|>> (.text_composite# module " " proper " ") [""] {.#Name} [provenance.dummy])) body' (list#mix (is (-> [Code Code] Code Code) (function (_ binding body') (<| (_expansion#let [ (` (|> (, value) @@ -112,7 +112,7 @@ (reversed (pairs bindings)))] (in (list (when ?name {.#Some name} - (let [name [location.dummy {.#Name ["" name]}]] + (let [name [provenance.dummy {.#Name ["" name]}]] (` (.when (, monad) (, name) (.when (, name) diff --git a/stdlib/source/library/lux/concurrency/event.lux b/stdlib/source/library/lux/concurrency/event.lux index 62d7bc3e86..872926a854 100644 --- a/stdlib/source/library/lux/concurrency/event.lux +++ b/stdlib/source/library/lux/concurrency/event.lux @@ -19,10 +19,9 @@ [math [number ["n" natural]]] - [world - [time - ["[0]" instant (.only Instant) (.use "[1]#[0]" order)] - ["[0]" duration]]]]] + [time + ["[0]" instant (.only Instant) (.use "[1]#[0]" order)] + ["[0]" duration]]]] [// ["[0]" atom (.only Atom)]]) diff --git a/stdlib/source/library/lux/concurrency/thread.lux b/stdlib/source/library/lux/concurrency/thread.lux index 82d0267664..36ca354817 100644 --- a/stdlib/source/library/lux/concurrency/thread.lux +++ b/stdlib/source/library/lux/concurrency/thread.lux @@ -24,10 +24,9 @@ [macro ["[0]" expansion] ["[0]" template]]] - [world - [time - ["[0]" instant (.only Instant) (.use "[1]#[0]" order)] - ["[0]" duration]]]]] + [time + ["[0]" instant (.only Instant) (.use "[1]#[0]" order)] + ["[0]" duration]]]] [// ["[0]" atom (.only Atom)] ["[0]" event]]) diff --git a/stdlib/source/library/lux/control/error.lux b/stdlib/source/library/lux/control/error.lux index 8f3def583a..6249650328 100644 --- a/stdlib/source/library/lux/control/error.lux +++ b/stdlib/source/library/lux/control/error.lux @@ -5,10 +5,10 @@ [library [lux (.except) [meta - ["[0]" location]]]]) + ["[0]" provenance]]]]) (the .public error (macro (_ '*it lux) {.#Right [lux (list (` (is Error - (location.with (location.here) + (provenance.with (provenance.here) (,* '*it)))))]})) diff --git a/stdlib/source/library/lux/control/function/polymorphism/aspect.lux b/stdlib/source/library/lux/control/function/polymorphism/aspect.lux index 6149393add..a3728a0ed1 100644 --- a/stdlib/source/library/lux/control/function/polymorphism/aspect.lux +++ b/stdlib/source/library/lux/control/function/polymorphism/aspect.lux @@ -1,11 +1,10 @@ ... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. ... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. -... "The Different Aspects of Monads and Mixins" by Bruno C. d. S. Oliveira (.using [library [lux (.except Global - #Local #location + #Local #provenance with local global) [abstract [monad (.only do)]] @@ -72,7 +71,7 @@ (every .public Join_Point (Record - [#location Location + [#provenance Provenance #scenario Scenario])) (every .public Point_Cut @@ -81,7 +80,7 @@ (the .public (when_module ?) (-> (Predicate Text) Point_Cut) - (|>> (its [#location .#module]) + (|>> (its [#provenance .#module]) ?)) (template.with [ ] @@ -252,8 +251,8 @@ (phase archive) ,term) _ (type.inference type) - location meta.location - .let [join_point [#location location + provenance meta.provenance + .let [join_point [#provenance provenance #scenario { [it type]}]]] (when (list.one (function (_ [point_cut advice]) (if (point_cut join_point) diff --git a/stdlib/source/library/lux/control/maybe.lux b/stdlib/source/library/lux/control/maybe.lux index ca1a793f40..3defbd5808 100644 --- a/stdlib/source/library/lux/control/maybe.lux +++ b/stdlib/source/library/lux/control/maybe.lux @@ -9,9 +9,7 @@ [equivalence (.only Equivalence)] [hash (.only Hash)] ["[0]" functor (.only Functor)] - ["[0]" monad (.only Monad do)]] - [meta - ["[0]" location]]]]) + ["[0]" monad (.only Monad do)]]]]) (the template#macro (.in_module# .prelude .template#macro)) diff --git a/stdlib/source/library/lux/control/projection.lux b/stdlib/source/library/lux/control/projection.lux index f974750bda..2bfa0afcf6 100644 --- a/stdlib/source/library/lux/control/projection.lux +++ b/stdlib/source/library/lux/control/projection.lux @@ -15,7 +15,7 @@ [collection ["[0]" list (.use "[1]#[0]" functor monoid)]]] [meta - ["[0]" location] + ["[0]" provenance] [macro ["[0]" expansion]]]]]) @@ -291,7 +291,7 @@ (the .public did_not_fail Error - (location.with (location.here) + (provenance.with (provenance.here) "Expected to fail; yet succeeded.")) (the .public (not projection) diff --git a/stdlib/source/library/lux/data/collection/array.lux b/stdlib/source/library/lux/data/collection/array.lux index 2dd0f13d62..868e7a6e66 100644 --- a/stdlib/source/library/lux/data/collection/array.lux +++ b/stdlib/source/library/lux/data/collection/array.lux @@ -21,7 +21,7 @@ [number ["[0]" i64]]] [meta - ["[0]" location] + ["[0]" provenance] [type [variance (.only)]]]]] ["!" \\unsafe]) @@ -45,7 +45,7 @@ (let [natural (is (-> Natural Code) (|>> {.#Natural} - [location.dummy]))] + [provenance.dummy]))] (macro (_ elements lux) {try.#Success [lux (.list (` (|> (!.empty (, (natural (list.size elements)))) @@ -71,7 +71,7 @@ (|>> !.size)) (the .public index_out_of_bounds - (location.with (location.here) + (provenance.with (provenance.here) "Index out of bounds.")) (the .public (item index array) diff --git a/stdlib/source/library/lux/data/collection/dictionary.lux b/stdlib/source/library/lux/data/collection/dictionary.lux index 23959d3e03..6cd8b94209 100644 --- a/stdlib/source/library/lux/data/collection/dictionary.lux +++ b/stdlib/source/library/lux/data/collection/dictionary.lux @@ -24,7 +24,7 @@ ["n" natural] ["[0]" i64]]] [meta - ["[0]" location] + ["[0]" provenance] [macro ["^" pattern]]]]]) @@ -513,7 +513,7 @@ (the .public unknown_value Error - (location.with (location.here) + (provenance.with (provenance.here) "Unknown value.")) (the (node#value level hash key key_hash node) diff --git a/stdlib/source/library/lux/data/collection/dictionary/ordered.lux b/stdlib/source/library/lux/data/collection/dictionary/ordered.lux index b8bbdf1fae..386eea5b49 100644 --- a/stdlib/source/library/lux/data/collection/dictionary/ordered.lux +++ b/stdlib/source/library/lux/data/collection/dictionary/ordered.lux @@ -18,7 +18,7 @@ [number ["n" natural]]] [meta - ["[0]" location] + ["[0]" provenance] [macro ["^" pattern] ["[0]" expansion] @@ -26,7 +26,7 @@ (the invariant_violation Error - (location.with (location.here) + (provenance.with (provenance.here) "Invariant violation.")) (every Color @@ -71,7 +71,7 @@ (the .public unknown_value Error - (location.with (location.here) + (provenance.with (provenance.here) "Unknown value.")) ... TODO: Doing inneficient access of Order functions due to compiler bug. @@ -125,7 +125,7 @@ (the .public it_is_empty Error - (location.with (location.here) + (provenance.with (provenance.here) "Unknown value.")) (template.with [ ] diff --git a/stdlib/source/library/lux/data/collection/list.lux b/stdlib/source/library/lux/data/collection/list.lux index 4e614b9861..5b47704488 100644 --- a/stdlib/source/library/lux/data/collection/list.lux +++ b/stdlib/source/library/lux/data/collection/list.lux @@ -23,9 +23,7 @@ ["[0]" product]] [math [number - ["n" natural]]] - [meta - ["[0]" location]]]]) + ["n" natural]]]]]) (the with_template' (.in_module# .prelude .with_template)) (the template#macro (.in_module# .prelude .template#macro)) diff --git a/stdlib/source/library/lux/data/collection/list/property.lux b/stdlib/source/library/lux/data/collection/list/property.lux index dd8e368a79..ae909c3ef1 100644 --- a/stdlib/source/library/lux/data/collection/list/property.lux +++ b/stdlib/source/library/lux/data/collection/list/property.lux @@ -19,7 +19,7 @@ [number ["n" natural]]] [meta - ["[0]" location]]]]) + ["[0]" provenance]]]]) (the with_template' (.in_module# .prelude .with_template)) @@ -46,7 +46,7 @@ (the .public unknown_value Error - (location.with (location.here) + (provenance.with (provenance.here) "Unknown value.")) (the .public (value key properties) diff --git a/stdlib/source/library/lux/data/collection/queue.lux b/stdlib/source/library/lux/data/collection/queue.lux index cd17e3c679..9429794cb2 100644 --- a/stdlib/source/library/lux/data/collection/queue.lux +++ b/stdlib/source/library/lux/data/collection/queue.lux @@ -16,7 +16,7 @@ [number ["n" natural]]] [meta - ["[0]" location]]]]) + ["[0]" provenance]]]]) (every .public (Queue of) (Record @@ -44,7 +44,7 @@ (the .public it_is_empty Error - (location.with (location.here) + (provenance.with (provenance.here) "Empty.")) (the .public front diff --git a/stdlib/source/library/lux/data/collection/queue/priority.lux b/stdlib/source/library/lux/data/collection/queue/priority.lux index 07d6332954..191487006a 100644 --- a/stdlib/source/library/lux/data/collection/queue/priority.lux +++ b/stdlib/source/library/lux/data/collection/queue/priority.lux @@ -18,7 +18,7 @@ [number ["n" natural (.use "[1]#[0]" interval)]]] [meta - ["[0]" location] + ["[0]" provenance] [type (.only by_example) ["[0]" nominal]]]]]) @@ -51,7 +51,7 @@ (the .public it_is_empty Error - (location.with (location.here) + (provenance.with (provenance.here) "Empty.")) (the .public (front queue) diff --git a/stdlib/source/library/lux/data/collection/set/ordered.lux b/stdlib/source/library/lux/data/collection/set/ordered.lux index da1b84a33f..bf4f550523 100644 --- a/stdlib/source/library/lux/data/collection/set/ordered.lux +++ b/stdlib/source/library/lux/data/collection/set/ordered.lux @@ -15,7 +15,7 @@ [dictionary ["/" ordered]]]] [meta - ["[0]" location] + ["[0]" provenance] [type ["[0]" nominal]] [macro @@ -39,7 +39,7 @@ (the .public it_is_empty Error - (location.with (location.here) + (provenance.with (provenance.here) "Empty.")) (template.with [ ] diff --git a/stdlib/source/library/lux/data/collection/tree/zipper.lux b/stdlib/source/library/lux/data/collection/tree/zipper.lux index 2f74bc5a9e..f1002f983a 100644 --- a/stdlib/source/library/lux/data/collection/tree/zipper.lux +++ b/stdlib/source/library/lux/data/collection/tree/zipper.lux @@ -17,7 +17,7 @@ [collection ["[0]" list (.use "[1]#[0]" functor monoid)]]] [meta - ["[0]" location] + ["[0]" provenance] [macro ["[0]" template]]]]] ["[0]" // (.only Tree) (.use "[1]#[0]" functor)]) @@ -113,7 +113,7 @@ (the .public cannot_move Error - (location.with (location.here) + (provenance.with (provenance.here) "Cannot move.")) (the .public (down zipper) @@ -291,7 +291,7 @@ (the .public cannot_remove Error - (location.with (location.here) + (provenance.with (provenance.here) "Cannot remove.")) (the .public (remove zipper) @@ -316,7 +316,7 @@ (the .public cannot_insert Error - (location.with (location.here) + (provenance.with (provenance.here) "Cannot insert.")) (template.with [ ] diff --git a/stdlib/source/library/lux/data/format/json.lux b/stdlib/source/library/lux/data/format/json.lux index 80d2788f36..9ce21bcc09 100644 --- a/stdlib/source/library/lux/data/format/json.lux +++ b/stdlib/source/library/lux/data/format/json.lux @@ -40,13 +40,12 @@ [macro ["[0]" syntax] ["[0]" template]]] - [world - [time - ["[0]" instant] - ["[0]" duration] - ["[0]" date] - ["[0]" day] - ["[0]" month]]]]]) + [time + ["[0]" instant] + ["[0]" duration] + ["[0]" date] + ["[0]" day] + ["[0]" month]]]]) (template.with [ ] [(every .public diff --git a/stdlib/source/library/lux/data/format/tar.lux b/stdlib/source/library/lux/data/format/tar.lux index 069cb5796e..fafaf00ca1 100644 --- a/stdlib/source/library/lux/data/format/tar.lux +++ b/stdlib/source/library/lux/data/format/tar.lux @@ -42,11 +42,11 @@ ["[0]" expansion]] [type ["[0]" nominal]]] + [time + ["[0]" instant (.only Instant)] + ["[0]" duration]] [world - ["[0]" file] - [time - ["[0]" instant (.only Instant)] - ["[0]" duration]]]]]) + ["[0]" file]]]]) (every Size Natural) diff --git a/stdlib/source/library/lux/debug.lux b/stdlib/source/library/lux/debug.lux index f1c85434db..7d3b1e46c0 100644 --- a/stdlib/source/library/lux/debug.lux +++ b/stdlib/source/library/lux/debug.lux @@ -31,7 +31,7 @@ ["[0]" fraction (.only Fraction)]]] ["[0]" meta (.only) ["[0]" name] - ["[0]" location] + ["[0]" provenance] ["[0]" binding (.only) ["[0]" local]] ["[0]" code (.only) @@ -476,7 +476,7 @@ [Fraction fraction.as_text] [Name name.as_text] - [Location location.as_text] + [Provenance provenance.as_text] [Type type.as_text] [Code code.as_text])) @@ -586,18 +586,18 @@ Any) (|>> .log!#)) -(exception.the .public (type_hole [location type]) - (Exception [Location Type]) +(exception.the .public (type_hole [provenance type]) + (Exception [Provenance Type]) (exception.report - (list ["Location" (location.as_text location)] + (list ["Provenance" (provenance.as_text provenance)] ["Type" (type.as_text type)]))) (the .public hole (syntax.macro (_ []) (do meta.monad - [location meta.location + [provenance meta.provenance expectedT meta.expected_type] - (function.constant (exception.except ..type_hole [location expectedT]))))) + (function.constant (exception.except ..type_hole [provenance expectedT]))))) (.every Target [Text (Maybe Code)]) @@ -620,7 +620,7 @@ <>.some (<>.else (list))))]) (do [! meta.monad] - [location meta.location + [provenance meta.provenance locals local.all .let [environment (|> locals list.together @@ -643,7 +643,7 @@ (function.constant (exception.except ..unknown_local_binding [name])))) targets)))] (in (list (` (..log! (.text_composite# - (, (code.text (%.message (location.as_text location) text.new_line))) + (, (code.text (%.message (provenance.as_text provenance) text.new_line))) (exception.report (.list (,* (|> targets (list#each (function (_ [name injection]) diff --git a/stdlib/source/library/lux/documentation.lux b/stdlib/source/library/lux/documentation.lux index 6bf56bf176..d76f362d12 100644 --- a/stdlib/source/library/lux/documentation.lux +++ b/stdlib/source/library/lux/documentation.lux @@ -95,7 +95,7 @@ ))) (the (padding reference_column [_ old_line old_column] [_ new_line new_column]) - (-> Natural Location Location + (-> Natural Provenance Provenance Text) (if (n.= old_line new_line) (if (n.< old_column new_column) @@ -108,11 +108,11 @@ "" (text.together (list.repeated (n.- reference_column new_column) " ")))))) -(the (code_documentation expected_module old_location reference_column example) - (-> Text Location Natural Code - [Location Text]) +(the (code_documentation expected_module old_provenance reference_column example) + (-> Text Provenance Natural Code + [Provenance Text]) (`` (when example - [new_location {.#Name [module proper]}] + [new_provenance {.#Name [module proper]}] (let [documentation (if (text.= expected_module module) proper @@ -121,15 +121,15 @@ ... else (name.as_text [module proper]))] - [(revised .#column (n.+ (text.size documentation)) new_location) - (%.message (padding reference_column old_location new_location) + [(revised .#column (n.+ (text.size documentation)) new_provenance) + (%.message (padding reference_column old_provenance new_provenance) documentation)]) (,, (template.with [ ] - [[new_location { value}] + [[new_provenance { value}] (let [documentation (`` (|> value (,, (template.spliced ))))] - [(revised .#column (n.+ (text.size documentation)) new_location) - (%.message (padding reference_column old_location new_location) + [(revised .#column (n.+ (text.size documentation)) new_provenance) + (%.message (padding reference_column old_provenance new_provenance) documentation)])] [.#Bit [bit.as_text]] @@ -140,14 +140,14 @@ [.#Text [%.text]])) (,, (template.with [|<| |>| ] - [[group_location { members}] - (let [[group_location' members_documentation] (list#mix (function (_ part [last_location text_accum]) - (let [[member_location member_documentation] (code_documentation expected_module last_location reference_column part)] - [member_location (%.message text_accum member_documentation)])) - [(revised .#column ++ group_location) ""] - members)] - [(revised .#column ++ group_location') - (%.message (padding reference_column old_location group_location) + [[group_provenance { members}] + (let [[group_provenance' members_documentation] (list#mix (function (_ part [last_provenance text_accum]) + (let [[member_provenance member_documentation] (code_documentation expected_module last_provenance reference_column part)] + [member_provenance (%.message text_accum member_documentation)])) + [(revised .#column ++ group_provenance) ""] + members)] + [(revised .#column ++ group_provenance') + (%.message (padding reference_column old_provenance group_provenance) |<| members_documentation |>|)])] [lux/syntax.open_form lux/syntax.close_form .#Form] @@ -168,9 +168,9 @@ (Markdown Block))) (<| (md.code "clojure") (let [reference_column (..reference_column it) - [location _] it] + [provenance _] it] (|> it - (..code_documentation module (has .#column reference_column location) reference_column) + (..code_documentation module (has .#column reference_column provenance) reference_column) product.right)))) (the .public (deprecated when module) diff --git a/stdlib/source/library/lux/documentation/remember.lux b/stdlib/source/library/lux/documentation/remember.lux index 426b9a6cf2..2bb66ac956 100644 --- a/stdlib/source/library/lux/documentation/remember.lux +++ b/stdlib/source/library/lux/documentation/remember.lux @@ -20,10 +20,9 @@ [macro ["[0]" syntax] ["[0]" template]]] - [world - [time - ["[0]" instant] - ["[0]" date (.only Date) (.use "[1]#[0]" order)]]]]]) + [time + ["[0]" instant] + ["[0]" date (.only Date) (.use "[1]#[0]" order)]]]]) (exception.the .public (must_remember [deadline today message focus]) (Exception [Date Date Text (Maybe Code)]) diff --git a/stdlib/source/library/lux/ffi.lux b/stdlib/source/library/lux/ffi.lux index 9bc6ef68d8..1c3cbc1e9e 100644 --- a/stdlib/source/library/lux/ffi.lux +++ b/stdlib/source/library/lux/ffi.lux @@ -19,7 +19,7 @@ [collection ["[0]" list (.use "[1]#[0]" monoid monad mix)]]] ["[0]" meta (.only) - ["[0]" location] + ["[0]" provenance] ["[0]" code (.only) ["<[1]>" \\projection (.only Projection)]] ["[0]" macro (.only with_names) @@ -70,18 +70,18 @@ (Extension @)))) (every Analysis~ - (Annotated Location - (Analysis~' (Annotated Location)))) + (Annotated Provenance + (Analysis~' (Annotated Provenance)))) (the extension_analysis (template.macro (_ ) [(is Analysis~ - [location.dummy {5 #1 [ ]}])])) + [provenance.dummy {5 #1 [ ]}])])) (the text_analysis (template.macro (_ ) [(is Analysis~ - [location.dummy {#0 {5 #1 }}])])) + [provenance.dummy {#0 {5 #1 }}])])) (the analysis (template.macro (_ ) @@ -155,8 +155,8 @@ (Extension @)))) (every Synthesis~ - (Annotated Location - (Synthesis~' (Annotated Location)))) + (Annotated Provenance + (Synthesis~' (Annotated Provenance)))) (the text_synthesis (template.macro (_ <@> ) @@ -164,7 +164,7 @@ (the .public invalid_inputs_for_extension Error - (location.with (location.here) + (provenance.with (provenance.here) "Invalid inputs for extension.")) (the translation diff --git a/stdlib/source/library/lux/math.lux b/stdlib/source/library/lux/math.lux index c8f1fbb596..0ac6508685 100644 --- a/stdlib/source/library/lux/math.lux +++ b/stdlib/source/library/lux/math.lux @@ -16,7 +16,7 @@ ["[0]" list (.use "[1]#[0]" mix)]]] [meta [extension (.only analysis)] - ["[0]" location] + ["[0]" provenance] ["[0]" code ["<[1]>" \\projection]] [macro @@ -54,7 +54,7 @@ (when <+> [_ {.#Name [.prelude $]}] (phase#in (list#mix (function (_ left right) - [location.dummy {analysis.#Extension [.prelude $] (list left right)}]) + [provenance.dummy {analysis.#Extension [.prelude $] (list left right)}]) last prevs)) @@ -167,31 +167,31 @@ ... else (phase.except ..no_arithmetic_for [:it:])))))))))] - [+ [[.Natural (in (analysis.natural location.dummy 0)) .i64_+#|translation] - [.Integer (in (analysis.integer location.dummy +0)) .i64_+#|translation] - [.Revolution (in (analysis.revolution location.dummy .0)) .i64_+#|translation] - [.Decimal (in (analysis.decimal location.dummy +0.0)) .f64_+#|translation] + [+ [[.Natural (in (analysis.natural provenance.dummy 0)) .i64_+#|translation] + [.Integer (in (analysis.integer provenance.dummy +0)) .i64_+#|translation] + [.Revolution (in (analysis.revolution provenance.dummy .0)) .i64_+#|translation] + [.Decimal (in (analysis.decimal provenance.dummy +0.0)) .f64_+#|translation] [fraction.Number (typeA.expecting fraction.Number (phase archive (` fraction.zero))) fraction.+] [rational.Number (typeA.expecting rational.Number (phase archive (` rational.zero))) rational.+] [complex.Number (typeA.expecting complex.Number (phase archive (` complex.zero))) complex.+]]] - [- [[.Natural (in (analysis.natural location.dummy 0)) .i64_-#|translation] - [.Integer (in (analysis.integer location.dummy -0)) .i64_-#|translation] - [.Revolution (in (analysis.revolution location.dummy .0)) .i64_-#|translation] - [.Decimal (in (analysis.decimal location.dummy -0.0)) .f64_-#|translation] + [- [[.Natural (in (analysis.natural provenance.dummy 0)) .i64_-#|translation] + [.Integer (in (analysis.integer provenance.dummy -0)) .i64_-#|translation] + [.Revolution (in (analysis.revolution provenance.dummy .0)) .i64_-#|translation] + [.Decimal (in (analysis.decimal provenance.dummy -0.0)) .f64_-#|translation] [fraction.Number (typeA.expecting fraction.Number (phase archive (` fraction.zero))) fraction.-] [rational.Number (typeA.expecting rational.Number (phase archive (` rational.zero))) rational.-] [complex.Number (typeA.expecting complex.Number (phase archive (` complex.zero))) complex.-]]] - [* [[.Natural (in (analysis.natural location.dummy 1)) natural.*] - [.Integer (in (analysis.integer location.dummy +1)) .int_*#|translation] - [.Revolution (in (analysis.revolution location.dummy revolution./1)) revolution.*] - [.Decimal (in (analysis.decimal location.dummy +1.0)) .f64_*#|translation] + [* [[.Natural (in (analysis.natural provenance.dummy 1)) natural.*] + [.Integer (in (analysis.integer provenance.dummy +1)) .int_*#|translation] + [.Revolution (in (analysis.revolution provenance.dummy revolution./1)) revolution.*] + [.Decimal (in (analysis.decimal provenance.dummy +1.0)) .f64_*#|translation] [fraction.Number (typeA.expecting fraction.Number (phase archive (` fraction.one))) fraction.*] [rational.Number (typeA.expecting rational.Number (phase archive (` rational.one))) rational.*] [complex.Number (typeA.expecting complex.Number (phase archive (` complex.one))) complex.*]]] - [/ [[.Natural (in (analysis.natural location.dummy 1)) natural./] - [.Integer (in (analysis.integer location.dummy +1)) .int_/#|translation] - [.Revolution (in (analysis.revolution location.dummy revolution./1)) revolution./] - [.Decimal (in (analysis.decimal location.dummy +1.0)) .f64_/#|translation] + [/ [[.Natural (in (analysis.natural provenance.dummy 1)) natural./] + [.Integer (in (analysis.integer provenance.dummy +1)) .int_/#|translation] + [.Revolution (in (analysis.revolution provenance.dummy revolution./1)) revolution./] + [.Decimal (in (analysis.decimal provenance.dummy +1.0)) .f64_/#|translation] [fraction.Number (typeA.expecting fraction.Number (phase archive (` fraction.one))) fraction./] [rational.Number (typeA.expecting rational.Number (phase archive (` rational.one))) rational./] [complex.Number (typeA.expecting complex.Number (phase archive (` complex.one))) complex./]]] diff --git a/stdlib/source/library/lux/math/arithmetic/modular.lux b/stdlib/source/library/lux/math/arithmetic/modular.lux index 72d1186450..7b6881b18d 100644 --- a/stdlib/source/library/lux/math/arithmetic/modular.lux +++ b/stdlib/source/library/lux/math/arithmetic/modular.lux @@ -22,7 +22,7 @@ [number ["i" integer (.use "[1]#[0]" base_10)]]] [meta - ["[0]" location] + ["[0]" provenance] ["[0]" code (.only) ["<[1]>" \\projection]] [type diff --git a/stdlib/source/library/lux/math/number/decimal.lux b/stdlib/source/library/lux/math/number/decimal.lux index 2cb1ac2e53..9f6d916144 100644 --- a/stdlib/source/library/lux/math/number/decimal.lux +++ b/stdlib/source/library/lux/math/number/decimal.lux @@ -19,7 +19,7 @@ [data ["[0]" text]] [meta - ["[0]" location]]]] + ["[0]" provenance]]]] ["[0]" // ["[1][0]" i64] ["[1][0]" natural] @@ -469,7 +469,7 @@ (the .public cannot_project Error - (location.with (location.here) + (provenance.with (provenance.here) "Cannot project.")) ... https://en.wikipedia.org/wiki/Delimiter diff --git a/stdlib/source/library/lux/math/number/fraction.lux b/stdlib/source/library/lux/math/number/fraction.lux index 6082af9cfc..916f40f206 100644 --- a/stdlib/source/library/lux/math/number/fraction.lux +++ b/stdlib/source/library/lux/math/number/fraction.lux @@ -20,7 +20,6 @@ [data ["[0]" text (.use "[1]#[0]" monoid)]] [meta - ["[0]" location] ["[0]" code ["<[1]>" \\projection (.only Projection)]] [macro @@ -28,6 +27,7 @@ ["[0]" template]]]]] [// ["//" natural (.use "[1]#[0]" base_10)] + ["[0]" integer] ["[0]" decimal] [// ["[0]" unit] @@ -69,6 +69,15 @@ (in (list (` (..normal [..#numerator (, numerator) ..#denominator (, (maybe.else (' 1) ?denominator))])))))) +(template.with [,numerator ,name] + [(the .public ,name + It + (..fraction ,numerator))] + + [0 zero] + [1 one] + ) + (the .public (= parameter subject) (-> It It Bit) @@ -171,6 +180,25 @@ [..#numerator /#denominator ..#denominator /#numerator]) +... https://en.wikipedia.org/wiki/Exponentiation +... https://en.wikipedia.org/wiki/Exponentiation_by_squaring +(the .public (^ power base) + (-> Integer It + It) + (if (.int_<# +0 power) + (..reciprocal (^ (integer.opposite power) + base)) + (loop (^ [power power + base base + it ..one]) + (if (.i64_=# +0 power) + it + (^ (.i64_right# 1 power) + (* base base) + (if (.i64_=# +1 (.i64_and# 1 power)) + (* base it) + it)))))) + ... https://en.wikipedia.org/wiki/Delimiter (the .public delimiter "/") @@ -199,16 +227,6 @@ {.#None} {.#Left (text#composite "Invalid syntax for fraction: " input)})))) -(the .public zero - It - [#numerator 0 - #denominator 1]) - -(the .public one - It - [#numerator 1 - #denominator 1]) - (template.with [,name ] [(the .public (,name left right) (-> It It diff --git a/stdlib/source/library/lux/math/number/i64.lux b/stdlib/source/library/lux/math/number/i64.lux index 9d888102d7..113378ab9f 100644 --- a/stdlib/source/library/lux/math/number/i64.lux +++ b/stdlib/source/library/lux/math/number/i64.lux @@ -11,7 +11,7 @@ [control ["[0]" try (.only Try)]] [meta - ["[0]" location]]]] + ["[0]" provenance]]]] [// ["n" natural]]) @@ -231,7 +231,7 @@ (the .public invalid_width Error - (location.with (location.here) + (provenance.with (provenance.here) "Invalid width.")) (the .public (sub width) diff --git a/stdlib/source/library/lux/math/number/integer.lux b/stdlib/source/library/lux/math/number/integer.lux index b4ed8c62fd..a0ac473a28 100644 --- a/stdlib/source/library/lux/math/number/integer.lux +++ b/stdlib/source/library/lux/math/number/integer.lux @@ -109,6 +109,22 @@ [(../ param subject) (..% param subject)]) +... https://en.wikipedia.org/wiki/Exponentiation +... https://en.wikipedia.org/wiki/Exponentiation_by_squaring +(the .public (^ power base) + (-> Natural It + It) + (loop (^ [power power + base base + it +1]) + (if (.i64_=# 0 power) + it + (^ (.i64_right# 1 power) + (.int_*# base base) + (if (.i64_=# 1 (.i64_and# 1 power)) + (.int_*# base it) + it))))) + (the .public (opposite it) (-> It It) @@ -165,6 +181,7 @@ (alias [greatest_common_divisor] ..gcd) +... https://en.wikipedia.org/wiki/Coprime_integers (the .public (co_prime? a b) (-> It It Bit) @@ -317,3 +334,13 @@ (alias [octal] ..base_08) ... (alias [decimal] ..base_10) (alias [hex] ..base_16) + +(the .public (multiple? reference it) + (-> It + (Predicate It)) + (.i64_=# +0 (% reference it))) + +(the .public (divisor? reference it) + (-> It + (Predicate It)) + (.i64_=# +0 (% it reference))) diff --git a/stdlib/source/library/lux/math/number/natural.lux b/stdlib/source/library/lux/math/number/natural.lux index 3afe3375ac..ea294288fd 100644 --- a/stdlib/source/library/lux/math/number/natural.lux +++ b/stdlib/source/library/lux/math/number/natural.lux @@ -13,9 +13,10 @@ [format (.only Format)] [order (.only Order)]] [control - ["[0]" function] ["[0]" maybe] - ["[0]" try (.only Try)]]]] + ["[0]" try (.only Try)] + ["[0]" function (.only) + [predicate (.only Predicate)]]]]] [/// [arithmetic (.only Arithmetic)]]) @@ -38,6 +39,15 @@ [.i64_-# It -] ) +(with_template' [,value ,name] + [(the .public ,name + It + ,value)] + + [0 zero] + [1 one] + ) + (the high (-> (I64 Any) I64) @@ -130,6 +140,22 @@ (.integer (../ parameter subject)))] (.i64_-# flat subject))) +... https://en.wikipedia.org/wiki/Exponentiation +... https://en.wikipedia.org/wiki/Exponentiation_by_squaring +(the .public (^ power base) + (-> Natural It + It) + (loop (^ [power power + base base + it 1]) + (if (.i64_=# 0 power) + it + (^ (.i64_right# 1 power) + (* base base) + (if (.i64_=# 1 (.i64_and# 1 power)) + (* base it) + it))))) + (the .public arithmetic (Arithmetic It) (implementation @@ -138,6 +164,7 @@ (the * ..*) (the / ../))) +... https://en.wikipedia.org/wiki/Greatest_common_divisor (the .public (gcd a b) (-> It It It) @@ -145,15 +172,20 @@ 0 a _ (gcd b (..% b a)))) +(alias [greatest_common_divisor] + ..gcd) + +... https://en.wikipedia.org/wiki/Coprime_integers (the .public (co_prime? a b) (-> It It Bit) - (..= 1 (..gcd a b))) + (..= 1 (..greatest_common_divisor a b))) -(`` (the .public (lcm a b) - (-> It It - It) - (when [a b] +... https://en.wikipedia.org/wiki/Least_common_multiple +(the .public (lcm a b) + (-> It It + It) + (`` (when [a b] (,, (with_template' [] [ 0] @@ -164,6 +196,9 @@ _ (|> a (../ (..gcd a b)) (..* b))))) +(alias [least_common_multiple] + ..lcm) + (the .public even? (-> It Bit) @@ -476,3 +511,27 @@ (alias [base_08] ..octal) ... (alias [base_10] ..decimal) (alias [base_16] ..hex) + +(the .public (multiple? reference it) + (-> It + (Predicate It)) + (.i64_=# 0 (% reference it))) + +(the .public (divisor? reference it) + (-> It + (Predicate It)) + (.i64_=# 0 (% it reference))) + +... https://en.wikipedia.org/wiki/Primality_test +(the .public (prime? it) + (Predicate It) + (or (< 4 it) + (if (or (multiple? 2 it) + (multiple? 3 it)) + false + (loop (prime? [under 5]) + (or (< (* under under) it) + (if (or (divisor? it under) + (divisor? it (+ 2 under))) + false + (prime? (+ 6 under)))))))) diff --git a/stdlib/source/library/lux/math/number/rational.lux b/stdlib/source/library/lux/math/number/rational.lux index deef70e177..aaa8e17d82 100644 --- a/stdlib/source/library/lux/math/number/rational.lux +++ b/stdlib/source/library/lux/math/number/rational.lux @@ -8,8 +8,8 @@ [equivalence (.only Equivalence)] [order (.only Order)] [monoid (.only Monoid)] - [format (.only Format)] - [monad (.only do)]] + [monad (.only do)] + ["[0]" format (.only Format)]] [control ["<>" projection] ["[0]" function] @@ -22,7 +22,6 @@ ["[0]" product] ["[0]" text (.use "[1]#[0]" monoid)]] [meta - ["[0]" location] ["[0]" code (.only) ["<[1]>" \\projection]] [macro @@ -75,6 +74,19 @@ (in (list (` (..normal [..#numerator (, numerator) ..#denominator (, (maybe.else (' 1) ?denominator))])))))) +(template.with [,numerator ,name] + [(the .public ,name + It + (..rational ,numerator))] + + [+0 zero] + [+1 one] + [-1 negative] + ) + +(alias [positive] + ..one) + (the .public (= parameter subject) (-> It It Bit) @@ -181,6 +193,25 @@ (the * ..*) (the / ../))) +... https://en.wikipedia.org/wiki/Exponentiation +... https://en.wikipedia.org/wiki/Exponentiation_by_squaring +(the .public (^ power base) + (-> Integer It + It) + (if (.int_<# +0 power) + (..reciprocal (^ (//.opposite power) + base)) + (loop (^ [power power + base base + it ..one]) + (if (.i64_=# +0 power) + it + (^ (.i64_right# 1 power) + (* base base) + (if (.i64_=# +1 (.i64_and# +1 power)) + (* base it) + it)))))) + ... https://en.wikipedia.org/wiki/Delimiter (the .public delimiter fraction.delimiter) @@ -209,19 +240,6 @@ {.#None} {try.#Failure (text#composite "Invalid syntax for rational: " input)})))) -(template.with [,numerator ,name] - [(the .public ,name - It - (..rational ,numerator))] - - [+0 zero] - [+1 one] - [-1 negative] - ) - -(alias [positive] - ..one) - (template.with [,name ] [(the .public (,name left right) (-> It It @@ -238,10 +256,14 @@ It (..rational +1 (by natural.interval maximum))) -(the .public biggest +(the .public most_positive It (..rational (by //.interval maximum) 1)) +(the .public most_negative + It + (..rational (by //.interval minimum) 1)) + (template.with [,identity ,composite ,name] [(the .public ,name (Monoid It) @@ -252,8 +274,8 @@ [(..rational +0) ..+ addition] [(..rational +1) ..* multiplication] - [(..* ..positive ..biggest) ..minor minimum] - [(..* ..negative ..biggest) ..major maximum] + [..most_positive ..minor minimum] + [..most_negative ..major maximum] ) (template.with [,order ,name] @@ -277,8 +299,12 @@ (..opposite it) it)) -(alias [abs] - ..absolute) +(the .public signum + (-> It + It) + (|>> (its #numerator) + //.signum + ..rational)) (template.with [ ] [(the .public @@ -325,11 +351,6 @@ (d./ (natural.decimal (its #denominator it)) (//.decimal (its #numerator it)))) -(the .public cannot_project - Error - (location.with (location.here) - "Cannot project.")) - (template.with [ ,unit] [(the .public (-> It @@ -361,7 +382,7 @@ (try#each (|>> ..rational ))) _ - {try.#Failure ..cannot_project})))))] + {try.#Failure format.not_valid})))))] [degree as_degree of_degree unit.degree] [gradian as_gradian of_gradian unit.gradian] diff --git a/stdlib/source/library/lux/meta.lux b/stdlib/source/library/lux/meta.lux index 45f8f9d885..b704f48828 100644 --- a/stdlib/source/library/lux/meta.lux +++ b/stdlib/source/library/lux/meta.lux @@ -16,7 +16,7 @@ [list ["[0]" property]]]]]] [/ - ["[0]" location]]) + ["[0]" provenance]]) (the with_template' (.in_module# .prelude .with_template)) @@ -115,7 +115,7 @@ (-> Text (Meta of))) (function (_ lux) - {try.#Failure (location.with (its .#location lux) error)})) + {try.#Failure (provenance.with (its .#provenance lux) error)})) (the .public (assertion message test) (-> Text Bit @@ -170,10 +170,10 @@ [configuration [.#info .#configuration] (property.List Text)] ) -(the .public location - (Meta Location) +(the .public provenance + (Meta Provenance) (function (_ lux) - {try.#Success [lux (its .#location lux)]})) + {try.#Success [lux (its .#provenance lux)]})) (the .public not_expecting_any_type Error diff --git a/stdlib/source/library/lux/meta/binding.lux b/stdlib/source/library/lux/meta/binding.lux index 4b457ff899..09786584b7 100644 --- a/stdlib/source/library/lux/meta/binding.lux +++ b/stdlib/source/library/lux/meta/binding.lux @@ -22,7 +22,7 @@ ["[0]" local]] ["[0]" // (.only) ["[0]" module] - ["[0]" location] + ["[0]" provenance] ["[0]" name (.use "[1]#[0]" absolute)] ["[0]" code]]) @@ -307,7 +307,7 @@ (the .public cannot_de-alias_a_default Error - (location.with (location.here) + (provenance.with (provenance.here) "Cannot de-alias a default global.")) (the .public (resolved_globals module) @@ -403,7 +403,7 @@ (the .public not_a_macro Error - (location.with (location.here) + (provenance.with (provenance.here) "Not a macro.")) (the .public (macro full_name) diff --git a/stdlib/source/library/lux/meta/binding/local.lux b/stdlib/source/library/lux/meta/binding/local.lux index 6cbfa31997..6761dc173d 100644 --- a/stdlib/source/library/lux/meta/binding/local.lux +++ b/stdlib/source/library/lux/meta/binding/local.lux @@ -18,7 +18,7 @@ [number ["n" natural]]]]] ["[0]" /// (.only) - ["[0]" location]]) + ["[0]" provenance]]) (the with_template' (.in_module# .prelude .with_template)) @@ -96,7 +96,7 @@ (the .public no_environment Error - (location.with (location.here) + (provenance.with (provenance.here) "No local environment.")) (the .public all diff --git a/stdlib/source/library/lux/meta/code.lux b/stdlib/source/library/lux/meta/code.lux index 0316e499ee..b9f0483fe0 100644 --- a/stdlib/source/library/lux/meta/code.lux +++ b/stdlib/source/library/lux/meta/code.lux @@ -19,7 +19,7 @@ ["[0]" revolution] ["[0]" decimal]]] [meta - ["[0]" location] + ["[0]" provenance] ["[0]" name]]]]) (the with_template' (.in_module# .prelude .with_template)) @@ -37,13 +37,13 @@ ... {.#Tuple (List (w (Code' w)))}) ... (every Code -... (Annotated Location (Code' (Annotated Location)))) +... (Annotated Provenance (Code' (Annotated Provenance)))) (with_template' [ ] [(the .public ( x) (-> Code) - [location.dummy { x}])] + [provenance.dummy { x}])] [bit Bit .#Bit] [natural Natural .#Natural] @@ -60,7 +60,7 @@ (the .public (local name) (-> Text Code) - [location.dummy {.#Name ["" name]}]) + [provenance.dummy {.#Name ["" name]}]) (`` (the .public equivalence (Equivalence Code) @@ -171,8 +171,8 @@ substitute (when it (,, (with_template' [] - [[location { parts}] - [location { (list#each (replaced original substitute) parts)}]] + [[provenance { parts}] + [provenance { (list#each (replaced original substitute) parts)}]] [.#Form] [.#Variant] diff --git a/stdlib/source/library/lux/meta/compiler/default/init.lux b/stdlib/source/library/lux/meta/compiler/default/init.lux index 4689ded835..95d5be4a2d 100644 --- a/stdlib/source/library/lux/meta/compiler/default/init.lux +++ b/stdlib/source/library/lux/meta/compiler/default/init.lux @@ -76,7 +76,7 @@ (every Reader (-> Source (Either [Source Text] [Source Code]))) -(the (reader current_module aliases [location offset source_code]) +(the (reader current_module aliases [provenance offset source_code]) (-> descriptor.Module Aliases Source (///analysis.Operation Reader)) (function (_ state) {try.#Success [state (///syntax.parse source_code current_module aliases)]})) @@ -89,10 +89,10 @@ {try.#Failure error} {.#Right [source' output]} - (let [[location _] output] + (let [[provenance _] output] {try.#Success [(|> compiler (has .#source source') - (has .#location location)) + (has .#provenance provenance)) [source' output]]})))) (every (Operation a) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/analysis.lux b/stdlib/source/library/lux/meta/compiler/language/lux/analysis.lux index de0f644f99..4a205bd0ec 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/analysis.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/analysis.lux @@ -27,7 +27,7 @@ ["i" integer] ["r" revolution]]] [meta - ["[0]" location] + ["[0]" provenance] ["[0]" configuration (.only Configuration)] ["[0]" name] ["[0]" type] @@ -75,8 +75,8 @@ {#Extension (Extension @)}))) (every .public Term - (Annotated Location - (Term' (Annotated Location)))) + (Annotated Provenance + (Term' (Annotated Provenance)))) (every .public Branch (Branch' Term)) @@ -132,20 +132,20 @@ (template.with [ ] [(the .public - (template.macro ( location content) - [[location { content}]]))] + (template.macro ( provenance content) + [[provenance { content}]]))] [when ..#When] ) (the .public unit - (template.macro (unit location) - [[location {..#Simple {/simple.#Unit}}]])) + (template.macro (unit provenance) + [[provenance {..#Simple {/simple.#Unit}}]])) (template.with [ ] [(the .public - (template.macro ( location value) - [[location {..#Simple { value}}]]))] + (template.macro ( provenance value) + [[provenance {..#Simple { value}}]]))] [bit /simple.#Bit] [natural /simple.#Natural] @@ -193,9 +193,9 @@ (template.with [ ] [(the .public - (syntax.macro (_ [location .any + (syntax.macro (_ [provenance .any content .any]) - (in (list (` (.<| [(, location)] + (in (list (` (.<| [(, provenance)] {..#Reference} (, content)))))))] @@ -209,8 +209,8 @@ (template.with [ ] [(the .public - (template.macro ( location content) - [(.<| [location] + (template.macro ( provenance content) + [(.<| [provenance] {..#Structure} {} content)]))] @@ -305,33 +305,33 @@ (has .#current_module) (function.constant {.#Some name}))) -(the .public (with_location location action) +(the .public (with_provenance provenance action) (for_any (_ of) - (-> Location (Operation of) + (-> Provenance (Operation of) (Operation of))) - (if (text.= "" (product.left location)) + (if (text.= "" (product.left provenance)) action (function (_ state) - (let [old_location (its .#location state)] - (.when (action (has .#location location state)) + (let [old_provenance (its .#provenance state)] + (.when (action (has .#provenance provenance state)) {try.#Success [state' output]} - {try.#Success [(has .#location old_location state') + {try.#Success [(has .#provenance old_provenance state') output]} failure failure))))) -(the (located location error) - (-> Location Text +(the (located provenance error) + (-> Provenance Text Text) - (%.message (location.as_text location) text.new_line + (%.message (provenance.as_text provenance) text.new_line error)) (the .public (failure error) (-> Text Operation) (function (_ state) - {try.#Failure (located (its .#location state) error)})) + {try.#Failure (located (its .#provenance state) error)})) (the .public (of_try it) (for_any (_ of) @@ -340,7 +340,7 @@ (function (_ state) (.when it {try.#Failure error} - {try.#Failure (located (its .#location state) error)} + {try.#Failure (located (its .#provenance state) error)} {try.#Success it} {try.#Success [state it]}))) @@ -367,7 +367,7 @@ (.when (exception.with exception message (action state)) {try.#Failure error} - {try.#Failure (located (its .#location state) error)} + {try.#Failure (located (its .#provenance state) error)} success success))) @@ -384,24 +384,24 @@ (Operation Any)) (phase.update (has )))] - [set_source_code Source .#source value] - [set_current_module Text .#current_module {.#Some value}] - [set_location Location .#location value] + [set_source_code Source .#source value] + [set_current_module Text .#current_module {.#Some value}] + [set_provenance Provenance .#provenance value] ) -(the .public (location file) +(the .public (provenance file) (-> Text - Location) + Provenance) [file 1 0]) (the .public (source file code) (-> Text Text Source) - [(location file) 0 code]) + [(provenance file) 0 code]) (the dummy_source Source - [location.dummy 0 ""]) + [provenance.dummy 0 ""]) (the type_context Type_Context @@ -422,7 +422,7 @@ Lux) [.#info info .#source ..dummy_source - .#location location.dummy + .#provenance provenance.dummy .#current_module {.#None} .#modules (list) .#scopes (list) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase.lux index 7197c965ab..18842cac11 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase.lux @@ -14,10 +14,6 @@ ["[0]" io]] [data ["[0]" product]] - [world - [time - ["[0]" instant] - ["[0]" duration]]] [meta [macro ["[0]" template]]]]] 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 48e335031f..473c58dd00 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 @@ -20,7 +20,7 @@ ["[0]" meta (.only) ["[0]" module] ["[0]" binding] - ["[0]" location] + ["[0]" provenance] ["[0]" code] [macro ["^" pattern] @@ -173,18 +173,18 @@ Phase) (function (analysis archive code) (<| (let [[@ code'] code]) - ... The location must be set in the state for the sake + ... The provenance must be set in the state for the sake ... of having useful error messages. - (/.with_location @) + (/.with_provenance @) (`` (when code - ... The `quoted_module` value is extracted from the name's location in order to solve a problem with macro expansion. + ... The `quoted_module` value is extracted from the name's provenance in order to solve a problem with macro expansion. ... Suppose that we have 3 modules: `A`, `B`, and `C`. ... Module `A` exports a definition named `a`. ... Module `B` exports a macro named `b`, which makes a reference to `A.a` in its expansion. ... Module `C` imports module `B`, but not module `A`. It also utilizes the `B.b` macro somewhere in its code. ... Now, Module `C` has a reference to `A.a` somewhere in its code, which it cannot access because it does not import `A`. ... In order to allow macros to reference any definition their owning module can see, when programmatically generating a name, they set themselves - ... as the module in the name's location. + ... as the module in the name's provenance. ... The compiler then picks that up as the `quoted_module`, and uses it for name resolution in order to guarantee visibility of names in the expansion. [[quoted_module _line _row] {.#Name it}] (/reference.reference extender analysis archive quoted_module it) 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 47281244a1..15f008f5cb 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 @@ -113,7 +113,7 @@ (do [! phase.monad] [expectedT meta.expected_type expectedT' (/type.check (check.clean (list) expectedT)) - @ meta.location + @ meta.provenance [here _] module.current] (/.with_exception ..cannot_analyse_sum [here expectedT' lefts right? valueC] (when expectedT @@ -194,7 +194,7 @@ (do ! [inferenceT (/inference.variant lefts right? variantT) [inferredT valueA+] (/inference.general archive analyse inferenceT (list valueC)) - @ meta.location] + @ meta.provenance] (in (/.variant @ [lefts right? (|> valueA+ list.head try.trusted)]))) _ @@ -207,7 +207,7 @@ (-> Phase Type Archive (List Code) (Operation /.Term)) (<| (do [! phase.monad] - [@ meta.location]) + [@ meta.provenance]) (by ! each (|>> (/.tuple @))) (is (Operation (List /.Term))) (loop (again [membersT+ (type.flat_tuple expectedT) @@ -267,7 +267,7 @@ [membersTA (monad.each ! (|>> (analyse archive) /type.inferring) membersC) _ (/type.check (check.check expectedT (type.tuple (list#each product.left membersTA)))) - @ meta.location] + @ meta.provenance] (in (/.tuple @ (list#each product.right membersTA)))))) {.#Universal _} @@ -502,7 +502,7 @@ (do ! [inferenceT (/inference.record record_size recordT) [inferredT membersA] (/inference.general archive analyse inferenceT membersC) - @ meta.location] + @ meta.provenance] (in (/.tuple @ membersA))) _ 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 0402d7331d..fd631b7134 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 @@ -64,7 +64,7 @@ (when expectedT {.#Function :input: :output:} (<| (do ! - [@ meta.location]) + [@ meta.provenance]) (by ! each (.function (_ [scope bodyA]) [@ {/.#Abstraction (list#each (|>> (/.variable @)) (/scope.environment scope)) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/simple.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/simple.lux index b9081ade09..36f45f3be1 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/simple.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/analysis/simple.lux @@ -21,7 +21,7 @@ (Operation /.Term)) (do phase.monad [_ (/type.inference ) - @ meta.location] + @ meta.provenance] (in [@ {/.#Simple { value}}])))] [bit .Bit /simple.#Bit] @@ -36,5 +36,5 @@ (Operation /.Term) (do phase.monad [_ (/type.inference .Any) - @ meta.location] + @ meta.provenance] (in [@ {/.#Simple {/simple.#Unit}}]))) 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 b628a4065a..86b4bbd4b8 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 @@ -156,9 +156,9 @@ _ (by check.monad in [(list) (..quantified envs :it:)])))) -(the (simple_pattern_analysis type :input: location output next) - (for_any (_ a) (-> Type Type Location Pattern (Operation a) (Operation [Pattern a]))) - (/.with_location location +(the (simple_pattern_analysis type :input: provenance output next) + (for_any (_ a) (-> Type Type Provenance Pattern (Operation a) (Operation [Pattern a]))) + (/.with_provenance provenance (do phase.monad [_ (/type.check (check.check :input: type)) outputA next] @@ -223,13 +223,13 @@ (the (anonymous_variant pattern_analysis :input: pattern next - location lefts right? values) + provenance lefts right? values) (for_any (_ of) (-> (Analysis of) Type Code (Operation of) - Location Natural Bit (List Code) + Provenance Natural Bit (List Code) (Operation [Pattern of]))) - (/.with_location location + (/.with_provenance provenance (do [! phase.monad] [[@ex_var+ :input:'] (/type.check (..tuple :input:))] (.when :input:' @@ -287,8 +287,8 @@ (the (pattern_analysis :input: pattern next) Analysis (`` (.when pattern - [location {.#Name ["" name]}] - (/.with_location location + [provenance {.#Name ["" name]}] + (/.with_provenance provenance (do phase.monad [outputA (/scope.with_local [name :input:] next) @@ -296,8 +296,8 @@ (in [{/pattern.#Bind idx} outputA]))) (,, (template.with [ ] - [[location ] - (simple_pattern_analysis :input: location {/pattern.#Simple } next)] + [[provenance ] + (simple_pattern_analysis :input: provenance {/pattern.#Simple } next)] [Bit {.#Bit pattern_value} {/simple.#Bit pattern_value}] [Natural {.#Natural pattern_value} {/simple.#Natural pattern_value}] @@ -307,11 +307,11 @@ [Text {.#Text pattern_value} {/simple.#Text pattern_value}] [Any {.#Tuple {.#End}} {/simple.#Unit}])) - [location {.#Tuple (list singleton)}] + [provenance {.#Tuple (list singleton)}] (pattern_analysis :input: singleton next) - [location {.#Tuple sub_patterns}] - (/.with_location location + [provenance {.#Tuple sub_patterns}] + (/.with_provenance provenance (do [! phase.monad] [record (//complex.normal true sub_patterns) record_size,members,recordT (is (Operation (Maybe [Natural (List Code) Type])) @@ -344,18 +344,18 @@ {.#None} (..tuple_pattern_analysis pattern_analysis :input: sub_patterns next)))) - [location {.#Variant (list.partial [_ {.#Bit right?}] values)}] + [provenance {.#Variant (list.partial [_ {.#Bit right?}] values)}] (anonymous_variant pattern_analysis :input: pattern next - location 0 right? values) + provenance 0 right? values) - [location {.#Variant (list.partial [_ {.#Natural lefts}] [_ {.#Bit right?}] values)}] + [provenance {.#Variant (list.partial [_ {.#Natural lefts}] [_ {.#Bit right?}] values)}] (anonymous_variant pattern_analysis :input: pattern next - location lefts right? values) + provenance lefts right? values) - [location {.#Variant (list.partial [_ {.#Name tag}] values)}] - (/.with_location location + [provenance {.#Variant (list.partial [_ {.#Name tag}] values)}] + (/.with_provenance provenance (do phase.monad [tag (binding.normal tag) [lefts,right? variantT] (label.tag tag) @@ -397,7 +397,7 @@ {try.#Failure error} (/.failure error)) - @ meta.location] + @ meta.provenance] (in [@ {/.#When inputA [outputH outputT]}])) {.#End} 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 3c84155eca..9b084beaff 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 @@ -97,7 +97,7 @@ (//.except ..not_a_declaration [here function_term])) (//.except ..not_a_declaration [here function_term]))))) -(expansion.let [ (these [|form_location| {.#Form (list.partial [|text_location| {.#Name [..prelude "module#"]}] annotations)}])] +(expansion.let [ (these [|form_provenance| {.#Form (list.partial [|text_provenance| {.#Name [..prelude "module#"]}] annotations)}])] (the .public (phase wrapper extender expander) (for_any (_ anchor expression declaration) (-> //.Wrapper (Extender anchor expression declaration) Expander diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/js.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/js.lux index dba8ed8fe8..a21325f819 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/js.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/js.lux @@ -44,7 +44,7 @@ [lengthA (analysis/type.expecting Natural (phase archive lengthC)) _ (analysis/type.inference (type (array.Array' :read: :write:))) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list lengthA)}]))))])) @@ -61,7 +61,7 @@ [arrayA (analysis/type.expecting (type (array.Array' :read: :write:)) (phase archive arrayC)) _ (analysis/type.inference Natural) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list arrayA)}]))))])) @@ -80,7 +80,7 @@ arrayA (analysis/type.expecting (type (array.Array' :read: :write:)) (phase archive arrayC)) _ (analysis/type.inference :read:) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list indexA arrayA)}]))))])) @@ -101,7 +101,7 @@ arrayA (analysis/type.expecting (type (array.Array' :read: :write:)) (phase archive arrayC)) _ (analysis/type.inference (type (array.Array' :read: :write:))) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list indexA valueA arrayA)}]))))])) @@ -120,7 +120,7 @@ arrayA (analysis/type.expecting (type (array.Array' :read: :write:)) (phase archive arrayC)) _ (analysis/type.inference (type (array.Array' :read: :write:))) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list indexA arrayA)}]))))])) @@ -143,7 +143,7 @@ (phase archive constructorC)) inputsA (monad.each ! (|>> (phase archive) (analysis/type.expecting Any)) inputsC) _ (analysis/type.inference .Any) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list.partial constructorA inputsA)}])))])) @@ -156,7 +156,7 @@ [objectA (analysis/type.expecting Any (phase archive objectC)) _ (analysis/type.inference .Any) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list (analysis.text @ fieldC) objectA)}])))])) @@ -171,7 +171,7 @@ (phase archive objectC)) inputsA (monad.each ! (|>> (phase archive) (analysis/type.expecting Any)) inputsC) _ (analysis/type.inference .Any) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list.partial (analysis.text @ methodC) objectA @@ -197,7 +197,7 @@ (function (_ extension phase archive name) (do phase.monad [_ (analysis/type.inference Any) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list (analysis.text @ name))}])))])) @@ -211,7 +211,7 @@ (phase archive abstractionC)) inputsA (monad.each ! (|>> (phase archive) (analysis/type.expecting Any)) inputsC) _ (analysis/type.inference Any) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list.partial abstractionA inputsA)}])))])) @@ -224,7 +224,7 @@ [objectA (analysis/type.expecting Any (phase archive objectC)) _ (analysis/type.inference .Text) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list objectA)}])))])) @@ -239,7 +239,7 @@ (phase archive abstractionC)) _ (analysis/type.inference (for .js ffi.Function Any)) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list (analysis.natural @ arity) abstractionA)}])))])) 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 82f4c6fe3a..d5296818dd 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 @@ -499,7 +499,7 @@ ..reflection) (list)}) (analyse archive arrayC)) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list arrayA)}])))])) @@ -519,7 +519,7 @@ :read: (typeA.check (check.clean (list) :read:)) :write: (typeA.check (check.clean (list) :write:)) arrayJT (jvm_array_type (.type (array.Array' :read: :write:))) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list (analysis.text @ (..signature arrayJT)) arrayA)}]))))])) @@ -535,7 +535,7 @@ (analyse archive lengthC)) _ (typeA.inference {.#Nominal (|> (jvm.array primitive_type) ..reflection) (list)}) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list lengthA)}])))])) @@ -555,7 +555,7 @@ {.#None} (analysis.except ..non_array expectedT)) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list (analysis.text @ (..signature elementJT)) lengthA)}])))])) @@ -742,7 +742,7 @@ arrayA (<| (typeA.expecting {.#Nominal (|> (jvm.array jvm_type) ..reflection) (list)}) (analyse archive arrayC)) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list idxA arrayA)}])))])) @@ -764,7 +764,7 @@ :read: (typeA.check (check.clean (list) :read:)) :write: (typeA.check (check.clean (list) :write:)) arrayJT (jvm_array_type (.type (array.Array' :read: :write:))) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list (analysis.text @ (..signature arrayJT)) idxA @@ -786,7 +786,7 @@ (analyse archive valueC)) arrayA (<| (typeA.expecting array_type) (analyse archive arrayC)) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list idxA valueA @@ -812,7 +812,7 @@ :read: (typeA.check (check.clean (list) :read:)) :write: (typeA.check (check.clean (list) :write:)) arrayJT (jvm_array_type (.type (array.Array' :read: :write:))) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list (analysis.text @ (..signature arrayJT)) idxA @@ -872,7 +872,7 @@ [expectedT meta.expected_type [_ :object:] (check_object expectedT) _ (typeA.inference :object:) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list)}])))])) @@ -886,7 +886,7 @@ [objectT objectA] (typeA.inferring (analyse archive objectC)) _ (check_object objectT) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list objectA)}])))])) @@ -900,7 +900,7 @@ (analyse archive monitorC)) _ (check_object monitorT) exprA (analyse archive exprC) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list monitorA exprA)}])))])) @@ -920,7 +920,7 @@ (if ? (in []) (analysis.except non_throwable exception_class))) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list exceptionA)}])))])) @@ -934,7 +934,7 @@ [_ (..ensure_fresh_class! class_loader class) _ (typeA.inference {.#Nominal "java.lang.Class" (list {.#Nominal class (list)})}) _ (phase.of_try (reflection!.load class_loader class)) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list (analysis.text @ class))}])))])) @@ -951,7 +951,7 @@ (analyse archive objectC)) [object_class _] (check_object objectT) ? (phase.of_try (reflection!.sub? class_loader object_class sub_class)) - @ meta.location] + @ meta.provenance] (if ? (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list (analysis.text @ sub_class) objectA)}]) @@ -1048,7 +1048,7 @@ _ false))))))) - @ meta.location] + @ meta.provenance] (if can_cast? (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list (analysis.text @ from_name) @@ -1086,7 +1086,7 @@ (not deprecated?)) fieldT (reflection_type luxT.fresh fieldJT) _ (typeA.inference fieldT) - @ meta.location] + @ meta.provenance] (in (<| [@] {analysis.#Extension [.prelude (%.message extension_name "|translation")]} (list (analysis.text @ class) (analysis.text @ field) @@ -1112,7 +1112,7 @@ fieldT (reflection_type luxT.fresh fieldJT) valueA (<| (typeA.expecting fieldT) (analyse archive valueC)) - @ meta.location] + @ meta.provenance] (in (<| [@] {analysis.#Extension [.prelude (%.message extension_name "|translation")]} (list (analysis.text @ class) (analysis.text @ field) @@ -1139,7 +1139,7 @@ (not deprecated?)) fieldT (reflection_type mapping fieldJT) _ (typeA.inference fieldT) - @ meta.location] + @ meta.provenance] (in (<| [@] {analysis.#Extension [.prelude (%.message extension_name "|translation")]} (list (analysis.text @ class) (analysis.text @ field) @@ -1170,7 +1170,7 @@ fieldT (reflection_type mapping fieldJT) valueA (<| (typeA.expecting fieldT) (analyse archive valueC)) - @ meta.location] + @ meta.provenance] (in (<| [@] {analysis.#Extension [.prelude (%.message extension_name "|translation")]} (list (analysis.text @ class) (analysis.text @ field) @@ -1591,7 +1591,7 @@ (.tuple (<>.and ..type .any))) (the (decorate_inputs @ typesT inputsA) - (-> Location (List (Type Value)) (List analysis.Term) + (-> Provenance (List (Type Value)) (List analysis.Term) (List analysis.Term)) (|> inputsA (list.zipped_2 (list#each (|>> ..signature (analysis.text @)) typesT)) @@ -1616,7 +1616,7 @@ (not (its #deprecated? method_candidate))) [outputT argsA] (inference.general archive analyse method_type (list#each product.right argsTC)) outputJT (check_return outputT) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list.partial (analysis.text @ (..signature (jvm.class (list) class))) (analysis.text @ method) @@ -1644,7 +1644,7 @@ _ (undefined))] outputJT (check_return outputT) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list.partial (analysis.text @ (..signature (jvm.class (list) class))) (analysis.text @ method) @@ -1673,7 +1673,7 @@ _ (undefined))] outputJT (check_return outputT) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list.partial (analysis.text @ (..signature (jvm.class (list) class))) (analysis.text @ method) @@ -1708,7 +1708,7 @@ _ (undefined))] outputJT (check_return outputT) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list.partial (analysis.text @ (..signature (jvm.class (list) class_name))) (analysis.text @ method) @@ -1730,7 +1730,7 @@ _ (phase.assertion ..deprecated_method [class ..constructor_method method_type] (not (its #deprecated? method_candidate))) [outputT argsA] (inference.general archive analyse method_type (list#each product.right argsTC)) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list.partial (analysis.text @ (..signature (jvm.class (list) class))) (decorate_inputs @ argsT argsA))}])))])) @@ -1770,19 +1770,19 @@ (.tuple (<>.and .text ..type))) (the (annotation_parameter_analysis @ [name value]) - (-> Location (Annotation_Parameter analysis.Term) + (-> Provenance (Annotation_Parameter analysis.Term) analysis.Term) (analysis.tuple @ (list (analysis.text @ name) value))) (the (annotation_analysis @ [name parameters]) - (-> Location (Annotation analysis.Term) + (-> Provenance (Annotation analysis.Term) analysis.Term) (analysis.tuple @ (list.partial (analysis.text @ name) (list#each (annotation_parameter_analysis @) parameters)))) (template.with [ ] [(the ( @) - (-> Location (Type ) + (-> Provenance (Type ) analysis.Term) (|>> ..signature (analysis.text @)))] @@ -1793,12 +1793,12 @@ ) (the (typed_analysis @ [type term]) - (-> Location (Typed analysis.Term) + (-> Provenance (Typed analysis.Term) analysis.Term) (analysis.tuple @ (list (value_analysis @ type) term))) (the (argument_analysis @ [argument argumentJT]) - (-> Location Argument + (-> Provenance Argument analysis.Term) (<| (analysis.tuple @) (list (analysis.text @ argument) @@ -1911,7 +1911,7 @@ (.then ..visibility' .text)) (the .public (visibility_analysis @ visibility) - (-> Location Visibility + (-> Provenance Visibility analysis.Term) (analysis.text @ (when visibility {#Public} ..public_tag @@ -1984,7 +1984,7 @@ parameters)] (in [name parametersA]))) annotations) - @ meta.location] + @ meta.provenance] (in (analysis.tuple @ (list (analysis.text @ ..abstract_tag) (analysis.text @ method_name) (visibility_analysis @ visibility) @@ -2093,7 +2093,7 @@ {analysis.#Extension name (list#each with_fake_parameter parameters)})]) (the .public (hidden_method_body @ arity bodyA) - (-> Location Natural analysis.Term + (-> Provenance Natural analysis.Term analysis.Term) (<| (analysis.tuple @) (list (analysis.unit @)) @@ -2171,7 +2171,7 @@ (typeA.expecting .Any) scope.with) .let [arity (list.size arguments)] - @ meta.location] + @ meta.provenance] (in (analysis.tuple @ (list (analysis.text @ ..constructor_tag) (visibility_analysis @ visibility) (analysis.bit @ strict_fp?) @@ -2275,7 +2275,7 @@ (typeA.expecting :return:) scope.with) .let [arity (list.size arguments)] - @ meta.location] + @ meta.provenance] (in (analysis.tuple @ (list (analysis.text @ ..virtual_tag) (analysis.text @ method_name) (visibility_analysis @ visibility) @@ -2354,7 +2354,7 @@ (list#mix scope.with_local (analyse archive body)) (typeA.expecting :return:) scope.with) - @ meta.location] + @ meta.provenance] (in (analysis.tuple @ (list (analysis.text @ ..static_tag) (analysis.text @ method_name) (visibility_analysis @ visibility) @@ -2485,7 +2485,7 @@ (typeA.expecting :return:) scope.with) .let [arity (list.size arguments)] - @ meta.location] + @ meta.provenance] (in (analysis.tuple @ (list (analysis.text @ ..overriden_tag) (class_analysis @ parent_type) (analysis.text @ method_name) @@ -2876,7 +2876,7 @@ .let [supers {.#Item super_class super_interfaces}] _ (..require_complete_method_concretion class_loader supers methods) methodsA (monad.each ! (analyse_overriden_method analyse archive selfT mapping supers) methods) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (%.message extension_name "|translation")] (list (class_analysis @ super_class) (analysis.tuple @ (list#each (class_analysis @) super_interfaces)) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lua.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lua.lux index d225dd4b66..c2db75f1fd 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lua.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/lua.lux @@ -58,7 +58,7 @@ [lengthA (analysis/type.expecting Natural (phase archive lengthC)) _ (analysis/type.inference (type (array.Array' :read: :write:))) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list lengthA)}]))))])) @@ -75,7 +75,7 @@ [arrayA (analysis/type.expecting (type (array.Array' :read: :write:)) (phase archive arrayC)) _ (analysis/type.inference Natural) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list arrayA)}]))))])) @@ -94,7 +94,7 @@ arrayA (analysis/type.expecting (type (array.Array' :read: :write:)) (phase archive arrayC)) _ (analysis/type.inference :read:) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list indexA arrayA)}]))))])) @@ -115,7 +115,7 @@ arrayA (analysis/type.expecting (type (array.Array' :read: :write:)) (phase archive arrayC)) _ (analysis/type.inference (type (array.Array' :read: :write:))) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list indexA valueA arrayA)}]))))])) @@ -134,7 +134,7 @@ arrayA (analysis/type.expecting (type (array.Array' :read: :write:)) (phase archive arrayC)) _ (analysis/type.inference (type (array.Array' :read: :write:))) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list indexA arrayA)}]))))])) @@ -156,7 +156,7 @@ [objectA (analysis/type.expecting ..Object (phase archive objectC)) _ (analysis/type.inference .Any) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list (analysis.text @ fieldC) objectA)}])))])) @@ -171,7 +171,7 @@ (phase archive objectC)) inputsA (monad.each ! (|>> (phase archive) (analysis/type.expecting Any)) inputsC) _ (analysis/type.inference .Any) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list.partial (analysis.text @ methodC) objectA @@ -195,7 +195,7 @@ [inputA (analysis/type.expecting (type ) (phase archive inputC)) _ (analysis/type.inference (type )) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list inputA)}])))]))] @@ -216,7 +216,7 @@ (function (_ extension phase archive name) (do phase.monad [_ (analysis/type.inference Any) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list (analysis.text @ name))}])))])) @@ -230,7 +230,7 @@ (phase archive abstractionC)) inputsA (monad.each ! (|>> (phase archive) (analysis/type.expecting Any)) inputsC) _ (analysis/type.inference Any) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list.partial abstractionA inputsA)}])))])) @@ -245,7 +245,7 @@ baseA (analysis/type.expecting Decimal (phase archive baseC)) _ (analysis/type.inference Decimal) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list powerA baseA)}])))])) @@ -256,7 +256,7 @@ (function (_ extension phase archive name) (do phase.monad [_ (analysis/type.inference ..Object) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list (analysis.text @ name))}])))])) @@ -270,7 +270,7 @@ abstractionA (analysis/type.expecting (-> inputT Any) (phase archive abstractionC)) _ (analysis/type.inference ..Function) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list (analysis.natural @ arity) abstractionA)}])))])) 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 50ce1ae0be..2701119121 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 @@ -97,7 +97,7 @@ (<| (typeA.expecting argT) (analysis archive argC))) (list.zipped_2 inputsT+ args)) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (..translation extension_name) argsA}])) (analysis.except ..incorrect_arity [num_expected num_actual])))))) @@ -131,7 +131,7 @@ (|>> (analysis archive) (typeA.expecting input)) args) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension [.prelude (next extension_name)] argsA}])))) ... TODO: Get rid of this ASAP @@ -170,7 +170,7 @@ conditionals) else (<| (typeA.expecting expectedT) (phase archive else)) - @ meta.location] + @ meta.provenance] (in (|> conditionals (list#each (.function (_ [cases branch]) (<| (analysis.tuple @) @@ -199,7 +199,7 @@ (.function (_ [@var :var:])) (do [! phase.monad] [_ (typeA.inference (type (Either Text :var:))) - @ meta.location] + @ meta.provenance] (|> opC (analysis archive) (typeA.expecting (type (-> .Any :var:))) @@ -310,7 +310,7 @@ {.#Definition [type _]} (do ! [_ (typeA.inference type) - @ meta.location] + @ meta.provenance] (in (analysis.constant @ def_name))) {.#Default it} @@ -333,7 +333,7 @@ {.#Some [local_type local_reference]} (do ! [_ (typeA.inference local_type) - @ meta.location] + @ meta.provenance] (in (analysis.variable @ local_reference))) {.#None} @@ -346,7 +346,7 @@ (.function (_ extension_name phase archive []) (do phase.monad [_ (typeA.inference Natural) - @ meta.location] + @ meta.provenance] (in (analysis.natural @ (++ (.universe#))))))])) (the when @@ -378,7 +378,7 @@ (do phase.monad [.let [[numerator denominator] (,normal [numerator denominator])] _ (typeA.inference ,type) - @ meta.location] + @ meta.provenance] (in (analysis.tuple @ (list (,numerator_analysis @ numerator) (analysis.natural @ denominator))))))]))] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/python.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/python.lux index 509224cc63..40476c0f15 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/python.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/python.lux @@ -43,7 +43,7 @@ [lengthA (analysis/type.expecting Natural (phase archive lengthC)) _ (analysis/type.inference (type (array.Array' :read: :write:))) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list lengthA)}]))))])) @@ -60,7 +60,7 @@ [arrayA (analysis/type.expecting (type (array.Array' :read: :write:)) (phase archive arrayC)) _ (analysis/type.inference Natural) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list arrayA)}]))))])) @@ -79,7 +79,7 @@ arrayA (analysis/type.expecting (type (array.Array' :read: :write:)) (phase archive arrayC)) _ (analysis/type.inference :read:) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list indexA arrayA)}]))))])) @@ -100,7 +100,7 @@ arrayA (analysis/type.expecting (type (array.Array' :read: :write:)) (phase archive arrayC)) _ (analysis/type.inference (type (array.Array' :read: :write:))) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list indexA valueA arrayA)}]))))])) @@ -119,7 +119,7 @@ arrayA (analysis/type.expecting (type (array.Array' :read: :write:)) (phase archive arrayC)) _ (analysis/type.inference (type (array.Array' :read: :write:))) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list indexA arrayA)}]))))])) @@ -157,7 +157,7 @@ [objectA (analysis/type.expecting ..Object (phase archive objectC)) _ (analysis/type.inference .Any) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list (analysis.text @ fieldC) objectA)}])))])) @@ -172,7 +172,7 @@ (phase archive objectC)) inputsA (monad.each ! (|>> (phase archive) (analysis/type.expecting Any)) inputsC) _ (analysis/type.inference .Any) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list.partial (analysis.text @ methodC) objectA @@ -193,7 +193,7 @@ (function (_ extension phase archive name) (do phase.monad [_ (analysis/type.inference Any) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list (analysis.text @ name))}])))])) @@ -204,7 +204,7 @@ (function (_ extension phase archive name) (do phase.monad [_ (analysis/type.inference ..Object) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list (analysis.text @ name))}])))])) @@ -218,7 +218,7 @@ (phase archive abstractionC)) inputsA (monad.each ! (|>> (phase archive) (analysis/type.expecting Any)) inputsC) _ (analysis/type.inference Any) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list.partial abstractionA inputsA)}])))])) @@ -232,7 +232,7 @@ abstractionA (analysis/type.expecting (-> inputT Any) (phase archive abstractionC)) _ (analysis/type.inference ..Function) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list (analysis.natural @ arity) abstractionA)}])))])) @@ -248,7 +248,7 @@ globalsA (analysis/type.expecting ..Dict (phase archive globalsC)) _ (analysis/type.inference .Any) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list codeA globalsA)}])))])) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/ruby.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/ruby.lux index 4850dd6081..3d28a223e2 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/ruby.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/ruby.lux @@ -44,7 +44,7 @@ [lengthA (<| (analysis/type.expecting Natural) (phase archive lengthC)) _ (analysis/type.inference (type (array.Array' :read: :write:))) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list lengthA)}]))))])) @@ -61,7 +61,7 @@ [arrayA (<| (analysis/type.expecting (type (array.Array' :read: :write:))) (phase archive arrayC)) _ (analysis/type.inference Natural) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list arrayA)}]))))])) @@ -80,7 +80,7 @@ arrayA (<| (analysis/type.expecting (type (array.Array' :read: :write:))) (phase archive arrayC)) _ (analysis/type.inference :read:) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list indexA arrayA)}]))))])) @@ -101,7 +101,7 @@ arrayA (<| (analysis/type.expecting (type (array.Array' :read: :write:))) (phase archive arrayC)) _ (analysis/type.inference (type (array.Array' :read: :write:))) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list indexA valueA arrayA)}]))))])) @@ -120,7 +120,7 @@ arrayA (<| (analysis/type.expecting (type (array.Array' :read: :write:))) (phase archive arrayC)) _ (analysis/type.inference (type (array.Array' :read: :write:))) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list indexA arrayA)}]))))])) @@ -154,7 +154,7 @@ [objectA (<| (analysis/type.expecting ..Object) (phase archive objectC)) _ (analysis/type.inference .Any) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list (analysis.text @ fieldC) objectA)}])))])) @@ -169,7 +169,7 @@ (phase archive objectC)) inputsA (monad.each ! (|>> (phase archive) (analysis/type.expecting Any)) inputsC) _ (analysis/type.inference .Any) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list.partial (analysis.text @ methodC) objectA @@ -190,7 +190,7 @@ (function (_ extension phase archive name) (do phase.monad [_ (analysis/type.inference Any) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list (analysis.text @ name))}])))])) @@ -204,7 +204,7 @@ (phase archive abstractionC)) inputsA (monad.each ! (|>> (phase archive) (analysis/type.expecting Any)) inputsC) _ (analysis/type.inference Any) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list.partial abstractionA inputsA)}])))])) @@ -215,7 +215,7 @@ (function (_ extension phase archive name) (do phase.monad [_ (analysis/type.inference Bit) - @ meta.location] + @ meta.provenance] (in [@ {analysis.#Extension (/.translation extension) (list (analysis.text @ name))}])))])) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/synthesis/lux.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/synthesis/lux.lux index 0c605fd6a8..b27d849563 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/synthesis/lux.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/synthesis/lux.lux @@ -12,7 +12,7 @@ ["[0]" list (.use "[1]#[0]" monad)] ["[0]" dictionary]]] [meta - ["[0]" location] + ["[0]" provenance] ["[0]" name] [macro ["[0]" template]]]]] @@ -57,7 +57,7 @@ (function (_ synthesis archive parts) (do [! phase.monad] [parts (monad.each ! (synthesis archive) parts)] - (in [location.dummy {synthesis.#Extension translation (flat_text_composite translation parts)}]))))) + (in [provenance.dummy {synthesis.#Extension translation (flat_text_composite translation parts)}]))))) (the .public bundle Bundle 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 d435077c64..4225ff4ee0 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 @@ -28,7 +28,7 @@ ["n" natural] ["[0]" i32]]] [meta - ["[0]" location] + ["[0]" provenance] [macro ["^" pattern] ["[0]" template] @@ -1260,7 +1260,7 @@ local_mapping (|> environment list.enumeration (list#each (function (_ [foreign_id capture]) - [(synthesis.foreign location.dummy foreign_id) + [(synthesis.foreign provenance.dummy foreign_id) (|> global_mapping (dictionary.value capture) try.trusted)])) 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 a1fa55c1d4..bd29ce3698 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 @@ -48,7 +48,7 @@ [(/.local @ 0)])) (the .public (reification @ phase) - (-> Location Phase + (-> Provenance Phase Phase) (function (_ archive exprA) (let [[funcA argsA] (analysis.reification exprA)] @@ -235,7 +235,7 @@ (phase#in expression))) (the .public (abstraction @ phase environment archive bodyA) - (-> Location Phase (Environment analysis.Term) + (-> Provenance Phase (Environment analysis.Term) Phase) (do [! phase.monad] [environment (monad.each ! (phase archive) environment) 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 9261c4f6ee..f7643b6c5a 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 @@ -219,7 +219,7 @@ )))) (the .public (synthesize_when synthesize @ archive input [[headP headA] tailPA+]) - (-> Phase Location Archive /.Term Match + (-> Phase Provenance Archive /.Term Match (Operation /.Term)) (do [! phase.monad] [headSP (path archive synthesize headP headA) @@ -233,7 +233,7 @@ (list)]])) (the .public (synthesize_masking synthesize @ archive input @variable @output) - (-> Phase Location Archive /.Term Register Register + (-> Phase Provenance Archive /.Term Register Register (Operation /.Term)) (if (n.= @variable @output) (phase#in input) @@ -243,7 +243,7 @@ (in (/.let @ @variable input body))))) (the .public (synthesize @ synthesize^ [headB tailB+] archive inputA) - (-> Location Phase Match + (-> Provenance Phase Match Phase) (do [! phase.monad] [inputS (synthesize^ archive inputA)] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/c++/when.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/c++/when.lux index 631c5d83ba..26c65267e4 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/c++/when.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/c++/when.lux @@ -12,7 +12,7 @@ ["[0]" list (.use "[1]#[0]" mix)] ["[0]" set]]] [meta - ["[0]" location] + ["[0]" provenance] [compiler [target ["_" c++]]]]]] @@ -96,7 +96,7 @@ (runtime.Expression synthesis.When)) (do [! phase.monad] [.let [storage (synthesis/when.storage (.its synthesis.#output it))] - it (statement expression archive (synthesis.when location.dummy it))] + it (statement expression archive (synthesis.when provenance.dummy it))] (in (_.on (list) (_.lambda (.if (set.member? (.its synthesis/when.#bindings storage) 0) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/runtime.lux index 5381874227..d3b9618177 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/common_lisp/runtime.lux @@ -3,8 +3,7 @@ (.using [library - [lux (.except Location - the) + [lux (.except the) [abstract ["[0]" monad (.only do)]] [control diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm.lux index f8331183f1..0f09eadd29 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/jvm.lux @@ -45,7 +45,7 @@ (the (with_source_mapping @ it) (for_any (_ of) - (-> Location (Operation (Bytecode of)) + (-> Provenance (Operation (Bytecode of)) (Operation (Bytecode of)))) (do [! phase.monad] [.let [[expected_module line column] @] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/runtime.lux index 0b2753534f..394ce82ef1 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/lua/runtime.lux @@ -3,7 +3,7 @@ (.using [library - [lux (.except Label Location Declaration + [lux (.except Label Declaration variant the) [abstract diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/runtime.lux index ac9651fdcb..712f7d07fe 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/php/runtime.lux @@ -3,8 +3,7 @@ (.using [library - [lux (.except Location - the) + [lux (.except the) [abstract ["[0]" monad (.only do)]] [control diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/runtime.lux index 6c34af7fcf..f591de9f69 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/translation/r/runtime.lux @@ -3,8 +3,7 @@ (.using [library - [lux (.except Location - ++ i64 + [lux (.except ++ i64 the) [abstract ["[0]" monad (.only do)]] 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 5fbd1e9bd2..594433072f 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/syntax.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/syntax.lux @@ -11,22 +11,22 @@ ... its position within the input data. ... That is, the parser takes into account the line and column ... information in the input text (it doesn't really touch the -... file-name aspect of the location, leaving it intact in whatever -... base-line location it is given). +... file-name aspect of the provenance, leaving it intact in whatever +... base-line provenance it is given). ... This particular piece of functionality is not located in one ... function, but it is instead scattered throughout several parsers, -... since the logic for how to update the location varies, depending on +... since the logic for how to update the provenance varies, depending on ... what is being parsed, and the rules involved. ... You will notice that several parsers have a "where" parameter, that -... tells them the location position prior to the parser being run. +... tells them the provenance position prior to the parser being run. ... They are supposed to produce some parsed output, alongside an -... updated location pointing to the end position, after the parser was run. +... updated provenance pointing to the end position, after the parser was run. -... Lux Code nodes/tokens are annotated with location meta-data +... Lux Code nodes/tokens are annotated with provenance meta-data ... [file-name, line, column] to keep track of their provenance and -... location, which is helpful for documentation and debugging. +... provenance, which is helpful for documentation and debugging. (.using [library [lux (.except Alias @@ -48,7 +48,7 @@ ["[0]" name] ["[0]" module] ["[0]" static] - ["[0]" location] + ["[0]" provenance] ["[0]" code ["<[1]>" \\projection]] [macro @@ -85,10 +85,10 @@ ... TODO: Make an extension to take advantage of java/lang/String::indexOf ... to get better performance than the current .text_index# extension. -... TODO: Instead of always keeping a "where" location variable, keep the +... TODO: Instead of always keeping a "where" provenance variable, keep the ... individual components (i.e. file, line and column) separate, so ... that updated the "where" only involved updating the components, and -... producing the locations only involved building them, without any need +... producing the provenances only involved building them, without any need ... for pattern-matching and de-structuring. (template.with [ ] @@ -178,10 +178,10 @@ (n.minor (.text_size# input)))] (!clip start end input))) -(exception.the .public (unrecognized_input [location offset input]) - (Exception [Location Offset Source_Code]) +(exception.the .public (unrecognized_input [provenance offset input]) + (Exception [Provenance Offset Source_Code]) (exception.report - (list ["Location" (location.as_text location)] + (list ["Provenance" (provenance.as_text provenance)] ["Source code" (..input_at offset input)]))) (exception.the .public (text_cannot_contain_new_lines [text]) @@ -200,8 +200,8 @@ Natural) (inlined (!forward length where) - (-> Length Location - Location) + (-> Length Provenance + Provenance) (let [[where::file where::line where::column] where] [where::file where::line (!n/+ length where::column)])) @@ -287,7 +287,7 @@ (template.with [,as ,extension ,numerator_type ,numerator_tag] [(inlined (,as where numerator denominator) - (-> Location ,numerator_type Natural + (-> Provenance ,numerator_type Natural Code) [where {.#Form (list [where {.#Name [.prelude ,extension]}] [where {,numerator_tag numerator}] @@ -353,7 +353,7 @@ else)])) (inlined (name_part the_globals start where offset) - (-> types_of_the_globals Offset Location Offset + (-> types_of_the_globals Offset Provenance Offset (Result Text)) (expansion.let [,success (..success [(revised .#column (|>> (!n/+ (!n/- start end))) where) end @@ -418,7 +418,7 @@ (..success source' [where {tag full_name}]))])) (inlined (natural the_globals start where offset) - (-> types_of_the_globals Offset Location Offset + (-> types_of_the_globals Offset Provenance Offset (Result Nat)) (loop (next ['end offset]) (<| (with_character the_globals 'end 'character (..value the_globals where start 'end n.base_10)) @@ -428,7 +428,7 @@ (..value the_globals where start 'end n.base_10))))) (the (decimal the_globals start where offset) - (-> types_of_the_globals Offset Location Offset + (-> types_of_the_globals Offset Provenance Offset (Result Code)) (expansion.let [ (..number the_globals start end decimal.base_10 .#Decimal) (!failure the_globals where offset) @@ -474,14 +474,14 @@ ))))))) (inlined (rational the_globals numerator denominator_start where) - (-> types_of_the_globals Integer Offset Location + (-> types_of_the_globals Integer Offset Provenance (Result Code)) (<| (!letE [[where' denominator_end _] denominator] (..natural the_globals denominator_start where denominator_start)) (..success [where' denominator_end @code] (..as_rational where numerator denominator)))) (inlined (signed_projection the_globals start where offset) - (-> types_of_the_globals Offset Location Offset + (-> types_of_the_globals Offset Provenance Offset (Result Code)) (expansion.let [,success (..number the_globals start end integer.base_10 .#Integer)] (loop (again [end offset]) @@ -512,7 +512,7 @@ ,success))))))) (inlined (revolution the_globals start where offset) - (-> types_of_the_globals Offset Location Offset + (-> types_of_the_globals Offset Provenance Offset (Result Code)) (expansion.let [,success (..number the_globals start 'end revolution.base_10 .#Revolution)] (loop (next ['end offset]) @@ -523,14 +523,14 @@ ,success))))) (inlined (fraction the_globals numerator denominator_start where) - (-> types_of_the_globals Natural Offset Location + (-> types_of_the_globals Natural Offset Provenance (Result Code)) (<| (!letE [[where' denominator_end _] denominator] (..natural the_globals denominator_start where denominator_start)) (..success [where' denominator_end @code] (..as_fraction where numerator denominator)))) (inlined (positive the_globals start where offset) - (-> types_of_the_globals Offset Location Offset + (-> types_of_the_globals Offset Provenance Offset (Result Code)) (<| (!letE [[where' numerator_end _] numerator] (..natural the_globals start where offset)) (expansion.let [,natural (..number the_globals start numerator_end n.base_10 .#Natural)]) @@ -570,8 +570,8 @@ @code]])) (inlined (!new_line where) - (-> Location - Location) + (-> Provenance + Provenance) (let [[where::file where::line where::column] where] [where::file (after where::line) 0])) @@ -583,7 +583,7 @@ (template.with [ ] [(inlined ( the_globals parse where offset) - (-> types_of_the_globals (Projection Code) Location Offset + (-> types_of_the_globals (Projection Code) Provenance Offset (Result Code)) (loop ( [source (is Source [(!forward 1 where) offset @code]) stack (is (List Code) {.#End})]) @@ -615,7 +615,7 @@ (exception.error ..text_cannot_contain_new_lines content)))])) (the (text_projection the_globals where offset) - (-> types_of_the_globals Location Offset + (-> types_of_the_globals Provenance Offset (Result Code)) (when (.text_index# offset (static ..text_delimiter) @code) {.#Some 'end} diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/synthesis.lux b/stdlib/source/library/lux/meta/compiler/language/lux/synthesis.lux index 6a359470a4..14e0e154bf 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/synthesis.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/synthesis.lux @@ -138,8 +138,8 @@ {#Extension (Extension @)}))) (every .public Term - (Annotated Location - (Term' (Annotated Location)))) + (Annotated Provenance + (Term' (Annotated Provenance)))) (every .public Operation (phase.Operation State)) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/translation.lux b/stdlib/source/library/lux/meta/compiler/language/lux/translation.lux index 198eed79ed..d8723e79ac 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/translation.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/translation.lux @@ -3,7 +3,7 @@ (.using [library - [lux (.except #module #counter #host #location + [lux (.except #module #counter #host name) [abstract [monad (.only do)]] diff --git a/stdlib/source/library/lux/meta/compiler/meta/export.lux b/stdlib/source/library/lux/meta/compiler/meta/export.lux index 7b9cb23bbf..0138b7c7e4 100644 --- a/stdlib/source/library/lux/meta/compiler/meta/export.lux +++ b/stdlib/source/library/lux/meta/compiler/meta/export.lux @@ -28,10 +28,10 @@ [cli (.only Source Export)] ["[0]" io ["[1]" context]]]]] + [time + ["[0]" instant]] [world - ["[0]" file] - [time - ["[0]" instant]]]]]) + ["[0]" file]]]]) (the .public file "library.tar") diff --git a/stdlib/source/library/lux/meta/compiler/target/js.lux b/stdlib/source/library/lux/meta/compiler/target/js.lux index 59f29d6747..9afef887c3 100644 --- a/stdlib/source/library/lux/meta/compiler/target/js.lux +++ b/stdlib/source/library/lux/meta/compiler/target/js.lux @@ -3,7 +3,7 @@ (.using [library - [lux (.except Location Code Label + [lux (.except Code Label or and function if undefined for comment not try ++ -- its type_of , when) [control ["[0]" pipe]] diff --git a/stdlib/source/library/lux/meta/compiler/target/lua.lux b/stdlib/source/library/lux/meta/compiler/target/lua.lux index 7699721123..802f5327ce 100644 --- a/stdlib/source/library/lux/meta/compiler/target/lua.lux +++ b/stdlib/source/library/lux/meta/compiler/target/lua.lux @@ -3,7 +3,7 @@ (.using [library - [lux (.except Location Code Label + [lux (.except Code Label if function or and not let local comment its when) [abstract [equivalence (.only Equivalence)] diff --git a/stdlib/source/library/lux/meta/compiler/target/php.lux b/stdlib/source/library/lux/meta/compiler/target/php.lux index f49b5e4818..9fa772ddb1 100644 --- a/stdlib/source/library/lux/meta/compiler/target/php.lux +++ b/stdlib/source/library/lux/meta/compiler/target/php.lux @@ -3,7 +3,7 @@ (.using [library - [lux (.except Location Code Global Label + [lux (.except Code Global Label static if or and not comment for try global its when) [abstract [equivalence (.only Equivalence)] diff --git a/stdlib/source/library/lux/meta/compiler/target/python.lux b/stdlib/source/library/lux/meta/compiler/target/python.lux index d1cf277786..0590c84d21 100644 --- a/stdlib/source/library/lux/meta/compiler/target/python.lux +++ b/stdlib/source/library/lux/meta/compiler/target/python.lux @@ -3,7 +3,7 @@ (.using [library - [lux (.except Location Code + [lux (.except Code not or and list if comment exec try its is when tuple) [abstract [equivalence (.only Equivalence)] diff --git a/stdlib/source/library/lux/meta/compiler/target/ruby.lux b/stdlib/source/library/lux/meta/compiler/target/ruby.lux index 7e1fa15f60..a00ab3950f 100644 --- a/stdlib/source/library/lux/meta/compiler/target/ruby.lux +++ b/stdlib/source/library/lux/meta/compiler/target/ruby.lux @@ -3,7 +3,7 @@ (.using [library - [lux (.except Location Code + [lux (.except Code static if function or and not comment local global its when) [abstract [equivalence (.only Equivalence)] diff --git a/stdlib/source/library/lux/meta/macro/expansion.lux b/stdlib/source/library/lux/meta/macro/expansion.lux index cf0eb72a00..0ec47f6750 100644 --- a/stdlib/source/library/lux/meta/macro/expansion.lux +++ b/stdlib/source/library/lux/meta/macro/expansion.lux @@ -14,7 +14,7 @@ ["[0]" list (.use "[1]#[0]" monoid monad)]]]]] ["[0]" /// (.only) ["[0]" code] - ["[0]" location] + ["[0]" provenance] ["[0]" name (.use "[1]#[0]" absolute)] ["[0]" binding]]) @@ -131,10 +131,10 @@ {.#None})) {.#Some [omit? token]} (do ///.monad - [location ///.location + [provenance ///.provenance output ( token) .let [_ (.log!# (all text#composite - (name#injection macro_name) " " (location.as_text location) + (name#injection macro_name) " " (provenance.as_text provenance) (|> output (list#each (|>> code.absolute (all text#composite text.\n text.\t))) diff --git a/stdlib/source/library/lux/meta/macro/syntax/definition.lux b/stdlib/source/library/lux/meta/macro/syntax/definition.lux index ec9c29afda..44500b60bc 100644 --- a/stdlib/source/library/lux/meta/macro/syntax/definition.lux +++ b/stdlib/source/library/lux/meta/macro/syntax/definition.lux @@ -19,7 +19,7 @@ [collection ["[0]" list]]] ["[0]" meta (.only) - ["[0]" location] + ["[0]" provenance] [macro ["[0]" expansion]] ["[0]" code (.only) @@ -53,9 +53,9 @@ (the dummy Code - (` [.#module (, (code.text (its .#module location.dummy))) - .#line (, (code.natural (its .#line location.dummy))) - .#column (, (code.natural (its .#column location.dummy)))])) + (` [.#module (, (code.text (its .#module provenance.dummy))) + .#line (, (code.natural (its .#line provenance.dummy))) + .#column (, (code.natural (its .#column provenance.dummy)))])) (the .public (injection (open "_[0]")) (-> Definition Code) diff --git a/stdlib/source/library/lux/meta/module.lux b/stdlib/source/library/lux/meta/module.lux index 4c528110df..e3ab139d88 100644 --- a/stdlib/source/library/lux/meta/module.lux +++ b/stdlib/source/library/lux/meta/module.lux @@ -14,7 +14,7 @@ [list ["[0]" property]]]]]] ["[0]" // (.only) - ["[0]" location]]) + ["[0]" provenance]]) (every .public Name Text) @@ -36,7 +36,7 @@ (the .public no_current Error - (location.with (location.here) + (provenance.with (provenance.here) "No current module.")) (the current_name diff --git a/stdlib/source/library/lux/meta/location.lux b/stdlib/source/library/lux/meta/provenance.lux similarity index 81% rename from stdlib/source/library/lux/meta/location.lux rename to stdlib/source/library/lux/meta/provenance.lux index a6744f1621..a39b9a9a82 100644 --- a/stdlib/source/library/lux/meta/location.lux +++ b/stdlib/source/library/lux/meta/provenance.lux @@ -8,7 +8,7 @@ [equivalence (.only Equivalence)]]]]) (the .public equivalence - (Equivalence Location) + (Equivalence Provenance) (implementation (the (= expected actual) (and (.text_=# (its .#module expected) (its .#module actual)) @@ -19,7 +19,7 @@ ..equivalence) (the .public dummy - Location + Provenance [.#module "" .#line 0 .#column 0]) @@ -28,18 +28,18 @@ (macro (_ tokens compiler) (when tokens {.#End} - (let [location (its .#location compiler)] + (let [provenance (its .#provenance compiler)] {.#Right [compiler - (list (` (.is .Location - [.#module (, [..dummy {.#Text (its .#module location)}]) - .#line (, [..dummy {.#Natural (its .#line location)}]) - .#column (, [..dummy {.#Natural (its .#column location)}])])))]}) + (list (` (.is .Provenance + [.#module (, [..dummy {.#Text (its .#module provenance)}]) + .#line (, [..dummy {.#Natural (its .#line provenance)}]) + .#column (, [..dummy {.#Natural (its .#column provenance)}])])))]}) _ {.#Left .wrong_syntax}))) (the .public (as_text it) - (-> Location + (-> Provenance Text) (let [... https://en.wikipedia.org/wiki/Delimiter delimiter "," @@ -52,8 +52,8 @@ (the \n (.int_char# +10)) -(the .public (with location error) - (-> Location Text +(the .public (with provenance error) + (-> Provenance Text Text) - (.text_composite# (as_text location) \n + (.text_composite# (as_text provenance) \n error)) diff --git a/stdlib/source/library/lux/meta/type.lux b/stdlib/source/library/lux/meta/type.lux index 473cc29c2c..b95d6f1bd8 100644 --- a/stdlib/source/library/lux/meta/type.lux +++ b/stdlib/source/library/lux/meta/type.lux @@ -24,7 +24,7 @@ [number ["n" natural (.use "[1]#[0]" base_10)]]] ["[0]" meta (.use "[1]#[0]" functor) - ["[0]" location] + ["[0]" provenance] ["[0]" name] ["[0]" binding] ["[0]" code (.only) @@ -470,11 +470,11 @@ (when input {.#Left [valueN valueC]} (do meta.monad - [location meta.location + [provenance meta.provenance valueT (binding.type valueN) - .let [[@ _ _] location + .let [[@ _ _] provenance _ (.log!# (all text#composite - (by name.absolute injection (name ..log!)) " " (location.as_text location) text.new_line + (by name.absolute injection (name ..log!)) " " (provenance.as_text provenance) text.new_line "Expression: " (when valueC {.#Some valueC} (code.absolute valueC) diff --git a/stdlib/source/library/lux/meta/type/function.lux b/stdlib/source/library/lux/meta/type/function.lux index 7cb85008f4..9cedf9800f 100644 --- a/stdlib/source/library/lux/meta/type/function.lux +++ b/stdlib/source/library/lux/meta/type/function.lux @@ -11,7 +11,7 @@ [data ["[0]" product]] ["[0]" meta (.use "[1]#[0]" functor) - ["[0]" location] + ["[0]" provenance] ["[0]" binding] ["[0]" code ["?[1]" \\projection]] @@ -21,7 +21,7 @@ (the .public cannot_specialize Error - (location.with (location.here) + (provenance.with (provenance.here) "Cannot specialize function type.")) (the (special it parameters) diff --git a/stdlib/source/library/lux/meta/type/record.lux b/stdlib/source/library/lux/meta/type/record.lux index 3e66569666..ccf7362587 100644 --- a/stdlib/source/library/lux/meta/type/record.lux +++ b/stdlib/source/library/lux/meta/type/record.lux @@ -22,7 +22,7 @@ ["[0]" meta (.only) ["[0]" module] ["[0]" binding] - ["[0]" location] + ["[0]" provenance] ["[0]" name] ["[0]" label] ["[0]" code @@ -89,7 +89,7 @@ (the .public slots_belong_to_different_types Error - (location.with (location.here) + (provenance.with (provenance.here) "Slots belong to different types.")) (the (specialized parameters [head tail]) @@ -115,7 +115,7 @@ (the .public singleton Error - (location.with (location.here) + (provenance.with (provenance.here) "Cannot produce a subset of a singleton.")) (the (slot_index [it _]) diff --git a/stdlib/source/library/lux/test/benchmark.lux b/stdlib/source/library/lux/test/benchmark.lux index 2458bf71e0..9ccc766473 100644 --- a/stdlib/source/library/lux/test/benchmark.lux +++ b/stdlib/source/library/lux/test/benchmark.lux @@ -15,10 +15,9 @@ [math [number ["[0]" integer]]] - [world - [time - ["[0]" instant] - ["[0]" duration (.only Duration)]]]]]) + [time + ["[0]" instant] + ["[0]" duration (.only Duration)]]]]) (the .public (time subject) (-> (IO Any) diff --git a/stdlib/source/library/lux/test/property.lux b/stdlib/source/library/lux/test/property.lux index a425bec5d4..72cf213804 100644 --- a/stdlib/source/library/lux/test/property.lux +++ b/stdlib/source/library/lux/test/property.lux @@ -39,12 +39,12 @@ ["[0]" syntax] ["[0]" expansion] ["[0]" template]]] + [time + ["[0]" duration (.only Duration)] + ["[0]" instant]] [world ["[0]" environment] - ["[0]" console] - [time - ["[0]" duration (.only Duration)] - ["[0]" instant]]]]] + ["[0]" console]]]] [// ["//" unit] ["[0]" coverage (.only Coverage)] diff --git a/stdlib/source/library/lux/world/time.lux b/stdlib/source/library/lux/time.lux similarity index 100% rename from stdlib/source/library/lux/world/time.lux rename to stdlib/source/library/lux/time.lux diff --git a/stdlib/source/library/lux/world/time/date.lux b/stdlib/source/library/lux/time/date.lux similarity index 100% rename from stdlib/source/library/lux/world/time/date.lux rename to stdlib/source/library/lux/time/date.lux diff --git a/stdlib/source/library/lux/world/time/day.lux b/stdlib/source/library/lux/time/day.lux similarity index 100% rename from stdlib/source/library/lux/world/time/day.lux rename to stdlib/source/library/lux/time/day.lux diff --git a/stdlib/source/library/lux/world/time/duration.lux b/stdlib/source/library/lux/time/duration.lux similarity index 100% rename from stdlib/source/library/lux/world/time/duration.lux rename to stdlib/source/library/lux/time/duration.lux diff --git a/stdlib/source/library/lux/world/time/instant.lux b/stdlib/source/library/lux/time/instant.lux similarity index 100% rename from stdlib/source/library/lux/world/time/instant.lux rename to stdlib/source/library/lux/time/instant.lux diff --git a/stdlib/source/library/lux/world/time/month.lux b/stdlib/source/library/lux/time/month.lux similarity index 100% rename from stdlib/source/library/lux/world/time/month.lux rename to stdlib/source/library/lux/time/month.lux diff --git a/stdlib/source/library/lux/world/time/solar.lux b/stdlib/source/library/lux/time/solar.lux similarity index 100% rename from stdlib/source/library/lux/world/time/solar.lux rename to stdlib/source/library/lux/time/solar.lux diff --git a/stdlib/source/library/lux/world/time/year.lux b/stdlib/source/library/lux/time/year.lux similarity index 100% rename from stdlib/source/library/lux/world/time/year.lux rename to stdlib/source/library/lux/time/year.lux diff --git a/stdlib/source/library/lux/web/css/property.lux b/stdlib/source/library/lux/web/css/property.lux index fa25ae25f8..cf68ca2e81 100644 --- a/stdlib/source/library/lux/web/css/property.lux +++ b/stdlib/source/library/lux/web/css/property.lux @@ -3,8 +3,7 @@ (.using [library - [lux (.except Location - all name) + [lux (.except all name) [data ["[0]" text]] [meta diff --git a/stdlib/source/library/lux/web/css/value.lux b/stdlib/source/library/lux/web/css/value.lux index 140772d9c8..94d8769164 100644 --- a/stdlib/source/library/lux/web/css/value.lux +++ b/stdlib/source/library/lux/web/css/value.lux @@ -3,7 +3,7 @@ (.using [library - [lux (.except Label Location + [lux (.except Label and static false true all alias quote) [control ["[0]" maybe]] diff --git a/stdlib/source/library/lux/web/html/attribute.lux b/stdlib/source/library/lux/web/html/attribute.lux index 049410dcad..2badee732f 100644 --- a/stdlib/source/library/lux/web/html/attribute.lux +++ b/stdlib/source/library/lux/web/html/attribute.lux @@ -17,11 +17,11 @@ ["[0]" template]] [type ["[0]" nominal]]] + [time + ["[0]" instant (.only Instant)]] [world [net (.only URL) ["[0]" mime (.only MIME)]] - [time - ["[0]" instant (.only Instant)]] [locale ["[0]" language (.only Language)]]]]] [/ diff --git a/stdlib/source/library/lux/world/file.lux b/stdlib/source/library/lux/world/file.lux index 13e48e2d79..b50f845b29 100644 --- a/stdlib/source/library/lux/world/file.lux +++ b/stdlib/source/library/lux/world/file.lux @@ -37,11 +37,10 @@ [meta [macro ["[0]" template] - ["[0]" expansion]]]]] - [// - [time - ["[0]" instant (.only Instant)] - ["[0]" duration]]]))) + ["[0]" expansion]]] + [time + ["[0]" instant (.only Instant)] + ["[0]" duration]]]]))) (every .public Path Text) diff --git a/stdlib/source/library/lux/world/file/watch.lux b/stdlib/source/library/lux/world/file/watch.lux index b16374be49..116fba9a3c 100644 --- a/stdlib/source/library/lux/world/file/watch.lux +++ b/stdlib/source/library/lux/world/file/watch.lux @@ -35,9 +35,8 @@ [macro ["[0]" expansion] ["[0]" template]]] - [world - [time - ["[0]" instant (.only Instant)]]]]] + [time + ["[0]" instant (.only Instant)]]]] ["[0]" //]) (nominal.every .public Concern diff --git a/stdlib/source/library/lux/world/logging.lux b/stdlib/source/library/lux/world/logging.lux index 6e89003bf1..15cad115cf 100644 --- a/stdlib/source/library/lux/world/logging.lux +++ b/stdlib/source/library/lux/world/logging.lux @@ -16,10 +16,10 @@ [meta [macro ["[0]" template]]] + [time + ["[0]" instant (.only Instant)]] [world - ["[0]" console (.only Console)] - [time - ["[0]" instant (.only Instant)]]]]]) + ["[0]" console (.only Console)]]]]) (every .public (Logger !) (Interface diff --git a/stdlib/source/library/lux/world/net/http/cookie.lux b/stdlib/source/library/lux/world/net/http/cookie.lux index 43f17e4996..6a35d95160 100644 --- a/stdlib/source/library/lux/world/net/http/cookie.lux +++ b/stdlib/source/library/lux/world/net/http/cookie.lux @@ -25,14 +25,13 @@ ["[0]" nominal (.only)]] [macro ["[0]" template]]] - [world - ["[0]" time (.only) - ["[0]" day] - ["[0]" month] - ["[0]" year] - ["[0]" date] - ["[0]" instant (.only Instant)] - ["[0]" duration (.only Duration)]]]]]) + ["[0]" time (.only) + ["[0]" day] + ["[0]" month] + ["[0]" year] + ["[0]" date] + ["[0]" instant (.only Instant)] + ["[0]" duration (.only Duration)]]]]) (every .public (Cookie of) (Record diff --git a/stdlib/source/polytypic/lux/abstract/equivalence.lux b/stdlib/source/polytypic/lux/abstract/equivalence.lux index 8d8bdfc4fd..d6ad247e2a 100644 --- a/stdlib/source/polytypic/lux/abstract/equivalence.lux +++ b/stdlib/source/polytypic/lux/abstract/equivalence.lux @@ -32,13 +32,12 @@ [type ["[0]" poly] ["[0]" unit]]] - [world - [time - ["[0]" duration] - ["[0]" date] - ["[0]" instant] - ["[0]" day] - ["[0]" month]]]]] + [time + ["[0]" duration] + ["[0]" date] + ["[0]" instant] + ["[0]" day] + ["[0]" month]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/polytypic/lux/data/format/json.lux b/stdlib/source/polytypic/lux/data/format/json.lux index 1883daa132..a3b331f8f4 100644 --- a/stdlib/source/polytypic/lux/data/format/json.lux +++ b/stdlib/source/polytypic/lux/data/format/json.lux @@ -15,13 +15,12 @@ [meta [type ["[0]" poly]]] - [world - [time - ["[0]" instant] - ["[0]" duration] - ["[0]" date] - ["[0]" day] - ["[0]" month]]]]] + [time + ["[0]" instant] + ["[0]" duration] + ["[0]" date] + ["[0]" day] + ["[0]" month]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/program/aedifex/input.lux b/stdlib/source/program/aedifex/input.lux index 5c46671ffd..5f4cc303b8 100644 --- a/stdlib/source/program/aedifex/input.lux +++ b/stdlib/source/program/aedifex/input.lux @@ -20,7 +20,7 @@ [collection ["[0]" list]]] [meta - ["[0]" location] + ["[0]" provenance] ["[0]" code (.only) ["<[1]>" \\projection]] [compiler @@ -39,7 +39,7 @@ (let [parse (syntax.parse source_code "" syntax.no_aliases)] - (when (parse [location.dummy 0 source_code]) + (when (parse [provenance.dummy 0 source_code]) {.#Left [_ error]} {try.#Failure error} diff --git a/stdlib/source/projection/lux/data/binary.lux b/stdlib/source/projection/lux/data/binary.lux index 777e2ebf43..bed322474a 100644 --- a/stdlib/source/projection/lux/data/binary.lux +++ b/stdlib/source/projection/lux/data/binary.lux @@ -35,10 +35,9 @@ ["^" pattern] ["[0]" template] ["[0]" expansion]]] - [world - [time - ["[0]" instant (.only Instant)] - ["[0]" duration (.only Duration)]]]]]) + [time + ["[0]" instant (.only Instant)] + ["[0]" duration (.only Duration)]]]]) (.every .public Offset Natural) @@ -318,8 +317,8 @@ [09 [.#Reification] pair] [10 [.#Named] (//.and ..name type)]]))))) -(the .public location - (Projection Location) +(the .public provenance + (Projection Provenance) (all //.and ..text ..natural ..natural)) (the .public code @@ -327,7 +326,7 @@ (..rec (function (_ again) (let [sequence (..list again)] - (//.and ..location + (//.and ..provenance (!variant [[0 [.#Bit] ..bit] [1 [.#Natural] ..natural] [2 [.#Integer] ..integer] diff --git a/stdlib/source/projection/lux/meta/code.lux b/stdlib/source/projection/lux/meta/code.lux index e56ffa7070..9e2244208a 100644 --- a/stdlib/source/projection/lux/meta/code.lux +++ b/stdlib/source/projection/lux/meta/code.lux @@ -21,7 +21,7 @@ ["[0]" revolution] ["[0]" decimal]]] [meta - ["[0]" location] + ["[0]" provenance] ["[0]" name] ["[0]" code] [macro @@ -49,7 +49,7 @@ (the .public empty Error - (location.with (location.here) + (provenance.with (provenance.here) "There are no tokens to parse!")) (the .public any diff --git a/stdlib/source/projection/lux/program.lux b/stdlib/source/projection/lux/program.lux index 49eb002713..2b5daca248 100644 --- a/stdlib/source/projection/lux/program.lux +++ b/stdlib/source/projection/lux/program.lux @@ -13,7 +13,7 @@ ["[0]" text (.only) ["%" \\injection]]] [meta - ["[0]" location]]]]) + ["[0]" provenance]]]]) (every .public (Projection of) (//.Projection (List Text) @@ -37,7 +37,7 @@ (the .public empty Error - (location.with (location.here) + (provenance.with (provenance.here) "Cannot parse empty arguments.")) (the .public any diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux index a803eb7e96..e6775cdb99 100644 --- a/stdlib/source/test/lux.lux +++ b/stdlib/source/test/lux.lux @@ -33,7 +33,7 @@ ["[0]" meta (.use "[1]#[0]" monad) ["[0]" module] ["[0]" static] - ["[0]" location] + ["[0]" provenance] ["[0]" code (.only) ["<[1]>" \\projection]] ["[0]" macro (.only) @@ -85,6 +85,7 @@ ["[1][0]" web/html/tag] ["[1][0]" web/html/attribute] ["[1][0]" web/dom/event] + ["[1][0]" time] ["[1][0]" world] ["[1][0]" ffi] @@ -367,7 +368,7 @@ /.#meta /.#datum] (|> example (its /.#meta) - (location.= location.dummy))) + (provenance.= provenance.dummy))) (_.for [/.UnQuote] (all _.and (_.coverage [/.unquote_macro] @@ -1377,7 +1378,8 @@ /web/html/tag.test /web/html/attribute.test /web/dom/event.test - + + /time.test /world.test /ffi.test diff --git a/stdlib/source/test/lux/abstract/interval.lux b/stdlib/source/test/lux/abstract/interval.lux index ee954a845c..8dfe74d1ff 100644 --- a/stdlib/source/test/lux/abstract/interval.lux +++ b/stdlib/source/test/lux/abstract/interval.lux @@ -167,7 +167,7 @@ (not (/.overlaps? some_interval (/.complement some_interval)))) ))) -(the location +(the provenance Test (do [! random.monad] [[l m r] (|> (random.set n.hash 3 random.natural) @@ -296,7 +296,7 @@ ..intersection) (_.for [/.complement] ..complement) - ..location + ..provenance ..touch (_.for [/.nested?] ..nested) diff --git a/stdlib/source/test/lux/concurrency/async.lux b/stdlib/source/test/lux/concurrency/async.lux index 48b5b3b1a1..964873e236 100644 --- a/stdlib/source/test/lux/concurrency/async.lux +++ b/stdlib/source/test/lux/concurrency/async.lux @@ -17,10 +17,9 @@ ["n" natural] ["i" integer] ["[0]" i64]]] - [world - [time - ["[0]" instant] - ["[0]" duration]]] + [time + ["[0]" instant] + ["[0]" duration]] [test ["_" property (.only Test)] ["[0]" unit]]]] diff --git a/stdlib/source/test/lux/concurrency/thread.lux b/stdlib/source/test/lux/concurrency/thread.lux index 9766db036e..09abf93ed0 100644 --- a/stdlib/source/test/lux/concurrency/thread.lux +++ b/stdlib/source/test/lux/concurrency/thread.lux @@ -16,10 +16,9 @@ [meta [macro ["[0]" template]]] - [world - [time - ["[0]" instant (.only Instant)] - ["[0]" duration]]] + [time + ["[0]" instant (.only Instant)] + ["[0]" duration]] [test ["_" property (.only Test)] ["[0]" unit]]]] diff --git a/stdlib/source/test/lux/control/function/memo.lux b/stdlib/source/test/lux/control/function/memo.lux index 2cb57ebbd1..f8be28412a 100644 --- a/stdlib/source/test/lux/control/function/memo.lux +++ b/stdlib/source/test/lux/control/function/memo.lux @@ -22,10 +22,9 @@ [meta [macro ["^" pattern]]] - [world - [time - ["[0]" instant] - ["[0]" duration (.only Duration)]]] + [time + ["[0]" instant] + ["[0]" duration (.only Duration)]] [test ["_" property (.only Test)]]]] [\\library diff --git a/stdlib/source/test/lux/control/function/polymorphism/aspect.lux b/stdlib/source/test/lux/control/function/polymorphism/aspect.lux index 0ee04b3bfe..c534329b6b 100644 --- a/stdlib/source/test/lux/control/function/polymorphism/aspect.lux +++ b/stdlib/source/test/lux/control/function/polymorphism/aspect.lux @@ -97,7 +97,7 @@ (/.with ..before_aspect (triple local)))) )) - (_.for [/.Join_Point /.#location /.#scenario + (_.for [/.Join_Point /.#provenance /.#scenario /.Point_Cut] (all _.and (_.coverage [/.when_local] diff --git a/stdlib/source/test/lux/data/binary.lux b/stdlib/source/test/lux/data/binary.lux index 785b5d83ff..b57dc31b95 100644 --- a/stdlib/source/test/lux/data/binary.lux +++ b/stdlib/source/test/lux/data/binary.lux @@ -51,10 +51,9 @@ [macro ["^" pattern] ["[0]" template]]] - [world - [time - ["[0]" instant] - ["[0]" duration]]] + [time + ["[0]" instant] + ["[0]" duration]] [test ["_" property (.only Test)]]]] [\\library @@ -95,8 +94,8 @@ (Random Name) (random.and ..random_text ..random_text)) -(the location_equivalence - (Equivalence Location) +(the provenance_equivalence + (Equivalence Provenance) (implementation (the (= [expected_module expected_line expected_column] [sample_module sample_line sample_column]) @@ -104,8 +103,8 @@ (n.= expected_line sample_line) (n.= expected_column sample_column))))) -(the random_location - (Random Location) +(the random_provenance + (Random Provenance) (all random.and ..random_text random.natural @@ -120,8 +119,8 @@ [size (by ! each (n.% 2) random.natural)] (random.list size again)))] (all random.and - ..random_location - (is (Random (Code' (Annotated Location))) + ..random_provenance + (is (Random (Code' (Annotated Provenance))) (all random.or random.bit random.natural @@ -275,7 +274,7 @@ (!expect (^.multi {try.#Success actual} (by = expected actual))))))] - [\\projection.location \\injection.location random_location location_equivalence] + [\\projection.provenance \\injection.provenance random_provenance provenance_equivalence] [\\projection.code \\injection.code random_code code.equivalence] [\\projection.type \\injection.type random_type type.equivalence] )) diff --git a/stdlib/source/test/lux/data/format/json.lux b/stdlib/source/test/lux/data/format/json.lux index 93d0f47c70..c5660a8a05 100644 --- a/stdlib/source/test/lux/data/format/json.lux +++ b/stdlib/source/test/lux/data/format/json.lux @@ -46,13 +46,12 @@ ["[0]" syntax] ["[0]" expansion] ["[0]" template]]] - [world - [time - ["[0]" date] - ["[0]" instant (.only) - ["[0]/[1]" \\test]] - ["[0]" duration (.only) - ["[0]/[1]" \\test]]]] + [time + ["[0]" date] + ["[0]" instant (.only) + ["[0]/[1]" \\test]] + ["[0]" duration (.only) + ["[0]/[1]" \\test]]] [test ["_" property (.only Test)]]]] ["[0]" \\polytypic] diff --git a/stdlib/source/test/lux/data/format/tar.lux b/stdlib/source/test/lux/data/format/tar.lux index c40dbb5707..f674f6db93 100644 --- a/stdlib/source/test/lux/data/format/tar.lux +++ b/stdlib/source/test/lux/data/format/tar.lux @@ -33,10 +33,9 @@ [meta [macro ["[0]" template]]] - [world - [time - ["[0]" instant (.only Instant)] - ["[0]" duration]]] + [time + ["[0]" instant (.only Instant)] + ["[0]" duration]] [test ["_" property (.only Test)]]]] [\\library diff --git a/stdlib/source/test/lux/debug.lux b/stdlib/source/test/lux/debug.lux index cbdfddbd67..65845fe6a3 100644 --- a/stdlib/source/test/lux/debug.lux +++ b/stdlib/source/test/lux/debug.lux @@ -24,7 +24,7 @@ [number ["[0]" fraction (.only Fraction)]]] [meta - ["[0]" location] + ["[0]" provenance] ["[0]" name] ["[0]" type] ["[0]" code (.only) @@ -43,7 +43,7 @@ ["[1][0]" fraction]]] [meta ["[1][0]" code] - ["[1][0]" location] + ["[1][0]" provenance] ["[1][0]" name] ["[1][0]" type]]]) @@ -106,7 +106,7 @@ (do random.monad [sample_fraction $//fraction.random sample_name ($//name.random 5 5) - sample_location $//location.random + sample_provenance $//provenance.random sample_type ($//type.random 0) sample_code $//code.random] (in (`` (and (,, (template.with [ ] @@ -116,7 +116,7 @@ [Fraction fraction.as_text sample_fraction] [Name name.as_text sample_name] - [Location location.as_text sample_location] + [Provenance provenance.as_text sample_provenance] [Code code.as_text sample_code] [Type type.as_text sample_type])) ))))) diff --git a/stdlib/source/test/lux/documentation/remember.lux b/stdlib/source/test/lux/documentation/remember.lux index a52a3e5ec1..e36d465648 100644 --- a/stdlib/source/test/lux/documentation/remember.lux +++ b/stdlib/source/test/lux/documentation/remember.lux @@ -24,11 +24,10 @@ [macro ["[0]" syntax] ["[0]" expansion]]] - [world - [time - ["[0]" date (.only Date)] - ["[0]" instant] - ["[0]" duration]]] + [time + ["[0]" date (.only Date)] + ["[0]" instant] + ["[0]" duration]] [test ["_" property (.only Test)]]]] [\\library diff --git a/stdlib/source/test/lux/math/number/fraction.lux b/stdlib/source/test/lux/math/number/fraction.lux index e05b3a50ca..9b95a45655 100644 --- a/stdlib/source/test/lux/math/number/fraction.lux +++ b/stdlib/source/test/lux/math/number/fraction.lux @@ -19,7 +19,9 @@ ["[0]" try (.use "[1]#[0]" functor)]] [data ["[0]" bit] - ["[0]" text]] + ["[0]" text] + [collection + ["[0]" list (.use "[1]#[0]" mix)]]] [math ["[0]" random (.only Random) (.use "[1]#[0]" functor)] ["[0]" arithmetic @@ -34,6 +36,8 @@ ["[0]" / (.only) [// ["n" natural] + ["i" integer] + ["d" decimal] [// ["[0]" unit]]]]]) @@ -124,7 +128,7 @@ [/.minor /.minimum] [/.major /.maximum] )) - (_.for [/.format] + (_.for [/.format /.as_text] (static.when (same? /.as_text (by /.format injection)) (formatT.spec /.equivalence /.format ..random))) @@ -150,7 +154,8 @@ (/.= /.zero (/.* /.zero expected)) (/.= /.infinity (/./ /.zero expected)))) (_.coverage [/.one] - (and (/.= expected (/.* /.one expected)) + (and (not (/.= expected (/.+ /.one expected))) + (/.= expected (/.* /.one expected)) (/.= expected (/./ /.one expected)))) (_.coverage [/.smallest] (not (/.< /.smallest expected))) @@ -194,6 +199,14 @@ (try.is? /.not_a_natural)) (and (/.= /.zero (/.partial expected)) (/.= expected (/.whole expected))))) + (_.coverage [/.decimal] + (let [margin_of_error +0.000,000,000,001] + (and (by (d.approximately margin_of_error) = + (/.decimal (/.whole expected)) + (d.whole (/.decimal expected))) + (by (d.approximately margin_of_error) = + (/.decimal (/.partial expected)) + (d.partial (/.decimal expected)))))) (do random.monad [denom/0 random.natural denom/1 random.natural] @@ -236,8 +249,10 @@ (and only_numerator! denominator_1! with_denominator!)))) - (do random.monad - [sample ..random] + (do [! random.monad] + [sample ..random + power (by ! each (i.% +10) + random.integer)] (all _.and (_.coverage [/.-] (and (/.= (/.fraction 0) (/.- sample sample)) @@ -248,6 +263,18 @@ (_.coverage [/.reciprocal] (/.= (/.fraction 1) (/.* sample (/.reciprocal sample)))) + (_.coverage [/.^] + (and (/.= /.one (/.^ +0 sample)) + (/.= sample (/.^ +1 sample)) + (/.= (/.reciprocal sample) + (/.^ -1 sample)) + (/.= (/.reciprocal (/.^ power sample)) + (/.^ (i.opposite power) sample)) + (if (i.< +0 power) + (/.= (list#mix /.* /.one (list.repeated (.natural (i.opposite power)) sample)) + (/.reciprocal (/.^ power sample))) + (/.= (list#mix /.* /.one (list.repeated (.natural power) sample)) + (/.^ power sample))))) )) (do random.monad [left (random.only (|>> (/.= (/.fraction 0)) not) diff --git a/stdlib/source/test/lux/math/number/integer.lux b/stdlib/source/test/lux/math/number/integer.lux index 16496b69a6..2c07d3515c 100644 --- a/stdlib/source/test/lux/math/number/integer.lux +++ b/stdlib/source/test/lux/math/number/integer.lux @@ -21,12 +21,15 @@ ["[0]" monoid ["[1]T" \\test]]] [data - ["[0]" bit]] + ["[0]" bit] + [collection + ["[0]" list (.use "[1]#[0]" mix)]]] [math ["[0]" random (.only Random)] ["[0]" arithmetic ["[1]T" \\test]]] [meta + ["[0]" static] [macro ["[0]" template]]] [test @@ -42,7 +45,8 @@ Test (`` (all _.and (_.for [/.equivalence /.=] - (equivalenceT.spec /.equivalence random.integer)) + (static.when (same? /.equivalence /.=) + (equivalenceT.spec /.equivalence random.integer))) (_.for [/.hash] (hashT.spec /.hash random.integer)) (_.for [/.order /.<] @@ -51,15 +55,16 @@ (enumT.spec /.enum random.integer)) (_.for [/.interval] (intervalT.spec /.interval random.integer)) - (,, (template.with [] - [(_.for [] - (monoidT.spec /.equivalence random.integer))] + (,, (template.with [ ] + [(_.for [ ] + (static.when (same? (by composite)) + (monoidT.spec /.equivalence random.integer)))] - [/.addition] - [/.multiplication] + [/.+ /.addition] + [/.* /.multiplication] - [/.minimum] - [/.maximum] + [/.minor /.minimum] + [/.major /.maximum] )) (,, (template.with [] [(_.for [] @@ -107,15 +112,13 @@ (_.coverage [.Int .Z] (and (alias? .Integer .Int) (alias? .Integer .Z))) - (do random.monad + (do [! random.monad] [sample random.integer left random.integer - right random.integer] + right random.integer + power (by ! each (n.% 10) + random.natural)] (all _.and - (_.coverage [/.+] - (and (/.= (/.+ left right) - (/.+ right left)) - (/.= sample (/.+ +0 sample)))) (_.coverage [/.-] (and (/.= +0 (/.- sample sample)) (/.= sample (/.- +0 sample)) @@ -123,12 +126,6 @@ (/.- sample +0)) (/.= /#minimum (/.- /#minimum +0)))) - (_.coverage [/.*] - (and (/.= (/.* left right) - (/.* right left)) - (/.= sample (/.* +1 sample)) - (/.= /#minimum - (/.* -1 /#minimum)))) (_.coverage [/./] (and (/.= +1 (/./ sample sample)) (/.= sample (/./ +1 sample)) @@ -140,20 +137,11 @@ (_.coverage [/.signum] (/.= (/.abs sample) (/.* (/.signum sample) sample))) - (_.coverage [/.minor] - (and (/.= (/.minor left right) - (/.minor right left)) - (/.= sample - (/.minor /#maximum sample)) - (/.= /#minimum - (/.minor /#minimum sample)))) - (_.coverage [/.major] - (and (/.= (/.major left right) - (/.major right left)) - (/.= /#maximum - (/.major /#maximum sample)) - (/.= sample - (/.major /#minimum sample)))) + (_.coverage [/.^] + (and (/.= +1 (/.^ 0 sample)) + (/.= sample (/.^ 1 sample)) + (/.= (list#mix /.* +1 (list.repeated power sample)) + (/.^ power sample)))) )) (do random.monad [left random.integer @@ -200,10 +188,16 @@ left random right random] (all _.and - (_.coverage [/.gcd] - (let [gcd (/.gcd left right)] - (and (/.= +0 (/.% gcd left)) - (/.= +0 (/.% gcd right))))) + (_.coverage [/.lcm /.least_common_multiple] + (and (let [lcm (/.lcm left right)] + (and (/.= +0 (/.% left lcm)) + (/.= +0 (/.% right lcm)))) + (alias? /.lcm /.least_common_multiple))) + (_.coverage [/.gcd /.greatest_common_divisor] + (and (let [gcd (/.gcd left right)] + (and (/.= +0 (/.% gcd left)) + (/.= +0 (/.% gcd right)))) + (alias? /.gcd /.greatest_common_divisor))) (_.coverage [/.extended_gcd] (let [[[left_k right_k] gcd] (/.extended_gcd left right) @@ -220,10 +214,16 @@ (_.coverage [/.co_prime?] (bit.= (/.= +1 (/.gcd left right)) (/.co_prime? left right))) - (_.coverage [/.lcm] - (let [lcm (/.lcm left right)] - (and (/.= +0 (/.% left lcm)) - (/.= +0 (/.% right lcm))))) + (_.coverage [/.multiple?] + (and (/.multiple? left + (/.least_common_multiple left right)) + (/.multiple? right + (/.least_common_multiple left right)))) + (_.coverage [/.divisor?] + (and (/.divisor? left + (/.greatest_common_divisor left right)) + (/.divisor? right + (/.greatest_common_divisor left right)))) )) (do random.monad [expected random.integer] diff --git a/stdlib/source/test/lux/math/number/natural.lux b/stdlib/source/test/lux/math/number/natural.lux index 536415de38..ddaa2cef7b 100644 --- a/stdlib/source/test/lux/math/number/natural.lux +++ b/stdlib/source/test/lux/math/number/natural.lux @@ -22,12 +22,15 @@ ["[1]T" \\test]]] [data ["[0]" bit] - ["[0]" text]] + ["[0]" text] + [collection + ["[0]" list (.use "[1]#[0]" mix)]]] [math ["[0]" random] ["[0]" arithmetic ["[1]T" \\test]]] [meta + ["[0]" static] [macro ["[0]" template]]] [test @@ -41,7 +44,8 @@ Test (`` (all _.and (_.for [/.equivalence /.=] - (equivalenceT.spec /.equivalence random.natural)) + (static.when (same? /.equivalence /.=) + (equivalenceT.spec /.equivalence random.natural))) (_.for [/.hash] (hashT.spec /.hash random.natural)) (_.for [/.order /.<] @@ -52,7 +56,8 @@ (intervalT.spec /.interval random.natural)) (,, (template.with [ ] [(_.for [ ] - (monoidT.spec /.equivalence random.natural))] + (static.when (same? (by composite)) + (monoidT.spec /.equivalence random.natural)))] [/.+ /.addition] [/.* /.multiplication] @@ -99,13 +104,26 @@ Test (<| (_.covering /._) (_.for [.Natural]) + (do [! random.monad] + [expected random.natural]) (all _.and (_.coverage [.Nat .N /.Number] (and (alias? .Natural .Nat) (alias? .Natural .N) (alias? .Natural /.Number))) - (do random.monad - [sample random.natural] + (_.coverage [/.zero] + (and (/.= expected (/.+ /.zero expected)) + (/.= expected (/.- /.zero expected)) + + (/.= /.zero (/.* /.zero expected)))) + (_.coverage [/.one] + (and (not (/.= expected (/.+ /.one expected))) + (/.= expected (/.* /.one expected)) + (/.= expected (/./ /.one expected)))) + (do ! + [sample random.natural + power (by ! each (/.% 10) + random.natural)] (all _.and (_.coverage [/.-] (and (/.= 0 (/.- sample sample)) @@ -113,6 +131,11 @@ (_.coverage [/./] (and (/.= 1 (/./ sample sample)) (/.= sample (/./ 1 sample)))) + (_.coverage [/.^] + (and (/.= 1 (/.^ 0 sample)) + (/.= sample (/.^ 1 sample)) + (/.= (list#mix /.* 1 (list.repeated power sample)) + (/.^ power sample)))) )) (do random.monad [left random.natural @@ -140,24 +163,68 @@ (and (/.= div (/./ left right)) (/.= rem (/.% left right))))) )) - (do [! random.monad] + (do ! [.let [random (by ! each (|>> (/.% 1,000) ++) random.natural)] left random right random] (all _.and - (_.coverage [/.gcd] - (let [gcd (/.gcd left right)] - (and (/.= 0 (/.% gcd left)) - (/.= 0 (/.% gcd right))))) + (_.coverage [/.lcm /.least_common_multiple + /.multiple?] + (and (/.= /.zero + (/.lcm /.zero expected)) + (/.= (/.lcm right left) + (/.lcm left right)) + (and (/.multiple? left (/.lcm left right)) + (/.multiple? right (/.lcm left right))) + (alias? /.lcm /.least_common_multiple))) + (_.coverage [/.gcd /.greatest_common_divisor + /.divisor?] + (and (/.= expected + (/.gcd /.zero expected)) + (/.= (/.gcd right left) + (/.gcd left right)) + (and (/.divisor? left (/.gcd left right)) + (/.divisor? right (/.gcd left right))) + (alias? /.gcd /.greatest_common_divisor))) (_.coverage [/.co_prime?] - (bit.= (/.= 1 (/.gcd left right)) - (/.co_prime? left right))) - (_.coverage [/.lcm] - (let [lcm (/.lcm left right)] - (and (/.= 0 (/.% left lcm)) - (/.= 0 (/.% right lcm))))) + (and (bit.= (/.co_prime? expected expected) + (/.= /.one expected)) + (bit.= (/.= /.one (/.gcd left right)) + (/.co_prime? left right)))) + (do ! + [range (by ! each (/.% 100) random.natural)] + (_.coverage [/.prime?] + (let [candidates (|> range + list.indices + (list.only /.prime?))] + (and (bit.= (/.= /.zero range) + (list.empty? candidates)) + (list.every? (function (_ it) + (let [co_prime_with_others! + (list.every? (function (_ factor) + (or (/.co_prime? it factor) + ... 0 * x = x * 0 + (/.= /.zero factor) + (/.= /.zero it) + + (/.= it factor))) + candidates) + + no_multiple_is_prime! + (list.every? (function (_ factor) + (or (not (/.prime? (/.* factor it))) + ... 0 * x = x * 0 + (/.= /.zero factor) + (/.= /.zero it) + ... 1 * x = x * 1 + (/.= /.one factor) + (/.= /.one it))) + candidates)] + (and co_prime_with_others! + no_multiple_is_prime!))) + candidates))))) )) - (do [! random.monad] + (do ! [expected (by ! each (/.% 1,000,000) random.natural) sample random.natural] (_.coverage [/.decimal] diff --git a/stdlib/source/test/lux/math/number/rational.lux b/stdlib/source/test/lux/math/number/rational.lux index fdb17c6858..51cfbfec18 100644 --- a/stdlib/source/test/lux/math/number/rational.lux +++ b/stdlib/source/test/lux/math/number/rational.lux @@ -18,7 +18,10 @@ ["[0]" maybe (.use "[1]#[0]" functor)] ["[0]" try]] [data - ["[0]" bit]] + ["[0]" bit] + ["[0]" text] + [collection + ["[0]" list (.use "[1]#[0]" mix)]]] [math ["[0]" random (.only Random) (.use "[1]#[0]" functor)] ["[0]" arithmetic @@ -102,7 +105,10 @@ (_.for [/.Rational /.#numerator /.#denominator]) (do random.monad - [expected ..random]) + [expected ..random + + it_0 ..random + it_1 ..random]) (`` (all _.and (_.for [/.equivalence /.=] (static.when (same? /.equivalence /.=) @@ -112,22 +118,34 @@ (orderT.spec /.order ..random))) (,, (template.with [ ] [(_.for [ ] - (monoidT.spec /.equivalence ..random))] + (static.when (same? (by composite)) + (monoidT.spec /.equivalence ..random)))] [/.+ /.addition] [/.* /.multiplication] + + [/.minor /.minimum] + [/.major /.maximum] )) - (_.for [/.format] - (formatT.spec /.equivalence /.format ..random)) + (_.for [/.format /.as_text] + (static.when (same? /.as_text + (by /.format injection)) + (formatT.spec /.equivalence /.format ..random))) (_.for [/.arithmetic] (arithmeticT.spec /.equivalence /.arithmetic ..random)) (_.coverage [/.Number /.Q] (and (alias? /.Rational /.Number) (alias? /.Rational /.Q))) - (_.coverage [/.as_text] - (alias? (by /.format injection) - /.as_text)) + (_.coverage [/.approximately] + (and (bit.= (by (/.approximately /.zero) = it_0 it_1) + (/.= it_0 it_1)) + (by (/.approximately (/.major it_0 it_1)) = it_0 it_1) + (or (not (by (/.approximately (/.minor it_0 it_1)) = it_0 it_1)) + (/.= it_0 it_1)))) + (_.coverage [/.delimiter] + (text.contains? /.delimiter + (/.as_text expected))) (_.coverage [/.zero] (and (/.= expected (/.+ /.zero expected)) (/.= expected (/.- /.zero expected)) @@ -137,6 +155,14 @@ (_.coverage [/.one] (and (/.= expected (/.* /.one expected)) (/.= expected (/./ /.one expected)))) + (_.coverage [/.smallest] + (or (not (/.< /.smallest (/.absolute expected))) + (/.= /.zero expected))) + (_.coverage [/.most_positive] + (or (not (/.> /.most_positive expected)) + (/.= /.infinity expected))) + (_.coverage [/.most_negative] + (not (/.< /.most_negative expected))) (_.coverage [/.infinity] (and (/.= /.infinity (/./ /.zero /.one)) @@ -159,6 +185,15 @@ (_.coverage [/.determinate?] (and (/.determinate? expected) (not (/.determinate? /.indeterminate)))) + (_.coverage [/.absolute] + (/.>= expected (/.absolute expected))) + (_.coverage [/.signum] + (and (/.= (/.absolute expected) + (/.* (/.signum expected) + expected)) + (/.= expected + (/.* (/.signum expected) + (/.absolute expected))))) (_.coverage [/.whole /.partial] (/.= expected (/.+ (/.whole expected) @@ -231,8 +266,10 @@ (try.is? /.not_an_integer)) (and (/.= /.zero (/.partial expected)) (/.= expected (/.whole expected))))) - (do random.monad - [sample ..random] + (do [! random.monad] + [sample ..random + power (by ! each (i.% +10) + random.integer)] (all _.and (_.coverage [/.-] (and (/.= (/.rational +0) (/.- sample sample)) @@ -243,6 +280,18 @@ (_.coverage [/.reciprocal] (/.= (/.rational +1) (/.* sample (/.reciprocal sample)))) + (_.coverage [/.^] + (and (/.= /.one (/.^ +0 sample)) + (/.= sample (/.^ +1 sample)) + (/.= (/.reciprocal sample) + (/.^ -1 sample)) + (/.= (/.reciprocal (/.^ power sample)) + (/.^ (i.opposite power) sample)) + (if (i.< +0 power) + (/.= (list#mix /.* /.one (list.repeated (.natural (i.opposite power)) sample)) + (/.reciprocal (/.^ power sample))) + (/.= (list#mix /.* /.one (list.repeated (.natural power) sample)) + (/.^ power sample))))) )) (do random.monad [left (random.only (|>> (/.= (/.rational +0)) not) diff --git a/stdlib/source/test/lux/meta.lux b/stdlib/source/test/lux/meta.lux index 117e0d3b34..3922ece197 100644 --- a/stdlib/source/test/lux/meta.lux +++ b/stdlib/source/test/lux/meta.lux @@ -18,7 +18,7 @@ [number ["n" natural]]] [meta - ["[0]" location] + ["[0]" provenance] [macro ["^" pattern] ["[0]" template]]] @@ -28,7 +28,7 @@ ["[0]" /]] ["[0]" / ["[1][0]" code] - ["[1][0]" location] + ["[1][0]" provenance] ["[1][0]" name] ["[1][0]" configuration] ["[1][0]" version] @@ -67,8 +67,8 @@ .#version version .#mode {.#Build} .#configuration configuration] - .#source [location.dummy 0 source_code] - .#location location.dummy + .#source [provenance.dummy 0 source_code] + .#provenance provenance.dummy .#current_module {.#Some expected_current_module} .#modules (list) .#scopes (list) @@ -126,8 +126,8 @@ .#version version .#mode {.#Build} .#configuration (list)] - .#source [location.dummy 0 source_code] - .#location location.dummy + .#source [provenance.dummy 0 source_code] + .#provenance provenance.dummy .#current_module {.#Some expected_current_module} .#modules (list) .#scopes (list) @@ -146,7 +146,7 @@ (is (Meta Any)) (/.value expected_lux) (!expect (^.multi {try.#Failure actual_error} - (text.= (location.with location.dummy expected_error) + (text.= (provenance.with provenance.dummy expected_error) actual_error))))) (_.coverage [/.assertion] (and (|> (/.assertion expected_error true) @@ -176,7 +176,7 @@ (/.failure expected_error))) (/.value expected_lux) (!expect (^.multi {try.#Failure actual_error} - (text.= (location.with location.dummy expected_error) + (text.= (provenance.with provenance.dummy expected_error) actual_error)))) (|> (/.either (by /.monad in expected) (by /.monad in dummy)) @@ -203,7 +203,7 @@ (/.failure expected_error))) (/.value expected_lux) (!expect (^.multi {try.#Failure actual_error} - (text.= (location.with location.dummy expected_error) + (text.= (provenance.with provenance.dummy expected_error) actual_error)))) (|> (/.or (by /.monad in expected) (by /.monad in dummy)) @@ -239,7 +239,7 @@ (and (|> (/.try (/.failure expected_error)) (/.value expected_lux) (!expect (^.multi {try.#Success {try.#Failure actual_error}} - (text.= (location.with location.dummy expected_error) + (text.= (provenance.with provenance.dummy expected_error) actual_error)))) (|> (/.try (by /.monad in expected)) (/.value expected_lux) @@ -247,8 +247,8 @@ (same? expected actual)))))) ))) -(the random_location - (Random Location) +(the random_provenance + (Random Provenance) (all random.and (random.upper_cased 1) random.natural @@ -266,7 +266,7 @@ expected_seed random.natural expected random.natural dummy (random.only (|>> (n.= expected) not) random.natural) - expected_location ..random_location + expected_provenance ..random_provenance .let [type_context [.#ex_counter 0 .#var_counter 0 .#var_bindings (list)] @@ -277,8 +277,8 @@ .#version version .#mode {.#Build} .#configuration (list)] - .#source [location.dummy 0 source_code] - .#location expected_location + .#source [provenance.dummy 0 source_code] + .#provenance expected_provenance .#current_module {.#Some expected_current_module} .#modules (list) .#scopes (list) @@ -304,11 +304,11 @@ (!expect (^.multi {try.#Success [actual_pre actual_post]} (and (n.= expected_seed actual_pre) (n.= (++ expected_seed) actual_post)))))) - (_.coverage [/.location] - (|> /.location + (_.coverage [/.provenance] + (|> /.provenance (/.value (expected_lux {.#Some expected_type})) - (!expect (^.multi {try.#Success actual_location} - (same? expected_location actual_location))))) + (!expect (^.multi {try.#Success actual_provenance} + (same? expected_provenance actual_provenance))))) (_.coverage [/.expected_type] (|> /.expected_type (/.value (expected_lux {.#Some expected_type})) @@ -348,7 +348,7 @@ Test (<| (_.covering /._) (_.for [.Meta .Lux - .#info .#source .#location .#current_module + .#info .#source .#provenance .#current_module .#modules .#scopes .#type_context .#expected .#seed .#scope_type_vars .#extensions .#eval .#host]) @@ -364,13 +364,13 @@ expected_seed random.natural expected random.natural dummy (random.only (|>> (n.= expected) not) random.natural) - expected_location ..random_location + expected_provenance ..random_provenance .let [expected_lux [.#info [.#target target .#version version .#mode {.#Build} .#configuration (list)] - .#source [expected_location 0 source_code] - .#location expected_location + .#source [expected_provenance 0 source_code] + .#provenance expected_provenance .#current_module {.#Some expected_current_module} .#modules (list) .#scopes (list) @@ -399,7 +399,7 @@ /.of_try (/.value expected_lux) (!expect (^.multi {try.#Failure actual} - (text.= (location.with expected_location expected_error) + (text.= (provenance.with expected_provenance expected_error) actual)))) (|> expected_value {try.#Success} @@ -415,7 +415,7 @@ )) /code.test - /location.test + /provenance.test /name.test /configuration.test /version.test diff --git a/stdlib/source/test/lux/meta/binding.lux b/stdlib/source/test/lux/meta/binding.lux index e9c8e8f2b5..7212c25b22 100644 --- a/stdlib/source/test/lux/meta/binding.lux +++ b/stdlib/source/test/lux/meta/binding.lux @@ -21,7 +21,7 @@ [number ["n" natural]]] [meta - ["[0]" location] + ["[0]" provenance] ["[0]" name] ["[0]" type] [macro @@ -77,8 +77,8 @@ .#version version .#mode {.#Build} .#configuration (list)] - .#source [location.dummy 0 source_code] - .#location location.dummy + .#source [provenance.dummy 0 source_code] + .#provenance provenance.dummy .#current_module {.#Some expected_current_module} .#modules expected_modules .#scopes (list) @@ -105,8 +105,8 @@ (same? expected_proper actual_proper))))))) ))) -(the random_location - (Random Location) +(the random_provenance + (Random Provenance) (all random.and (random.upper_cased 1) random.natural @@ -151,8 +151,8 @@ .#version "" .#mode {.#Build} .#configuration (list)] - .#source [location.dummy 0 ""] - .#location location.dummy + .#source [provenance.dummy 0 ""] + .#provenance provenance.dummy .#current_module {.#Some expected_current_module} .#modules (list [expected_current_module [.#module_hash 0 @@ -271,8 +271,8 @@ .#version "" .#mode {.#Build} .#configuration (list)] - .#source [location.dummy 0 ""] - .#location location.dummy + .#source [provenance.dummy 0 ""] + .#provenance provenance.dummy .#current_module {.#Some expected_current_module} .#modules (list [expected_current_module [.#module_hash 0 diff --git a/stdlib/source/test/lux/meta/binding/local.lux b/stdlib/source/test/lux/meta/binding/local.lux index 4fb8f56ec1..c4b8896909 100644 --- a/stdlib/source/test/lux/meta/binding/local.lux +++ b/stdlib/source/test/lux/meta/binding/local.lux @@ -18,7 +18,7 @@ [math ["[0]" random (.only Random)]] [meta - ["[0]" location] + ["[0]" provenance] ["[0]" type]] [test ["_" property (.only Test)]]]] @@ -76,8 +76,8 @@ .#version "" .#mode {.#Build} .#configuration (list)] - .#source [location.dummy 0 ""] - .#location location.dummy + .#source [provenance.dummy 0 ""] + .#provenance provenance.dummy .#current_module {.#Some current_module} .#modules (list [current_module [.#module_hash 0 diff --git a/stdlib/source/test/lux/meta/code.lux b/stdlib/source/test/lux/meta/code.lux index 994d95f69d..a8fccafb14 100644 --- a/stdlib/source/test/lux/meta/code.lux +++ b/stdlib/source/test/lux/meta/code.lux @@ -27,7 +27,7 @@ ["[0]" decimal]]] [meta ["[0]" name] - ["[0]" location] + ["[0]" provenance] ["[0]" static] [macro ["^" pattern] @@ -219,7 +219,7 @@ ..here syntax.no_aliases) start (is Source - [location.dummy 0 source_code])] + [provenance.dummy 0 source_code])] (when (parse start) {.#Left [end error]} {try.#Failure error} @@ -273,7 +273,7 @@ {try.#Failure error} false) (by /.equivalence = - [location.dummy { expected}] + [provenance.dummy { expected}] ( expected)))))] [/.bit random.bit .#Bit] @@ -299,7 +299,7 @@ {try.#Failure error} false) (by /.equivalence = - [location.dummy { ["" expected]}] + [provenance.dummy { ["" expected]}] ( expected))) ))] diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/analysis.lux b/stdlib/source/test/lux/meta/compiler/language/lux/analysis.lux index 2986fce3c8..04e1e40d32 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/analysis.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/analysis.lux @@ -62,7 +62,7 @@ [/// [meta ["[1][0]" name] - ["[0]" location (.only) + ["[0]" provenance (.only) ["[2][1]" /] ["[1]" \\library]]]]]]) @@ -388,12 +388,12 @@ version/1 random.natural host/1 (random.lower_cased 5) expected_error (random.lower_cased 10) - location/0 /location.random - location/1 /location.random + provenance/0 /provenance.random + provenance/1 /provenance.random configuration ($configuration.random 5) - .let [state/0 (has .#location location/0 + .let [state/0 (has .#provenance provenance/0 (/.state (/.info version/0 host/0 configuration))) - state/1 (has .#location location/1 + state/1 (has .#provenance provenance/1 (/.state (/.info version/1 host/1 configuration)))]] (all _.and (_.coverage [/.set_state] @@ -411,7 +411,7 @@ (pipe.when {try.#Failure actual_error} (and (text.contains? expected_error actual_error) - (text.contains? (location.as_text location/0) actual_error)) + (text.contains? (provenance.as_text provenance/0) actual_error)) _ false))) @@ -421,7 +421,7 @@ (pipe.when {try.#Failure actual_error} (and (text.contains? (exception.error []) actual_error) - (text.contains? (location.as_text location/0) actual_error)) + (text.contains? (provenance.as_text provenance/0) actual_error)) _ false))) @@ -433,7 +433,7 @@ {try.#Failure actual_error} (and (text.contains? expected_error actual_error) (text.contains? (exception.error []) actual_error) - (text.contains? (location.as_text location/0) actual_error)) + (text.contains? (provenance.as_text provenance/0) actual_error)) _ false))) @@ -443,7 +443,7 @@ (pipe.when {try.#Failure actual_error} (and (text.contains? (exception.error []) actual_error) - (text.contains? (location.as_text location/0) actual_error)) + (text.contains? (provenance.as_text provenance/0) actual_error)) _ false)) @@ -466,13 +466,13 @@ expected_module (random.lower_cased 10) dummy_module (random.lower_cased 11) - location /location.random + provenance /provenance.random expected_file (random.lower_cased 12) expected_code (random.lower_cased 13) configuration ($configuration.random 5) - .let [state (has .#location location + .let [state (has .#provenance provenance (/.state (/.info version host configuration)))]] (all _.and (_.coverage [/.info] @@ -488,16 +488,16 @@ it (/.state info)] (and (same? info (its .#info it)) - (same? location.dummy - (its .#location it)) + (same? provenance.dummy + (its .#provenance it)) (..tagged? .#None (its .#current_module it)) (..tagged? .#None (its .#expected it)) (list.empty? (its .#modules it)) (list.empty? (its .#scopes it)) (list.empty? (its [.#type_context .#var_bindings] it)) (when (its .#source it) - [location 0 ""] - (same? location.dummy location) + [provenance 0 ""] + (same? provenance.dummy provenance) _ false)))) @@ -525,11 +525,11 @@ (same? expected_module post)))) (phase.value state) (try.else false)))) - (_.coverage [/.location /.set_location] - (let [expected (/.location expected_file)] + (_.coverage [/.provenance /.set_provenance] + (let [expected (/.provenance expected_file)] (|> (do phase.monad - [_ (/.set_location expected)] - (phase.read (its .#location))) + [_ (/.set_provenance expected)] + (phase.read (its .#provenance))) (phase.value state) (pipe.when {try.#Success actual} @@ -537,16 +537,16 @@ _ false)))) - (_.coverage [/.with_location] - (let [expected (/.location expected_file) - dummy (/.location expected_code) - location (phase.read (its .#location))] + (_.coverage [/.with_provenance] + (let [expected (/.provenance expected_file) + dummy (/.provenance expected_code) + provenance (phase.read (its .#provenance))] (|> (do phase.monad - [_ (/.set_location expected) - pre location - mid (/.with_location dummy - location) - post location] + [_ (/.set_provenance expected) + pre provenance + mid (/.with_provenance dummy + provenance) + post provenance] (in (and (same? expected pre) (same? dummy mid) (same? expected post)))) diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/complex.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/complex.lux index 1cd34867c4..674338d9e6 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/complex.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/complex.lux @@ -17,7 +17,7 @@ [number ["[0]" i64]]] [meta - ["[0]" location] + ["[0]" provenance] [macro ["[0]" template]] [compiler @@ -51,8 +51,8 @@ .#version "" .#mode {.#Build} .#configuration (list)] - .#source [location.dummy 0 ""] - .#location location.dummy + .#source [provenance.dummy 0 ""] + .#provenance provenance.dummy .#current_module {.#None} .#modules (list) .#scopes (list) @@ -92,7 +92,7 @@ [_ (translation.set_buffer translation.empty_buffer) _ runtime.translation it (/.variant phase archive.empty - [ ( location.dummy )])] + [ ( provenance.dummy )])] (in (when (by host evaluate [{.#None} it]) {try.#Success actual} (when (as Variant/3 actual) @@ -119,9 +119,9 @@ (do phase.monad [_ (translation.set_buffer translation.empty_buffer) it (/.tuple phase archive.empty - (list (synthesis.bit location.dummy expected_bit) - (synthesis.i64 location.dummy expected_i64) - (synthesis.text location.dummy expected_text)))] + (list (synthesis.bit provenance.dummy expected_bit) + (synthesis.i64 provenance.dummy expected_i64) + (synthesis.text provenance.dummy expected_text)))] (in (when (by host evaluate [{.#None} it]) {try.#Success actual} (let [[actual_bit actual_i64 actual_text] (as Tuple/3 actual)] diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/function/abstract.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/function/abstract.lux index b4225683fb..ca6cbc1e46 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/function/abstract.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/function/abstract.lux @@ -15,7 +15,6 @@ [number ["n" natural]]] [meta - ["[0]" location] [compiler [target [jvm diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/variable/count.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/variable/count.lux index 467f823a88..bb765bd6f4 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/variable/count.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/function/field/variable/count.lux @@ -19,7 +19,6 @@ [number ["n" natural]]] [meta - ["[0]" location] [compiler [target [jvm diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/reference.lux b/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/reference.lux index 8ad978cf81..b52e4e1ba8 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/reference.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/phase/translation/jvm/reference.lux @@ -18,7 +18,6 @@ ["n" natural] ["[0]" i64]]] [meta - ["[0]" location] [compiler [meta ["[0]" archive]]]] diff --git a/stdlib/source/test/lux/meta/compiler/language/lux/syntax.lux b/stdlib/source/test/lux/meta/compiler/language/lux/syntax.lux index c86eb0f9b4..50781863d6 100644 --- a/stdlib/source/test/lux/meta/compiler/language/lux/syntax.lux +++ b/stdlib/source/test/lux/meta/compiler/language/lux/syntax.lux @@ -24,7 +24,7 @@ ["[1]T" \\test]]]] [meta ["[0]" code] - ["[0]" location] + ["[0]" provenance] ["[0]" name] [macro ["[0]" template]]] @@ -96,7 +96,7 @@ (_.test "Can parse Lux code." (when (let [source_code (code.as_text sample)] (/.parse source_code "" (dictionary.empty text.hash) - [location.dummy 0 source_code])) + [provenance.dummy 0 source_code])) {.#Left error} false @@ -107,7 +107,7 @@ (_.test "Can parse multiple Lux code nodes." (let [source_code (%.message (code.as_text sample) " " (code.as_text other))] (when (/.parse source_code "" (dictionary.empty text.hash) - [location.dummy 0 source_code]) + [provenance.dummy 0 source_code]) {.#Left error} false @@ -123,7 +123,7 @@ (_.coverage [fraction.extension] (when (let [source_code (by fraction.format injection expected_fraction)] (/.parse source_code "" (dictionary.empty text.hash) - [location.dummy 0 source_code])) + [provenance.dummy 0 source_code])) {.#Left _} false @@ -136,7 +136,7 @@ (_.coverage [rational.extension] (when (let [source_code (by rational.format injection expected_rational)] (/.parse source_code "" (dictionary.empty text.hash) - [location.dummy 0 source_code])) + [provenance.dummy 0 source_code])) {.#Left _} false @@ -151,7 +151,7 @@ (and (when (let [source_code (%.message (by n.base_10 injection natural_numerator) (its unit.#suffix ,unit))] (/.parse source_code "" (dictionary.empty text.hash) - [location.dummy 0 source_code])) + [provenance.dummy 0 source_code])) {.#Left _} false @@ -164,7 +164,7 @@ (when (let [source_code (%.message (by i.base_10 injection integer_numerator) (its unit.#suffix ,unit))] (/.parse source_code "" (dictionary.empty text.hash) - [location.dummy 0 source_code])) + [provenance.dummy 0 source_code])) {.#Left _} false @@ -177,7 +177,7 @@ (when (let [source_code (%.message (by d.base_10 injection decimal_numerator) (its unit.#suffix ,unit))] (/.parse source_code "" (dictionary.empty text.hash) - [location.dummy 0 source_code])) + [provenance.dummy 0 source_code])) {.#Left _} false @@ -220,7 +220,7 @@ (_.test "Can handle comments." (when (let [source_code (%.message comment (code.as_text sample))] (/.parse source_code "" (dictionary.empty text.hash) - [location.dummy 0 source_code])) + [provenance.dummy 0 source_code])) {.#Left error} false diff --git a/stdlib/source/test/lux/meta/compiler/meta/import.lux b/stdlib/source/test/lux/meta/compiler/meta/import.lux index 0077dfd473..3b993f8812 100644 --- a/stdlib/source/test/lux/meta/compiler/meta/import.lux +++ b/stdlib/source/test/lux/meta/compiler/meta/import.lux @@ -29,10 +29,10 @@ ["[0]" random (.only Random)] [number ["n" natural]]] + [time + ["[0]" instant]] [world - ["[0]" file] - [time - ["[0]" instant]]] + ["[0]" file]] [test ["[0]" unit] ["_" property (.only Test)]]]] diff --git a/stdlib/source/test/lux/meta/extension.lux b/stdlib/source/test/lux/meta/extension.lux index 0ff7e50b7c..25a4a9349e 100644 --- a/stdlib/source/test/lux/meta/extension.lux +++ b/stdlib/source/test/lux/meta/extension.lux @@ -24,7 +24,7 @@ [number ["n" natural]]] ["[0]" meta (.only) - ["[0]" location] + ["[0]" provenance] ["[0]" code ["<[1]>" \\projection]] [macro @@ -87,7 +87,7 @@ (monad.each ! (phase archive)) (by ! each (|>> (is (List analysis.Term)) {analysis.#Extension (name ..my_synthesis|synthesis)} - [location.dummy] + [provenance.dummy] (is analysis.Term))))))) ... Translation @@ -103,7 +103,7 @@ (|> parameters (monad.each ! (phase archive)) (by ! each (|>> {synthesis.#Extension (name ..my_translation|translation)} - [location.dummy] + [provenance.dummy] (is synthesis.Term))))))) (the my_translation @@ -114,7 +114,7 @@ (monad.each ! (phase archive)) (by ! each (|>> (is (List analysis.Term)) {analysis.#Extension (name ..my_translation|synthesis)} - [location.dummy] + [provenance.dummy] (is analysis.Term))))))) (the dummy_translation|translation @@ -133,13 +133,13 @@ Synthesis (synthesis (_ phase archive []) (by phase.monad in (is synthesis.Term - [location.dummy {synthesis.#Extension (name ..dummy_translation|translation) (list)}])))) + [provenance.dummy {synthesis.#Extension (name ..dummy_translation|translation) (list)}])))) (the dummy_translation Analysis (analysis (_ phase archive []) (by phase.monad in (is analysis.Term - [location.dummy {analysis.#Extension (name ..dummy_translation|synthesis) (list)}])))) + [provenance.dummy {analysis.#Extension (name ..dummy_translation|synthesis) (list)}])))) ... Declaration (the my_declaration diff --git a/stdlib/source/test/lux/meta/label.lux b/stdlib/source/test/lux/meta/label.lux index 0e869fb7f6..18235620c7 100644 --- a/stdlib/source/test/lux/meta/label.lux +++ b/stdlib/source/test/lux/meta/label.lux @@ -26,7 +26,7 @@ ["[0]" static] ["[0]" name] ["[0]" code] - ["[0]" location] + ["[0]" provenance] ["[0]" type] [macro ["[0]" expansion] @@ -132,8 +132,8 @@ .#version "" .#mode {.#Build} .#configuration (list)] - .#source [location.dummy 0 ""] - .#location location.dummy + .#source [provenance.dummy 0 ""] + .#provenance provenance.dummy .#current_module {.#Some current_module} .#modules (list [current_module [.#module_hash 0 diff --git a/stdlib/source/test/lux/meta/macro.lux b/stdlib/source/test/lux/meta/macro.lux index 58e29bc40f..10d69df214 100644 --- a/stdlib/source/test/lux/meta/macro.lux +++ b/stdlib/source/test/lux/meta/macro.lux @@ -20,7 +20,7 @@ ["n" natural]]] ["[0]" meta (.only) ["[0]" static] - ["[0]" location] + ["[0]" provenance] ["[0]" name] ["[0]" code (.only) ["<[1]>" \\projection]]] @@ -84,8 +84,8 @@ .#version "" .#mode {.#Build} .#configuration (list)] - .#source [location.dummy 0 ""] - .#location location.dummy + .#source [provenance.dummy 0 ""] + .#provenance provenance.dummy .#current_module {.#Some current_module} .#modules (list [macro_module [.#module_hash 0 diff --git a/stdlib/source/test/lux/meta/macro/syntax/definition.lux b/stdlib/source/test/lux/meta/macro/syntax/definition.lux index 77a49ecccb..dcd27b6366 100644 --- a/stdlib/source/test/lux/meta/macro/syntax/definition.lux +++ b/stdlib/source/test/lux/meta/macro/syntax/definition.lux @@ -16,7 +16,7 @@ ["[0]" random (.only Random)]] [meta ["[0]" static] - ["[0]" location] + ["[0]" provenance] ["[0]" code ["<[1]>" \\projection]]] [test @@ -42,8 +42,8 @@ .#version "0.0.0" .#mode {.#Build} .#configuration (list)] - .#source [location.dummy 0 ""] - .#location location.dummy + .#source [provenance.dummy 0 ""] + .#provenance provenance.dummy .#current_module {.#None} .#modules (list) .#scopes (list) diff --git a/stdlib/source/test/lux/meta/module.lux b/stdlib/source/test/lux/meta/module.lux index a0eeea0252..47dbf0f834 100644 --- a/stdlib/source/test/lux/meta/module.lux +++ b/stdlib/source/test/lux/meta/module.lux @@ -15,7 +15,7 @@ [number ["n" natural]]] [meta - ["[0]" location] + ["[0]" provenance] [macro ["^" pattern] ["[0]" template]]] @@ -73,8 +73,8 @@ .#version version .#mode {.#Build} .#configuration (list)] - .#source [location.dummy 0 source_code] - .#location location.dummy + .#source [provenance.dummy 0 source_code] + .#provenance provenance.dummy .#current_module {.#Some expected_current_module} .#modules expected_modules .#scopes (list) diff --git a/stdlib/source/test/lux/meta/module/import.lux b/stdlib/source/test/lux/meta/module/import.lux index cf755c5ed4..21a68f30b5 100644 --- a/stdlib/source/test/lux/meta/module/import.lux +++ b/stdlib/source/test/lux/meta/module/import.lux @@ -17,7 +17,7 @@ [number ["n" natural]]] ["[0]" meta (.only) - ["[0]" location]] + ["[0]" provenance]] [test ["_" property (.only Test)]]]] [\\library @@ -59,8 +59,8 @@ .#version version .#mode {.#Build} .#configuration (list)] - .#source [location.dummy 0 source_code] - .#location location.dummy + .#source [provenance.dummy 0 source_code] + .#provenance provenance.dummy .#current_module {.#Some expected_current_module} .#modules expected_modules .#scopes (list) diff --git a/stdlib/source/test/lux/meta/location.lux b/stdlib/source/test/lux/meta/provenance.lux similarity index 81% rename from stdlib/source/test/lux/meta/location.lux rename to stdlib/source/test/lux/meta/provenance.lux index f565dc8490..3faf715a40 100644 --- a/stdlib/source/test/lux/meta/location.lux +++ b/stdlib/source/test/lux/meta/provenance.lux @@ -22,7 +22,7 @@ ["[1][0]" code]]) (the .public random - (Random Location) + (Random Provenance) (all random.and (random.alphabetic 10) random.natural @@ -32,7 +32,7 @@ (the .public test Test (<| (_.covering /._) - (_.for [.Location + (_.for [.Provenance .#module .#line .#column]) (all _.and (_.for [/.equivalence /.=] @@ -42,16 +42,16 @@ (_.coverage [/.here] (not (by /.equivalence = (/.here) (/.here)))) (do random.monad - [location ..random + [provenance ..random error (random.alphabetic 10)] (_.coverage [/.as_text /.with] - (let [located_error (/.with location error)] - (and (text.contains? (/.as_text location) + (let [located_error (/.with provenance error)] + (and (text.contains? (/.as_text provenance) located_error) (text.contains? error located_error))))) (do random.monad - [[location _] $//code.random] + [[provenance _] $//code.random] (_.coverage [/.dummy] - (by /.equivalence = /.dummy location))) + (by /.equivalence = /.dummy provenance))) ))) diff --git a/stdlib/source/test/lux/meta/type/row.lux b/stdlib/source/test/lux/meta/type/row.lux index 74fb8a1ece..50e28024ad 100644 --- a/stdlib/source/test/lux/meta/type/row.lux +++ b/stdlib/source/test/lux/meta/type/row.lux @@ -22,12 +22,11 @@ ["[0]" syntax] ["[0]" expansion] ["[0]" template]]] + [time + ["[0]" instant (.only Instant)] + ["[0]" duration (.only Duration)]] [test - ["_" property (.only Test)]] - [world - [time - ["[0]" instant (.only Instant)] - ["[0]" duration (.only Duration)]]]]] + ["_" property (.only Test)]]]] [\\library ["[0]" /]]) diff --git a/stdlib/source/test/lux/test/benchmark.lux b/stdlib/source/test/lux/test/benchmark.lux index 55d22ade67..4387f4f8b8 100644 --- a/stdlib/source/test/lux/test/benchmark.lux +++ b/stdlib/source/test/lux/test/benchmark.lux @@ -13,9 +13,8 @@ ["[0]" random (.only Random)] [number ["n" natural]]] - [world - [time - ["[0]" duration]]] + [time + ["[0]" duration]] [test ["_" property (.only Test)]]]] [\\library diff --git a/stdlib/source/test/lux/world/time.lux b/stdlib/source/test/lux/time.lux similarity index 100% rename from stdlib/source/test/lux/world/time.lux rename to stdlib/source/test/lux/time.lux diff --git a/stdlib/source/test/lux/world/time/date.lux b/stdlib/source/test/lux/time/date.lux similarity index 100% rename from stdlib/source/test/lux/world/time/date.lux rename to stdlib/source/test/lux/time/date.lux diff --git a/stdlib/source/test/lux/world/time/day.lux b/stdlib/source/test/lux/time/day.lux similarity index 100% rename from stdlib/source/test/lux/world/time/day.lux rename to stdlib/source/test/lux/time/day.lux diff --git a/stdlib/source/test/lux/world/time/duration.lux b/stdlib/source/test/lux/time/duration.lux similarity index 100% rename from stdlib/source/test/lux/world/time/duration.lux rename to stdlib/source/test/lux/time/duration.lux diff --git a/stdlib/source/test/lux/world/time/instant.lux b/stdlib/source/test/lux/time/instant.lux similarity index 100% rename from stdlib/source/test/lux/world/time/instant.lux rename to stdlib/source/test/lux/time/instant.lux diff --git a/stdlib/source/test/lux/world/time/month.lux b/stdlib/source/test/lux/time/month.lux similarity index 100% rename from stdlib/source/test/lux/world/time/month.lux rename to stdlib/source/test/lux/time/month.lux diff --git a/stdlib/source/test/lux/world/time/solar.lux b/stdlib/source/test/lux/time/solar.lux similarity index 100% rename from stdlib/source/test/lux/world/time/solar.lux rename to stdlib/source/test/lux/time/solar.lux diff --git a/stdlib/source/test/lux/world/time/year.lux b/stdlib/source/test/lux/time/year.lux similarity index 100% rename from stdlib/source/test/lux/world/time/year.lux rename to stdlib/source/test/lux/time/year.lux diff --git a/stdlib/source/test/lux/world.lux b/stdlib/source/test/lux/world.lux index b7da1cb93f..ac493ce9b9 100644 --- a/stdlib/source/test/lux/world.lux +++ b/stdlib/source/test/lux/world.lux @@ -27,7 +27,6 @@ ["[1]/[0]" interest ["[1]/[0]" rate]]] ["[1][0]" net] - ["[1][0]" time] ["[1][0]" locale] ["[1][0]" logging]]) @@ -50,7 +49,6 @@ /finance/interest/rate.test /net.test - /time.test /locale.test /logging.test )) diff --git a/stdlib/source/test/lux/world/file.lux b/stdlib/source/test/lux/world/file.lux index 0edbdc88b8..eeb5509984 100644 --- a/stdlib/source/test/lux/world/file.lux +++ b/stdlib/source/test/lux/world/file.lux @@ -32,9 +32,8 @@ [meta [macro ["^" pattern]]] - [world - [time - ["[0]" instant (.only Instant)]]] + [time + ["[0]" instant (.only Instant)]] [test ["_" property (.only Test)] ["[0]" unit]]]] diff --git a/stdlib/source/test/lux/world/finance/interest/rate.lux b/stdlib/source/test/lux/world/finance/interest/rate.lux index 2f674a668d..c3c7d85d9e 100644 --- a/stdlib/source/test/lux/world/finance/interest/rate.lux +++ b/stdlib/source/test/lux/world/finance/interest/rate.lux @@ -54,7 +54,7 @@ (_.coverage [/.as_text] (let [same_value! - (by (d.approximately +0.01) = left right) + (by (d.approximately +0.009) = left right) same_representation! (text.= (/.as_text left) (/.as_text right))] diff --git a/stdlib/source/test/lux/world/logging.lux b/stdlib/source/test/lux/world/logging.lux index 0cfa0d3fe0..b8a30b8e2f 100644 --- a/stdlib/source/test/lux/world/logging.lux +++ b/stdlib/source/test/lux/world/logging.lux @@ -18,9 +18,8 @@ [meta [macro ["[0]" template]]] - [world - [time - ["[0]" instant]]] + [time + ["[0]" instant]] [test ["_" property (.only Test)] ["[0]" unit]]]] diff --git a/stdlib/source/test/lux/world/net/http/cookie.lux b/stdlib/source/test/lux/world/net/http/cookie.lux index babc62aa0c..af23c51e93 100644 --- a/stdlib/source/test/lux/world/net/http/cookie.lux +++ b/stdlib/source/test/lux/world/net/http/cookie.lux @@ -21,10 +21,9 @@ [meta [macro ["[0]" template]]] - [world - [time - ["[0]" instant] - ["[0]" duration]]] + [time + ["[0]" instant] + ["[0]" duration]] [test ["_" property (.only Test)]]]] [\\library diff --git a/stdlib/source/test/lux/world/net/http/version.lux b/stdlib/source/test/lux/world/net/http/version.lux index df5afba410..45ade2a744 100644 --- a/stdlib/source/test/lux/world/net/http/version.lux +++ b/stdlib/source/test/lux/world/net/http/version.lux @@ -27,12 +27,10 @@ (the .public random (Random /.Version) - (all random.either - (random#in /.v0_9) - (random#in /.v1_0) - (random#in /.v1_1) - (random#in /.v2_0) - )) + (random.either (random.either (random#in /.v0_9) + (random#in /.v1_0)) + (random.either (random#in /.v1_1) + (random#in /.v2_0)))) (the .public test Test diff --git a/stdlib/source/unsafe/lux/data/collection/array.lux b/stdlib/source/unsafe/lux/data/collection/array.lux index c33f2a20f9..6bbd1587fd 100644 --- a/stdlib/source/unsafe/lux/data/collection/array.lux +++ b/stdlib/source/unsafe/lux/data/collection/array.lux @@ -15,7 +15,7 @@ [collection ["[0]" list]]] [meta - ["[0]" location] + ["[0]" provenance] [type ["[0]" variance]]]]]) @@ -323,7 +323,7 @@ (the .public no_example Text - (location.with (location.here) + (provenance.with (provenance.here) "No example to be found.")) (with_template' [ ] @@ -525,7 +525,7 @@ (the .public no_one Error - (location.with (location.here) + (provenance.with (provenance.here) "No one value to be found.")) (the .public one