From ec1f31b5a1492d5e0ab260397291d4449483bbd9 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 23 Aug 2021 02:30:53 -0400 Subject: The Python compiler can now be compiled by the new JVM compiler. --- stdlib/source/test/aedifex/command/auto.lux | 2 +- stdlib/source/test/aedifex/command/deploy.lux | 10 ++--- stdlib/source/test/aedifex/command/deps.lux | 4 +- stdlib/source/test/aedifex/command/pom.lux | 4 +- .../source/test/aedifex/dependency/deployment.lux | 10 ++--- .../source/test/aedifex/dependency/resolution.lux | 42 ++++++++++---------- stdlib/source/test/aedifex/hash.lux | 4 +- stdlib/source/test/aedifex/input.lux | 2 +- stdlib/source/test/aedifex/package.lux | 4 +- stdlib/source/test/aedifex/repository/local.lux | 2 +- stdlib/source/test/aedifex/repository/remote.lux | 6 +-- stdlib/source/test/lux/abstract.lux | 4 +- stdlib/source/test/lux/abstract/apply.lux | 6 +-- stdlib/source/test/lux/abstract/codec.lux | 6 +-- stdlib/source/test/lux/abstract/enum.lux | 14 +++---- stdlib/source/test/lux/abstract/fold.lux | 26 ------------ stdlib/source/test/lux/abstract/mix.lux | 26 ++++++++++++ stdlib/source/test/lux/abstract/monad.lux | 16 ++++---- stdlib/source/test/lux/abstract/monoid.lux | 4 +- stdlib/source/test/lux/control/concurrency/frp.lux | 26 ++++++------ stdlib/source/test/lux/control/function/memo.lux | 4 +- stdlib/source/test/lux/control/function/mixin.lux | 4 +- stdlib/source/test/lux/control/parser/binary.lux | 16 ++++---- stdlib/source/test/lux/control/parser/cli.lux | 6 +-- stdlib/source/test/lux/control/parser/text.lux | 28 ++++++------- stdlib/source/test/lux/data/binary.lux | 4 +- stdlib/source/test/lux/data/collection/array.lux | 6 +-- stdlib/source/test/lux/data/collection/list.lux | 18 ++++----- .../test/lux/data/collection/queue/priority.lux | 12 +++--- stdlib/source/test/lux/data/collection/row.lux | 8 ++-- .../source/test/lux/data/collection/set/multi.lux | 12 +++--- stdlib/source/test/lux/data/collection/tree.lux | 10 ++--- .../test/lux/data/collection/tree/finger.lux | 10 ++--- stdlib/source/test/lux/data/format/json.lux | 2 +- stdlib/source/test/lux/data/format/tar.lux | 6 +-- stdlib/source/test/lux/data/name.lux | 2 +- stdlib/source/test/lux/data/text/encoding.lux | 10 ++--- stdlib/source/test/lux/data/text/escape.lux | 4 +- stdlib/source/test/lux/data/text/format.lux | 4 +- stdlib/source/test/lux/locale/language.lux | 34 ++++++++-------- stdlib/source/test/lux/locale/territory.lux | 38 +++++++++--------- stdlib/source/test/lux/math/modular.lux | 4 +- stdlib/source/test/lux/math/number.lux | 6 +-- stdlib/source/test/lux/math/number/i64.lux | 2 +- stdlib/source/test/lux/time.lux | 8 ++-- stdlib/source/test/lux/time/date.lux | 2 +- stdlib/source/test/lux/time/day.lux | 2 +- stdlib/source/test/lux/time/instant.lux | 8 ++-- stdlib/source/test/lux/time/month.lux | 8 ++-- .../compiler/language/lux/phase/synthesis/case.lux | 46 +++++++++++----------- .../language/lux/phase/synthesis/function.lux | 38 +++++++++--------- .../language/lux/phase/synthesis/variable.lux | 14 +++---- stdlib/source/test/lux/type/check.lux | 12 +++--- stdlib/source/test/lux/world/net/http/client.lux | 8 ++-- 54 files changed, 307 insertions(+), 307 deletions(-) delete mode 100644 stdlib/source/test/lux/abstract/fold.lux create mode 100644 stdlib/source/test/lux/abstract/mix.lux (limited to 'stdlib/source/test') diff --git a/stdlib/source/test/aedifex/command/auto.lux b/stdlib/source/test/aedifex/command/auto.lux index ea62b6daa..1ed19ddf7 100644 --- a/stdlib/source/test/aedifex/command/auto.lux +++ b/stdlib/source/test/aedifex/command/auto.lux @@ -57,7 +57,7 @@ (if (n.= expected_runs actual_runs) (in (#try.Failure end_signal)) (do (try.with !) - [_ (\ fs write (\ utf8.codec encode (%.nat actual_runs)) dummy_file) + [_ (\ fs write (\ utf8.codec encoded (%.nat actual_runs)) dummy_file) _ (\ fs modify (|> actual_runs .int instant.of_millis) dummy_file)] diff --git a/stdlib/source/test/aedifex/command/deploy.lux b/stdlib/source/test/aedifex/command/deploy.lux index 1df6a4180..526227f2d 100644 --- a/stdlib/source/test/aedifex/command/deploy.lux +++ b/stdlib/source/test/aedifex/command/deploy.lux @@ -91,13 +91,13 @@ actual_sha-1 (\ repository download (///repository/remote.uri (value@ #///artifact.version artifact) artifact (format ///artifact/extension.lux_library ///artifact/extension.sha-1))) actual_sha-1 (\ async.monad in (do try.monad - [actual_sha-1 (\ utf8.codec decode actual_sha-1)] - (\ ///hash.sha-1_codec decode actual_sha-1))) + [actual_sha-1 (\ utf8.codec decoded actual_sha-1)] + (\ ///hash.sha-1_codec decoded actual_sha-1))) actual_md5 (\ repository download (///repository/remote.uri (value@ #///artifact.version artifact) artifact (format ///artifact/extension.lux_library ///artifact/extension.md5))) actual_md5 (\ async.monad in (do try.monad - [actual_md5 (\ utf8.codec decode actual_md5)] - (\ ///hash.md5_codec decode actual_md5))) + [actual_md5 (\ utf8.codec decoded actual_md5)] + (\ ///hash.md5_codec decoded actual_md5))) .let [succeeded! (text\= /.success logging) @@ -107,7 +107,7 @@ actual_library) deployed_pom! - (binary\= (|> expected_pom (\ xml.codec encode) (\ utf8.codec encode)) + (binary\= (|> expected_pom (\ xml.codec encoded) (\ utf8.codec encoded)) actual_pom) deployed_sha-1! diff --git a/stdlib/source/test/aedifex/command/deps.lux b/stdlib/source/test/aedifex/command/deps.lux index ec45ba697..87a3e1731 100644 --- a/stdlib/source/test/aedifex/command/deps.lux +++ b/stdlib/source/test/aedifex/command/deps.lux @@ -85,12 +85,12 @@ dependee_package (|> dependee_package (with@ #///package.origin (#///repository/origin.Remote "")) (with@ #///package.pom [dependee_pom - (|> dependee_pom (\ xml.codec encode) (\ utf8.codec encode)) + (|> dependee_pom (\ xml.codec encoded) (\ utf8.codec encoded)) #///dependency/status.Unverified])) depender_package (|> depender_package (with@ #///package.origin (#///repository/origin.Remote "")) (with@ #///package.pom [depender_pom - (|> depender_pom (\ xml.codec encode) (\ utf8.codec encode)) + (|> depender_pom (\ xml.codec encoded) (\ utf8.codec encoded)) #///dependency/status.Unverified])) fs (file.mock (\ file.default separator)) diff --git a/stdlib/source/test/aedifex/command/pom.lux b/stdlib/source/test/aedifex/command/pom.lux index b06a7c944..7c2097a4d 100644 --- a/stdlib/source/test/aedifex/command/pom.lux +++ b/stdlib/source/test/aedifex/command/pom.lux @@ -44,8 +44,8 @@ (do ! [verdict (do ///action.monad [expected (|> (///pom.write sample) - (try\map (|>> (\ xml.codec encode) - (\ utf8.codec encode))) + (try\map (|>> (\ xml.codec encoded) + (\ utf8.codec encoded))) (\ ! in)) actual (\ fs read ///pom.file) diff --git a/stdlib/source/test/aedifex/dependency/deployment.lux b/stdlib/source/test/aedifex/dependency/deployment.lux index 009298783..97fd9f1f4 100644 --- a/stdlib/source/test/aedifex/dependency/deployment.lux +++ b/stdlib/source/test/aedifex/dependency/deployment.lux @@ -20,7 +20,7 @@ [collection ["." dictionary (#+ Dictionary)] ["." set] - ["." list ("#\." fold)]]] + ["." list ("#\." mix)]]] [math ["." random (#+ Random)] [number @@ -171,10 +171,10 @@ bundles (|> ..bundle (random.set hash num_bundles) (\ ! map set.list)) - .let [resolution (list\fold (function (_ [dependency expected_artifact package] resolution) - (dictionary.has dependency package resolution)) - resolution.empty - bundles) + .let [resolution (list\mix (function (_ [dependency expected_artifact package] resolution) + (dictionary.has dependency package resolution)) + resolution.empty + bundles) cache (: Cache (atom.atom (dictionary.empty text.hash))) http (..http cache) diff --git a/stdlib/source/test/aedifex/dependency/resolution.lux b/stdlib/source/test/aedifex/dependency/resolution.lux index 44420243d..355cf9c98 100644 --- a/stdlib/source/test/aedifex/dependency/resolution.lux +++ b/stdlib/source/test/aedifex/dependency/resolution.lux @@ -77,14 +77,14 @@ (def: sha-1 (-> Binary Binary) (|>> ///hash.sha-1 - (\ ///hash.sha-1_codec encode) - (\ utf8.codec encode))) + (\ ///hash.sha-1_codec encoded) + (\ utf8.codec encoded))) (def: md5 (-> Binary Binary) (|>> ///hash.md5 - (\ ///hash.md5_codec encode) - (\ utf8.codec encode))) + (\ ///hash.md5_codec encoded) + (\ utf8.codec encoded))) (def: .public nope (Mock Any) @@ -112,8 +112,8 @@ (|> package (value@ #///package.pom) product.left - (\ xml.codec encode) - (\ utf8.codec encode)))] + (\ xml.codec encoded) + (\ utf8.codec encoded)))] (cond (text.ends_with? ///artifact/extension.lux_library uri) (#try.Success [state library]) @@ -166,23 +166,23 @@ (#try.Success [state (|> expected_package (value@ #///package.pom) product.left - (\ xml.codec encode) - (\ utf8.codec encode))]) + (\ xml.codec encoded) + (\ utf8.codec encoded))]) (text.ends_with? ..pom_sha-1 uri) (#try.Success [state (|> dummy_package (value@ #///package.pom) product.left - (\ xml.codec encode) - (\ utf8.codec encode) + (\ xml.codec encoded) + (\ utf8.codec encoded) ..sha-1)]) (text.ends_with? ..pom_md5 uri) (#try.Success [state (|> expected_package (value@ #///package.pom) product.left - (\ xml.codec encode) - (\ utf8.codec encode) + (\ xml.codec encoded) + (\ utf8.codec encoded) ..md5)]) ... else @@ -219,23 +219,23 @@ (#try.Success [state (|> expected_package (value@ #///package.pom) product.left - (\ xml.codec encode) - (\ utf8.codec encode))]) + (\ xml.codec encoded) + (\ utf8.codec encoded))]) (text.ends_with? ..pom_sha-1 uri) (#try.Success [state (|> expected_package (value@ #///package.pom) product.left - (\ xml.codec encode) - (\ utf8.codec encode) + (\ xml.codec encoded) + (\ utf8.codec encoded) ..sha-1)]) (text.ends_with? ..pom_md5 uri) (#try.Success [state (|> dummy_package (value@ #///package.pom) product.left - (\ xml.codec encode) - (\ utf8.codec encode) + (\ xml.codec encoded) + (\ utf8.codec encoded) ..md5)]) ... else @@ -381,17 +381,17 @@ dependee_package (with@ #///package.pom [dependee_pom - (|> dependee_pom (\ xml.codec encode) (\ utf8.codec encode)) + (|> dependee_pom (\ xml.codec encoded) (\ utf8.codec encoded)) #///dependency/status.Unverified] dependee_package) depender_package (with@ #///package.pom [depender_pom - (|> depender_pom (\ xml.codec encode) (\ utf8.codec encode)) + (|> depender_pom (\ xml.codec encoded) (\ utf8.codec encoded)) #///dependency/status.Unverified] depender_package) ignored_package (with@ #///package.pom [ignored_pom - (|> ignored_pom (\ xml.codec encode) (\ utf8.codec encode)) + (|> ignored_pom (\ xml.codec encoded) (\ utf8.codec encoded)) #///dependency/status.Unverified] ignored_package)]] (in [[dependee depender ignored] diff --git a/stdlib/source/test/aedifex/hash.lux b/stdlib/source/test/aedifex/hash.lux index dc5633040..5e267091d 100644 --- a/stdlib/source/test/aedifex/hash.lux +++ b/stdlib/source/test/aedifex/hash.lux @@ -80,8 +80,8 @@ [(do random.monad [expected (..random )] (_.cover [] - (case (\ decode - (format (\ encode expected) + (case (\ decoded + (format (\ encoded expected) "AABBCC")) (#try.Success actual) false diff --git a/stdlib/source/test/aedifex/input.lux b/stdlib/source/test/aedifex/input.lux index 1c47fdd6f..675357e7e 100644 --- a/stdlib/source/test/aedifex/input.lux +++ b/stdlib/source/test/aedifex/input.lux @@ -53,7 +53,7 @@ [.let [profile (|> expected //format.profile %.code - (\ utf8.codec encode))] + (\ utf8.codec encoded))] _ (\ fs write profile //project.file) actual (: (Async (Try Profile)) (/.read async.monad fs //.default))] diff --git a/stdlib/source/test/aedifex/package.lux b/stdlib/source/test/aedifex/package.lux index 9596eb63f..7e9cf1dd6 100644 --- a/stdlib/source/test/aedifex/package.lux +++ b/stdlib/source/test/aedifex/package.lux @@ -92,8 +92,8 @@ expected_md5 (//hash.md5 binary_pom)] (and (same? expected_pom actual_pom) (|> (do try.monad - [xml_pom (\ utf8.codec decode binary_pom) - decoded_pom (\ xml.codec decode xml_pom)] + [xml_pom (\ utf8.codec decoded binary_pom) + decoded_pom (\ xml.codec decoded xml_pom)] (in (\ xml.equivalence = actual_pom decoded_pom))) (try.else false)) (case pom_status diff --git a/stdlib/source/test/aedifex/repository/local.lux b/stdlib/source/test/aedifex/repository/local.lux index b2352bdd2..ccc13752f 100644 --- a/stdlib/source/test/aedifex/repository/local.lux +++ b/stdlib/source/test/aedifex/repository/local.lux @@ -35,7 +35,7 @@ repo (/.repository program fs)] uri (random.ascii/lower 10) - expected (\ ! map (\ utf8.codec encode) + expected (\ ! map (\ utf8.codec encoded) (random.ascii/lower 10))] ($_ _.and (in (do async.monad diff --git a/stdlib/source/test/aedifex/repository/remote.lux b/stdlib/source/test/aedifex/repository/remote.lux index 44f913863..96d62ef6f 100644 --- a/stdlib/source/test/aedifex/repository/remote.lux +++ b/stdlib/source/test/aedifex/repository/remote.lux @@ -33,7 +33,7 @@ (def: (url_body url) (-> URL (@http.Body IO)) - (let [url (\ utf8.codec encode url)] + (let [url (\ utf8.codec encoded url)] (function (_ _) (io.io (#try.Success [(binary.size url) url]))))) @@ -90,7 +90,7 @@ user (random.ascii/lower 10) password (random.ascii/lower 10) - content (\ ! map (\ utf8.codec encode) + content (\ ! map (\ utf8.codec encoded) (random.ascii/lower 10))] ($_ _.and (_.cover [/.repository /.user_agent /.Address] @@ -100,7 +100,7 @@ address)] (and (|> (\ repo download uri) io.run! - (try\map (\ utf8.codec decode)) + (try\map (\ utf8.codec decoded)) try\join (try\map (text\= (format address uri))) (try.else false)) diff --git a/stdlib/source/test/lux/abstract.lux b/stdlib/source/test/lux/abstract.lux index cb41844eb..d65330a22 100644 --- a/stdlib/source/test/lux/abstract.lux +++ b/stdlib/source/test/lux/abstract.lux @@ -10,7 +10,7 @@ ["#." enum] ["#." equivalence] ["#." hash] - ["#." fold] + ["#." mix] ["#." functor ["#/." contravariant]] ["#." interval] @@ -49,7 +49,7 @@ /enum.test /equivalence.test /hash.test - /fold.test + /mix.test /interval.test /monoid.test /order.test diff --git a/stdlib/source/test/lux/abstract/apply.lux b/stdlib/source/test/lux/abstract/apply.lux index fcdf5d793..75da1dc47 100644 --- a/stdlib/source/test/lux/abstract/apply.lux +++ b/stdlib/source/test/lux/abstract/apply.lux @@ -25,9 +25,9 @@ ($_ _.and (_.cover [/.composite] (let [expected (n.+ left right)] - (case (\ (/.composite maybe.monad maybe.apply list.apply) apply - (#.Some (list (n.+ left))) - (#.Some (list right))) + (case (\ (/.composite maybe.monad maybe.apply list.apply) on + (#.Some (list right)) + (#.Some (list (n.+ left)))) (^ (#.Some (list actual))) (n.= expected actual) diff --git a/stdlib/source/test/lux/abstract/codec.lux b/stdlib/source/test/lux/abstract/codec.lux index e3fd09626..32668c30f 100644 --- a/stdlib/source/test/lux/abstract/codec.lux +++ b/stdlib/source/test/lux/abstract/codec.lux @@ -21,12 +21,12 @@ (Codec JSON Bit) (let [field "value"] (implementation - (def: encode + (def: encoded (|>> #json.Boolean [field] list json.object)) - (def: decode + (def: decoded (json.boolean_field field))))) (def: codec @@ -39,7 +39,7 @@ [expected random.bit] (<| (_.covering /._) (_.cover [/.composite] - (case (|> expected (\ ..codec encode) (\ ..codec decode)) + (case (|> expected (\ ..codec encoded) (\ ..codec decoded)) (#try.Success actual) (bit\= expected actual) diff --git a/stdlib/source/test/lux/abstract/enum.lux b/stdlib/source/test/lux/abstract/enum.lux index 179dad8df..33dff9472 100644 --- a/stdlib/source/test/lux/abstract/enum.lux +++ b/stdlib/source/test/lux/abstract/enum.lux @@ -9,7 +9,7 @@ [data ["." product] [collection - ["." list ("#\." fold)]]] + ["." list ("#\." mix)]]] [math ["." random (#+ Random)] [number @@ -39,12 +39,12 @@ (list.reversed (/.range n.enum end start))) every_element_is_a_successor? (case range (#.Item head tail) - (|> (list\fold (function (_ next [verdict prev]) - [(and verdict - (n.= next (\ n.enum succ prev))) - next]) - [true head] - tail) + (|> (list\mix (function (_ next [verdict prev]) + [(and verdict + (n.= next (\ n.enum succ prev))) + next]) + [true head] + tail) product.left) #.End diff --git a/stdlib/source/test/lux/abstract/fold.lux b/stdlib/source/test/lux/abstract/fold.lux deleted file mode 100644 index 1dbf9eec8..000000000 --- a/stdlib/source/test/lux/abstract/fold.lux +++ /dev/null @@ -1,26 +0,0 @@ -(.module: - [library - [lux #* - ["_" test (#+ Test)] - [abstract - [monad (#+ do)]] - [data - [collection - ["." list]]] - [math - ["." random] - [number - ["n" nat]]]]] - [\\library - ["." / (#+ Fold)]]) - -(def: .public test - Test - (do random.monad - [samples (random.list 10 random.nat)] - (<| (_.covering /._) - ($_ _.and - (_.cover [/.with_monoid] - (n.= (\ list.fold fold (\ n.addition compose) (\ n.addition identity) samples) - (/.with_monoid n.addition list.fold samples))) - )))) diff --git a/stdlib/source/test/lux/abstract/mix.lux b/stdlib/source/test/lux/abstract/mix.lux new file mode 100644 index 000000000..5aac1fd2b --- /dev/null +++ b/stdlib/source/test/lux/abstract/mix.lux @@ -0,0 +1,26 @@ +(.module: + [library + [lux #* + ["_" test (#+ Test)] + [abstract + [monad (#+ do)]] + [data + [collection + ["." list]]] + [math + ["." random] + [number + ["n" nat]]]]] + [\\library + ["." / (#+ Mix)]]) + +(def: .public test + Test + (do random.monad + [samples (random.list 10 random.nat)] + (<| (_.covering /._) + ($_ _.and + (_.cover [/.with_monoid] + (n.= (\ list.mix mix (\ n.addition compose) (\ n.addition identity) samples) + (/.with_monoid n.addition list.mix samples))) + )))) diff --git a/stdlib/source/test/lux/abstract/monad.lux b/stdlib/source/test/lux/abstract/monad.lux index 051f63a5c..5ede269ef 100644 --- a/stdlib/source/test/lux/abstract/monad.lux +++ b/stdlib/source/test/lux/abstract/monad.lux @@ -5,7 +5,7 @@ [data ["." identity (#+ Identity)] [collection - ["." list ("#\." functor fold)]]] + ["." list ("#\." functor mix)]]] [math ["." random] [number @@ -52,13 +52,13 @@ (|> poly (/.only identity.monad (|>> n.even? (\ identity.monad in))) (: (Identity (List Nat)))))) - (_.cover [/.fold] - (n.= (list\fold n.+ 0 poly) + (_.cover [/.mix] + (n.= (list\mix n.+ 0 poly) (|> poly - (/.fold identity.monad - (function (_ part whole) - (\ identity.monad in - (n.+ part whole))) - 0) + (/.mix identity.monad + (function (_ part whole) + (\ identity.monad in + (n.+ part whole))) + 0) (: (Identity Nat))))) )))) diff --git a/stdlib/source/test/lux/abstract/monoid.lux b/stdlib/source/test/lux/abstract/monoid.lux index 75eee67c6..c78d2d8f6 100644 --- a/stdlib/source/test/lux/abstract/monoid.lux +++ b/stdlib/source/test/lux/abstract/monoid.lux @@ -23,8 +23,8 @@ intR random.int] (<| (_.covering /._) ($_ _.and - (_.cover [/.composite] - (let [[natLR intLR] (\ (/.composite nat.addition int.multiplication) compose + (_.cover [/.and] + (let [[natLR intLR] (\ (/.and nat.addition int.multiplication) compose [natL intL] [natR intR])] (and (nat.= (\ nat.addition compose natL natR) natLR) diff --git a/stdlib/source/test/lux/control/concurrency/frp.lux b/stdlib/source/test/lux/control/concurrency/frp.lux index 5876331b6..174c8adc7 100644 --- a/stdlib/source/test/lux/control/concurrency/frp.lux +++ b/stdlib/source/test/lux/control/concurrency/frp.lux @@ -14,7 +14,7 @@ ["." io (#+ IO io)]] [data [collection - ["." list ("#\." fold monoid)] + ["." list ("#\." mix monoid)] ["." row (#+ Row)]]] [math ["." random] @@ -161,22 +161,22 @@ (_.cover' [/.Subscriber /.subscribe!] (list\= inputs listened)))) (in (do async.monad - [actual (/.aggregate (function (_ input total) - (async.resolved (n.+ input total))) - 0 - (/.sequential 0 inputs))] - (_.cover' [/.aggregate] - (n.= (list\fold n.+ 0 inputs) + [actual (/.mix (function (_ input total) + (async.resolved (n.+ input total))) + 0 + (/.sequential 0 inputs))] + (_.cover' [/.mix] + (n.= (list\mix n.+ 0 inputs) actual)))) (in (do async.monad [actual (|> inputs (/.sequential 0) - (/.aggregates (function (_ input total) - (async.resolved (n.+ input total))) - 0) + (/.mixes (function (_ input total) + (async.resolved (n.+ input total))) + 0) /.list)] - (_.cover' [/.aggregates] - (list\= (list.aggregates n.+ 0 inputs) + (_.cover' [/.mixes] + (list\= (list.mixes n.+ 0 inputs) actual)))) (in (do async.monad [actual (|> (list distint/0 distint/0 distint/0 @@ -218,6 +218,6 @@ /.list)] (_.cover' [/.iterations] (and (n.= max_iterations (list.size actual)) - (list\= (list.aggregates n.+ sample (list.repeated (-- max_iterations) shift)) + (list\= (list.mixes n.+ sample (list.repeated (-- max_iterations) shift)) actual))))) ))))) diff --git a/stdlib/source/test/lux/control/function/memo.lux b/stdlib/source/test/lux/control/function/memo.lux index 914247204..3941998fc 100644 --- a/stdlib/source/test/lux/control/function/memo.lux +++ b/stdlib/source/test/lux/control/function/memo.lux @@ -11,7 +11,7 @@ ["." product] [collection ["." dictionary (#+ Dictionary)] - ["." list ("#\." functor fold)]]] + ["." list ("#\." functor mix)]]] [math ["." random] [number @@ -112,7 +112,7 @@ (in (n.* input output'))))))) expected (|> (list.indices input) (list\map ++) - (list\fold n.* 1)) + (list\mix n.* 1)) actual (|> (memo input) (state.result (dictionary.empty n.hash)) product.right)] diff --git a/stdlib/source/test/lux/control/function/mixin.lux b/stdlib/source/test/lux/control/function/mixin.lux index b41da5623..001626888 100644 --- a/stdlib/source/test/lux/control/function/mixin.lux +++ b/stdlib/source/test/lux/control/function/mixin.lux @@ -13,7 +13,7 @@ [data ["." product] [collection - ["." list ("#\." functor fold)]]] + ["." list ("#\." functor mix)]]] [math ["." random (#+ Random)] [number @@ -40,7 +40,7 @@ output)))) expected (|> (list.indices input) (list\map ++) - (list\fold n.* 1))]]) + (list\mix n.* 1))]]) ($_ _.and (_.for [/.Mixin] ($_ _.and diff --git a/stdlib/source/test/lux/control/parser/binary.lux b/stdlib/source/test/lux/control/parser/binary.lux index dcf4d0e80..a3c20dbde 100644 --- a/stdlib/source/test/lux/control/parser/binary.lux +++ b/stdlib/source/test/lux/control/parser/binary.lux @@ -54,8 +54,8 @@ (def: (utf8_conversion_does_not_alter? value) (Predicate Text) (|> value - (\ utf8.codec encode) - (\ utf8.codec decode) + (\ utf8.codec encoded) + (\ utf8.codec decoded) (case> (#try.Success converted) (text\= value converted) @@ -148,7 +148,7 @@ (`` ($_ _.and (~~ (template [ ] [(do {! random.monad} - [expected (\ ! map (\ utf8.codec encode) (random.ascii ..segment_size))] + [expected (\ ! map (\ utf8.codec encoded) (random.ascii ..segment_size))] (_.cover [ ] (|> (format.result expected) (/.result ) @@ -329,14 +329,14 @@ (/.result /.any) (!expect (#try.Success _)))) (do {! random.monad} - [data (\ ! map (\ utf8.codec encode) (random.ascii ..segment_size))] + [data (\ ! map (\ utf8.codec encoded) (random.ascii ..segment_size))] (_.cover [/.binary_was_not_fully_read] (|> data (/.result /.any) (!expect (^multi (#try.Failure error) (exception.match? /.binary_was_not_fully_read error)))))) (do {! random.monad} - [expected (\ ! map (\ utf8.codec encode) (random.ascii ..segment_size))] + [expected (\ ! map (\ utf8.codec encoded) (random.ascii ..segment_size))] (_.cover [/.segment format.segment format.result] (|> expected (format.result (format.segment ..segment_size)) @@ -344,7 +344,7 @@ (!expect (^multi (#try.Success actual) (\ binary.equivalence = expected actual)))))) (do {! random.monad} - [data (\ ! map (\ utf8.codec encode) (random.ascii ..segment_size))] + [data (\ ! map (\ utf8.codec encoded) (random.ascii ..segment_size))] (_.cover [/.end?] (|> data (/.result (do <>.monad @@ -356,7 +356,7 @@ (!expect (#try.Success #1))))) (do {! random.monad} [to_read (\ ! map (n.% (++ ..segment_size)) random.nat) - data (\ ! map (\ utf8.codec encode) (random.ascii ..segment_size))] + data (\ ! map (\ utf8.codec encoded) (random.ascii ..segment_size))] (_.cover [/.Offset /.offset] (|> data (/.result (do <>.monad @@ -371,7 +371,7 @@ (!expect (#try.Success #1))))) (do {! random.monad} [to_read (\ ! map (n.% (++ ..segment_size)) random.nat) - data (\ ! map (\ utf8.codec encode) (random.ascii ..segment_size))] + data (\ ! map (\ utf8.codec encoded) (random.ascii ..segment_size))] (_.cover [/.remaining] (|> data (/.result (do <>.monad diff --git a/stdlib/source/test/lux/control/parser/cli.lux b/stdlib/source/test/lux/control/parser/cli.lux index 529986ad4..9c1247775 100644 --- a/stdlib/source/test/lux/control/parser/cli.lux +++ b/stdlib/source/test/lux/control/parser/cli.lux @@ -31,7 +31,7 @@ (<| (_.covering /._) (_.for [/.Parser]) (do {! random.monad} - [expected (\ ! map n\encode random.nat) + [expected (\ ! map n\encoded random.nat) .let [random_dummy (random.only (|>> (text\= expected) not) (random.unicode 5))] dummy random_dummy @@ -45,10 +45,10 @@ (!expect (^multi (#try.Success actual) (text\= expected actual))))) (_.cover [/.parse] - (|> (/.result (/.parse n\decode) (list expected)) + (|> (/.result (/.parse n\decoded) (list expected)) (!expect (^multi (#try.Success actual) (text\= expected - (n\encode actual)))))) + (n\encoded actual)))))) (_.cover [/.this] (and (|> (/.result (/.this expected) (list expected)) (!expect (#try.Success _))) diff --git a/stdlib/source/test/lux/control/parser/text.lux b/stdlib/source/test/lux/control/parser/text.lux index 951bed82e..b3767ab01 100644 --- a/stdlib/source/test/lux/control/parser/text.lux +++ b/stdlib/source/test/lux/control/parser/text.lux @@ -100,19 +100,19 @@ [expected (\ ! map (n.% 10) random.nat) invalid (random.char (unicode.set [unicode/block.number_forms (list)]))] (_.cover [/.decimal] - (and (..should_pass (\ n.decimal encode expected) /.decimal) + (and (..should_pass (\ n.decimal encoded expected) /.decimal) (..should_fail (text.of_char invalid) /.decimal)))) (do {! random.monad} [expected (\ ! map (n.% 8) random.nat) invalid (random.char (unicode.set [unicode/block.number_forms (list)]))] (_.cover [/.octal] - (and (..should_pass (\ n.octal encode expected) /.octal) + (and (..should_pass (\ n.octal encoded expected) /.octal) (..should_fail (text.of_char invalid) /.octal)))) (do {! random.monad} [expected (\ ! map (n.% 16) random.nat) invalid (random.char (unicode.set [unicode/block.number_forms (list)]))] (_.cover [/.hexadecimal] - (and (..should_pass (\ n.hex encode expected) /.hexadecimal) + (and (..should_pass (\ n.hex encoded expected) /.hexadecimal) (..should_fail (text.of_char invalid) /.hexadecimal)))) (do {! random.monad} [expected (random.char unicode.ascii/alpha) @@ -210,26 +210,26 @@ (let [octal! (/.one_of! "01234567")] ($_ _.and (do {! random.monad} - [left (\ ! map (|>> (n.% 8) (\ n.octal encode)) random.nat) - right (\ ! map (|>> (n.% 8) (\ n.octal encode)) random.nat) + [left (\ ! map (|>> (n.% 8) (\ n.octal encoded)) random.nat) + right (\ ! map (|>> (n.% 8) (\ n.octal encoded)) random.nat) .let [expected (format left right)] invalid (|> random.nat (\ ! map (n.% 16)) (random.only (n.>= 8)) - (\ ! map (\ n.hex encode)))] + (\ ! map (\ n.hex encoded)))] (_.cover [/.many /.many!] (and (..should_pass expected (/.many /.octal)) (..should_fail invalid (/.many /.octal)) (..should_pass! expected (/.many! octal!))))) (do {! random.monad} - [left (\ ! map (|>> (n.% 8) (\ n.octal encode)) random.nat) - right (\ ! map (|>> (n.% 8) (\ n.octal encode)) random.nat) + [left (\ ! map (|>> (n.% 8) (\ n.octal encoded)) random.nat) + right (\ ! map (|>> (n.% 8) (\ n.octal encoded)) random.nat) .let [expected (format left right)] invalid (|> random.nat (\ ! map (n.% 16)) (random.only (n.>= 8)) - (\ ! map (\ n.hex encode)))] + (\ ! map (\ n.hex encoded)))] (_.cover [/.some /.some!] (and (..should_pass expected (/.some /.octal)) (..should_pass "" (/.some /.octal)) @@ -238,7 +238,7 @@ (..should_pass! expected (/.some! octal!)) (..should_pass! "" (/.some! octal!))))) (do {! random.monad} - [.let [octal (\ ! map (|>> (n.% 8) (\ n.octal encode)) random.nat)] + [.let [octal (\ ! map (|>> (n.% 8) (\ n.octal encoded)) random.nat)] first octal second octal third octal] @@ -251,7 +251,7 @@ (..should_fail (format first second third) (/.exactly! 2 octal!)) (..should_fail (format first) (/.exactly! 2 octal!))))) (do {! random.monad} - [.let [octal (\ ! map (|>> (n.% 8) (\ n.octal encode)) random.nat)] + [.let [octal (\ ! map (|>> (n.% 8) (\ n.octal encoded)) random.nat)] first octal second octal third octal] @@ -264,7 +264,7 @@ (..should_pass! (format first) (/.at_most! 2 octal!)) (..should_fail (format first second third) (/.at_most! 2 octal!))))) (do {! random.monad} - [.let [octal (\ ! map (|>> (n.% 8) (\ n.octal encode)) random.nat)] + [.let [octal (\ ! map (|>> (n.% 8) (\ n.octal encoded)) random.nat)] first octal second octal third octal] @@ -277,7 +277,7 @@ (..should_pass! (format first second third) (/.at_least! 2 octal!)) (..should_fail (format first) (/.at_least! 2 octal!))))) (do {! random.monad} - [.let [octal (\ ! map (|>> (n.% 8) (\ n.octal encode)) random.nat)] + [.let [octal (\ ! map (|>> (n.% 8) (\ n.octal encoded)) random.nat)] first octal second octal third octal] @@ -389,7 +389,7 @@ (/.this output))) (!expect (#try.Success _))))) (do {! random.monad} - [expected (\ ! map (|>> (n.% 8) (\ n.octal encode)) random.nat)] + [expected (\ ! map (|>> (n.% 8) (\ n.octal encoded)) random.nat)] (_.cover [/.then] (|> (list (code.text expected)) (.result (/.then /.octal .text)) diff --git a/stdlib/source/test/lux/data/binary.lux b/stdlib/source/test/lux/data/binary.lux index 331e05142..9d843b540 100644 --- a/stdlib/source/test/lux/data/binary.lux +++ b/stdlib/source/test/lux/data/binary.lux @@ -93,7 +93,7 @@ (_.for [/.monoid] ($monoid.spec /.equivalence /.monoid (..random size))) (_.cover [/.aggregate] - (n.= (\ list.fold fold n.+ 0 (..as_list sample)) + (n.= (\ list.mix mix n.+ 0 (..as_list sample)) (/.aggregate n.+ 0 sample))) (_.cover [/.empty] @@ -142,7 +142,7 @@ false (#.Item head tail) - (n.= (list.fold n.+ 0 tail) + (n.= (list.mix n.+ 0 tail) (/.aggregate n.+ 0 (/.after 1 sample)))))) (_.cover [/.copy] (and (case (/.copy size 0 sample 0 (/.empty size)) diff --git a/stdlib/source/test/lux/data/collection/array.lux b/stdlib/source/test/lux/data/collection/array.lux index 4045c008a..c7fad1619 100644 --- a/stdlib/source/test/lux/data/collection/array.lux +++ b/stdlib/source/test/lux/data/collection/array.lux @@ -7,7 +7,7 @@ [\\specification ["$." equivalence] ["$." monoid] - ["$." fold] + ["$." mix] ["$." functor (#+ Injection)]]] [control ["." maybe]] @@ -43,8 +43,8 @@ ($monoid.spec (/.equivalence n.equivalence) /.monoid (random.array size random.nat))) (_.for [/.functor] ($functor.spec ..injection /.equivalence /.functor)) - (_.for [/.fold] - ($fold.spec ..injection /.equivalence /.fold)) + (_.for [/.mix] + ($mix.spec ..injection /.equivalence /.mix)) ))) (def: search diff --git a/stdlib/source/test/lux/data/collection/list.lux b/stdlib/source/test/lux/data/collection/list.lux index f635eca05..41139da07 100644 --- a/stdlib/source/test/lux/data/collection/list.lux +++ b/stdlib/source/test/lux/data/collection/list.lux @@ -9,7 +9,7 @@ ["$." equivalence] ["$." hash] ["$." monoid] - ["$." fold] + ["$." mix] ["$." functor] ["$." apply] ["$." monad]]] @@ -56,8 +56,8 @@ ($hash.spec (/.hash n.hash)))) (_.for [/.monoid] ($monoid.spec (/.equivalence n.equivalence) /.monoid ..random)) - (_.for [/.fold] - ($fold.spec /\in /.equivalence /.fold)) + (_.for [/.mix] + ($mix.spec /\in /.equivalence /.mix)) (_.for [/.functor] ($functor.spec /\in /.equivalence /.functor)) (_.for [/.apply] @@ -355,7 +355,7 @@ choose (: (-> Nat (Maybe Text)) (function (_ value) (if (n.even? value) - (#.Some (\ n.decimal encode value)) + (#.Some (\ n.decimal encoded value)) #.None)))] (do {! random.monad} [sample ..random] @@ -363,7 +363,7 @@ (_.cover [/.one] (case [(|> sample (/.only n.even?) - (/\map (\ n.decimal encode)) + (/\map (\ n.decimal encoded)) /.head) (/.one choose sample)] [(#.Some expected) (#.Some actual)] @@ -378,7 +378,7 @@ (\ (/.equivalence text.equivalence) = (|> sample (/.only n.even?) - (/\map (\ n.decimal encode))) + (/\map (\ n.decimal encoded))) (/.all choose sample))) (_.cover [/.example] (case (/.example n.even? sample) @@ -422,11 +422,11 @@ (#.Some (++ index)) #.None)) 0))))) - (_.cover [/.aggregates] + (_.cover [/.mixes] (/\= (/\map (function (_ index) - (\ /.fold fold n.+ 0 (/.first index sample))) + (\ /.mix mix n.+ 0 (/.first index sample))) (/.indices (++ (/.size sample)))) - (/.aggregates n.+ 0 sample))) + (/.mixes n.+ 0 sample))) (do random.monad [expected random.nat .let [(^open "/\.") (/.equivalence n.equivalence)]] diff --git a/stdlib/source/test/lux/data/collection/queue/priority.lux b/stdlib/source/test/lux/data/collection/queue/priority.lux index 9be7c183f..1e199d23e 100644 --- a/stdlib/source/test/lux/data/collection/queue/priority.lux +++ b/stdlib/source/test/lux/data/collection/queue/priority.lux @@ -19,12 +19,12 @@ (-> Nat (Random (Queue Nat))) (do {! random.monad} [inputs (random.list size random.nat)] - (monad.fold ! (function (_ head tail) - (do ! - [priority random.nat] - (in (/.end priority head tail)))) - /.empty - inputs))) + (monad.mix ! (function (_ head tail) + (do ! + [priority random.nat] + (in (/.end priority head tail)))) + /.empty + inputs))) (def: .public test Test diff --git a/stdlib/source/test/lux/data/collection/row.lux b/stdlib/source/test/lux/data/collection/row.lux index 8e8348617..a8ff3a7ab 100644 --- a/stdlib/source/test/lux/data/collection/row.lux +++ b/stdlib/source/test/lux/data/collection/row.lux @@ -7,7 +7,7 @@ [\\specification ["$." equivalence] ["$." monoid] - ["$." fold] + ["$." mix] ["$." functor (#+ Injection)] ["$." apply] ["$." monad]]] @@ -17,7 +17,7 @@ [data ["." bit ("#\." equivalence)] [collection - ["." list ("#\." fold)] + ["." list ("#\." mix)] ["." set]]] [math ["." random] @@ -35,8 +35,8 @@ ($equivalence.spec (/.equivalence n.equivalence) (random.row size random.nat))) (_.for [/.monoid] ($monoid.spec (/.equivalence n.equivalence) /.monoid (random.row size random.nat))) - (_.for [/.fold] - ($fold.spec /\in /.equivalence /.fold)) + (_.for [/.mix] + ($mix.spec /\in /.equivalence /.mix)) (_.for [/.functor] ($functor.spec /\in /.equivalence /.functor)) (_.for [/.apply] diff --git a/stdlib/source/test/lux/data/collection/set/multi.lux b/stdlib/source/test/lux/data/collection/set/multi.lux index 4ca359ddb..0afe973ef 100644 --- a/stdlib/source/test/lux/data/collection/set/multi.lux +++ b/stdlib/source/test/lux/data/collection/set/multi.lux @@ -13,7 +13,7 @@ ["." bit ("#\." equivalence)] [collection ["." set] - ["." list ("#\." fold)]]] + ["." list ("#\." mix)]]] [math ["." random (#+ Random)] [number @@ -30,11 +30,11 @@ (do {! random.monad} [elements (random.set hash size element) element_counts (random.list size ..count)] - (in (list\fold (function (_ [count element] set) - (/.has count element set)) - (/.empty hash) - (list.zipped/2 element_counts - (set.list elements)))))) + (in (list\mix (function (_ [count element] set) + (/.has count element set)) + (/.empty hash) + (list.zipped/2 element_counts + (set.list elements)))))) (def: signature Test diff --git a/stdlib/source/test/lux/data/collection/tree.lux b/stdlib/source/test/lux/data/collection/tree.lux index 986ef566e..be610c25d 100644 --- a/stdlib/source/test/lux/data/collection/tree.lux +++ b/stdlib/source/test/lux/data/collection/tree.lux @@ -6,12 +6,12 @@ ["." monad (#+ do)] [\\specification ["$." equivalence] - ["$." fold] + ["$." mix] ["$." functor]]] [data ["." product] [collection - ["." list ("#\." functor fold)]]] + ["." list ("#\." functor mix)]]] [math ["." random (#+ Random)] [number @@ -27,7 +27,7 @@ children (random.list num_children (tree gen_value))] (in [(|> children (list\map product.left) - (list\fold n.+ 1)) + (list\mix n.+ 1)) {#/.value value #/.children (list\map product.right children)}]))) @@ -40,8 +40,8 @@ (|> (..tree random.nat) (\ random.monad map product.right) ($equivalence.spec (/.equivalence n.equivalence)))) - (_.for [/.fold] - ($fold.spec /.leaf /.equivalence /.fold)) + (_.for [/.mix] + ($mix.spec /.leaf /.equivalence /.mix)) (_.for [/.functor] ($functor.spec /.leaf /.equivalence /.functor)) diff --git a/stdlib/source/test/lux/data/collection/tree/finger.lux b/stdlib/source/test/lux/data/collection/tree/finger.lux index 370a39a53..53631edbf 100644 --- a/stdlib/source/test/lux/data/collection/tree/finger.lux +++ b/stdlib/source/test/lux/data/collection/tree/finger.lux @@ -9,7 +9,7 @@ [data ["." text ("#\." equivalence monoid)] [collection - ["." list ("#\." fold)]]] + ["." list ("#\." mix)]]] [math ["." random] [number @@ -86,10 +86,10 @@ values/H random.nat values/T (random.list 5 random.nat)] (_.cover [/.tags /.values] - (let [tree (list\fold (function (_ [tag value] tree) - (\ builder branch tree (\ builder leaf tag value))) - (\ builder leaf tags/H values/H) - (list.zipped/2 tags/T values/T))] + (let [tree (list\mix (function (_ [tag value] tree) + (\ builder branch tree (\ builder leaf tag value))) + (\ builder leaf tags/H values/H) + (list.zipped/2 tags/T values/T))] (and (\ tags_equivalence = (list& tags/H tags/T) (/.tags tree)) (\ values_equivalence = (list& values/H values/T) (/.values tree)))))) (_.cover [/.one] diff --git a/stdlib/source/test/lux/data/format/json.lux b/stdlib/source/test/lux/data/format/json.lux index 33b2622f4..9e5a03843 100644 --- a/stdlib/source/test/lux/data/format/json.lux +++ b/stdlib/source/test/lux/data/format/json.lux @@ -84,7 +84,7 @@ (_.cover [/.format] (|> expected /.format - (\ /.codec decode) + (\ /.codec decoded) (try\map (\= expected)) (try.else false)))) (do random.monad diff --git a/stdlib/source/test/lux/data/format/tar.lux b/stdlib/source/test/lux/data/format/tar.lux index 9bed1f5ed..7a84f12fd 100644 --- a/stdlib/source/test/lux/data/format/tar.lux +++ b/stdlib/source/test/lux/data/format/tar.lux @@ -22,7 +22,7 @@ ["#/." block]]] [collection ["." row] - ["." list ("#\." fold)]] + ["." list ("#\." mix)]] ["." format #_ ["#" binary]]] [time @@ -165,7 +165,7 @@ .let [content (|> chunk (list.repeated chunks) text.together - (\ utf8.codec encode))]] + (\ utf8.codec encoded))]] (`` ($_ _.and (~~ (template [ ] [(_.cover [] @@ -245,7 +245,7 @@ (do {! random.monad} [path (random.ascii/lower 10) modes (random.list 4 ..random_mode) - .let [expected_mode (list\fold /.and /.none modes)]] + .let [expected_mode (list\mix /.and /.none modes)]] (`` ($_ _.and (_.cover [/.and] (|> (do try.monad diff --git a/stdlib/source/test/lux/data/name.lux b/stdlib/source/test/lux/data/name.lux index 2856d3476..0a882efaf 100644 --- a/stdlib/source/test/lux/data/name.lux +++ b/stdlib/source/test/lux/data/name.lux @@ -52,7 +52,7 @@ (let [(^open "/\.") /.codec] (_.test "Encoding an name without a module component results in text equal to the short of the name." (if (text.empty? module1) - (text\= short1 (/\encode name1)) + (text\= short1 (/\encoded name1)) #1))))) (_.cover [/.module /.short] diff --git a/stdlib/source/test/lux/data/text/encoding.lux b/stdlib/source/test/lux/data/text/encoding.lux index 432e98257..ca28e316d 100644 --- a/stdlib/source/test/lux/data/text/encoding.lux +++ b/stdlib/source/test/lux/data/text/encoding.lux @@ -12,7 +12,7 @@ [data ["." text ("#\." equivalence)] [collection - ["." list ("#\." fold)] + ["." list ("#\." mix)] ["." set]]] [macro ["." template]] @@ -193,10 +193,10 @@ (list.together (list ))) (def: unique_encodings - (list\fold (function (_ encoding set) - (set.has (/.name encoding) set)) - (set.empty text.hash) - ..all_encodings)) + (list\mix (function (_ encoding set) + (set.has (/.name encoding) set)) + (set.empty text.hash) + ..all_encodings)) (def: verdict (n.= (list.size ..all_encodings) diff --git a/stdlib/source/test/lux/data/text/escape.lux b/stdlib/source/test/lux/data/text/escape.lux index 707a06996..49b125cba 100644 --- a/stdlib/source/test/lux/data/text/escape.lux +++ b/stdlib/source/test/lux/data/text/escape.lux @@ -138,7 +138,7 @@ (\ ! map (n.% (hex "1000")))) code (|> (random.unicode 4) (random.only (function (_ code) - (case (\ n.hex decode code) + (case (\ n.hex decoded code) (#try.Failure error) true (#try.Success _) false))))] (_.cover [/.invalid_unicode_escape] @@ -149,7 +149,7 @@ (#try.Failure error) (exception.match? /.invalid_unicode_escape error))]] - (and (!invalid (\ n.hex encode too_short)) + (and (!invalid (\ n.hex encoded too_short)) (!invalid code))))) (_.cover [/.literal] (with_expansions [ (..static_sample)] diff --git a/stdlib/source/test/lux/data/text/format.lux b/stdlib/source/test/lux/data/text/format.lux index 24746c45d..cbeedd65a 100644 --- a/stdlib/source/test/lux/data/text/format.lux +++ b/stdlib/source/test/lux/data/text/format.lux @@ -76,7 +76,7 @@ [(do random.monad [sample ] (_.cover [] - (text\= (\ encode sample) + (text\= (\ encoded sample) ( sample))))] [/.bit bit.codec random.bit] @@ -180,6 +180,6 @@ sample (\ ! map (modular.modular modulus) random.int)] (_.cover [/.mod] - (text\= (\ (modular.codec modulus) encode sample) + (text\= (\ (modular.codec modulus) encoded sample) (/.mod sample)))) )))) diff --git a/stdlib/source/test/lux/locale/language.lux b/stdlib/source/test/lux/locale/language.lux index e6ded5090..b8ac893fd 100644 --- a/stdlib/source/test/lux/locale/language.lux +++ b/stdlib/source/test/lux/locale/language.lux @@ -13,7 +13,7 @@ ["." text] [collection ["." set (#+ Set)] - ["." list ("#\." functor fold)]]] + ["." list ("#\." functor mix)]]] [macro ["." template]] [math @@ -188,29 +188,29 @@ (Hash a) (List Bundle) [Nat (Set a)])) - (list\fold (function (_ bundle [amount set]) - [(n.+ amount (value@ #amount bundle)) - (set.union set (lens bundle))]) - [0 (set.empty hash)] - territories)) + (list\mix (function (_ bundle [amount set]) + [(n.+ amount (value@ #amount bundle)) + (set.union set (lens bundle))]) + [0 (set.empty hash)] + territories)) (def: languages_test Test (|> ..languages list.reversed (list\map (value@ #test)) - (list\fold _.and - (`` ($_ _.and - (~~ (template [ ] - [(let [[amount set] (..aggregate (value@ ) ..languages)] - (_.cover [] - (n.= amount (set.size set))))] + (list\mix _.and + (`` ($_ _.and + (~~ (template [ ] + [(let [[amount set] (..aggregate (value@ ) ..languages)] + (_.cover [] + (n.= amount (set.size set))))] - [/.name #names text.hash] - [/.code #codes text.hash] - [/.equivalence #languages /.hash] - )) - ))))) + [/.name #names text.hash] + [/.code #codes text.hash] + [/.equivalence #languages /.hash] + )) + ))))) (template: (!aliases ) [(_.cover diff --git a/stdlib/source/test/lux/locale/territory.lux b/stdlib/source/test/lux/locale/territory.lux index d25308c49..b8a36d4fd 100644 --- a/stdlib/source/test/lux/locale/territory.lux +++ b/stdlib/source/test/lux/locale/territory.lux @@ -13,7 +13,7 @@ ["." text] [collection ["." set (#+ Set)] - ["." list ("#\." functor fold)]]] + ["." list ("#\." functor mix)]]] [macro ["." template]] [math @@ -143,31 +143,31 @@ (Hash a) (List Bundle) [Nat (Set a)])) - (list\fold (function (_ bundle [amount set]) - [(n.+ amount (value@ #amount bundle)) - (set.union set (lens bundle))]) - [0 (set.empty hash)] - territories)) + (list\mix (function (_ bundle [amount set]) + [(n.+ amount (value@ #amount bundle)) + (set.union set (lens bundle))]) + [0 (set.empty hash)] + territories)) (def: territories_test Test (|> ..territories list.reversed (list\map (value@ #test)) - (list\fold _.and - (`` ($_ _.and - (~~ (template [ ] - [(let [[amount set] (..aggregate (value@ ) ..territories)] - (_.cover [] - (n.= amount (set.size set))))] + (list\mix _.and + (`` ($_ _.and + (~~ (template [ ] + [(let [[amount set] (..aggregate (value@ ) ..territories)] + (_.cover [] + (n.= amount (set.size set))))] - [/.name #names text.hash] - [/.short_code #shorts text.hash] - [/.long_code #longs text.hash] - [/.numeric_code #numbers n.hash] - [/.equivalence #territories /.hash] - )) - ))))) + [/.name #names text.hash] + [/.short_code #shorts text.hash] + [/.long_code #longs text.hash] + [/.numeric_code #numbers n.hash] + [/.equivalence #territories /.hash] + )) + ))))) (template: (!aliases ) [(_.cover diff --git a/stdlib/source/test/lux/math/modular.lux b/stdlib/source/test/lux/math/modular.lux index b87f30bb1..ce10c6ca2 100644 --- a/stdlib/source/test/lux/math/modular.lux +++ b/stdlib/source/test/lux/math/modular.lux @@ -64,8 +64,8 @@ (_.cover [/.incorrect_modulus] (case (|> param - (\ (/.codec param\\%) encode) - (\ (/.codec subject\\%) decode)) + (\ (/.codec param\\%) encoded) + (\ (/.codec subject\\%) decoded)) (#try.Failure error) (exception.match? /.incorrect_modulus error) diff --git a/stdlib/source/test/lux/math/number.lux b/stdlib/source/test/lux/math/number.lux index 8a298338f..08a044d60 100644 --- a/stdlib/source/test/lux/math/number.lux +++ b/stdlib/source/test/lux/math/number.lux @@ -34,7 +34,7 @@ ($_ _.and (_.cover [/.bin] (`` (and (~~ (template [<=> ] - [(case (\ decode (..clean_commas )) + [(case (\ decoded (..clean_commas )) (#try.Success actual) (<=> (/.bin ) actual) @@ -55,7 +55,7 @@ ))))) (_.cover [/.oct] (`` (and (~~ (template [<=> ] - [(case (\ decode (..clean_commas )) + [(case (\ decoded (..clean_commas )) (#try.Success actual) (<=> (/.oct ) actual) @@ -76,7 +76,7 @@ ))))) (_.cover [/.hex] (`` (and (~~ (template [<=> ] - [(case (\ decode (..clean_commas )) + [(case (\ decoded (..clean_commas )) (#try.Success actual) (<=> (/.hex ) actual) diff --git a/stdlib/source/test/lux/math/number/i64.lux b/stdlib/source/test/lux/math/number/i64.lux index ac82addce..4692a646c 100644 --- a/stdlib/source/test/lux/math/number/i64.lux +++ b/stdlib/source/test/lux/math/number/i64.lux @@ -142,7 +142,7 @@ ($_ _.and ($equivalence.spec (\ sub &equivalence) (random (\ sub narrow))) (_.cover [/.sub] - (let [actual (|> expected .i64 (\ sub narrow) (\ sub widen))] + (let [actual (|> expected .i64 (\ sub narrow) (\ sub wide))] (\= expected actual))) )))))) diff --git a/stdlib/source/test/lux/time.lux b/stdlib/source/test/lux/time.lux index 671afe39d..81c56089d 100644 --- a/stdlib/source/test/lux/time.lux +++ b/stdlib/source/test/lux/time.lux @@ -75,7 +75,7 @@ %.nat (text.prefix ) (text.suffix ) - (\ /.codec decode) + (\ /.codec decoded) (case> (#try.Success _) true (#try.Failure error) false)) @@ -84,7 +84,7 @@ %.nat (text.prefix ) (text.suffix ) - (\ /.codec decode) + (\ /.codec decoded) (case> (#try.Success _) false @@ -101,7 +101,7 @@ (|> valid_milli_second %.nat (format "00:00:00.") - (\ /.codec decode) + (\ /.codec decoded) (case> (#try.Success _) true (#try.Failure error) false))) )))) @@ -138,7 +138,7 @@ (n.= 0))) (_.cover [/.parser] (|> expected - (\ /.codec encode) + (\ /.codec encoded) (.result /.parser) (try\map (\ /.equivalence = expected)) (try.else false))) diff --git a/stdlib/source/test/lux/time/date.lux b/stdlib/source/test/lux/time/date.lux index 70bb0a93e..87e54e623 100644 --- a/stdlib/source/test/lux/time/date.lux +++ b/stdlib/source/test/lux/time/date.lux @@ -72,7 +72,7 @@ (do random.monad [expected random.date] (_.cover [/.parser] - (|> (\ /.codec encode expected) + (|> (\ /.codec encoded expected) (.result /.parser) (try\map (\ /.equivalence = expected)) (try.else false)))) diff --git a/stdlib/source/test/lux/time/day.lux b/stdlib/source/test/lux/time/day.lux index dd71f0f93..462a96939 100644 --- a/stdlib/source/test/lux/time/day.lux +++ b/stdlib/source/test/lux/time/day.lux @@ -59,7 +59,7 @@ (do random.monad [not_a_day (random.ascii/upper 1)] (_.cover [/.not_a_day_of_the_week] - (case (\ /.codec decode not_a_day) + (case (\ /.codec decoded not_a_day) (#try.Failure error) (exception.match? /.not_a_day_of_the_week error) diff --git a/stdlib/source/test/lux/time/instant.lux b/stdlib/source/test/lux/time/instant.lux index a7659421a..b9b2996e6 100644 --- a/stdlib/source/test/lux/time/instant.lux +++ b/stdlib/source/test/lux/time/instant.lux @@ -15,7 +15,7 @@ ["." io]] [data [collection - ["." list ("#\." fold)]]] + ["." list ("#\." mix)]]] [math ["." random]] [time @@ -71,9 +71,9 @@ (_.cover [/.day_of_week] (let [apply (: (-> (-> Duration Duration) (-> Day Day) Nat Bit) (function (_ polarity move steps) - (let [day_shift (list\fold (function.constant move) - d0 - (list.repeated steps [])) + (let [day_shift (list\mix (function.constant move) + d0 + (list.repeated steps [])) instant_shift (|> instant (/.after (polarity (duration.up steps duration.day))) /.day_of_week)] diff --git a/stdlib/source/test/lux/time/month.lux b/stdlib/source/test/lux/time/month.lux index 77a0a9702..7f5487069 100644 --- a/stdlib/source/test/lux/time/month.lux +++ b/stdlib/source/test/lux/time/month.lux @@ -17,7 +17,7 @@ [data [collection ["." set] - ["." list ("#\." functor fold)]]] + ["." list ("#\." functor mix)]]] [math ["." random (#+ Random)] [number @@ -80,18 +80,18 @@ (let [expected (.nat (duration.ticks duration.day duration.normal_year))] (|> /.year (list\map /.days) - (list\fold n.+ 0) + (list\mix n.+ 0) (n.= expected)))) (_.cover [/.leap_year_days] (let [expected (.nat (duration.ticks duration.day duration.leap_year))] (|> /.year (list\map /.leap_year_days) - (list\fold n.+ 0) + (list\mix n.+ 0) (n.= expected)))) (do random.monad [not_a_month (random.ascii/upper 1)] (_.cover [/.not_a_month_of_the_year] - (case (\ /.codec decode not_a_month) + (case (\ /.codec decoded not_a_month) (#try.Failure error) (exception.match? /.not_a_month_of_the_year error) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux index b634c0115..f7b169ea3 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux @@ -17,7 +17,7 @@ ["." rev] ["." frac]] [collection - ["." list ("#\." functor fold monoid)] + ["." list ("#\." functor mix monoid)] ["." set]]] [math ["." random (#+ Random)]]] @@ -127,19 +127,19 @@ (Random [analysis.Pattern Register])) (do random.monad [@member random.nat] - (in [(list\fold (function (_ member inner) - (case member - (#.Left lefts) - (analysis.pattern/tuple - (list\compose (list.repeated lefts (analysis.pattern/unit)) - (list inner (analysis.pattern/unit)))) - - (#.Right lefts) - (analysis.pattern/tuple - (list\compose (list.repeated (++ lefts) (analysis.pattern/unit)) - (list inner))))) - (#analysis.Bind @member) - (list.reversed path)) + (in [(list\mix (function (_ member inner) + (case member + (#.Left lefts) + (analysis.pattern/tuple + (list\compose (list.repeated lefts (analysis.pattern/unit)) + (list inner (analysis.pattern/unit)))) + + (#.Right lefts) + (analysis.pattern/tuple + (list\compose (list.repeated (++ lefts) (analysis.pattern/unit)) + (list inner))))) + (#analysis.Bind @member) + (list.reversed path)) @member]))) (def: get_test @@ -297,15 +297,15 @@ (list (analysis.pattern/text value) (analysis.pattern/unit))))) #analysis.then (analysis.frac body)}))]] - (in [(list\fold (function (_ left right) - (#synthesis.Alt left right)) - (path (++ mid_size) true value/last body/last) - (|> (list.zipped/2 value/mid body/mid) - (#.Item [value/first body/first]) - list.enumeration - (list\map (function (_ [lefts' [value body]]) - (path lefts' false value body))) - list.reversed)) + (in [(list\mix (function (_ left right) + (#synthesis.Alt left right)) + (path (++ mid_size) true value/last body/last) + (|> (list.zipped/2 value/mid body/mid) + (#.Item [value/first body/first]) + list.enumeration + (list\map (function (_ [lefts' [value body]]) + (path lefts' false value body))) + list.reversed)) [(branch 0 false value/first body/first) (list\compose (|> (list.zipped/2 value/mid body/mid) list.enumeration diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux index a25bd787c..6190c05aa 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux @@ -12,7 +12,7 @@ [number ["n" nat]] [collection - ["." list ("#\." functor fold monoid)] + ["." list ("#\." functor mix monoid)] ["." dictionary (#+ Dictionary)] ["." set]]] [math @@ -50,16 +50,16 @@ (def: (n_abstraction arity body) (-> Arity Analysis Analysis) - (list\fold (function (_ arity_1 body) - (case arity_1 - 0 (#analysis.Function (list) body) - _ (#analysis.Function ($_ list\compose - (list\map (|>> #variable.Foreign) - (list.indices arity_1)) - (list (#variable.Local 1))) - body))) - body - (list.reversed (list.indices arity)))) + (list\mix (function (_ arity_1 body) + (case arity_1 + 0 (#analysis.Function (list) body) + _ (#analysis.Function ($_ list\compose + (list\map (|>> #variable.Foreign) + (list.indices arity_1)) + (list (#variable.Local 1))) + body))) + body + (list.reversed (list.indices arity)))) (template: (!expect ) (case @@ -318,10 +318,10 @@ (do {! random.monad} [resets (random.list arity (..random_variable arity output?)) [_ expected_output actual_output] (..random_nat output?)] - (in [(list\fold (function (_ new old) - (and new old)) - true - (list\map product.left resets)) + (in [(list\mix (function (_ new old) + (and new old)) + true + (list\map product.left resets)) (synthesis.loop/scope {#synthesis.start (++ arity) #synthesis.inits (list\map (|>> product.right product.left) resets) @@ -364,10 +364,10 @@ [[loop?_abstraction expected_abstraction actual_abstraction] (..random_nat output?) arity (|> random.nat (\ ! map (|>> (n.% 5) ++))) inputs (random.list arity (random_value false))] - (in [(list\fold (function (_ new old) - (and new old)) - loop?_abstraction - (list\map product.left inputs)) + (in [(list\mix (function (_ new old) + (and new old)) + loop?_abstraction + (list\map product.left inputs)) (synthesis.function/apply [expected_abstraction (list\map (|>> product.right product.left) inputs)]) (analysis.apply [actual_abstraction diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux index 10a6ca270..690ac7ce2 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux @@ -15,7 +15,7 @@ [number ["n" nat]] [collection - ["." list ("#\." functor fold)] + ["." list ("#\." functor mix)] ["." dictionary (#+ Dictionary)]]]] [\\ ["." / @@ -244,12 +244,12 @@ inits (random.list ..scope_arity (scenario context)) [expected_iteration actual_iteration] (scenario (revised@ #necessary (function (_ necessary) - (list\fold (function (_ [idx _] context) - (dictionary.has (n.+ real_start idx) - (n.+ fake_start idx) - context)) - necessary - (list.enumeration inits))) + (list\mix (function (_ [idx _] context) + (dictionary.has (n.+ real_start idx) + (n.+ fake_start idx) + context)) + necessary + (list.enumeration inits))) context))] (in [(synthesis.loop/scope [real_start (list\map product.left inits) expected_iteration]) (synthesis.loop/scope [fake_start (list\map product.right inits) actual_iteration])]))) diff --git a/stdlib/source/test/lux/type/check.lux b/stdlib/source/test/lux/type/check.lux index d148e9fdc..12370e87a 100644 --- a/stdlib/source/test/lux/type/check.lux +++ b/stdlib/source/test/lux/type/check.lux @@ -421,12 +421,12 @@ [[id/T var/tail] /.var] (in var/tail))) (list.repeated tail_size /.var)) - var/last (monad.fold ! (function (_ var/next var/prev) - (do ! - [_ (/.check var/prev var/next)] - (in var/next))) - var/head - var/tail+) + var/last (monad.mix ! (function (_ var/next var/prev) + (do ! + [_ (/.check var/prev var/next)] + (in var/next))) + var/head + var/tail+) _ (/.check var/last var/head)] (in [var/head var/tail+ var/last]))) diff --git a/stdlib/source/test/lux/world/net/http/client.lux b/stdlib/source/test/lux/world/net/http/client.lux index c9b3f12c9..994e2cbf3 100644 --- a/stdlib/source/test/lux/world/net/http/client.lux +++ b/stdlib/source/test/lux/world/net/http/client.lux @@ -57,8 +57,8 @@ #//.Options on_options #//.Trace on_trace) data (|> value - (\ nat.decimal encode) - (\ utf8.codec encode))] + (\ nat.decimal encoded) + (\ utf8.codec encoded))] (#try.Success [//status.ok {#//.headers headers #//.body (function (_ ?wanted_bytes) @@ -71,8 +71,8 @@ (do> try.monad [io.run!] [product.right (value@ #//.body) (function.on #.None) io.run!] - [product.right (\ utf8.codec decode)] - [(\ nat.decimal decode)] + [product.right (\ utf8.codec decoded)] + [(\ nat.decimal decoded)] [(nat.= ) in]) (try.else false)))] -- cgit v1.2.3