aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--documentation/book/the_lux_programming_language/chapter_8.md2
-rw-r--r--documentation/book/the_lux_programming_language/chapter_9.md168
-rw-r--r--documentation/bookmark/compilation/invariant.md5
-rw-r--r--documentation/bookmark/database.md1
-rw-r--r--documentation/bookmark/database/relational.md4
-rw-r--r--documentation/bookmark/floating_point.md4
-rw-r--r--documentation/bookmark/game/math.md4
-rw-r--r--documentation/bookmark/inspiration.md8
-rw-r--r--documentation/bookmark/machine_learning/probabilistic_soft_logic.md4
-rw-r--r--documentation/bookmark/platform/jvm.md1
-rw-r--r--documentation/bookmark/rendering.md5
-rw-r--r--documentation/bookmark/security.md1
-rw-r--r--documentation/bookmark/security/programming.md4
-rw-r--r--documentation/bookmark/user_interface/color.md2
-rw-r--r--stdlib/source/library/lux.lux1043
-rw-r--r--stdlib/source/library/lux/abstract/comonad.lux17
-rw-r--r--stdlib/source/library/lux/abstract/monad.lux19
-rw-r--r--stdlib/source/library/lux/abstract/monad/indexed.lux26
-rw-r--r--stdlib/source/library/lux/control/concurrency/actor.lux8
-rw-r--r--stdlib/source/library/lux/control/concurrency/async.lux4
-rw-r--r--stdlib/source/library/lux/control/concurrency/atom.lux2
-rw-r--r--stdlib/source/library/lux/control/concurrency/frp.lux2
-rw-r--r--stdlib/source/library/lux/control/concurrency/semaphore.lux2
-rw-r--r--stdlib/source/library/lux/control/concurrency/stm.lux6
-rw-r--r--stdlib/source/library/lux/control/concurrency/thread.lux6
-rw-r--r--stdlib/source/library/lux/control/continuation.lux2
-rw-r--r--stdlib/source/library/lux/control/exception.lux9
-rw-r--r--stdlib/source/library/lux/control/function/mutual.lux4
-rw-r--r--stdlib/source/library/lux/control/parser/binary.lux2
-rw-r--r--stdlib/source/library/lux/control/parser/json.lux2
-rw-r--r--stdlib/source/library/lux/control/parser/text.lux2
-rw-r--r--stdlib/source/library/lux/control/parser/type.lux8
-rw-r--r--stdlib/source/library/lux/control/pipe.lux2
-rw-r--r--stdlib/source/library/lux/control/security/capability.lux4
-rw-r--r--stdlib/source/library/lux/control/security/policy.lux8
-rw-r--r--stdlib/source/library/lux/data/collection/array.lux8
-rw-r--r--stdlib/source/library/lux/data/collection/dictionary.lux34
-rw-r--r--stdlib/source/library/lux/data/collection/list.lux15
-rw-r--r--stdlib/source/library/lux/data/collection/queue.lux24
-rw-r--r--stdlib/source/library/lux/data/collection/queue/priority.lux4
-rw-r--r--stdlib/source/library/lux/data/collection/row.lux68
-rw-r--r--stdlib/source/library/lux/data/collection/set.lux12
-rw-r--r--stdlib/source/library/lux/data/collection/set/multi.lux6
-rw-r--r--stdlib/source/library/lux/data/collection/set/ordered.lux14
-rw-r--r--stdlib/source/library/lux/data/color.lux72
-rw-r--r--stdlib/source/library/lux/data/format/binary.lux6
-rw-r--r--stdlib/source/library/lux/data/format/css/value.lux8
-rw-r--r--stdlib/source/library/lux/data/format/json.lux2
-rw-r--r--stdlib/source/library/lux/data/format/tar.lux8
-rw-r--r--stdlib/source/library/lux/data/format/xml.lux92
-rw-r--r--stdlib/source/library/lux/data/maybe.lux31
-rw-r--r--stdlib/source/library/lux/data/text.lux2
-rw-r--r--stdlib/source/library/lux/data/text/regex.lux10
-rw-r--r--stdlib/source/library/lux/debug.lux4
-rw-r--r--stdlib/source/library/lux/ffi.jvm.lux54
-rw-r--r--stdlib/source/library/lux/ffi.old.lux60
-rw-r--r--stdlib/source/library/lux/macro.lux4
-rw-r--r--stdlib/source/library/lux/macro/local.lux4
-rw-r--r--stdlib/source/library/lux/macro/poly.lux20
-rw-r--r--stdlib/source/library/lux/macro/syntax.lux24
-rw-r--r--stdlib/source/library/lux/math/logic/fuzzy.lux2
-rw-r--r--stdlib/source/library/lux/math/modulus.lux15
-rw-r--r--stdlib/source/library/lux/math/number/frac.lux18
-rw-r--r--stdlib/source/library/lux/math/number/int.lux11
-rw-r--r--stdlib/source/library/lux/math/number/ratio.lux1
-rw-r--r--stdlib/source/library/lux/math/random.lux21
-rw-r--r--stdlib/source/library/lux/meta.lux8
-rw-r--r--stdlib/source/library/lux/meta/annotation.lux3
-rw-r--r--stdlib/source/library/lux/meta/location.lux9
-rw-r--r--stdlib/source/library/lux/target/jvm/bytecode.lux4
-rw-r--r--stdlib/source/library/lux/target/jvm/bytecode/environment.lux2
-rw-r--r--stdlib/source/library/lux/target/jvm/bytecode/instruction.lux14
-rw-r--r--stdlib/source/library/lux/target/jvm/constant/pool.lux4
-rw-r--r--stdlib/source/library/lux/target/jvm/method.lux2
-rw-r--r--stdlib/source/library/lux/target/jvm/reflection.lux8
-rw-r--r--stdlib/source/library/lux/test.lux20
-rw-r--r--stdlib/source/library/lux/time.lux26
-rw-r--r--stdlib/source/library/lux/time/date.lux19
-rw-r--r--stdlib/source/library/lux/time/day.lux63
-rw-r--r--stdlib/source/library/lux/time/duration.lux22
-rw-r--r--stdlib/source/library/lux/time/instant.lux33
-rw-r--r--stdlib/source/library/lux/time/month.lux22
-rw-r--r--stdlib/source/library/lux/tool/compiler/default/init.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/default/platform.lux26
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/function.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux146
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lua.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux18
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/host.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/common.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/host.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/common.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/host.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/case.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/function.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/loop.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/function.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux10
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/apply.lux10
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/case.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/function.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/loop.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/case.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/function.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/loop.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/function.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/loop.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/function.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/function.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/loop.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/function.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/archive/artifact.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/io/archive.lux26
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/packager.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/packager/scheme.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/packager/script.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/phase.lux4
-rw-r--r--stdlib/source/library/lux/tool/interpreter.lux4
-rw-r--r--stdlib/source/library/lux/type.lux14
-rw-r--r--stdlib/source/library/lux/type/abstract.lux2
-rw-r--r--stdlib/source/library/lux/type/check.lux6
-rw-r--r--stdlib/source/library/lux/type/implicit.lux10
-rw-r--r--stdlib/source/library/lux/type/resource.lux6
-rw-r--r--stdlib/source/library/lux/type/unit.lux6
-rw-r--r--stdlib/source/library/lux/world/db/jdbc/input.lux2
-rw-r--r--stdlib/source/library/lux/world/file.lux32
-rw-r--r--stdlib/source/library/lux/world/file/watch.lux8
-rw-r--r--stdlib/source/library/lux/world/net/http/client.lux6
-rw-r--r--stdlib/source/library/lux/world/net/http/route.lux2
-rw-r--r--stdlib/source/library/lux/world/program.lux10
-rw-r--r--stdlib/source/library/lux/world/shell.lux4
-rw-r--r--stdlib/source/poly/lux/abstract/equivalence.lux14
-rw-r--r--stdlib/source/poly/lux/abstract/functor.lux18
-rw-r--r--stdlib/source/poly/lux/data/format/json.lux85
-rw-r--r--stdlib/source/program/aedifex.lux2
-rw-r--r--stdlib/source/program/aedifex/command/auto.lux2
-rw-r--r--stdlib/source/program/aedifex/command/build.lux8
-rw-r--r--stdlib/source/program/aedifex/command/clean.lux2
-rw-r--r--stdlib/source/program/aedifex/command/deploy.lux2
-rw-r--r--stdlib/source/program/aedifex/command/deps.lux6
-rw-r--r--stdlib/source/program/aedifex/command/install.lux2
-rw-r--r--stdlib/source/program/aedifex/command/test.lux6
-rw-r--r--stdlib/source/program/aedifex/dependency/deployment.lux4
-rw-r--r--stdlib/source/program/aedifex/dependency/resolution.lux10
-rw-r--r--stdlib/source/program/aedifex/format.lux2
-rw-r--r--stdlib/source/program/aedifex/parser.lux2
-rw-r--r--stdlib/source/program/aedifex/pom.lux12
-rw-r--r--stdlib/source/program/aedifex/repository/local.lux2
-rw-r--r--stdlib/source/program/compositor.lux6
-rw-r--r--stdlib/source/program/compositor/import.lux2
-rw-r--r--stdlib/source/program/scriptum.lux64
-rw-r--r--stdlib/source/specification/aedifex/repository.lux4
-rw-r--r--stdlib/source/specification/compositor.lux2
-rw-r--r--stdlib/source/specification/compositor/common.lux2
-rw-r--r--stdlib/source/specification/compositor/generation/case.lux4
-rw-r--r--stdlib/source/specification/compositor/generation/common.lux2
-rw-r--r--stdlib/source/specification/compositor/generation/function.lux2
-rw-r--r--stdlib/source/specification/compositor/generation/structure.lux4
-rw-r--r--stdlib/source/specification/lux/abstract/comonad.lux6
-rw-r--r--stdlib/source/specification/lux/world/console.lux2
-rw-r--r--stdlib/source/specification/lux/world/file.lux6
-rw-r--r--stdlib/source/test/aedifex/cache.lux10
-rw-r--r--stdlib/source/test/aedifex/command/auto.lux6
-rw-r--r--stdlib/source/test/aedifex/command/build.lux10
-rw-r--r--stdlib/source/test/aedifex/command/clean.lux6
-rw-r--r--stdlib/source/test/aedifex/command/deploy.lux8
-rw-r--r--stdlib/source/test/aedifex/command/deps.lux6
-rw-r--r--stdlib/source/test/aedifex/command/install.lux10
-rw-r--r--stdlib/source/test/aedifex/command/pom.lux6
-rw-r--r--stdlib/source/test/aedifex/command/test.lux4
-rw-r--r--stdlib/source/test/aedifex/command/version.lux2
-rw-r--r--stdlib/source/test/aedifex/dependency/deployment.lux10
-rw-r--r--stdlib/source/test/aedifex/dependency/resolution.lux12
-rw-r--r--stdlib/source/test/aedifex/input.lux4
-rw-r--r--stdlib/source/test/aedifex/metadata/artifact.lux4
-rw-r--r--stdlib/source/test/aedifex/metadata/snapshot.lux4
-rw-r--r--stdlib/source/test/aedifex/project.lux2
-rw-r--r--stdlib/source/test/aedifex/repository/local.lux2
-rw-r--r--stdlib/source/test/lux.lux16
-rw-r--r--stdlib/source/test/lux/abstract/enum.lux2
-rw-r--r--stdlib/source/test/lux/abstract/equivalence.lux2
-rw-r--r--stdlib/source/test/lux/abstract/hash.lux2
-rw-r--r--stdlib/source/test/lux/abstract/interval.lux14
-rw-r--r--stdlib/source/test/lux/abstract/order.lux2
-rw-r--r--stdlib/source/test/lux/abstract/predicate.lux2
-rw-r--r--stdlib/source/test/lux/control/concatenative.lux2
-rw-r--r--stdlib/source/test/lux/control/concurrency/actor.lux6
-rw-r--r--stdlib/source/test/lux/control/concurrency/async.lux42
-rw-r--r--stdlib/source/test/lux/control/concurrency/atom.lux8
-rw-r--r--stdlib/source/test/lux/control/concurrency/frp.lux12
-rw-r--r--stdlib/source/test/lux/control/concurrency/semaphore.lux20
-rw-r--r--stdlib/source/test/lux/control/concurrency/stm.lux4
-rw-r--r--stdlib/source/test/lux/control/concurrency/thread.lux4
-rw-r--r--stdlib/source/test/lux/control/continuation.lux2
-rw-r--r--stdlib/source/test/lux/control/exception.lux2
-rw-r--r--stdlib/source/test/lux/control/function/memo.lux10
-rw-r--r--stdlib/source/test/lux/control/function/mixin.lux2
-rw-r--r--stdlib/source/test/lux/control/function/mutual.lux4
-rw-r--r--stdlib/source/test/lux/control/parser.lux2
-rw-r--r--stdlib/source/test/lux/control/parser/cli.lux2
-rw-r--r--stdlib/source/test/lux/control/parser/json.lux4
-rw-r--r--stdlib/source/test/lux/control/parser/text.lux30
-rw-r--r--stdlib/source/test/lux/control/parser/xml.lux4
-rw-r--r--stdlib/source/test/lux/control/region.lux10
-rw-r--r--stdlib/source/test/lux/control/remember.lux18
-rw-r--r--stdlib/source/test/lux/control/security/capability.lux2
-rw-r--r--stdlib/source/test/lux/control/security/policy.lux4
-rw-r--r--stdlib/source/test/lux/control/state.lux2
-rw-r--r--stdlib/source/test/lux/control/try.lux2
-rw-r--r--stdlib/source/test/lux/data/binary.lux4
-rw-r--r--stdlib/source/test/lux/data/collection/array.lux34
-rw-r--r--stdlib/source/test/lux/data/collection/dictionary.lux8
-rw-r--r--stdlib/source/test/lux/data/collection/dictionary/ordered.lux4
-rw-r--r--stdlib/source/test/lux/data/collection/dictionary/plist.lux6
-rw-r--r--stdlib/source/test/lux/data/collection/list.lux16
-rw-r--r--stdlib/source/test/lux/data/collection/queue.lux14
-rw-r--r--stdlib/source/test/lux/data/collection/row.lux18
-rw-r--r--stdlib/source/test/lux/data/collection/set.lux12
-rw-r--r--stdlib/source/test/lux/data/collection/set/multi.lux34
-rw-r--r--stdlib/source/test/lux/data/collection/set/ordered.lux18
-rw-r--r--stdlib/source/test/lux/data/collection/tree/finger.lux2
-rw-r--r--stdlib/source/test/lux/data/collection/tree/zipper.lux2
-rw-r--r--stdlib/source/test/lux/data/color.lux26
-rw-r--r--stdlib/source/test/lux/data/format/json.lux6
-rw-r--r--stdlib/source/test/lux/data/format/tar.lux16
-rw-r--r--stdlib/source/test/lux/data/lazy.lux2
-rw-r--r--stdlib/source/test/lux/data/maybe.lux12
-rw-r--r--stdlib/source/test/lux/data/text.lux44
-rw-r--r--stdlib/source/test/lux/data/text/escape.lux2
-rw-r--r--stdlib/source/test/lux/data/text/unicode/block.lux4
-rw-r--r--stdlib/source/test/lux/data/text/unicode/set.lux4
-rw-r--r--stdlib/source/test/lux/extension.lux2
-rw-r--r--stdlib/source/test/lux/ffi.jvm.lux8
-rw-r--r--stdlib/source/test/lux/locale.lux4
-rw-r--r--stdlib/source/test/lux/locale/language.lux2
-rw-r--r--stdlib/source/test/lux/locale/territory.lux2
-rw-r--r--stdlib/source/test/lux/macro.lux4
-rw-r--r--stdlib/source/test/lux/macro/poly/equivalence.lux2
-rw-r--r--stdlib/source/test/lux/math.lux8
-rw-r--r--stdlib/source/test/lux/math/logic/fuzzy.lux18
-rw-r--r--stdlib/source/test/lux/math/number/frac.lux8
-rw-r--r--stdlib/source/test/lux/math/number/i16.lux2
-rw-r--r--stdlib/source/test/lux/math/number/i32.lux2
-rw-r--r--stdlib/source/test/lux/math/number/i64.lux6
-rw-r--r--stdlib/source/test/lux/math/number/i8.lux2
-rw-r--r--stdlib/source/test/lux/math/number/int.lux2
-rw-r--r--stdlib/source/test/lux/math/number/nat.lux2
-rw-r--r--stdlib/source/test/lux/math/number/ratio.lux2
-rw-r--r--stdlib/source/test/lux/math/number/rev.lux2
-rw-r--r--stdlib/source/test/lux/meta.lux28
-rw-r--r--stdlib/source/test/lux/meta/annotation.lux2
-rw-r--r--stdlib/source/test/lux/target/jvm.lux48
-rw-r--r--stdlib/source/test/lux/test.lux16
-rw-r--r--stdlib/source/test/lux/time.lux12
-rw-r--r--stdlib/source/test/lux/time/date.lux8
-rw-r--r--stdlib/source/test/lux/time/day.lux71
-rw-r--r--stdlib/source/test/lux/time/duration.lux10
-rw-r--r--stdlib/source/test/lux/time/instant.lux16
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/case.lux21
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux6
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/structure.lux12
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux14
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/function.lux4
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux2
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/variable.lux10
-rw-r--r--stdlib/source/test/lux/type.lux12
-rw-r--r--stdlib/source/test/lux/type/check.lux8
-rw-r--r--stdlib/source/test/lux/type/implicit.lux4
-rw-r--r--stdlib/source/test/lux/type/quotient.lux2
-rw-r--r--stdlib/source/test/lux/type/refinement.lux2
-rw-r--r--stdlib/source/test/lux/type/resource.lux6
-rw-r--r--stdlib/source/test/lux/type/unit.lux10
-rw-r--r--stdlib/source/test/lux/world/console.lux2
-rw-r--r--stdlib/source/test/lux/world/file/watch.lux8
-rw-r--r--stdlib/source/test/lux/world/input/keyboard.lux2
-rw-r--r--stdlib/source/test/lux/world/net/http/client.lux2
-rw-r--r--stdlib/source/test/lux/world/shell.lux6
298 files changed, 2286 insertions, 1921 deletions
diff --git a/documentation/book/the_lux_programming_language/chapter_8.md b/documentation/book/the_lux_programming_language/chapter_8.md
index 11b56faf8..fc3e9c4a9 100644
--- a/documentation/book/the_lux_programming_language/chapter_8.md
+++ b/documentation/book/the_lux_programming_language/chapter_8.md
@@ -311,5 +311,5 @@ Hopefully, you'll be able to get a feel for them in the next chapters, because w
So, buckle-up, cowboy. This ride is about to get bumpy.
-See you in the next chapter!
+See you in [the next chapter](chapter_9.md)!
diff --git a/documentation/book/the_lux_programming_language/chapter_9.md b/documentation/book/the_lux_programming_language/chapter_9.md
new file mode 100644
index 000000000..d79057d63
--- /dev/null
+++ b/documentation/book/the_lux_programming_language/chapter_9.md
@@ -0,0 +1,168 @@
+# Chapter 9: Metaprogramming
+
+_Where we go meta. For real._
+
+---
+
+Metaprogramming is the art of making programs... that make programs.
+
+There are many techniques and tools for achieving this, but one that is very familiar to _Lisp_ fans is to use macros to generate code at compile-time.
+
+However, we're not going to talk about macros in this chapter.
+
+Instead, I'll reveal the infrastructure that makes macros possible, and we'll discuss macros in the next chapter.
+
+## The `Lux` type
+
+ Yeah, I'm aware that it's weird there's a type with the same name as the language, but I couldn't figure out a better name.
+
+The Lux compiler was designed to integrate very well with the language itself.
+
+Most compilers are just programs that take source code and emit some binary executable or some byte-code. But the Lux compiler opens itself for usage within Lux programs and provides Lux programmers with a wealth of information.
+
+The `Lux` type enters the stage.
+
+```
+(type: #export Lux
+ {#info Info
+ #source Source
+ #location Location
+ #current_module (Maybe Text)
+ #modules (List [Text Module])
+ #scopes (List Scope)
+ #type_context Type_Context
+ #expected (Maybe Type)
+ #seed Nat
+ #scope_type_vars (List Nat)
+ #extensions Any
+ #host Any})
+```
+
+ By the way, the `Lux` type and other weird types you may not recognize there are all defined in the `library/lux` module. Check the documentation for the Standard Library for more details.
+
+The `Lux` type represents the state of the Lux compiler at any given point.
+
+It iss not a reflection of that state, or a subset of it. It is `the` state of the Lux compiler; and, as you can see, it contains quite a lot of information about compiled modules, the state of the type-checker, the lexical and global environments, and more.
+
+Heck, you can even access the yet-unprocessed source code of a module at any given time.
+
+That's pretty neat.
+
+You can actually write computations that can read and even modify (_careful with that one_) the state of the compiler. This turns out to be massively useful when implementing a variety of powerful macros.
+
+For example, remember the `open:` and `\` macros from [chapter 7](chapter_7.md)?
+
+They actually look up the typing information for the structures you give them to figure out the names of members and generate the code necessary to get that functionality going.
+
+And that is just the tip of the iceberg.
+
+The possibilities are really vast when it comes to using the information provided by the `Lux` compiler state.
+
+## The `Meta` type
+
+_But, how do I use it?_
+
+Well, that is where the `Meta` type and the `library/lux/meta` module come into play.
+
+The `library/lux/meta` module houses many functions for querying the `Lux` compiler state for information, and even to change it a little bit (in safe ways).
+
+I won't go into detail about what's available, but you'll quickly get an idea of what you can do if you read the documentation for it in the Standard Library.
+
+However, one thing I _will_ say is that those functions rely heavily on the `Meta` type, which is defined thusly:
+
+```
+(type: #export (Meta a)
+ (-> Lux (Either Text [Lux a])))
+```
+
+ The `Meta` type is defined in the `library/lux` module, although most functions that deal with it are in the `library/lux/meta` module.
+
+The `Meta` type has a `Functor`, and a `Monad`, but they are a bit rather complicated.
+
+You saw some functor/monad examples in the last chapter, but this is more colorful.
+
+`Meta` instances are functions that given an instance of the `Lux` compiler state, will perform some calculations which may fail (_with an error message_); but if they succeed, they yield a value, plus a (_possibly updated_) instance of the `Lux` compiler state.
+
+Lux metaprogramming is based heavily on the `Meta` type, and macros themselves rely on it for many of their functionalities, as you'll see in the next chapter.
+
+## Where do `Lux` instances come from?
+
+Clearly, `Lux` instances are data, but the compiler is not available at all times.
+
+The compiler is only ever present during... well... compilation.
+
+And that is precisely when all of your `Lux`-dependant code will execute.
+
+Basically, in order for you to get your hands on that _sweet_ compiler information, your code must be run at compile-time. But only macro code can ever do that, so you will have to wait until the next chapter to learn how this story ends.
+
+## Definition annotations
+
+Another important piece of information you should be aware of is that definitions don't just have values and types associated with them, but also arbitrary meta-data which you can customize as much as you want.
+
+The relevant types in the `library/lux` module are:
+
+```
+(type: #export Location
+ {#module Text
+ #line Nat
+ #column Nat})
+
+(type: #export (Ann m v)
+ {#meta m
+ #datum v})
+
+(type: #export (Code' w)
+ (#Bit Bit)
+ (#Nat Nat)
+ (#Int Int)
+ (#Rev Rev)
+ (#Frac Frac)
+ (#Text Text)
+ (#Identifier Name)
+ (#Tag Name)
+ (#Form (List (w (Code' w))))
+ (#Tuple (List (w (Code' w))))
+ (#Record (List [(w (Code' w)) (w (Code' w))])))
+
+(type: #export Code
+ (Ann Location (Code' (Ann Location))))
+```
+
+You can add annotations to definitions in the many definition macros offered in the standard library.
+You can also annotate modules when using the `module:` macro.
+
+All you need to do is pass in some record syntax, with tags signaling the type of annotation you want, and the associated value being either an explicit variant `Code`, or some function or macro call that would produce such a value.
+
+Here's an example from `library/lux`:
+
+```
+(def: #export (is? reference sample)
+ {#.doc (doc "Tests whether the 2 values are identical (not just 'equal')."
+ "This one should succeed:"
+ (let [value +5]
+ (is? value value))
+
+ "This one should fail:"
+ (is? +5 (+ +2 +3)))}
+ (All [a] (-> a a Bit))
+ ("lux is" reference sample))
+```
+
+ The (_optional_) annotations always goes after the declaration or name of the thing being defined.
+
+Note that all tag usage within annotation records should be fully qualified, to avoid potential confusions, as different modules could be using annotation tags with similar names.
+
+The `library/lux/meta/annotation` module contains various functions for reading and exploring annotations, and some modules in the standard library (for example, the `lbrary/lux/ffi` module) make heavy use of annotations to figure out properties of definitions which may be useful during code-generation and parsing in macros.
+
+And also, as you can appreciate from the previous example, some macros may be designed to be used during annotation specification.
+
+---
+
+This chapter feels a little empty because the topic only makes sense within the context of macros. But macros by themselves are a huge subject, and involve more machinery than you've seen so far.
+
+However, I wanted to give you a taste of what's possible in order to whet your appetite, while keeping the chapter focused.
+
+In the next chapter, I'll complete this puzzle, and you'll be given access to a power greater than you've ever known (_unless you've already been a lisper for a while_).
+
+See you in the next chapter!
+
diff --git a/documentation/bookmark/compilation/invariant.md b/documentation/bookmark/compilation/invariant.md
new file mode 100644
index 000000000..a8af7e993
--- /dev/null
+++ b/documentation/bookmark/compilation/invariant.md
@@ -0,0 +1,5 @@
+# Reference
+
+1. [William J Bowman: Compilation as Multi Language Semantics](https://www.youtube.com/watch?v=RfVhUPkAEKo)
+1. [Do compilers respect programmers?](https://www.williamjbowman.com/resources/wjb-talk-respinv.pdf)
+
diff --git a/documentation/bookmark/database.md b/documentation/bookmark/database.md
index 5b0784c07..3ef227087 100644
--- a/documentation/bookmark/database.md
+++ b/documentation/bookmark/database.md
@@ -123,6 +123,7 @@
# Exemplar
+1. [Debunking “Purpose-Built Data Systems”: Enter the Universal Database](https://tiledb.com/blog/debunking-purpose-built-data-systems-enter-the-universal-database-2021-08-04)
1. [Irmin](https://irmin.org/)
1. [Database of Databases](https://dbdb.io/)
diff --git a/documentation/bookmark/database/relational.md b/documentation/bookmark/database/relational.md
new file mode 100644
index 000000000..1977a1cec
--- /dev/null
+++ b/documentation/bookmark/database/relational.md
@@ -0,0 +1,4 @@
+# Reference
+
+1. [Implicit ordering in relational languages](https://scattered-thoughts.net/writing/implicit-ordering-in-relational-languages)
+
diff --git a/documentation/bookmark/floating_point.md b/documentation/bookmark/floating_point.md
index 238112f51..47527b43e 100644
--- a/documentation/bookmark/floating_point.md
+++ b/documentation/bookmark/floating_point.md
@@ -1,3 +1,7 @@
+# Half-precision
+
+1. [Supporting half-precision floats is really annoying](https://futhark-lang.org/blog/2021-08-05-half-precision-floats.html)
+
# Debugging
1. [Keynote: William Kahan - Debugging Tools for Floating-Point Code](https://www.youtube.com/watch?v=qHddEkfQBrA)
diff --git a/documentation/bookmark/game/math.md b/documentation/bookmark/game/math.md
new file mode 100644
index 000000000..708a77871
--- /dev/null
+++ b/documentation/bookmark/game/math.md
@@ -0,0 +1,4 @@
+# Reference
+
+1. [A Bestiary of Functions for Systems Designers](https://brunodias.dev/2021/03/19/functions-for-system-designers.html)
+
diff --git a/documentation/bookmark/inspiration.md b/documentation/bookmark/inspiration.md
index 3e5841ba7..5331f9a0b 100644
--- a/documentation/bookmark/inspiration.md
+++ b/documentation/bookmark/inspiration.md
@@ -1,3 +1,11 @@
+# Design
+
+1. [Good Design is Imperfect Design Part 1: Honest Names](https://www.domainlanguage.com/articles/good-design-is-imperfect-design-part-1-honest-names/)
+
+# Programming
+
+1. [Reflections on 10,000 Hours of Programming](https://matt-rickard.com/reflections-on-10-000-hours-of-programming/)
+
# Feature
1. [About Adding Features (part 1)](https://kele.codes/2021/07/about-adding-features-1/)
diff --git a/documentation/bookmark/machine_learning/probabilistic_soft_logic.md b/documentation/bookmark/machine_learning/probabilistic_soft_logic.md
new file mode 100644
index 000000000..8ded7ebf1
--- /dev/null
+++ b/documentation/bookmark/machine_learning/probabilistic_soft_logic.md
@@ -0,0 +1,4 @@
+# Reference
+
+1. [Probabilistic soft logic (PSL)](https://psl.linqs.org/)
+
diff --git a/documentation/bookmark/platform/jvm.md b/documentation/bookmark/platform/jvm.md
index f804b80e2..4ea87de28 100644
--- a/documentation/bookmark/platform/jvm.md
+++ b/documentation/bookmark/platform/jvm.md
@@ -1,5 +1,6 @@
# Reference
+1. [Journey to the Centre of the JVM — Daniel Spiewak](https://www.youtube.com/watch?v=EFkpmFt61Jo)
1. [String concatenation, redux](https://cl4es.github.io/2019/05/14/String-Concat-Redux.html)
1. [Beware of computation in static initializer](https://pangin.pro/posts/computation-in-static-initializer)
1. [JVM Internals](https://blog.jamesdbloom.com/JVMInternals.html)
diff --git a/documentation/bookmark/rendering.md b/documentation/bookmark/rendering.md
index 4222fea4b..793367868 100644
--- a/documentation/bookmark/rendering.md
+++ b/documentation/bookmark/rendering.md
@@ -1,3 +1,8 @@
+# Ray Tracing
+
+1. [Ray Tracing Gems II Available Today as Free Digital Download](https://developer.nvidia.com/blog/ray-tracing-gems-ii-available-today-as-free-digital-download/)
+1. [Ray Tracing Gems II](https://link.springer.com/book/10.1007/978-1-4842-7185-8)
+
# Physically Based Rendering
1. [Physically Based Rendering](https://www.pbr-book.org/3ed-2018/contents)
diff --git a/documentation/bookmark/security.md b/documentation/bookmark/security.md
index 620c37e1f..524d1651c 100644
--- a/documentation/bookmark/security.md
+++ b/documentation/bookmark/security.md
@@ -63,6 +63,7 @@
# Vulnerability
+1. [SAML is insecure by design](https://joonas.fi/2021/08/saml-is-insecure-by-design/)
1. [Against Cipher Agility in Cryptography Protocols](https://paragonie.com/blog/2019/10/against-agility-in-cryptography-protocols)
1. [Padding the struct: How a compiler optimization can disclose stack memory](https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2019/october/padding-the-struct-how-a-compiler-optimization-can-disclose-stack-memory/)
1. [PCG generators are easily “crackable”](https://news.ycombinator.com/item?id=21475210)
diff --git a/documentation/bookmark/security/programming.md b/documentation/bookmark/security/programming.md
new file mode 100644
index 000000000..75cb2fb4e
--- /dev/null
+++ b/documentation/bookmark/security/programming.md
@@ -0,0 +1,4 @@
+# Reference
+
+1. [Secure Programming in C](https://web.mit.edu/6.s096/www/lecture/lecture03/secure-C.pdf)
+
diff --git a/documentation/bookmark/user_interface/color.md b/documentation/bookmark/user_interface/color.md
index 80595d1b1..a4de0c8e3 100644
--- a/documentation/bookmark/user_interface/color.md
+++ b/documentation/bookmark/user_interface/color.md
@@ -1,5 +1,7 @@
# Reference
+1. [Building a color scheme: A foundational overview of how to establish a dynamic and configurable color scheme](https://web.dev/building-a-color-scheme/)
+1. [Web-safe colors](https://en.wikipedia.org/wiki/Web_colors#Web-safe_colors)
1. [CSS Gradient Fixer](https://www.da.vidbuchanan.co.uk/widgets/css-gradient-fixer/)
1. [Towards richer colors on the Web](https://darker.ink/writings/Towards-richer-colors-on-the-Web)
1. [How software gets color wrong](https://bottosson.github.io/posts/colorwrong/)
diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux
index c342863e7..e9b0278e5 100644
--- a/stdlib/source/library/lux.lux
+++ b/stdlib/source/library/lux.lux
@@ -735,7 +735,7 @@
#1)
## Base functions & macros
-("lux def" return
+("lux def" in_meta
("lux type check"
(#UnivQ #End
(#Function (#Parameter 1)
@@ -767,8 +767,8 @@
("lux macro"
([_ tokens]
({(#Item lhs (#Item rhs (#Item body #End)))
- (return (#Item (form$ (#Item (record$ (#Item [lhs body] #End)) (#Item rhs #End)))
- #End))
+ (in_meta (#Item (form$ (#Item (record$ (#Item [lhs body] #End)) (#Item rhs #End)))
+ #End))
_
(failure "Wrong syntax for let''")}
@@ -780,32 +780,32 @@
("lux macro"
([_ tokens]
({(#Item [_ (#Tuple (#Item arg args'))] (#Item body #End))
- (return (#Item (_ann (#Form (#Item (_ann (#Tuple (#Item (_ann (#Identifier ["" ""]))
- (#Item arg #End))))
- (#Item ({#End
- body
+ (in_meta (#Item (_ann (#Form (#Item (_ann (#Tuple (#Item (_ann (#Identifier ["" ""]))
+ (#Item arg #End))))
+ (#Item ({#End
+ body
- _
- (_ann (#Form (#Item (_ann (#Identifier ["library/lux" "function''"]))
- (#Item (_ann (#Tuple args'))
- (#Item body #End)))))}
- args')
- #End))))
- #End))
+ _
+ (_ann (#Form (#Item (_ann (#Identifier ["library/lux" "function''"]))
+ (#Item (_ann (#Tuple args'))
+ (#Item body #End)))))}
+ args')
+ #End))))
+ #End))
(#Item [_ (#Identifier ["" self])] (#Item [_ (#Tuple (#Item arg args'))] (#Item body #End)))
- (return (#Item (_ann (#Form (#Item (_ann (#Tuple (#Item (_ann (#Identifier ["" self]))
- (#Item arg #End))))
- (#Item ({#End
- body
+ (in_meta (#Item (_ann (#Form (#Item (_ann (#Tuple (#Item (_ann (#Identifier ["" self]))
+ (#Item arg #End))))
+ (#Item ({#End
+ body
- _
- (_ann (#Form (#Item (_ann (#Identifier ["library/lux" "function''"]))
- (#Item (_ann (#Tuple args'))
- (#Item body #End)))))}
- args')
- #End))))
- #End))
+ _
+ (_ann (#Form (#Item (_ann (#Identifier ["library/lux" "function''"]))
+ (#Item (_ann (#Tuple args'))
+ (#Item body #End)))))}
+ args')
+ #End))))
+ #End))
_
(failure "Wrong syntax for function''")}
@@ -838,12 +838,6 @@
(record$ #End)
#0)
-("lux def" doc_meta
- ("lux type check" (#Function Text (#Product Code Code))
- (function'' [doc] [(tag$ ["library/lux" "doc"]) (text$ doc)]))
- (record$ #End)
- #0)
-
("lux def" as_def
("lux type check" (#Function Code (#Function Code (#Function Code (#Function Bit Code))))
(function'' [name value annotations exported?]
@@ -883,37 +877,37 @@
({(#Item [[_ (#Tag ["" "export"])]
(#Item [[_ (#Form (#Item [name args]))]
(#Item [meta (#Item [type (#Item [body #End])])])])])
- (return (#Item [(as_def name (as_checked type (as_function name args body))
- (form$ (#Item (identifier$ ["library/lux" "record$"])
- (#Item meta
- #End)))
- #1)
- #End]))
+ (in_meta (#Item [(as_def name (as_checked type (as_function name args body))
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item meta
+ #End)))
+ #1)
+ #End]))
(#Item [[_ (#Tag ["" "export"])] (#Item [name (#Item [meta (#Item [type (#Item [body #End])])])])])
- (return (#Item [(as_def name (as_checked type body)
- (form$ (#Item (identifier$ ["library/lux" "record$"])
- (#Item meta
- #End)))
- #1)
- #End]))
+ (in_meta (#Item [(as_def name (as_checked type body)
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item meta
+ #End)))
+ #1)
+ #End]))
(#Item [[_ (#Form (#Item [name args]))]
(#Item [meta (#Item [type (#Item [body #End])])])])
- (return (#Item [(as_def name (as_checked type (as_function name args body))
- (form$ (#Item (identifier$ ["library/lux" "record$"])
- (#Item meta
- #End)))
- #0)
- #End]))
+ (in_meta (#Item [(as_def name (as_checked type (as_function name args body))
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item meta
+ #End)))
+ #0)
+ #End]))
(#Item [name (#Item [meta (#Item [type (#Item [body #End])])])])
- (return (#Item [(as_def name (as_checked type body)
- (form$ (#Item (identifier$ ["library/lux" "record$"])
- (#Item meta
- #End)))
- #0)
- #End]))
+ (in_meta (#Item [(as_def name (as_checked type body)
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item meta
+ #End)))
+ #0)
+ #End]))
_
(failure "Wrong syntax for def''")}
@@ -925,28 +919,28 @@
("lux macro"
(function'' [tokens]
({(#Item [_ (#Form (#Item name args))] (#Item body #End))
- (return (#Item (as_def name (as_macro (as_function name args body))
- (form$ (#Item (identifier$ ["library/lux" "record$"])
- (#Item (tag$ ["library/lux" "End"])
- #End)))
- #0)
- #End))
+ (in_meta (#Item (as_def name (as_macro (as_function name args body))
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item (tag$ ["library/lux" "End"])
+ #End)))
+ #0)
+ #End))
(#Item [_ (#Tag ["" "export"])] (#Item [_ (#Form (#Item name args))] (#Item body #End)))
- (return (#Item (as_def name (as_macro (as_function name args body))
- (form$ (#Item (identifier$ ["library/lux" "record$"])
- (#Item (tag$ ["library/lux" "End"])
- #End)))
- #1)
- #End))
+ (in_meta (#Item (as_def name (as_macro (as_function name args body))
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item (tag$ ["library/lux" "End"])
+ #End)))
+ #1)
+ #End))
(#Item [_ (#Tag ["" "export"])] (#Item [_ (#Form (#Item name args))] (#Item meta_data (#Item body #End))))
- (return (#Item (as_def name (as_macro (as_function name args body))
- (form$ (#Item (identifier$ ["library/lux" "record$"])
- (#Item meta_data
- #End)))
- #1)
- #End))
+ (in_meta (#Item (as_def name (as_macro (as_function name args body))
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item meta_data
+ #End)))
+ #1)
+ #End))
_
(failure "Wrong syntax for macro:'")}
@@ -962,18 +956,18 @@
("lux text concat" "## Great for commenting-out code, while retaining syntax high-lighting and formatting in your text editor." __paragraph)
"(comment +1 +2 +3 +4)")))]
#End)
- (return #End))
+ (in_meta #End))
(macro:' ($' tokens)
({(#Item x #End)
- (return tokens)
+ (in_meta tokens)
(#Item x (#Item y xs))
- (return (#Item (form$ (#Item (identifier$ ["library/lux" "$'"])
- (#Item (form$ (#Item (tag$ ["library/lux" "Apply"])
- (#Item y (#Item x #End))))
- xs)))
- #End))
+ (in_meta (#Item (form$ (#Item (identifier$ ["library/lux" "$'"])
+ (#Item (form$ (#Item (tag$ ["library/lux" "Apply"])
+ (#Item y (#Item x #End))))
+ xs)))
+ #End))
_
(failure "Wrong syntax for $'")}
@@ -1058,7 +1052,7 @@
syntax))
(def:'' (n/* param subject)
- (#.Item (doc_meta "Nat(ural) multiplication.") #.End)
+ #.End
(#Function Nat (#Function Nat Nat))
("lux type as" Nat
("lux i64 *"
@@ -1160,18 +1154,18 @@
#End))))))
body
names)
- (return (#Item ({[#1 _]
- body'
-
- [_ #End]
- body'
-
- [#0 _]
- (with_replacements (#Item [self_name (type_parameter (n/* 2 ("lux i64 -" 1 (list\size names))))]
- #End)
- body')}
- [(text\= "" self_name) names])
- #End)))))
+ (in_meta (#Item ({[#1 _]
+ body'
+
+ [_ #End]
+ body'
+
+ [#0 _]
+ (with_replacements (#Item [self_name (type_parameter (n/* 2 ("lux i64 -" 1 (list\size names))))]
+ #End)
+ body')}
+ [(text\= "" self_name) names])
+ #End)))))
_
(failure "Wrong syntax for All")}
@@ -1205,18 +1199,18 @@
#End))))))
body
names)
- (return (#Item ({[#1 _]
- body'
-
- [_ #End]
- body'
-
- [#0 _]
- (with_replacements (#Item [self_name (type_parameter (n/* 2 ("lux i64 -" 1 (list\size names))))]
- #End)
- body')}
- [(text\= "" self_name) names])
- #End)))))
+ (in_meta (#Item ({[#1 _]
+ body'
+
+ [_ #End]
+ body'
+
+ [#0 _]
+ (with_replacements (#Item [self_name (type_parameter (n/* 2 ("lux i64 -" 1 (list\size names))))]
+ #End)
+ body')}
+ [(text\= "" self_name) names])
+ #End)))))
_
(failure "Wrong syntax for Ex")}
@@ -1239,11 +1233,11 @@
"## This is the type of a function that takes 2 Ints and returns an Int.")))]
#End)
({(#Item output inputs)
- (return (#Item (list\fold ("lux type check" (#Function Code (#Function Code Code))
- (function'' [i o] (form$ (#Item (tag$ ["library/lux" "Function"]) (#Item i (#Item o #End))))))
- output
- inputs)
- #End))
+ (in_meta (#Item (list\fold ("lux type check" (#Function Code (#Function Code Code))
+ (function'' [i o] (form$ (#Item (tag$ ["library/lux" "Function"]) (#Item i (#Item o #End))))))
+ output
+ inputs)
+ #End))
_
(failure "Wrong syntax for ->")}
@@ -1255,13 +1249,13 @@
("lux text concat" "## List-construction macro." __paragraph)
"(list +1 +2 +3)"))]
#End)
- (return (#Item (list\fold (function'' [head tail]
- (form$ (#Item (tag$ ["library/lux" "Item"])
- (#Item (tuple$ (#Item [head (#Item [tail #End])]))
- #End))))
- (tag$ ["library/lux" "End"])
- (list\reverse xs))
- #End)))
+ (in_meta (#Item (list\fold (function'' [head tail]
+ (form$ (#Item (tag$ ["library/lux" "Item"])
+ (#Item (tuple$ (#Item [head (#Item [tail #End])]))
+ #End))))
+ (tag$ ["library/lux" "End"])
+ (list\reverse xs))
+ #End)))
(macro:' #export (list& xs)
(#Item [(tag$ ["library/lux" "doc"])
@@ -1272,11 +1266,11 @@
"(list& +1 +2 +3 (list +4 +5 +6))")))]
#End)
({(#Item last init)
- (return (list (list\fold (function'' [head tail]
- (form$ (list (tag$ ["library/lux" "Item"])
- (tuple$ (list head tail)))))
- last
- init)))
+ (in_meta (list (list\fold (function'' [head tail]
+ (form$ (list (tag$ ["library/lux" "Item"])
+ (tuple$ (list head tail)))))
+ last
+ init)))
_
(failure "Wrong syntax for list&")}
@@ -1293,12 +1287,12 @@
"(&)"))))]
#End)
({#End
- (return (list (identifier$ ["library/lux" "Any"])))
+ (in_meta (list (identifier$ ["library/lux" "Any"])))
(#Item last prevs)
- (return (list (list\fold (function'' [left right] (form$ (list (tag$ ["library/lux" "Product"]) left right)))
- last
- prevs)))}
+ (in_meta (list (list\fold (function'' [left right] (form$ (list (tag$ ["library/lux" "Product"]) left right)))
+ last
+ prevs)))}
(list\reverse tokens)))
(macro:' #export (Variant tokens)
@@ -1312,12 +1306,12 @@
"(Variant)"))))]
#End)
({#End
- (return (list (identifier$ ["library/lux" "Nothing"])))
+ (in_meta (list (identifier$ ["library/lux" "Nothing"])))
(#Item last prevs)
- (return (list (list\fold (function'' [left right] (form$ (list (tag$ ["library/lux" "Sum"]) left right)))
- last
- prevs)))}
+ (in_meta (list (list\fold (function'' [left right] (form$ (list (tag$ ["library/lux" "Sum"]) left right)))
+ last
+ prevs)))}
(list\reverse tokens)))
(macro:' (function' tokens)
@@ -1332,14 +1326,14 @@
(failure "function' requires a non-empty arguments tuple.")
(#Item [harg targs])
- (return (list (form$ (list (tuple$ (list (local_identifier$ name)
- harg))
- (list\fold (function'' [arg body']
- (form$ (list (tuple$ (list (local_identifier$ "")
- arg))
- body')))
- body
- (list\reverse targs))))))}
+ (in_meta (list (form$ (list (tuple$ (list (local_identifier$ name)
+ harg))
+ (list\fold (function'' [arg body']
+ (form$ (list (tuple$ (list (local_identifier$ "")
+ arg))
+ body')))
+ body
+ (list\reverse targs))))))}
args)
_
@@ -1350,53 +1344,53 @@
({(#Item [[_ (#Tag ["" "export"])]
(#Item [[_ (#Form (#Item [name args]))]
(#Item [meta (#Item [type (#Item [body #End])])])])])
- (return (list (form$ (list (text$ "lux def")
- name
- (form$ (list (text$ "lux type check")
- type
- (form$ (list (identifier$ ["library/lux" "function'"])
- name
- (tuple$ args)
- body))))
- (form$ (#Item (identifier$ ["library/lux" "record$"])
- (#Item meta
- #End)))
- (bit$ #1)))))
+ (in_meta (list (form$ (list (text$ "lux def")
+ name
+ (form$ (list (text$ "lux type check")
+ type
+ (form$ (list (identifier$ ["library/lux" "function'"])
+ name
+ (tuple$ args)
+ body))))
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item meta
+ #End)))
+ (bit$ #1)))))
(#Item [[_ (#Tag ["" "export"])] (#Item [name (#Item [meta (#Item [type (#Item [body #End])])])])])
- (return (list (form$ (list (text$ "lux def")
- name
- (form$ (list (text$ "lux type check")
- type
- body))
- (form$ (#Item (identifier$ ["library/lux" "record$"])
- (#Item meta
- #End)))
- (bit$ #1)))))
+ (in_meta (list (form$ (list (text$ "lux def")
+ name
+ (form$ (list (text$ "lux type check")
+ type
+ body))
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item meta
+ #End)))
+ (bit$ #1)))))
(#Item [[_ (#Form (#Item [name args]))]
(#Item [meta (#Item [type (#Item [body #End])])])])
- (return (list (form$ (list (text$ "lux def")
- name
- (form$ (list (text$ "lux type check")
- type
- (form$ (list (identifier$ ["library/lux" "function'"])
- name
- (tuple$ args)
- body))))
- (form$ (#Item (identifier$ ["library/lux" "record$"])
- (#Item meta
- #End)))
- (bit$ #0)))))
+ (in_meta (list (form$ (list (text$ "lux def")
+ name
+ (form$ (list (text$ "lux type check")
+ type
+ (form$ (list (identifier$ ["library/lux" "function'"])
+ name
+ (tuple$ args)
+ body))))
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item meta
+ #End)))
+ (bit$ #0)))))
(#Item [name (#Item [meta (#Item [type (#Item [body #End])])])])
- (return (list (form$ (list (text$ "lux def")
- name
- (form$ (list (text$ "lux type check") type body))
- (form$ (#Item (identifier$ ["library/lux" "record$"])
- (#Item meta
- #End)))
- (bit$ #0)))))
+ (in_meta (list (form$ (list (text$ "lux def")
+ name
+ (form$ (list (text$ "lux type check") type body))
+ (form$ (#Item (identifier$ ["library/lux" "record$"])
+ (#Item meta
+ #End)))
+ (bit$ #0)))))
_
(failure "Wrong syntax for def:'''")}
@@ -1424,14 +1418,14 @@
(macro:' (let' tokens)
({(#Item [[_ (#Tuple bindings)] (#Item [body #End])])
- (return (list (list\fold ("lux type check" (-> (Tuple Code Code) Code
- Code)
- (function' [binding body]
- ({[label value]
- (form$ (list (record$ (list [label body])) value))}
- binding)))
- body
- (list\reverse (pairs bindings)))))
+ (in_meta (list (list\fold ("lux type check" (-> (Tuple Code Code) Code
+ Code)
+ (function' [binding body]
+ ({[label value]
+ (form$ (list (record$ (list [label body])) value))}
+ binding)))
+ body
+ (list\reverse (pairs bindings)))))
_
(failure "Wrong syntax for let'")}
@@ -1450,7 +1444,7 @@
(p x))}
xs))
-(def:''' (wrap_meta content)
+(def:''' (with_location content)
#End
(-> Code Code)
(tuple$ (list (tuple$ (list (text$ "") (nat$ 0) (nat$ 0)))
@@ -1505,7 +1499,7 @@
#End)
({(#Item op tokens')
({(#Item first nexts)
- (return (list (list\fold (function\flip (right_associativity op)) first nexts)))
+ (in_meta (list (list\fold (function\flip (right_associativity op)) first nexts)))
_
(failure "Wrong syntax for _$")}
@@ -1527,7 +1521,7 @@
#End)
({(#Item op tokens')
({(#Item last prevs)
- (return (list (list\fold (right_associativity op) last prevs)))
+ (in_meta (list (list\fold (right_associativity op) last prevs)))
_
(failure "Wrong syntax for $_")}
@@ -1590,8 +1584,16 @@
body' (list\fold ("lux type check" (-> (Tuple Code Code) Code Code)
(function' [binding body']
(let' [[var value] binding]
- ({[_ (#Tag "" "let")]
- (form$ (list (identifier$ ["library/lux" "let'"]) value body'))
+ ({[_ (#Identifier [module short])]
+ ({""
+ (form$ (list g!bind
+ (form$ (list (tuple$ (list (local_identifier$ "") var)) body'))
+ value))
+
+ _
+ (form$ (list var value body'))}
+ module)
+
_
(form$ (list g!bind
@@ -1600,9 +1602,9 @@
var))))
body
(list\reverse (pairs bindings)))]
- (return (list (form$ (list (record$ (list [(record$ (list [(tag$ ["library/lux" "in"]) g!in] [(tag$ ["library/lux" "bind"]) g!bind]))
- body']))
- monad)))))
+ (in_meta (list (form$ (list (record$ (list [(record$ (list [(tag$ ["library/lux" "in"]) g!in] [(tag$ ["library/lux" "bind"]) g!bind]))
+ body']))
+ monad)))))
_
(failure "Wrong syntax for do")}
@@ -1655,9 +1657,9 @@
"(if #1 ''Oh, yeah!'' ''Aw hell naw!'')" __paragraph
"=> ''Oh, yeah!''"))])
({(#Item test (#Item then (#Item else #End)))
- (return (list (form$ (list (record$ (list [(bit$ #1) then]
- [(bit$ #0) else]))
- test))))
+ (in_meta (list (form$ (list (record$ (list [(bit$ #1) then]
+ [(bit$ #0) else]))
+ test))))
_
(failure "Wrong syntax for if")}
@@ -1772,7 +1774,7 @@
(-> Bit (-> Code ($' Meta Code)) ($' List Code) ($' Meta Code))
({#1
({#End
- (return (tag$ ["library/lux" "End"]))
+ (in_meta (tag$ ["library/lux" "End"]))
(#Item lastI inits)
(do meta_monad
@@ -1810,31 +1812,31 @@
(def:''' (untemplated_text value)
#End
(-> Text Code)
- (wrap_meta (form$ (list (tag$ ["library/lux" "Text"]) (text$ value)))))
+ (with_location (form$ (list (tag$ ["library/lux" "Text"]) (text$ value)))))
(def:''' (untemplate replace? subst token)
#End
(-> Bit Text Code ($' Meta Code))
({[_ [_ (#Bit value)]]
- (return (wrap_meta (form$ (list (tag$ ["library/lux" "Bit"]) (bit$ value)))))
+ (in_meta (with_location (form$ (list (tag$ ["library/lux" "Bit"]) (bit$ value)))))
[_ [_ (#Nat value)]]
- (return (wrap_meta (form$ (list (tag$ ["library/lux" "Nat"]) (nat$ value)))))
+ (in_meta (with_location (form$ (list (tag$ ["library/lux" "Nat"]) (nat$ value)))))
[_ [_ (#Int value)]]
- (return (wrap_meta (form$ (list (tag$ ["library/lux" "Int"]) (int$ value)))))
+ (in_meta (with_location (form$ (list (tag$ ["library/lux" "Int"]) (int$ value)))))
[_ [_ (#Rev value)]]
- (return (wrap_meta (form$ (list (tag$ ["library/lux" "Rev"]) (rev$ value)))))
+ (in_meta (with_location (form$ (list (tag$ ["library/lux" "Rev"]) (rev$ value)))))
[_ [_ (#Frac value)]]
- (return (wrap_meta (form$ (list (tag$ ["library/lux" "Frac"]) (frac$ value)))))
+ (in_meta (with_location (form$ (list (tag$ ["library/lux" "Frac"]) (frac$ value)))))
[_ [_ (#Text value)]]
- (return (untemplated_text value))
+ (in_meta (untemplated_text value))
[#0 [_ (#Tag [module name])]]
- (return (wrap_meta (form$ (list (tag$ ["library/lux" "Tag"]) (tuple$ (list (text$ module) (text$ name)))))))
+ (in_meta (with_location (form$ (list (tag$ ["library/lux" "Tag"]) (tuple$ (list (text$ module) (text$ name)))))))
[#1 [_ (#Tag [module name])]]
(let' [module' ({""
@@ -1843,7 +1845,7 @@
_
module}
module)]
- (return (wrap_meta (form$ (list (tag$ ["library/lux" "Tag"]) (tuple$ (list (text$ module') (text$ name))))))))
+ (in_meta (with_location (form$ (list (tag$ ["library/lux" "Tag"]) (tuple$ (list (text$ module') (text$ name))))))))
[#1 [_ (#Identifier [module name])]]
(do meta_monad
@@ -1855,24 +1857,24 @@
_
(in [module name])}
module)
- #let [[module name] real_name]]
- (return (wrap_meta (form$ (list (tag$ ["library/lux" "Identifier"]) (tuple$ (list (text$ module) (text$ name))))))))
+ .let' [[module name] real_name]]
+ (in_meta (with_location (form$ (list (tag$ ["library/lux" "Identifier"]) (tuple$ (list (text$ module) (text$ name))))))))
[#0 [_ (#Identifier [module name])]]
- (return (wrap_meta (form$ (list (tag$ ["library/lux" "Identifier"]) (tuple$ (list (text$ module) (text$ name)))))))
+ (in_meta (with_location (form$ (list (tag$ ["library/lux" "Identifier"]) (tuple$ (list (text$ module) (text$ name)))))))
[#1 [_ (#Form (#Item [[_ (#Identifier ["" "~"])] (#Item [unquoted #End])]))]]
- (return (form$ (list (text$ "lux type check")
- (identifier$ ["library/lux" "Code"])
- unquoted)))
+ (in_meta (form$ (list (text$ "lux type check")
+ (identifier$ ["library/lux" "Code"])
+ unquoted)))
[#1 [_ (#Form (#Item [[_ (#Identifier ["" "~!"])] (#Item [dependent #End])]))]]
(do meta_monad
[independent (untemplate replace? subst dependent)]
- (in (wrap_meta (form$ (list (tag$ ["library/lux" "Form"])
- (untemplated_list (list (untemplated_text "lux in-module")
- (untemplated_text subst)
- independent)))))))
+ (in (with_location (form$ (list (tag$ ["library/lux" "Form"])
+ (untemplated_list (list (untemplated_text "lux in-module")
+ (untemplated_text subst)
+ independent)))))))
[#1 [_ (#Form (#Item [[_ (#Identifier ["" "~'"])] (#Item [keep_quoted #End])]))]]
(untemplate #0 subst keep_quoted)
@@ -1880,13 +1882,13 @@
[_ [meta (#Form elems)]]
(do meta_monad
[output (spliced replace? (untemplate replace? subst) elems)
- #let [[_ output'] (wrap_meta (form$ (list (tag$ ["library/lux" "Form"]) output)))]]
+ .let' [[_ output'] (with_location (form$ (list (tag$ ["library/lux" "Form"]) output)))]]
(in [meta output']))
[_ [meta (#Tuple elems)]]
(do meta_monad
[output (spliced replace? (untemplate replace? subst) elems)
- #let [[_ output'] (wrap_meta (form$ (list (tag$ ["library/lux" "Tuple"]) output)))]]
+ .let' [[_ output'] (with_location (form$ (list (tag$ ["library/lux" "Tuple"]) output)))]]
(in [meta output']))
[_ [_ (#Record fields)]]
@@ -1900,7 +1902,7 @@
=v (untemplate replace? subst v)]
(in (tuple$ (list =k =v)))))))
fields)]
- (in (wrap_meta (form$ (list (tag$ ["library/lux" "Record"]) (untemplated_list =fields))))))}
+ (in (with_location (form$ (list (tag$ ["library/lux" "Record"]) (untemplated_list =fields))))))}
[replace? token]))
(macro:' #export (primitive tokens)
@@ -1910,10 +1912,10 @@
"(primitive ''java.lang.Object'')" __paragraph
"(primitive ''java.util.List'' [(primitive ''java.lang.Long'')])"))])
({(#Item [_ (#Text class_name)] #End)
- (return (list (form$ (list (tag$ ["library/lux" "Primitive"]) (text$ class_name) (tag$ ["library/lux" "End"])))))
+ (in_meta (list (form$ (list (tag$ ["library/lux" "Primitive"]) (text$ class_name) (tag$ ["library/lux" "End"])))))
(#Item [_ (#Text class_name)] (#Item [_ (#Tuple params)] #End))
- (return (list (form$ (list (tag$ ["library/lux" "Primitive"]) (text$ class_name) (untemplated_list params)))))
+ (in_meta (list (form$ (list (tag$ ["library/lux" "Primitive"]) (text$ class_name) (untemplated_list params)))))
_
(failure "Wrong syntax for primitive")}
@@ -1988,19 +1990,19 @@
"## =>" __paragraph
"(fold text\compose '''' (interpose '' '' (list\map int\encode elems)))"))])
({(#Item [init apps])
- (return (list (list\fold ("lux type check" (-> Code Code Code)
- (function' [app acc]
- ({[_ (#Tuple parts)]
- (tuple$ (list\compose parts (list acc)))
+ (in_meta (list (list\fold ("lux type check" (-> Code Code Code)
+ (function' [app acc]
+ ({[_ (#Tuple parts)]
+ (tuple$ (list\compose parts (list acc)))
- [_ (#Form parts)]
- (form$ (list\compose parts (list acc)))
+ [_ (#Form parts)]
+ (form$ (list\compose parts (list acc)))
- _
- (` ((~ app) (~ acc)))}
- app)))
- init
- apps)))
+ _
+ (` ((~ app) (~ acc)))}
+ app)))
+ init
+ apps)))
_
(failure "Wrong syntax for |>")}
@@ -2014,19 +2016,19 @@
"## =>" __paragraph
"(fold text\compose '''' (interpose '' '' (list\map int\encode elems)))"))])
({(#Item [init apps])
- (return (list (list\fold ("lux type check" (-> Code Code Code)
- (function' [app acc]
- ({[_ (#Tuple parts)]
- (tuple$ (list\compose parts (list acc)))
+ (in_meta (list (list\fold ("lux type check" (-> Code Code Code)
+ (function' [app acc]
+ ({[_ (#Tuple parts)]
+ (tuple$ (list\compose parts (list acc)))
- [_ (#Form parts)]
- (form$ (list\compose parts (list acc)))
+ [_ (#Form parts)]
+ (form$ (list\compose parts (list acc)))
- _
- (` ((~ app) (~ acc)))}
- app)))
- init
- apps)))
+ _
+ (` ((~ app) (~ acc)))}
+ app)))
+ init
+ apps)))
_
(failure "Wrong syntax for <|")}
@@ -2172,7 +2174,7 @@
(|> data'
(list\map (compose apply (replacement_environment bindings')))
list\join
- return)
+ in_meta)
(failure "Irregular arguments tuples for template.")))
_
@@ -2335,7 +2337,7 @@
(in [module_name name]))
_
- (return name)}
+ (in_meta name)}
name))
(def:''' (macro full_name)
@@ -2388,11 +2390,11 @@
(("lux type as" Macro' macro) args)
#None
- (return (list token))}
+ (in_meta (list token))}
?macro))
_
- (return (list token))}
+ (in_meta (list token))}
token))
(def:''' (expansion token)
@@ -2409,11 +2411,11 @@
(in (list\join recursive_expansion)))
#None
- (return (list token))}
+ (in_meta (list token))}
?macro))
_
- (return (list token))}
+ (in_meta (list token))}
token))
(def:''' (full_expansion syntax)
@@ -2453,7 +2455,7 @@
(do meta_monad
[val' (full_expansion val)]
({(#Item val'' #End)
- (return [key val''])
+ (in_meta [key val''])
_
(failure "The value-part of a KV-pair in a record must macro-expand to a single Code.")}
@@ -2462,7 +2464,7 @@
(in (list (record$ pairs'))))
_
- (return (list syntax))}
+ (in_meta (list syntax))}
syntax))
(def:''' (normal_type type)
@@ -2496,7 +2498,7 @@
(macro:' #export (type tokens)
(list [(tag$ ["library/lux" "doc"])
(text$ ($_ "lux text concat"
- "## Takes a type expression and returns it's representation as data-structure." __paragraph
+ "## Takes a type expression and returns its representation as data-structure." __paragraph
"(type (All [a] (Maybe (List a))))"))])
({(#Item type #End)
(do meta_monad
@@ -2518,7 +2520,7 @@
"## The type-annotation macro." __paragraph
"(: (List Int) (list +1 +2 +3))"))])
({(#Item type (#Item value #End))
- (return (list (` ("lux type check" (type (~ type)) (~ value)))))
+ (in_meta (list (` ("lux type check" (type (~ type)) (~ value)))))
_
(failure "Wrong syntax for :")}
@@ -2530,7 +2532,7 @@
"## The type-coercion macro." __paragraph
"(:as Dinosaur (list +1 +2 +3))"))])
({(#Item type (#Item value #End))
- (return (list (` ("lux type as" (type (~ type)) (~ value)))))
+ (in_meta (list (` ("lux type as" (type (~ type)) (~ value)))))
_
(failure "Wrong syntax for :as")}
@@ -2561,24 +2563,24 @@
(: (-> [Code Code] (Meta [Text Code]))
(function' [pair]
({[[_ (#Tag "" member_name)] member_type]
- (return [member_name member_type])
+ (in_meta [member_name member_type])
_
(failure "Wrong syntax for variant case.")}
pair)))
pairs)]
- (return [(` (Tuple (~+ (list\map second members))))
- (#Some (list\map first members))]))
+ (in_meta [(` (Tuple (~+ (list\map second members))))
+ (#Some (list\map first members))]))
(#Item type #End)
({[_ (#Tag "" member_name)]
- (return [(` .Any) (#Some (list member_name))])
+ (in_meta [(` .Any) (#Some (list member_name))])
[_ (#Form (#Item [_ (#Tag "" member_name)] member_types))]
- (return [(` (Tuple (~+ member_types))) (#Some (list member_name))])
+ (in_meta [(` (Tuple (~+ member_types))) (#Some (list member_name))])
_
- (return [type #None])}
+ (in_meta [type #None])}
type)
(#Item case cases)
@@ -2587,20 +2589,20 @@
(: (-> Code (Meta [Text Code]))
(function' [case]
({[_ (#Tag "" member_name)]
- (return [member_name (` .Any)])
+ (in_meta [member_name (` .Any)])
[_ (#Form (#Item [_ (#Tag "" member_name)] (#Item member_type #End)))]
- (return [member_name member_type])
+ (in_meta [member_name member_type])
[_ (#Form (#Item [_ (#Tag "" member_name)] member_types))]
- (return [member_name (` (Tuple (~+ member_types)))])
+ (in_meta [member_name (` (Tuple (~+ member_types)))])
_
(failure "Wrong syntax for variant case.")}
case)))
(list& case cases))]
- (return [(` (..Variant (~+ (list\map second members))))
- (#Some (list\map first members))]))
+ (in_meta [(` (..Variant (~+ (list\map second members))))
+ (#Some (list\map first members))]))
_
(failure "Improper type-definition syntax")}
@@ -2632,7 +2634,7 @@
(let' [body' (|> body
nested_quantification
(with_replacements (list [name (` (#.Apply (~ (type_parameter 1)) (~ (type_parameter 0))))])))]
- (return (list (` (#.Apply .Nothing (#.UnivQ #.End (~ body')))))))
+ (in_meta (list (` (#.Apply .Nothing (#.UnivQ #.End (~ body')))))))
_
(failure "Wrong syntax for Rec")}
@@ -2649,11 +2651,11 @@
"''YOLO'')"))])
({(#Item value actions)
(let' [dummy (local_identifier$ "")]
- (return (list (list\fold ("lux type check" (-> Code Code Code)
- (function' [pre post] (` ({(~ dummy) (~ post)}
- (~ pre)))))
- value
- actions))))
+ (in_meta (list (list\fold ("lux type check" (-> Code Code Code)
+ (function' [pre post] (` ({(~ dummy) (~ post)}
+ (~ pre)))))
+ value
+ actions))))
_
(failure "Wrong syntax for exec")}
@@ -2695,11 +2697,11 @@
#None
body'}
?type)]
- (return (list (` ("lux def" (~ name)
- (~ body'')
- [(~ location_code)
- (#.Record #.End)]
- (~ (bit$ export?)))))))
+ (in_meta (list (` ("lux def" (~ name)
+ (~ body'')
+ [(~ location_code)
+ (#.Record #.End)]
+ (~ (bit$ export?)))))))
#None
(failure "Wrong syntax for def'")}
@@ -2864,7 +2866,7 @@
(let' [pairs (|> patterns
(list\map (function' [pattern] (list pattern body)))
(list\join))]
- (return (list\compose pairs branches))))
+ (in_meta (list\compose pairs branches))))
_
(failure "Wrong syntax for ^or")))
@@ -2897,7 +2899,7 @@
(` (case (~ r) (~ l) (~ body')))))))
body)
list
- return)
+ in_meta)
(failure "let requires an even number of parts"))
_
@@ -2929,8 +2931,8 @@
(` ([(~ g!name) (~ arg)] (~ body')))
(` ([(~ g!name) (~ g!blank)]
(.case (~ g!blank) (~ arg) (~ body'))))))))]
- (return (list (nest (..local_identifier$ g!name) head
- (list\fold (nest g!blank) body (list\reverse tail))))))
+ (in_meta (list (nest (..local_identifier$ g!name) head
+ (list\fold (nest g!blank) body (list\reverse tail))))))
#None
(failure "Wrong syntax for function")))
@@ -3075,11 +3077,11 @@
#None
body)
=meta (definition_annotations meta)]
- (return (list (` ("lux def" (~ name)
- (~ body)
- [(~ location_code)
- (#.Record (~ (with_func_args args =meta)))]
- (~ (bit$ exported?)))))))
+ (in_meta (list (` ("lux def" (~ name)
+ (~ body)
+ [(~ location_code)
+ (#.Record (~ (with_func_args args =meta)))]
+ (~ (bit$ exported?)))))))
#None
(failure "Wrong syntax for def:"))))
@@ -3110,7 +3112,7 @@
" (case tokens" ..\n
" (^template [<tag>]" ..\n
" [(^ (list [_ (<tag> [prefix name])]))" ..\n
- " (return (list (` [(~ (text$ prefix)) (~ (text$ name))])))])" ..\n
+ " (in (list (` [(~ (text$ prefix)) (~ (text$ name))])))])" ..\n
" ([#Identifier] [#Tag])"
__paragraph
" _" ..\n
@@ -3143,11 +3145,11 @@
(` ("lux macro"
(function ((~ name) (~+ args)) (~ body)))))
=meta (definition_annotations meta)]
- (return (list (` ("lux def" (~ name)
- (~ body)
- [(~ location_code)
- (#Record (~ =meta))]
- (~ (bit$ exported?)))))))
+ (in_meta (list (` ("lux def" (~ name)
+ (~ body)
+ [(~ location_code)
+ (#Record (~ =meta))]
+ (~ (bit$ exported?)))))))
#None
(failure "Wrong syntax for macro:"))))
@@ -3199,13 +3201,13 @@
_
(failure "Signatures require typed members!"))))
(list\join sigs')))
- #let [[_module _name] name+
+ .let [[_module _name] name+
def_name (identifier$ name)
sig_type (record$ (list\map (: (-> [Text Code] [Code Code])
- (function (_ [m_name m_type])
- [(local_tag$ m_name) m_type]))
+ (function (_ [module_name m_type])
+ [(local_tag$ module_name) m_type]))
members))
- sig_meta (merged_definition_annotations (` {#.sig? #1})
+ sig_meta (merged_definition_annotations (` {#.interface? #1})
meta)
usage (case args
#End
@@ -3213,7 +3215,7 @@
_
(` ((~ def_name) (~+ args))))]]
- (return (list (` (..type: (~+ (export exported?)) (~ usage) (~ sig_meta) (~ sig_type))))))
+ (in_meta (list (` (..type: (~+ (export exported?)) (~ usage) (~ sig_meta) (~ sig_type))))))
#None
(failure "Wrong syntax for interface:"))))
@@ -3233,15 +3235,15 @@
(#Some y)
(#Some y))))
-(template [<name> <form> <message> <doc_msg>]
+(template [<name> <form> <message> <documentation>]
[(macro: #export (<name> tokens)
- {#.doc <doc_msg>}
+ {#.doc <documentation>}
(case (list\reverse tokens)
(^ (list& last init))
- (return (list (list\fold (: (-> Code Code Code)
- (function (_ pre post) (` <form>)))
- last
- init)))
+ (in_meta (list (list\fold (: (-> Code Code Code)
+ (function (_ pre post) (` <form>)))
+ last
+ init)))
_
(failure <message>)))]
@@ -3386,9 +3388,9 @@
_
(list type)))]
- [flat_variant #Sum]
- [flat_tuple #Product]
- [flat_lambda #Function]
+ [flat_variant #Sum]
+ [flat_tuple #Product]
+ [flat_lambda #Function]
)
(def: (flat_application type)
@@ -3451,10 +3453,10 @@
(-> Name (Meta [Nat (List Name) Bit Type]))
(do meta_monad
[=module (..module module)
- #let [{#module_hash _ #module_aliases _ #definitions bindings #imports _ #tags tags_table #types types #module_annotations _ #module_state _} =module]]
+ .let [{#module_hash _ #module_aliases _ #definitions bindings #imports _ #tags tags_table #types types #module_annotations _ #module_state _} =module]]
(case (get name tags_table)
(#Some output)
- (return output)
+ (in_meta output)
_
(failure (text\compose "Unknown tag: " (name\encode [module name]))))))
@@ -3474,21 +3476,21 @@
(#Named [module name] unnamed)
(do meta_monad
[=module (..module module)
- #let [{#module_hash _ #module_aliases _ #definitions bindings #imports _ #tags tags #types types #module_annotations _ #module_state _} =module]]
+ .let [{#module_hash _ #module_aliases _ #definitions bindings #imports _ #tags tags #types types #module_annotations _ #module_state _} =module]]
(case (get name types)
(#Some [tags exported? (#Named _ _type)])
(case (interface_methods _type)
(#Some members)
- (return (#Some [tags members]))
+ (in_meta (#Some [tags members]))
_
- (return #None))
+ (in_meta #None))
_
(record_slots unnamed)))
_
- (return #None)))
+ (in_meta #None)))
(def: get_expected_type
(Meta Type)
@@ -3513,11 +3515,11 @@
tags (: (Meta (List Name))
(case tags+type
(#Some [tags _])
- (return tags)
+ (in_meta tags)
_
(failure "No tags available for type.")))
- #let [tag_mappings (: (List [Text Code])
+ .let [tag_mappings (: (List [Text Code])
(list\map (function (_ tag) [(second tag) (tag$ tag)])
tags))]
members (monad\map meta_monad
@@ -3589,11 +3591,11 @@
_
(` ((~ name) (~+ args))))]
- (return (list (` (..def: (~+ (export exported?)) (~ usage)
- (~ (merged_definition_annotations (` {#.implementation? #1})
- meta))
- (~ type)
- (implementation (~+ definitions)))))))
+ (in_meta (list (` (..def: (~+ (export exported?)) (~ usage)
+ (~ (merged_definition_annotations (` {#.implementation? #1})
+ meta))
+ (~ type)
+ (implementation (~+ definitions)))))))
#None
(failure "Wrong syntax for implementation:"))))
@@ -3669,20 +3671,20 @@
(let [typeC (` (#.Named [(~ (text$ module_name))
(~ (text$ name))]
(.type (~ type''))))]
- (return (list (case tags??
- (#Some tags)
- (` ("lux def type tagged" (~ type_name)
- (~ typeC)
- (~ total_meta)
- [(~+ (list\map text$ tags))]
- (~ (bit$ exported?))))
-
- _
- (` ("lux def" (~ type_name)
- ("lux type check type"
- (~ typeC))
- (~ total_meta)
- (~ (bit$ exported?))))))))
+ (in_meta (list (case tags??
+ (#Some tags)
+ (` ("lux def type tagged" (~ type_name)
+ (~ typeC)
+ (~ total_meta)
+ [(~+ (list\map text$ tags))]
+ (~ (bit$ exported?))))
+
+ _
+ (` ("lux def" (~ type_name)
+ ("lux type check type"
+ (~ typeC))
+ (~ total_meta)
+ (~ (bit$ exported?))))))))
#None
(failure "Wrong syntax for type:"))))
@@ -3728,7 +3730,7 @@
(function (_ def)
(case def
[_ (#Identifier ["" name])]
- (return name)
+ (in_meta name)
_
(failure "#only/#+ and #exclude/#- require identifiers."))))
@@ -3751,20 +3753,20 @@
(^or (^ (list& [_ (#Tag ["" "*"])] tokens'))
(^ (list& [_ (#Tag ["" "all"])] tokens')))
- (return [#All tokens'])
+ (in_meta [#All tokens'])
(^or (^ (list& [_ (#Tag ["" "_"])] tokens'))
(^ (list& [_ (#Tag ["" "nothing"])] tokens')))
- (return [#Ignore tokens'])
+ (in_meta [#Ignore tokens'])
_
- (return [#Nothing tokens])))
+ (in_meta [#Nothing tokens])))
(def: (openings_parser parts)
(-> (List Code) (Meta [(List Openings) (List Code)]))
(case parts
#.End
- (return [#.End #.End])
+ (in_meta [#.End #.End])
(^ (list& [_ (#Form (list& [_ (#Text prefix)] structs))] parts'))
(do meta_monad
@@ -3772,18 +3774,18 @@
(function (_ struct)
(case struct
[_ (#Identifier ["" struct_name])]
- (return struct_name)
+ (in_meta struct_name)
_
(failure "Expected all implementations of opening form to be identifiers.")))
structs)
next+remainder (openings_parser parts')]
(let [[next remainder] next+remainder]
- (return [(#.Item [prefix structs'] next)
- remainder])))
+ (in_meta [(#.Item [prefix structs'] next)
+ remainder])))
_
- (return [#.End parts])))
+ (in_meta [#.End parts])))
(def: (text\split! at x)
(-> Nat Text [Text Text])
@@ -3794,7 +3796,7 @@
(-> Text Text (Maybe [Text Text]))
(do ..maybe_monad
[index (..index token sample)
- #let [[pre post'] (text\split! index sample)
+ .let [[pre post'] (text\split! index sample)
[_ post] (text\split! ("lux text size" token) post')]]
(in [pre post])))
@@ -3876,13 +3878,13 @@
[_ (#Item _ tail)]
(list\drop ("lux i64 -" 1 amount) tail)))
-(def: (clean_module nested? relative_root module)
+(def: (absolute_module_name nested? relative_root module)
(-> Bit Text Text (Meta Text))
(case (count_relatives 0 module)
0
- (return (if nested?
- ($_ "lux text concat" relative_root ..module_separator module)
- module))
+ (in_meta (if nested?
+ ($_ "lux text concat" relative_root ..module_separator module)
+ module))
relatives
(let [parts (text\split_all_with ..module_separator relative_root)
@@ -3898,27 +3900,12 @@
output (case ("lux text size" clean)
0 prefix
_ ($_ text\compose prefix ..module_separator clean))]
- (return output))
+ (in_meta output))
(failure ($_ "lux text concat"
"Cannot climb the module hierarchy..." ..\n
"Importing module: " module ..\n
" Relative Root: " relative_root ..\n))))))
-(def: (alter_domain alteration domain import)
- (-> Nat Text Importation Importation)
- (let [[import_name import_alias import_refer] import
- original (text\split_all_with ..module_separator import_name)
- truncated (list\drop (.nat alteration) original)
- parallel (case domain
- ""
- truncated
-
- _
- (list& domain truncated))]
- {#import_name (text\join_with ..module_separator parallel)
- #import_alias import_alias
- #import_refer import_refer}))
-
(def: (imports_parser nested? relative_root context_alias imports)
(-> Bit Text Text (List Code) (Meta (List Importation)))
(do meta_monad
@@ -3927,59 +3914,59 @@
(function (_ token)
(case token
## Simple
- [_ (#Identifier ["" m_name])]
+ [_ (#Identifier ["" module_name])]
(do meta_monad
- [m_name (clean_module nested? relative_root m_name)]
- (in (list {#import_name m_name
+ [absolute_module_name (..absolute_module_name nested? relative_root module_name)]
+ (in (list {#import_name absolute_module_name
#import_alias #None
#import_refer {#refer_defs #All
#refer_open (list)}})))
## Nested
- (^ [_ (#Tuple (list& [_ (#Identifier ["" m_name])] extra))])
+ (^ [_ (#Tuple (list& [_ (#Identifier ["" module_name])] extra))])
(do meta_monad
- [import_name (case (normal_parallel_path relative_root m_name)
- (#.Some parallel_path)
- (in parallel_path)
+ [absolute_module_name (case (normal_parallel_path relative_root module_name)
+ (#.Some parallel_path)
+ (in parallel_path)
- #.None
- (clean_module nested? relative_root m_name))
+ #.None
+ (..absolute_module_name nested? relative_root module_name))
referral+extra (referrals_parser extra)
- #let [[referral extra] referral+extra]
+ .let [[referral extra] referral+extra]
openings+extra (openings_parser extra)
- #let [[openings extra] openings+extra]
- sub_imports (imports_parser #1 import_name context_alias extra)]
+ .let [[openings extra] openings+extra]
+ sub_imports (imports_parser #1 absolute_module_name context_alias extra)]
(in (case [referral openings]
[#Nothing #End]
sub_imports
_
- (list& {#import_name import_name
+ (list& {#import_name absolute_module_name
#import_alias #None
#import_refer {#refer_defs referral
#refer_open openings}}
sub_imports))))
- (^ [_ (#Tuple (list& [_ (#Text alias)] [_ (#Identifier ["" m_name])] extra))])
+ (^ [_ (#Tuple (list& [_ (#Text alias)] [_ (#Identifier ["" module_name])] extra))])
(do meta_monad
- [import_name (case (normal_parallel_path relative_root m_name)
- (#.Some parallel_path)
- (in parallel_path)
+ [absolute_module_name (case (normal_parallel_path relative_root module_name)
+ (#.Some parallel_path)
+ (in parallel_path)
- #.None
- (clean_module nested? relative_root m_name))
+ #.None
+ (..absolute_module_name nested? relative_root module_name))
referral+extra (referrals_parser extra)
- #let [[referral extra] referral+extra]
+ .let [[referral extra] referral+extra]
openings+extra (openings_parser extra)
- #let [[openings extra] openings+extra
- module_alias (..module_alias context_alias m_name alias)]
- sub_imports (imports_parser #1 import_name module_alias extra)]
+ .let [[openings extra] openings+extra
+ module_alias (..module_alias context_alias module_name alias)]
+ sub_imports (imports_parser #1 absolute_module_name module_alias extra)]
(in (case [referral openings]
[#Ignore #End]
sub_imports
_
- (list& {#import_name import_name
+ (list& {#import_name absolute_module_name
#import_alias (#Some module_alias)
#import_refer {#refer_defs referral
#refer_open openings}}
@@ -4148,7 +4135,7 @@
(def: (type_definition full_name)
(-> Name (Meta Type))
(do meta_monad
- [#let [[module name] full_name]
+ [.let [[module name] full_name]
current_module current_module_name]
(function (_ compiler)
(let [temp (if (text\= "" module)
@@ -4310,12 +4297,12 @@
(failure "cond requires an uneven number of arguments.")
(case (list\reverse tokens)
(^ (list& else branches'))
- (return (list (list\fold (: (-> [Code Code] Code Code)
- (function (_ branch else)
- (let [[right left] branch]
- (` (if (~ left) (~ right) (~ else))))))
- else
- (pairs branches'))))
+ (in_meta (list (list\fold (: (-> [Code Code] Code Code)
+ (function (_ branch else)
+ (let [[right left] branch]
+ (` (if (~ left) (~ right) (~ else))))))
+ else
+ (pairs branches'))))
_
(failure "Wrong syntax for cond"))))
@@ -4349,7 +4336,7 @@
(do meta_monad
[slot (normal slot')
output (..type_tag slot)
- #let [[idx tags exported? type] output]
+ .let [[idx tags exported? type] output]
g!_ (gensym "_")
g!output (gensym "")]
(case (interface_methods type)
@@ -4361,17 +4348,17 @@
g!output
g!_)]))
(zipped/2 tags (enumeration members))))]
- (return (list (` ({(~ pattern) (~ g!output)} (~ record))))))
+ (in_meta (list (` ({(~ pattern) (~ g!output)} (~ record))))))
_
(failure "get@ can only use records.")))
(^ (list [_ (#Tuple slots)] record))
- (return (list (list\fold (: (-> Code Code Code)
- (function (_ slot inner)
- (` (..get@ (~ slot) (~ inner)))))
- record
- slots)))
+ (in_meta (list (list\fold (: (-> Code Code Code)
+ (function (_ slot inner)
+ (` (..get@ (~ slot) (~ inner)))))
+ record
+ slots)))
(^ (list selector))
(do meta_monad
@@ -4387,7 +4374,7 @@
(do meta_monad
[output (record_slots type)
g!_ (gensym "g!_")
- #let [g!output (local_identifier$ short)
+ .let [g!output (local_identifier$ short)
pattern (|> tags
enumeration
(list\map (function (_ [tag_idx tag])
@@ -4404,13 +4391,13 @@
(function (_ [sub_tag_index sname stype])
(open_declaration alias tags' sub_tag_index sname source+ stype)))
(enumeration (zipped/2 tags' members')))]
- (return (list\join decls')))
+ (in_meta (list\join decls')))
_
- (return (list (` ("lux def" (~ (local_identifier$ (..module_alias "" short alias)))
- (~ source+)
- [(~ location_code) (#.Record #End)]
- #0)))))))
+ (in_meta (list (` ("lux def" (~ (local_identifier$ (..module_alias "" short alias)))
+ (~ source+)
+ [(~ location_code) (#.Record #End)]
+ #0)))))))
(macro: #export (open: tokens)
{#.doc (text$ ($_ "lux text concat"
@@ -4431,7 +4418,7 @@
(do meta_monad
[struct_type (type_definition struct_name)
output (record_slots struct_type)
- #let [source (identifier$ struct_name)]]
+ .let [source (identifier$ struct_name)]]
(case output
(#Some [tags members])
(do meta_monad
@@ -4439,7 +4426,7 @@
(function (_ [tag_index sname stype])
(open_declaration alias tags tag_index sname source stype)))
(enumeration (zipped/2 tags members)))]
- (return (list\join decls')))
+ (in_meta (list\join decls')))
_
(failure (text\compose "Can only 'open:' structs: " (type\encode struct_type)))))
@@ -4447,10 +4434,10 @@
_
(do meta_monad
[g!struct (gensym "struct")]
- (return (list (` ("lux def" (~ g!struct) (~ struct)
- [(~ location_code) (#.Record #End)]
- #0))
- (` (..open: (~ (text$ alias)) (~ g!struct)))))))
+ (in_meta (list (` ("lux def" (~ g!struct) (~ struct)
+ [(~ location_code) (#.Record #End)]
+ #0))
+ (` (..open: (~ (text$ alias)) (~ g!struct)))))))
_
(failure "Wrong syntax for open:")))
@@ -4464,7 +4451,7 @@
(do meta_monad
[g!_ (gensym "_")
g!arg (gensym "arg")]
- (return (list (` (function ((~ g!_) (~ g!arg)) (|> (~ g!arg) (~+ tokens))))))))
+ (in_meta (list (` (function ((~ g!_) (~ g!arg)) (|> (~ g!arg) (~+ tokens))))))))
(macro: #export (<<| tokens)
{#.doc (text$ ($_ "lux text concat"
@@ -4475,22 +4462,22 @@
(do meta_monad
[g!_ (gensym "_")
g!arg (gensym "arg")]
- (return (list (` (function ((~ g!_) (~ g!arg)) (<| (~+ tokens) (~ g!arg))))))))
+ (in_meta (list (` (function ((~ g!_) (~ g!arg)) (<| (~+ tokens) (~ g!arg))))))))
(def: (imported_by? import_name module_name)
(-> Text Text (Meta Bit))
(do meta_monad
[module (module module_name)
- #let [{#module_hash _ #module_aliases _ #definitions _ #imports imports #tags _ #types _ #module_annotations _ #module_state _} module]]
+ .let [{#module_hash _ #module_aliases _ #definitions _ #imports imports #tags _ #types _ #module_annotations _ #module_state _} module]]
(in (is_member? imports import_name))))
(def: (referrals module_name options)
(-> Text (List Code) (Meta Refer))
(do meta_monad
[referral+options (referrals_parser options)
- #let [[referral options] referral+options]
+ .let [[referral options] referral+options]
openings+options (openings_parser options)
- #let [[openings options] openings+options]
+ .let [[openings options] openings+options]
current_module current_module_name]
(case options
#End
@@ -4508,13 +4495,13 @@
(-> Text Refer (Meta (List Code)))
(do meta_monad
[current_module current_module_name
- #let [test_referrals (: (-> Text (List Text) (List Text) (Meta (List Any)))
+ .let [test_referrals (: (-> Text (List Text) (List Text) (Meta (List Any)))
(function (_ module_name all_defs referred_defs)
(monad\map meta_monad
(: (-> Text (Meta Any))
(function (_ _def)
(if (is_member? all_defs _def)
- (return [])
+ (in_meta [])
(failure ($_ text\compose _def " is not defined in module " module_name " @ " current_module)))))
referred_defs)))]
defs' (case r_defs
@@ -4538,7 +4525,7 @@
#Nothing
(in (list)))
- #let [defs (list\map (: (-> Text Code)
+ .let [defs (list\map (: (-> Text Code)
(function (_ def)
(` ("lux def alias" (~ (local_identifier$ def)) (~ (identifier$ [module_name def]))))))
defs')
@@ -4607,7 +4594,7 @@
" [//" ..\n
" [type (''.'' equivalence)]])"))}
(do meta_monad
- [#let [[_meta _imports] (: [(List [Code Code]) (List Code)]
+ [.let [[_meta _imports] (: [(List [Code Code]) (List Code)]
(case tokens
(^ (list& [_ (#Record _meta)] _imports))
[_meta _imports]
@@ -4616,14 +4603,14 @@
[(list) tokens]))]
current_module current_module_name
imports (imports_parser #0 current_module "" _imports)
- #let [=imports (|> imports
+ .let [=imports (|> imports
(list\map (: (-> Importation Code)
- (function (_ [m_name m_alias =refer])
- (` [(~ (text$ m_name)) (~ (text$ (..else "" m_alias)))]))))
+ (function (_ [module_name m_alias =refer])
+ (` [(~ (text$ module_name)) (~ (text$ (..else "" m_alias)))]))))
tuple$)
=refers (list\map (: (-> Importation Code)
- (function (_ [m_name m_alias =refer])
- (refer_code m_name m_alias =refer)))
+ (function (_ [module_name m_alias =refer])
+ (refer_code module_name m_alias =refer)))
imports)
=module (` ("lux def module" [(~ location_code)
(#.Record (~ (definition_annotations _meta)))]
@@ -4639,10 +4626,10 @@
"(\ codec encode +123)"))}
(case tokens
(^ (list struct [_ (#Identifier member)]))
- (return (list (` (let [(^open (~ (text$ ..self_reference))) (~ struct)] (~ (identifier$ member))))))
+ (in_meta (list (` (let [(^open (~ (text$ ..self_reference))) (~ struct)] (~ (identifier$ member))))))
(^ (list& struct member args))
- (return (list (` ((..\ (~ struct) (~ member)) (~+ args)))))
+ (in_meta (list (` ((..\ (~ struct) (~ member)) (~+ args)))))
_
(failure "Wrong syntax for \")))
@@ -4663,7 +4650,7 @@
(do meta_monad
[slot (normal slot')
output (..type_tag slot)
- #let [[idx tags exported? type] output]]
+ .let [[idx tags exported? type] output]]
(case (interface_methods type)
(#Some members)
(do meta_monad
@@ -4672,7 +4659,7 @@
(function (_ [r_slot_name [r_idx r_type]])
(do meta_monad
[g!slot (gensym "")]
- (return [r_slot_name r_idx g!slot]))))
+ (in_meta [r_slot_name r_idx g!slot]))))
(zipped/2 tags (enumeration members)))]
(let [pattern (record$ (list\map (: (-> [Name Nat Code] [Code Code])
(function (_ [r_slot_name r_idx r_var])
@@ -4686,7 +4673,7 @@
value
r_var)]))
pattern'))]
- (return (list (` ({(~ pattern) (~ output)} (~ record)))))))
+ (in_meta (list (` ({(~ pattern) (~ output)} (~ record)))))))
_
(failure "set@ can only use records.")))
@@ -4702,7 +4689,7 @@
(: (-> Code (Meta Code))
(function (_ _) (gensym "temp")))
slots)
- #let [pairs (zipped/2 slots bindings)
+ .let [pairs (zipped/2 slots bindings)
update_expr (list\fold (: (-> [Code Code] Code Code)
(function (_ [s b] v)
(` (..set@ (~ s) (~ v) (~ b)))))
@@ -4752,7 +4739,7 @@
(do meta_monad
[slot (normal slot')
output (..type_tag slot)
- #let [[idx tags exported? type] output]]
+ .let [[idx tags exported? type] output]]
(case (interface_methods type)
(#Some members)
(do meta_monad
@@ -4761,7 +4748,7 @@
(function (_ [r_slot_name [r_idx r_type]])
(do meta_monad
[g!slot (gensym "")]
- (return [r_slot_name r_idx g!slot]))))
+ (in_meta [r_slot_name r_idx g!slot]))))
(zipped/2 tags (enumeration members)))]
(let [pattern (record$ (list\map (: (-> [Name Nat Code] [Code Code])
(function (_ [r_slot_name r_idx r_var])
@@ -4775,7 +4762,7 @@
(` ((~ fun) (~ r_var)))
r_var)]))
pattern'))]
- (return (list (` ({(~ pattern) (~ output)} (~ record)))))))
+ (in_meta (list (` ({(~ pattern) (~ output)} (~ record)))))))
_
(failure "update@ can only use records.")))
@@ -4866,7 +4853,7 @@
in))
#None))))
(#Some output)
- (return (list\compose output branches))
+ (in_meta (list\compose output branches))
#None
(failure "Wrong syntax for ^template"))
@@ -4901,18 +4888,18 @@
(list\map (|>> second baseline_column) pairs)))
))
-(type: Doc_Fragment
- (#Doc_Comment Text)
- (#Doc_Example Code))
+(type: Documentation_Fragment
+ (#Documentation_Comment Text)
+ (#Documentation_Example Code))
-(def: (identify_doc_fragment code)
- (-> Code Doc_Fragment)
+(def: (documentation_fragment code)
+ (-> Code Documentation_Fragment)
(case code
[_ (#Text comment)]
- (#Doc_Comment comment)
+ (#Documentation_Comment comment)
_
- (#Doc_Example code)))
+ (#Documentation_Example code)))
(template [<name> <extension> <doc>]
[(def: #export <name>
@@ -4963,7 +4950,7 @@
(|>> (list\map pair_list)
list\join)))
-(def: (doc_example_to_text prev_location baseline example)
+(def: (example_documentation prev_location baseline example)
(-> Location Nat Code [Location Text])
(case example
(^template [<tag> <encode>]
@@ -4983,7 +4970,7 @@
(^template [<tag> <open> <close> <prep>]
[[group_location (<tag> parts)]
(let [[group_location' parts_text] (list\fold (function (_ part [last_location text_accum])
- (let [[part_location part_text] (doc_example_to_text last_location baseline part)]
+ (let [[part_location part_text] (example_documentation last_location baseline part)]
[part_location (text\compose text_accum part_text)]))
[(delim_update_location group_location) ""]
(<prep> parts))]
@@ -4997,26 +4984,26 @@
[#Record "{" "}" ..un_paired])
[new_location (#Rev value)]
- ("lux io error" "@doc_example_to_text Undefined behavior.")
+ ("lux io error" "@example_documentation Undefined behavior.")
))
(def: (with_baseline baseline [file line column])
(-> Nat Location Location)
[file line baseline])
-(def: (doc_fragment_to_text fragment)
- (-> Doc_Fragment Text)
+(def: (fragment_documentation fragment)
+ (-> Documentation_Fragment Text)
(case fragment
- (#Doc_Comment comment)
+ (#Documentation_Comment comment)
(|> comment
(text\split_all_with ..\n)
(list\map (function (_ line) ($_ text\compose "## " line ..\n)))
(text\join_with ""))
- (#Doc_Example example)
+ (#Documentation_Example example)
(let [baseline (baseline_column example)
[location _] example
- [_ text] (doc_example_to_text (with_baseline baseline location) baseline example)]
+ [_ text] (..example_documentation (with_baseline baseline location) baseline example)]
(text\compose text __paragraph))))
(macro: #export (doc tokens)
@@ -5031,13 +5018,13 @@
" (if (< +10 count)" ..\n
" (recur (inc count) (f x))" ..\n
" x)))"))}
- (return (list (` [(~ location_code)
- (#.Text (~ (|> tokens
- (list\map (|>> identify_doc_fragment doc_fragment_to_text))
- (text\join_with "")
- text$)))]))))
+ (in_meta (list (` [(~ location_code)
+ (#.Text (~ (|> tokens
+ (list\map (|>> ..documentation_fragment ..fragment_documentation))
+ (text\join_with "")
+ text$)))]))))
-(def: (interleave xs ys)
+(def: (interleaved xs ys)
(All [a] (-> (List a) (List a) (List a)))
(case xs
#End
@@ -5049,7 +5036,7 @@
#End
(#Item y ys')
- (list& x y (interleave xs' ys')))))
+ (list& x y (interleaved xs' ys')))))
(def: (type_code type)
(-> Type Code)
@@ -5116,25 +5103,25 @@
(do meta_monad
[inits' (: (Meta (List Name))
(case (monad\map maybe_monad get_name inits)
- (#Some inits') (return inits')
+ (#Some inits') (in_meta inits')
#None (failure "Wrong syntax for loop")))
init_types (monad\map meta_monad type_definition inits')
expected get_expected_type]
- (return (list (` (("lux type check"
- (-> (~+ (list\map type_code init_types))
- (~ (type_code expected)))
- (function ((~ name) (~+ vars))
- (~ body)))
- (~+ inits))))))
+ (in_meta (list (` (("lux type check"
+ (-> (~+ (list\map type_code init_types))
+ (~ (type_code expected)))
+ (function ((~ name) (~+ vars))
+ (~ body)))
+ (~+ inits))))))
(do meta_monad
[aliases (monad\map meta_monad
(: (-> Code (Meta Code))
(function (_ _) (gensym "")))
inits)]
- (return (list (` (let [(~+ (interleave aliases inits))]
- (.loop (~ name)
- [(~+ (interleave vars aliases))]
- (~ body)))))))))
+ (in_meta (list (` (let [(~+ (..interleaved aliases inits))]
+ (.loop (~ name)
+ [(~+ (..interleaved vars aliases))]
+ (~ body)))))))))
#.None
(failure "Wrong syntax for loop"))))
@@ -5154,16 +5141,16 @@
tslots (monad\map maybe_monad get_tag tslots')]
(in [hslot tslots])))
(#Some slots)
- (return slots)
+ (in_meta slots)
#None
(failure "Wrong syntax for ^slots")))
- #let [[hslot tslots] slots]
+ .let [[hslot tslots] slots]
hslot (..normal hslot)
tslots (monad\map meta_monad ..normal tslots)
output (..type_tag hslot)
g!_ (gensym "_")
- #let [[idx tags exported? type] output
+ .let [[idx tags exported? type] output
slot_pairings (list\map (: (-> Name [Text Code])
(function (_ [module name])
[name (local_identifier$ name)]))
@@ -5175,7 +5162,7 @@
(#Some binding) [tag binding]
#None [tag g!_]))))
tags))]]
- (return (list& pattern body branches)))
+ (in_meta (list& pattern body branches)))
_
(failure "Wrong syntax for ^slots")))
@@ -5254,7 +5241,7 @@
(failure "[with_expansions] Improper macro expansion.")))
#End
- (return bodies)
+ (in_meta bodies)
_
(failure "Wrong syntax for with_expansions"))
@@ -5281,11 +5268,11 @@
_
type))
-(def: (anti_quote_def name)
+(def: (static_simple_literal name)
(-> Name (Meta Code))
(do meta_monad
[type+value (definition_value name)
- #let [[type value] type+value]]
+ .let [[type value] type+value]]
(case (flat_alias type)
(^template [<name> <type> <wrapper>]
[(#Named ["library/lux" <name>] _)
@@ -5300,20 +5287,20 @@
_
(failure (text\compose "Cannot anti-quote type: " (name\encode name))))))
-(def: (anti_quote token)
+(def: (static_literal token)
(-> Code (Meta Code))
(case token
[_ (#Identifier [def_prefix def_name])]
(if (text\= "" def_prefix)
(do meta_monad
[current_module current_module_name]
- (anti_quote_def [current_module def_name]))
- (anti_quote_def [def_prefix def_name]))
+ (static_simple_literal [current_module def_name]))
+ (static_simple_literal [def_prefix def_name]))
(^template [<tag>]
[[meta (<tag> parts)]
(do meta_monad
- [=parts (monad\map meta_monad anti_quote parts)]
+ [=parts (monad\map meta_monad static_literal parts)]
(in [meta (<tag> =parts)]))])
([#Form]
[#Tuple])
@@ -5324,13 +5311,13 @@
(: (-> [Code Code] (Meta [Code Code]))
(function (_ [slot value])
(do meta_monad
- [=value (anti_quote value)]
+ [=value (static_literal value)]
(in [slot =value]))))
pairs)]
(in [meta (#Record =pairs)]))
_
- (\ meta_monad return token)
+ (\ meta_monad in_meta token)
## TODO: Figure out why this doesn't work:
## (\ meta_monad in token)
))
@@ -5339,7 +5326,7 @@
(case tokens
(^ (list pattern))
(do meta_monad
- [pattern' (anti_quote pattern)]
+ [pattern' (static_literal pattern)]
(in (list pattern')))
_
@@ -5352,10 +5339,10 @@
(-> Code (Meta [Code Code]))
(case level
(^ [_ (#Record (list [expr binding]))])
- (return [expr binding])
+ (in_meta [expr binding])
_
- (return [level (` #1)])
+ (in_meta [level (` #1)])
))
(def: (multi_level_case^ levels)
@@ -5414,7 +5401,7 @@
(^ (list& [_meta (#Form levels)] body next_branches))
(do meta_monad
[mlc (multi_level_case^ levels)
- #let [initial_bind? (case mlc
+ .let [initial_bind? (case mlc
[[_ (#.Identifier _)] _]
#1
@@ -5457,7 +5444,7 @@
(case tokens
(^template [<tag>]
[(^ (list [_ (<tag> [prefix name])]))
- (return (list (` [(~ (text$ prefix)) (~ (text$ name))])))])
+ (in_meta (list (` [(~ (text$ prefix)) (~ (text$ name))])))])
([#Identifier] [#Tag])
_
@@ -5516,9 +5503,9 @@
(case tokens
(^ (list& [_meta (#Form (list [_ (#Identifier ["" name])] pattern))] body branches))
(let [g!whole (local_identifier$ name)]
- (return (list& g!whole
- (` (case (~ g!whole) (~ pattern) (~ body)))
- branches)))
+ (in_meta (list& g!whole
+ (` (case (~ g!whole) (~ pattern) (~ body)))
+ branches)))
_
(failure (..wrong_syntax_error (name_of ..^@)))))
@@ -5531,10 +5518,10 @@
(case tokens
(^ (list& [_meta (#Form (list [_ (#Identifier ["" name])] [_ (#Tuple steps)]))] body branches))
(let [g!name (local_identifier$ name)]
- (return (list& g!name
- (` (let [(~ g!name) (|> (~ g!name) (~+ steps))]
- (~ body)))
- branches)))
+ (in_meta (list& g!name
+ (` (let [(~ g!name) (|> (~ g!name) (~+ steps))]
+ (~ body)))
+ branches)))
_
(failure (..wrong_syntax_error (name_of ..^|>)))))
@@ -5568,7 +5555,7 @@
#End
(do meta_monad
[location ..location
- #let [[module line column] location
+ .let [[module line column] location
location ($_ "lux text concat" (text\encode module) "," (nat\encode line) "," (nat\encode column))
message ($_ "lux text concat" "Undefined behavior @ " location)]]
(in (list (` (..error! (~ (text$ message)))))))
@@ -5627,7 +5614,7 @@
(-> (List Code) (Meta [Code (List Code)]))
(case tokens
(^ (list& token tokens'))
- (return [token tokens'])
+ (in_meta [token tokens'])
_
(failure "Could not parse anything.")
@@ -5637,7 +5624,7 @@
(-> (List Code) (Meta [(List Code) (List Code)]))
(case tokens
(^ (list& head tail))
- (return [tokens (list)])
+ (in_meta [tokens (list)])
_
(failure "Could not parse anything.")
@@ -5647,7 +5634,7 @@
(-> (List Code) (Meta Any))
(case tokens
(^ (list))
- (return [])
+ (in_meta [])
_
(failure "Expected input Codes to be empty.")
@@ -5657,10 +5644,10 @@
(-> (List Code) (Meta [Code (List Code)]))
(case tokens
(^ (list& [_ (#Record _anns)] tokens'))
- (return [(record$ _anns) tokens'])
+ (in_meta [(record$ _anns) tokens'])
_
- (return [(' {}) tokens])
+ (in_meta [(' {}) tokens])
))
(macro: #export (template: tokens)
@@ -5669,18 +5656,18 @@
(template: (square x)
(* x x)))}
(do meta_monad
- [#let [[export? tokens] (export^ tokens)]
+ [.let [[export? tokens] (export^ tokens)]
name+args|tokens (complex_declaration_parser tokens)
- #let [[[name args] tokens] name+args|tokens]
+ .let [[[name args] tokens] name+args|tokens]
anns|tokens (anns_parser tokens)
- #let [[anns tokens] anns|tokens]
+ .let [[anns tokens] anns|tokens]
input_templates|tokens (many_parser tokens)
- #let [[input_templates tokens] input_templates|tokens]
+ .let [[input_templates tokens] input_templates|tokens]
_ (end_parser tokens)
g!tokens (gensym "tokens")
g!compiler (gensym "compiler")
g!_ (gensym "_")
- #let [rep_env (list\map (function (_ arg)
+ .let [rep_env (list\map (function (_ arg)
[arg (` ((~' ~) (~ (local_identifier$ arg))))])
args)]
this_module current_module_name]
@@ -5723,13 +5710,13 @@
(-> Code (Meta Text))
(case choice
[_ (#Text platform)]
- (..return platform)
+ (..in_meta platform)
[_ (#Identifier identifier)]
(do meta_monad
[identifier (..global_identifier identifier)
type+value (..definition_value identifier)
- #let [[type value] type+value]]
+ .let [[type value] type+value]]
(case (..flat_alias type)
(^or (#Primitive "#Text" #End)
(#Named ["library/lux" "Text"] (#Primitive "#Text" #End)))
@@ -5754,13 +5741,13 @@
(failure ($_ text\compose "No code for target platform: " target))
(#.Some default)
- (return (list default)))
+ (in_meta (list default)))
(#Item [key pick] options')
(do meta_monad
[platform (..platform_name key)]
(if (text\= target platform)
- (return (list pick))
+ (in_meta (list pick))
(target_pick target options' default)))))
(macro: #export (for tokens)
@@ -5776,14 +5763,13 @@
_
(failure (..wrong_syntax_error (name_of ..for))))))
-(template [<name> <type> <output>]
- [(def: (<name> xy)
- (All [a b] (-> [a b] <type>))
- (let [[x y] xy]
- <output>))]
+(template [<name>]
+ [(def: (<name> [left right])
+ (All [left right] (-> [left right] <name>))
+ <name>)]
- [left a x]
- [right b y])
+ [left]
+ [right])
(def: (embedded_expansions code)
(-> Code (Meta [(List [Code Code]) Code]))
@@ -5808,7 +5794,7 @@
(do meta_monad
[=key (embedded_expansions key)
=val (embedded_expansions val)
- #let [[key_labels key_labelled] =key
+ .let [[key_labels key_labelled] =key
[val_labels val_labelled] =val]]
(in [(list\compose key_labels val_labels) [key_labelled val_labelled]])))
kvs)]
@@ -5816,22 +5802,21 @@
[ann (#Record (list\map right =kvs))]]))
_
- (return [(list) code])))
+ (in_meta [(list) code])))
(macro: #export (`` tokens)
(case tokens
(^ (list raw))
(do meta_monad
[=raw (..embedded_expansions raw)
- #let [[labels labelled] =raw]]
+ .let [[labels labelled] =raw]]
(in (list (` (with_expansions [(~+ (|> labels
(list\map (function (_ [label expansion]) (list label expansion)))
list\join))]
(~ labelled))))))
_
- (failure (..wrong_syntax_error (name_of ..``)))
- ))
+ (failure (..wrong_syntax_error (name_of ..``)))))
(def: (name$ [module name])
(-> Name Code)
@@ -5897,7 +5882,7 @@
[#.Identifier name$])
[_ (#Form (#Item [[_ (#Identifier ["" "~"])] (#Item [unquoted #End])]))]
- (return unquoted)
+ (in_meta unquoted)
[_ (#Form (#Item [[_ (#Identifier ["" "~+"])] (#Item [spliced #End])]))]
(failure "Cannot use (~+) inside of ^code unless it is the last element in a form or a tuple.")
@@ -5939,12 +5924,12 @@
(case tokens
(^ (list [_ (#Tuple bindings)] bodyT))
(if (multiple? 2 (list\size bindings))
- (return (list (` (..with_expansions [(~+ (|> bindings
- ..pairs
- (list\map (function (_ [localT valueT])
- (list localT (` (..as_is (~ valueT))))))
- (list\fold list\compose (list))))]
- (~ bodyT)))))
+ (in_meta (list (` (..with_expansions [(~+ (|> bindings
+ ..pairs
+ (list\map (function (_ [localT valueT])
+ (list localT (` (..as_is (~ valueT))))))
+ (list\fold list\compose (list))))]
+ (~ bodyT)))))
(..failure ":let requires an even number of parts"))
_
diff --git a/stdlib/source/library/lux/abstract/comonad.lux b/stdlib/source/library/lux/abstract/comonad.lux
index 3c2ce81b7..869eb3de5 100644
--- a/stdlib/source/library/lux/abstract/comonad.lux
+++ b/stdlib/source/library/lux/abstract/comonad.lux
@@ -50,14 +50,17 @@
g!split (gensym "split")
body' (list\fold (: (-> [Code Code] Code Code)
(function (_ binding body')
- (let [[var value] binding]
- (case var
- [_ (#.Tag ["" "let"])]
- (` (let (~ value) (~ body')))
+ (with_expansions [<default> (` (|> (~ value) (~ g!split) ((~ g!map) (function ((~ g!_) (~ var)) (~ body')))))]
+ (let [[var value] binding]
+ (case var
+ [_ (#.Identifier ["" _])]
+ <default>
- _
- (` (|> (~ value) (~ g!split) ((~ g!map) (function ((~ g!_) (~ var)) (~ body')))))
- ))))
+ [_ (#.Identifier _)]
+ (` ((~ var) (~ value) (~ body')))
+
+ _
+ <default>)))))
body
(list.reversed (list.pairs bindings)))]
(#.Right [state (list (case ?name
diff --git a/stdlib/source/library/lux/abstract/monad.lux b/stdlib/source/library/lux/abstract/monad.lux
index b0e09b794..0bbb58149 100644
--- a/stdlib/source/library/lux/abstract/monad.lux
+++ b/stdlib/source/library/lux/abstract/monad.lux
@@ -82,14 +82,17 @@
g!join (gensym "join")
body' (list\fold (: (-> [Code Code] Code Code)
(function (_ binding body')
- (let [[var value] binding]
- (case var
- [_ (#.Tag ["" "let"])]
- (` (let (~ value) (~ body')))
-
- _
- (` (|> (~ value) ((~ g!map) (function ((~ g!_) (~ var)) (~ body'))) (~ g!join)))
- ))))
+ (with_expansions [<default> (` (|> (~ value) ((~ g!map) (function ((~ g!_) (~ var)) (~ body'))) (~ g!join)))]
+ (let [[var value] binding]
+ (case var
+ [_ (#.Identifier ["" _])]
+ <default>
+
+ [_ (#.Identifier _)]
+ (` ((~ var) (~ value) (~ body')))
+
+ _
+ <default>)))))
body
(reversed (pairs bindings)))]
(#.Right [state (list (case ?name
diff --git a/stdlib/source/library/lux/abstract/monad/indexed.lux b/stdlib/source/library/lux/abstract/monad/indexed.lux
index c32aac5eb..120e33a7d 100644
--- a/stdlib/source/library/lux/abstract/monad/indexed.lux
+++ b/stdlib/source/library/lux/abstract/monad/indexed.lux
@@ -2,7 +2,6 @@
[library
[lux #*
[control
- [monad]
["<>" parser
["<.>" code (#+ Parser)]]]
[data
@@ -10,7 +9,8 @@
["." list ("#\." functor fold)]]]
["." macro
[syntax (#+ syntax:)]
- ["." code]]]])
+ ["." code]]]]
+ ["." //])
(interface: #export (IxMonad m)
(: (All [p a]
@@ -31,13 +31,20 @@
(<>.and <code>.any <code>.any))
(type: Context
- (#Let (List Binding))
+ (#Macro Name Code)
(#Bind Binding))
+(def: global_identifier
+ (Parser Name)
+ (//.do <>.monad
+ [[module short] <code>.identifier
+ _ (<>.assertion "" (case module "" false _ true))]
+ (in [module short])))
+
(def: context
(Parser Context)
- (<>.or (<>.after (<code>.this! (' #let))
- (<code>.tuple (<>.some binding)))
+ (<>.or (<>.and ..global_identifier
+ <code>.any)
binding))
(def: (pair_list [binding value])
@@ -58,11 +65,10 @@
(macro.with_gensyms [g!_ g!bind]
(let [body (list\fold (function (_ context next)
(case context
- (#Let bindings)
- (` (let [(~+ (|> bindings
- (list\map pair_list)
- list.concat))]
- (~ next)))
+ (#Macro macro parameter)
+ (` ((~ (code.identifier macro))
+ (~ parameter)
+ (~ next)))
(#Bind [binding value])
(` ((~ g!bind)
diff --git a/stdlib/source/library/lux/control/concurrency/actor.lux b/stdlib/source/library/lux/control/concurrency/actor.lux
index 067cf0178..eff114796 100644
--- a/stdlib/source/library/lux/control/concurrency/actor.lux
+++ b/stdlib/source/library/lux/control/concurrency/actor.lux
@@ -263,9 +263,9 @@
((on_mail mail state self)
(do (try.with async.monad)
- [#let [_ (debug.log! "BEFORE")]
+ [.let [_ (debug.log! "BEFORE")]
output (mail state self)
- #let [_ (debug.log! "AFTER")]]
+ .let [_ (debug.log! "AFTER")]]
(in output)))
(message: #export (push {value a} state self)
@@ -296,7 +296,7 @@
(with_gensyms [g!_]
(do meta.monad
[g!type (macro.gensym (format name "_abstract_type"))
- #let [g!actor (code.local_identifier name)
+ .let [g!actor (code.local_identifier name)
g!vars (list\map code.local_identifier vars)]]
(in (list (` ((~! abstract:) (~+ (|export|.format export)) ((~ g!type) (~+ g!vars))
(~ state_type)
@@ -361,7 +361,7 @@
(with_gensyms [g!_ g!return]
(do meta.monad
[actor_scope abstract.current
- #let [g!type (code.local_identifier (get@ #abstract.name actor_scope))
+ .let [g!type (code.local_identifier (get@ #abstract.name actor_scope))
g!message (code.local_identifier (get@ #name signature))
g!actor_vars (get@ #abstract.type_vars actor_scope)
g!all_vars (|> signature (get@ #vars) (list\map code.local_identifier) (list\compose g!actor_vars))
diff --git a/stdlib/source/library/lux/control/concurrency/async.lux b/stdlib/source/library/lux/control/concurrency/async.lux
index dc95a97e1..243d7327f 100644
--- a/stdlib/source/library/lux/control/concurrency/async.lux
+++ b/stdlib/source/library/lux/control/concurrency/async.lux
@@ -40,7 +40,7 @@
#.None
(do !
- [#let [new [(#.Some value) #.None]]
+ [.let [new [(#.Some value) #.None]]
succeeded? (atom.compare_and_swap old new async)]
(if succeeded?
(do !
@@ -71,7 +71,7 @@
{#.doc (doc "Executes the given function as soon as the async has been resolved.")}
(All [a] (-> (-> a (IO Any)) (Async a) (IO Any)))
(do {! io.monad}
- [#let [async (:representation async)]
+ [.let [async (:representation async)]
(^@ old [_value _observers]) (atom.read async)]
(case _value
(#.Some value)
diff --git a/stdlib/source/library/lux/control/concurrency/atom.lux b/stdlib/source/library/lux/control/concurrency/atom.lux
index 138e03e02..9a86f191b 100644
--- a/stdlib/source/library/lux/control/concurrency/atom.lux
+++ b/stdlib/source/library/lux/control/concurrency/atom.lux
@@ -90,7 +90,7 @@
(loop [_ []]
(do io.monad
[old (read atom)
- #let [new (f old)]
+ .let [new (f old)]
swapped? (..compare_and_swap old new atom)]
(if swapped?
(in [old new])
diff --git a/stdlib/source/library/lux/control/concurrency/frp.lux b/stdlib/source/library/lux/control/concurrency/frp.lux
index 7d0ac6129..14b4013d3 100644
--- a/stdlib/source/library/lux/control/concurrency/frp.lux
+++ b/stdlib/source/library/lux/control/concurrency/frp.lux
@@ -58,7 +58,7 @@
(loop [_ []]
(do {! io.monad}
[current (atom.read sink)
- #let [[next resolve_next] (:sharing [a]
+ .let [[next resolve_next] (:sharing [a]
(async.Resolver (Maybe [a (Channel a)]))
current
diff --git a/stdlib/source/library/lux/control/concurrency/semaphore.lux b/stdlib/source/library/lux/control/concurrency/semaphore.lux
index ea575915c..f4e094d3b 100644
--- a/stdlib/source/library/lux/control/concurrency/semaphore.lux
+++ b/stdlib/source/library/lux/control/concurrency/semaphore.lux
@@ -161,7 +161,7 @@
[(def: (<phase> (^:representation barrier))
(-> Barrier (Async Any))
(do async.monad
- [#let [limit (refinement.value (get@ #limit barrier))
+ [.let [limit (refinement.value (get@ #limit barrier))
goal <goal>
[_ count] (io.run (atom.update <update> (get@ #count barrier)))
reached? (n.= goal count)]]
diff --git a/stdlib/source/library/lux/control/concurrency/stm.lux b/stdlib/source/library/lux/control/concurrency/stm.lux
index 183558265..29979e17e 100644
--- a/stdlib/source/library/lux/control/concurrency/stm.lux
+++ b/stdlib/source/library/lux/control/concurrency/stm.lux
@@ -48,7 +48,7 @@
(def: (write! new_value var)
(All [a] (-> a (Var a) (IO Any)))
(do {! io.monad}
- [#let [var' (:representation var)]
+ [.let [var' (:representation var)]
(^@ old [old_value observers]) (atom.read var')
succeeded? (atom.compare_and_swap old [new_value observers] var')]
(if succeeded?
@@ -70,7 +70,7 @@
{#.doc "Creates a channel that will receive all changes to the value of the given var."}
(All [a] (-> (Var a) (IO [(Channel a) (Sink a)])))
(do io.monad
- [#let [[channel sink] (frp.channel [])]
+ [.let [[channel sink] (frp.channel [])]
_ (atom.update (function (_ [value observers])
[value (#.Item sink observers)])
(:representation target))]
@@ -180,7 +180,7 @@
(All [a] (-> (-> a a) (Var a) (STM [a a])))
(do ..monad
[a (..read var)
- #let [a' (f a)]
+ .let [a' (f a)]
_ (..write a' var)]
(in [a a'])))
diff --git a/stdlib/source/library/lux/control/concurrency/thread.lux b/stdlib/source/library/lux/control/concurrency/thread.lux
index edfc01f8c..0a2a2c547 100644
--- a/stdlib/source/library/lux/control/concurrency/thread.lux
+++ b/stdlib/source/library/lux/control/concurrency/thread.lux
@@ -129,7 +129,7 @@
## Default
(do {! io.monad}
- [now (\ ! map (|>> instant.to_millis .nat) instant.now)
+ [now (\ ! map (|>> instant.millis .nat) instant.now)
_ (atom.update (|>> (#.Item {#creation now
#delay milli_seconds
#action action}))
@@ -158,8 +158,8 @@
_
(do !
- [now (\ ! map (|>> instant.to_millis .nat) instant.now)
- #let [[ready pending] (list.partition (function (_ thread)
+ [now (\ ! map (|>> instant.millis .nat) instant.now)
+ .let [[ready pending] (list.partition (function (_ thread)
(|> (get@ #creation thread)
(n.+ (get@ #delay thread))
(n.<= now)))
diff --git a/stdlib/source/library/lux/control/continuation.lux b/stdlib/source/library/lux/control/continuation.lux
index e36f3ba69..16f789010 100644
--- a/stdlib/source/library/lux/control/continuation.lux
+++ b/stdlib/source/library/lux/control/continuation.lux
@@ -94,7 +94,7 @@
z)))
(call/cc (function (_ k)
(do ..monad
- [#let [nexus (function (nexus val)
+ [.let [nexus (function (nexus val)
(k [nexus val]))]
_ (k [nexus init])]
(in (undefined))))))
diff --git a/stdlib/source/library/lux/control/exception.lux b/stdlib/source/library/lux/control/exception.lux
index 65ddd84f1..7515cb9fb 100644
--- a/stdlib/source/library/lux/control/exception.lux
+++ b/stdlib/source/library/lux/control/exception.lux
@@ -57,7 +57,7 @@
then))
(#//.Failure error)))))
-(def: #export (otherwise to_do try)
+(def: #export (otherwise else try)
{#.doc "If no handler could be found to catch the exception, then run a function as a last-resort measure."}
(All [a]
(-> (-> Text a) (Try a) a))
@@ -66,7 +66,7 @@
output
(#//.Failure error)
- (to_do error)))
+ (else error)))
(def: #export (return value)
{#.doc "A way to lift normal values into the error-handling context."}
@@ -106,7 +106,7 @@
(macro.with_gensyms [g!descriptor]
(do meta.monad
[current_module meta.current_module_name
- #let [descriptor ($_ text\compose "{" current_module "." name "}" text.new_line)
+ .let [descriptor ($_ text\compose "{" current_module "." name "}" text.new_line)
g!self (code.local_identifier name)]]
(in (list (` (def: (~+ (|export|.format export))
(~ g!self)
@@ -116,8 +116,7 @@
{#..label (~ g!descriptor)
#..constructor (function ((~ g!self) [(~+ (list\map (get@ #|input|.binding) inputs))])
((~! text\compose) (~ g!descriptor)
- (~ (maybe.else (' "") body))))})))))
- )))
+ (~ (maybe.else (' "") body))))}))))))))
(def: (report' entries)
(-> (List [Text Text]) Text)
diff --git a/stdlib/source/library/lux/control/function/mutual.lux b/stdlib/source/library/lux/control/function/mutual.lux
index d53249897..e292f19ee 100644
--- a/stdlib/source/library/lux/control/function/mutual.lux
+++ b/stdlib/source/library/lux/control/function/mutual.lux
@@ -86,7 +86,7 @@
[here_name meta.current_module_name
hidden_names (monad.map ! (//.constant (macro.gensym "mutual_function#"))
functions)
- #let [definitions (list\map (..mutual_definition hidden_names g!context)
+ .let [definitions (list\map (..mutual_definition hidden_names g!context)
(list.zipped/2 hidden_names
functions))
context_types (list\map (function (_ mutual)
@@ -152,7 +152,7 @@
[here_name meta.current_module_name
hidden_names (monad.map ! (//.constant (macro.gensym "mutual_function#"))
functions)
- #let [definitions (list\map (..mutual_definition hidden_names g!context)
+ .let [definitions (list\map (..mutual_definition hidden_names g!context)
(list.zipped/2 hidden_names
(list\map (get@ #mutual) functions)))
context_types (list\map (function (_ mutual)
diff --git a/stdlib/source/library/lux/control/parser/binary.lux b/stdlib/source/library/lux/control/parser/binary.lux
index 7827bd8c0..fd4e1880a 100644
--- a/stdlib/source/library/lux/control/parser/binary.lux
+++ b/stdlib/source/library/lux/control/parser/binary.lux
@@ -239,7 +239,7 @@
(All [a] (-> (Hash a) (Parser a) (Parser (Set a))))
(do //.monad
[raw (..list value)
- #let [output (set.of_list hash raw)]
+ .let [output (set.of_list hash raw)]
_ (//.assertion (exception.error ..set_elements_are_not_unique [])
(n.= (list.size raw)
(set.size output)))]
diff --git a/stdlib/source/library/lux/control/parser/json.lux b/stdlib/source/library/lux/control/parser/json.lux
index 741933205..74747195d 100644
--- a/stdlib/source/library/lux/control/parser/json.lux
+++ b/stdlib/source/library/lux/control/parser/json.lux
@@ -132,7 +132,7 @@
[head ..any]
(case head
(#/.Array values)
- (case (//.run parser (row.to_list values))
+ (case (//.run parser (row.list values))
(#try.Failure error)
(//.failure error)
diff --git a/stdlib/source/library/lux/control/parser/text.lux b/stdlib/source/library/lux/control/parser/text.lux
index 1806d77e4..fcabe68ab 100644
--- a/stdlib/source/library/lux/control/parser/text.lux
+++ b/stdlib/source/library/lux/control/parser/text.lux
@@ -174,7 +174,7 @@
(-> Nat Nat (Parser Text))
(do //.monad
[char any
- #let [char' (maybe.assume (/.char 0 char))]
+ .let [char' (maybe.assume (/.char 0 char))]
_ (//.assertion ($_ /\compose "Character is not within range: " (/.of_char bottom) "-" (/.of_char top))
(.and (n.>= bottom char')
(n.<= top char')))]
diff --git a/stdlib/source/library/lux/control/parser/type.lux b/stdlib/source/library/lux/control/parser/type.lux
index 9c4dae7ee..0e07c633c 100644
--- a/stdlib/source/library/lux/control/parser/type.lux
+++ b/stdlib/source/library/lux/control/parser/type.lux
@@ -179,7 +179,7 @@
(Parser [Nat Type])
(do //.monad
[headT any
- #let [[num_arg bodyT] (type.flat_univ_q (type.anonymous headT))]]
+ .let [[num_arg bodyT] (type.flat_univ_q (type.anonymous headT))]]
(if (n.= 0 num_arg)
(//.failure (exception.error ..not_polymorphic headT))
(in [num_arg bodyT]))))
@@ -191,7 +191,7 @@
funcI (\ ! map dictionary.size ..env)
[num_args non_poly] (local (list headT) ..polymorphic')
env ..env
- #let [funcL (label funcI)
+ .let [funcL (label funcI)
[all_varsL env'] (loop [current_arg 0
env' env
all_varsL (: (List Code) (list))]
@@ -226,7 +226,7 @@
(All [i o] (-> (Parser i) (Parser o) (Parser [i o])))
(do //.monad
[headT any
- #let [[inputsT outputT] (type.flat_function (type.anonymous headT))]]
+ .let [[inputsT outputT] (type.flat_function (type.anonymous headT))]]
(if (n.> 0 (list.size inputsT))
(//.and (local inputsT in_poly)
(local (list outputT) out_poly))
@@ -237,7 +237,7 @@
(All [a] (-> (Parser a) (Parser a)))
(do //.monad
[headT any
- #let [[funcT paramsT] (type.flat_application (type.anonymous headT))]]
+ .let [[funcT paramsT] (type.flat_application (type.anonymous headT))]]
(if (n.= 0 (list.size paramsT))
(//.failure (exception.error ..not_application headT))
(..local (#.Item funcT paramsT) poly))))
diff --git a/stdlib/source/library/lux/control/pipe.lux b/stdlib/source/library/lux/control/pipe.lux
index 5f40fc055..8f36f8a41 100644
--- a/stdlib/source/library/lux/control/pipe.lux
+++ b/stdlib/source/library/lux/control/pipe.lux
@@ -123,7 +123,7 @@
[step (list.reversed prev_steps)]
(list g!temp (` (|> (~ g!temp) (~+ step)))))]
(in (list (` ((~! do) (~ monad)
- [(~' #let) [(~ g!temp) (~ prev)]
+ [.let [(~ g!temp) (~ prev)]
(~+ step_bindings)]
(|> (~ g!temp) (~+ last_step)))))))
diff --git a/stdlib/source/library/lux/control/security/capability.lux b/stdlib/source/library/lux/control/security/capability.lux
index 14461791f..b58468911 100644
--- a/stdlib/source/library/lux/control/security/capability.lux
+++ b/stdlib/source/library/lux/control/security/capability.lux
@@ -60,10 +60,10 @@
(is? left right)))}
(do {! meta.monad}
[this_module meta.current_module_name
- #let [[name vars] declaration]
+ .let [[name vars] declaration]
g!brand (\ ! map (|>> %.code code.text)
(macro.gensym (format (%.name [this_module name]))))
- #let [capability (` (..Capability (.primitive (~ g!brand)) (~ input) (~ output)))]]
+ .let [capability (` (..Capability (.primitive (~ g!brand)) (~ input) (~ output)))]]
(in (list (` (type: (~+ (|export|.format export))
(~ (|declaration|.format declaration))
(~ capability)))
diff --git a/stdlib/source/library/lux/control/security/policy.lux b/stdlib/source/library/lux/control/security/policy.lux
index 05b05cf5f..dc5a07e0d 100644
--- a/stdlib/source/library/lux/control/security/policy.lux
+++ b/stdlib/source/library/lux/control/security/policy.lux
@@ -77,19 +77,19 @@
(scope label))))
(context ..privilege))
- (def: (decorate constructor)
+ (def: (of_policy constructor)
(-> Type Type)
(type (All [brand label]
(constructor (All [value] (Policy brand value label))))))
(implementation: #export functor
- (:~ (..decorate Functor))
+ (:~ (..of_policy Functor))
(def: (map f fa)
(|> fa :representation f :abstraction)))
(implementation: #export apply
- (:~ (..decorate Apply))
+ (:~ (..of_policy Apply))
(def: &functor ..functor)
@@ -97,7 +97,7 @@
(:abstraction ((:representation ff) (:representation fa)))))
(implementation: #export monad
- (:~ (..decorate Monad))
+ (:~ (..of_policy Monad))
(def: &functor ..functor)
(def: in (|>> :abstraction))
diff --git a/stdlib/source/library/lux/data/collection/array.lux b/stdlib/source/library/lux/data/collection/array.lux
index e823c4212..6811c2234 100644
--- a/stdlib/source/library/lux/data/collection/array.lux
+++ b/stdlib/source/library/lux/data/collection/array.lux
@@ -1,6 +1,6 @@
(.module:
[library
- [lux #*
+ [lux (#- list)
["@" target]
[abstract
[monoid (#+ Monoid)]
@@ -288,7 +288,7 @@
Nat
(dec 0))
-(def: #export (to_list array)
+(def: #export (list array)
{#.doc (doc "Yields a list with every non-empty item in the array.")}
(All [a] (-> (Array a) (List a)))
(loop [idx (dec (size array))
@@ -306,8 +306,8 @@
#.None
output)))))
-(def: #export (to_list' default array)
- {#.doc (doc "Like 'to_list', but uses the 'default' value when encountering an empty cell in the array.")}
+(def: #export (list' default array)
+ {#.doc (doc "Like 'list', but uses the 'default' value when encountering an empty cell in the array.")}
(All [a] (-> a (Array a) (List a)))
(loop [idx (dec (size array))
output #.End]
diff --git a/stdlib/source/library/lux/data/collection/dictionary.lux b/stdlib/source/library/lux/data/collection/dictionary.lux
index 923d64c42..771bdc551 100644
--- a/stdlib/source/library/lux/data/collection/dictionary.lux
+++ b/stdlib/source/library/lux/data/collection/dictionary.lux
@@ -179,11 +179,11 @@
(i64.left_shifted index 1))
## The bit-position within a base that a given hash-code would have.
-(def: (bit_position level hash)
+(def: (level_bit_position level hash)
(-> Level Hash_Code Bit_Position)
(to_bit_position (level_index level hash)))
-(def: (bit_position_is_set? bit bitmap)
+(def: (with_bit_position? bit bitmap)
(-> Bit_Position Bit_Map Bit)
(|> bitmap
(i64.and bit)
@@ -195,11 +195,11 @@
(-> Bit_Position Bit_Map Bit)
n.=)
-(def: (set_bit_position bit bitmap)
+(def: (with_bit_position bit bitmap)
(-> Bit_Position Bit_Map Bit_Map)
(i64.or bit bitmap))
-(def: unset_bit_position
+(def: without_bit_position
(-> Bit_Position Bit_Map Bit_Map)
i64.xor)
@@ -241,7 +241,7 @@
(#.Some sub_node) (if (n.= except_idx idx)
[insertion_idx node]
[(inc insertion_idx)
- [(set_bit_position (to_bit_position idx) bitmap)
+ [(with_bit_position (to_bit_position idx) bitmap)
(array.write! insertion_idx (#.Left sub_node) base)]])
)))
[0 [clean_bitmap
@@ -261,8 +261,8 @@
Bit_Map (Base k v)
(Array (Node k v))))
(product.right (list\fold (function (_ hierarchy_idx (^@ default [base_idx h_array]))
- (if (bit_position_is_set? (to_bit_position hierarchy_idx)
- bitmap)
+ (if (with_bit_position? (to_bit_position hierarchy_idx)
+ bitmap)
[(inc base_idx)
(case (array.read base_idx base)
(#.Some (#.Left sub_node))
@@ -312,8 +312,8 @@
## For #Base nodes, check if the corresponding Bit_Position has
## already been used.
(#Base bitmap base)
- (let [bit (bit_position level hash)]
- (if (bit_position_is_set? bit bitmap)
+ (let [bit (level_bit_position level hash)]
+ (if (with_bit_position? bit bitmap)
## If so...
(let [idx (base_index bit bitmap)]
(case (array.read idx base)
@@ -364,7 +364,7 @@
(put' (level_up level) hash key val key_hash empty_node))))
## Otherwise, just resize the #Base node to accommodate the
## new KV-pair.
- (#Base (set_bit_position bit bitmap)
+ (#Base (with_bit_position bit bitmap)
(insert! (base_index bit bitmap) (#.Right [key val]) base))))))
## For #Collisions nodes, compare the hashes.
@@ -383,7 +383,7 @@
(#Collisions _hash (insert! (array.size _colls) [key val] _colls)))
## If the hashes are not equal, create a new #Base node that
## contains the old #Collisions node, plus the new KV-pair.
- (|> (#Base (bit_position level _hash)
+ (|> (#Base (level_bit_position level _hash)
(|> (array.empty 1)
(array.write! 0 (#.Left node))))
(put' level hash key val key_hash)))
@@ -422,8 +422,8 @@
## For #Base nodes, check whether the Bit_Position is set.
(#Base bitmap base)
- (let [bit (bit_position level hash)]
- (if (bit_position_is_set? bit bitmap)
+ (let [bit (level_bit_position level hash)]
+ (if (with_bit_position? bit bitmap)
(let [idx (base_index bit bitmap)]
(case (array.read idx base)
## If set, check if it's a sub_node, and remove the KV
@@ -442,7 +442,7 @@
empty_node
## But if not, then just unset the position and
## remove the node.
- (#Base (unset_bit_position bit bitmap)
+ (#Base (without_bit_position bit bitmap)
(remove! idx base)))
## But, if it did not come out empty, then the
## position is kept, and the node gets updated.
@@ -454,7 +454,7 @@
## Check if the keys match.
(if (\ key_hash = key key')
## If so, remove the KV-pair and unset the Bit_Position.
- (#Base (unset_bit_position bit bitmap)
+ (#Base (without_bit_position bit bitmap)
(remove! idx base))
## Otherwise, there's nothing to remove.
node)
@@ -492,8 +492,8 @@
## For #Base nodes, check the leaves, and recursively check the branches.
(#Base bitmap base)
- (let [bit (bit_position level hash)]
- (if (bit_position_is_set? bit bitmap)
+ (let [bit (level_bit_position level hash)]
+ (if (with_bit_position? bit bitmap)
(case (array.read (base_index bit bitmap) base)
(#.Some (#.Left sub_node))
(get' (level_up level) hash key key_hash sub_node)
diff --git a/stdlib/source/library/lux/data/collection/list.lux b/stdlib/source/library/lux/data/collection/list.lux
index 5b20c22fb..35aeaafe4 100644
--- a/stdlib/source/library/lux/data/collection/list.lux
+++ b/stdlib/source/library/lux/data/collection/list.lux
@@ -622,3 +622,18 @@
(#.Item x xs')
(#.Item [idx x] (recur (inc idx) xs')))))
+
+(macro: #export (when tokens state)
+ {#.doc (doc "Can be used as a guard in (co)monadic be/do expressions."
+ (do monad
+ [value (do_something 1 2 3)
+ ..when (passes_test? value)]
+ (do_something_else 4 5 6)))}
+ (case tokens
+ (^ (.list test then))
+ (#.Right [state (.list (` (.if (~ test)
+ (~ then)
+ (.list))))])
+
+ _
+ (#.Left "Wrong syntax for when")))
diff --git a/stdlib/source/library/lux/data/collection/queue.lux b/stdlib/source/library/lux/data/collection/queue.lux
index 0fa870a0c..0c6a24f88 100644
--- a/stdlib/source/library/lux/data/collection/queue.lux
+++ b/stdlib/source/library/lux/data/collection/queue.lux
@@ -1,6 +1,6 @@
(.module:
[library
- [lux #*
+ [lux (#- list)
[abstract
[equivalence (#+ Equivalence)]
[functor (#+ Functor)]]
@@ -18,15 +18,15 @@
(def: #export empty
Queue
- {#front (list)
- #rear (list)})
+ {#front (.list)
+ #rear (.list)})
(def: #export (of_list entries)
(All [a] (-> (List a) (Queue a)))
{#front entries
- #rear (list)})
+ #rear (.list)})
-(def: #export (to_list queue)
+(def: #export (list queue)
(All [a] (-> (Queue a) (List a)))
(let [(^slots [#front #rear]) queue]
(list\compose front (list.reversed rear))))
@@ -56,17 +56,17 @@
(All [a] (-> (Queue a) (Queue a)))
(case (get@ #front queue)
## Empty...
- (^ (list))
+ (^ (.list))
queue
## Front has dried up...
- (^ (list _))
+ (^ (.list _))
(|> queue
(set@ #front (list.reversed (get@ #rear queue)))
- (set@ #rear (list)))
+ (set@ #rear (.list)))
## Consume front!
- (^ (list& _ front'))
+ (^ (.list& _ front'))
(|> queue
(set@ #front front'))))
@@ -74,7 +74,7 @@
(All [a] (-> a (Queue a) (Queue a)))
(case (get@ #front queue)
#.End
- (set@ #front (list val) queue)
+ (set@ #front (.list val) queue)
_
(update@ #rear (|>> (#.Item val)) queue)))
@@ -84,8 +84,8 @@
(def: (= reference subject)
(\ (list.equivalence super) =
- (..to_list reference)
- (..to_list subject))))
+ (..list reference)
+ (..list subject))))
(implementation: #export functor
(Functor Queue)
diff --git a/stdlib/source/library/lux/data/collection/queue/priority.lux b/stdlib/source/library/lux/data/collection/queue/priority.lux
index 8f0a788fc..698bb57ac 100644
--- a/stdlib/source/library/lux/data/collection/queue/priority.lux
+++ b/stdlib/source/library/lux/data/collection/queue/priority.lux
@@ -3,7 +3,7 @@
[lux #*
[abstract
[equivalence (#+ Equivalence)]
- [monad (#+ do Monad)]]
+ [monad (#+ do)]]
[data
["." maybe]
[collection
@@ -86,7 +86,7 @@
(:abstraction
(do maybe.monad
[tree (:representation queue)
- #let [highest_priority (tree.tag tree)]]
+ .let [highest_priority (tree.tag tree)]]
(loop [node tree]
(case (tree.root node)
(0 #0 reference)
diff --git a/stdlib/source/library/lux/data/collection/row.lux b/stdlib/source/library/lux/data/collection/row.lux
index 1af5037ce..20c6c2cea 100644
--- a/stdlib/source/library/lux/data/collection/row.lux
+++ b/stdlib/source/library/lux/data/collection/row.lux
@@ -3,7 +3,7 @@
## https://hypirion.com/musings/understanding-persistent-vector-pt-3
(.module:
[library
- [lux #*
+ [lux (#- list)
["@" target]
[abstract
[functor (#+ Functor)]
@@ -72,9 +72,9 @@
(-> Index Index)
(i64.and branch_idx_mask))
-(def: (new_hierarchy _)
+(def: (empty_hierarchy _)
(All [a] (-> Any (Hierarchy a)))
- (array.empty full_node_size))
+ (array.empty ..full_node_size))
(def: (tail_off row_size)
(-> Nat Nat)
@@ -84,20 +84,20 @@
(i64.right_shifted branching_exponent)
(i64.left_shifted branching_exponent))))
-(def: (new_path level tail)
+(def: (path level tail)
(All [a] (-> Level (Base a) (Node a)))
(if (n.= 0 level)
(#Base tail)
- (|> (new_hierarchy [])
- (array.write! 0 (new_path (level_down level) tail))
+ (|> (empty_hierarchy [])
+ (array.write! 0 (path (level_down level) tail))
#Hierarchy)))
-(def: (new_tail singleton)
+(def: (tail singleton)
(All [a] (-> a (Base a)))
(|> (array.empty 1)
(array.write! 0 singleton)))
-(def: (push_tail size level tail parent)
+(def: (with_tail size level tail parent)
(All [a] (-> Nat Level (Base a) (Hierarchy a) (Hierarchy a)))
(let [sub_idx (branch_idx (i64.right_shifted level (dec size)))
## If we're currently on a bottom node
@@ -108,10 +108,10 @@
(case (array.read sub_idx parent)
## If so, set the path to the tail
#.None
- (new_path (level_down level) tail)
+ (..path (level_down level) tail)
## If not, push the tail onto the sub_node.
(#.Some (#Hierarchy sub_node))
- (#Hierarchy (push_tail size (level_down level) tail sub_node))
+ (#Hierarchy (with_tail size (level_down level) tail sub_node))
_
(undefined))
@@ -119,7 +119,7 @@
(|> (array.clone parent)
(array.write! sub_idx sub_node))))
-(def: (expand_tail val tail)
+(def: (expanded_tail val tail)
(All [a] (-> a (Base a) (Base a)))
(let [tail_size (array.size tail)]
(|> (array.empty (inc tail_size))
@@ -144,7 +144,7 @@
_
(undefined))))
-(def: (pop_tail size level hierarchy)
+(def: (without_tail size level hierarchy)
(All [a] (-> Nat Level (Hierarchy a) (Maybe (Hierarchy a))))
(let [sub_idx (branch_idx (i64.right_shifted level (n.- 2 size)))]
(cond (n.= 0 sub_idx)
@@ -155,7 +155,7 @@
[base|hierarchy (array.read sub_idx hierarchy)
sub (case base|hierarchy
(#Hierarchy sub)
- (pop_tail size (level_down level) sub)
+ (without_tail size (level_down level) sub)
(#Base _)
(undefined))]
@@ -169,17 +169,17 @@
#.Some)
)))
-(def: (to_list' node)
+(def: (list' node)
(All [a] (-> (Node a) (List a)))
(case node
(#Base base)
- (array.to_list base)
+ (array.list base)
(#Hierarchy hierarchy)
(|> hierarchy
- array.to_list
+ array.list
list.reversed
- (list\fold (function (_ sub acc) (list\compose (to_list' sub) acc))
+ (list\fold (function (_ sub acc) (list\compose (list' sub) acc))
#.End))))
(type: #export (Row a)
@@ -193,7 +193,7 @@
Row
{#level (level_up root_level)
#size 0
- #root (array.empty full_node_size)
+ #root (empty_hierarchy [])
#tail (array.empty 0)})
(def: #export (size row)
@@ -208,7 +208,7 @@
## If so, append to it.
(|> row
(update@ #size inc)
- (update@ #tail (expand_tail val)))
+ (update@ #tail (..expanded_tail val)))
## Otherwise, push tail into the tree
## --------------------------------------------------------
## Will the root experience an overflow with this addition?
@@ -219,18 +219,18 @@
(|> row
(set@ #root (|> (for {@.old
(: (Hierarchy (:parameter 0))
- (new_hierarchy []))}
- (new_hierarchy []))
+ (empty_hierarchy []))}
+ (empty_hierarchy []))
(array.write! 0 (#Hierarchy (get@ #root row)))
- (array.write! 1 (new_path (get@ #level row) (get@ #tail row)))))
+ (array.write! 1 (..path (get@ #level row) (get@ #tail row)))))
(update@ #level level_up))
## Otherwise, just push the current tail onto the root.
(|> row
- (update@ #root (push_tail row_size (get@ #level row) (get@ #tail row)))))
+ (update@ #root (..with_tail row_size (get@ #level row) (get@ #tail row)))))
## Finally, update the size of the row and grow a new
## tail with the new element as it's sole member.
(update@ #size inc)
- (set@ #tail (new_tail val)))
+ (set@ #tail (..tail val)))
)))
(exception: incorrect_row_structure)
@@ -319,10 +319,10 @@
(maybe.assume
(do maybe.monad
[new_tail (base_for (n.- 2 row_size) row)
- #let [[level' root'] (let [init_level (get@ #level row)]
+ .let [[level' root'] (let [init_level (get@ #level row)]
(loop [level init_level
- root (maybe.else (new_hierarchy [])
- (pop_tail row_size init_level (get@ #root row)))]
+ root (maybe.else (empty_hierarchy [])
+ (without_tail row_size init_level (get@ #root row)))]
(if (n.> branching_exponent level)
(case [(array.read 1 root) (array.read 0 root)]
[#.None (#.Some (#Hierarchy sub_node))]
@@ -341,10 +341,10 @@
(set@ #tail new_tail))))))
))
-(def: #export (to_list row)
+(def: #export (list row)
(All [a] (-> (Row a) (List a)))
- (list\compose (to_list' (#Hierarchy (get@ #root row)))
- (to_list' (#Base (get@ #tail row)))))
+ (list\compose (list' (#Hierarchy (get@ #root row)))
+ (list' (#Base (get@ #tail row)))))
(def: #export of_list
(All [a] (-> (List a) (Row a)))
@@ -352,7 +352,7 @@
(def: #export (member? a/Equivalence row val)
(All [a] (-> (Equivalence a) (Row a) a Bit))
- (list.member? a/Equivalence (to_list row) val))
+ (list.member? a/Equivalence (list row) val))
(def: #export empty?
(All [a] (-> (Row a) Bit))
@@ -361,7 +361,7 @@
(syntax: #export (row {elems (p.some s.any)})
{#.doc (doc "Row literals."
(row 12 34 56 78 90))}
- (in (list (` (..of_list (list (~+ elems)))))))
+ (in (.list (` (..of_list (.list (~+ elems)))))))
(implementation: (node_equivalence Equivalence<a>)
(All [a] (-> (Equivalence a) (Equivalence (Node a))))
@@ -418,7 +418,7 @@
(def: identity ..empty)
(def: (compose xs ys)
- (list\fold add xs (..to_list ys))))
+ (list\fold add xs (..list ys))))
(implementation: node_functor
(Functor Node)
@@ -467,7 +467,7 @@
(def: #export reversed
(All [a] (-> (Row a) (Row a)))
- (|>> ..to_list
+ (|>> ..list
list.reversed
(list\fold add ..empty)))
diff --git a/stdlib/source/library/lux/data/collection/set.lux b/stdlib/source/library/lux/data/collection/set.lux
index d6436be3b..64438517f 100644
--- a/stdlib/source/library/lux/data/collection/set.lux
+++ b/stdlib/source/library/lux/data/collection/set.lux
@@ -1,6 +1,6 @@
(.module:
[library
- [lux #*
+ [lux (#- list)
[abstract
[equivalence (#+ Equivalence)]
[hash (#+ Hash)]
@@ -44,7 +44,7 @@
(All [a] (-> (Set a) a Bit))
//.key?)
-(def: #export to_list
+(def: #export list
(All [a] (-> (Set a) (List a)))
//.keys)
@@ -54,7 +54,7 @@
(def: #export (difference sub base)
(All [a] (-> (Set a) (Set a) (Set a)))
- (list\fold ..remove base (..to_list sub)))
+ (list\fold ..remove base (..list sub)))
(def: #export (intersection filter base)
(All [a] (-> (Set a) (Set a) (Set a)))
@@ -68,7 +68,7 @@
(and (n.= (..size reference)
(..size sample))
(list.every? (..member? reference)
- (..to_list sample)))))
+ (..list sample)))))
(implementation: #export hash
(All [a] (Hash (Set a)))
@@ -77,7 +77,7 @@
(def: (hash set)
(|> set
- ..to_list
+ ..list
(\ (list.hash (..member_hash set)) hash))))
(implementation: #export (monoid hash)
@@ -96,7 +96,7 @@
(def: #export (sub? super sub)
(All [a] (-> (Set a) (Set a) Bit))
- (list.every? (..member? super) (..to_list sub)))
+ (list.every? (..member? super) (..list sub)))
(def: #export (super? sub super)
(All [a] (-> (Set a) (Set a) Bit))
diff --git a/stdlib/source/library/lux/data/collection/set/multi.lux b/stdlib/source/library/lux/data/collection/set/multi.lux
index df4db9a85..9d746ae52 100644
--- a/stdlib/source/library/lux/data/collection/set/multi.lux
+++ b/stdlib/source/library/lux/data/collection/set/multi.lux
@@ -1,7 +1,7 @@
## https://en.wikipedia.org/wiki/Multiset
(.module:
[library
- [lux #*
+ [lux (#- list)
[abstract
[equivalence (#+ Equivalence)]
[hash (#+ Hash)]]
@@ -59,7 +59,7 @@
(All [a] (-> (Set a) a Nat))
(|> set :representation (dictionary.get elem) (maybe.else 0)))
- (def: #export to_list
+ (def: #export list
(All [a] (-> (Set a) (List a)))
(|>> :representation
dictionary.entries
@@ -155,7 +155,7 @@
(def: #export (of_set subject)
(All [a] (-> (//.Set a) (Set a)))
(..of_list (//.member_hash subject)
- (//.to_list subject)))
+ (//.list subject)))
(def: #export super?
{#.doc (doc "Is 'subject' a super-set of 'reference'?")}
diff --git a/stdlib/source/library/lux/data/collection/set/ordered.lux b/stdlib/source/library/lux/data/collection/set/ordered.lux
index d0916508f..97e32646c 100644
--- a/stdlib/source/library/lux/data/collection/set/ordered.lux
+++ b/stdlib/source/library/lux/data/collection/set/ordered.lux
@@ -1,6 +1,6 @@
(.module:
[library
- [lux #*
+ [lux (#- list)
[abstract
[equivalence (#+ Equivalence)]
[order (#+ Order)]]
@@ -44,7 +44,7 @@
(All [a] (-> a (Set a) (Set a)))
(|> set :representation (/.remove elem) :abstraction))
- (def: #export to_list
+ (def: #export list
(All [a] (-> (Set a) (List a)))
(|>> :representation /.keys))
@@ -54,17 +54,17 @@
(def: #export (union left right)
(All [a] (-> (Set a) (Set a) (Set a)))
- (list\fold ..add right (..to_list left)))
+ (list\fold ..add right (..list left)))
(def: #export (intersection left right)
(All [a] (-> (Set a) (Set a) (Set a)))
- (|> (..to_list right)
+ (|> (..list right)
(list.only (..member? left))
(..of_list (get@ #/.&order (:representation right)))))
(def: #export (difference param subject)
(All [a] (-> (Set a) (Set a) (Set a)))
- (|> (..to_list subject)
+ (|> (..list subject)
(list.only (|>> (..member? param) not))
(..of_list (get@ #/.&order (:representation subject)))))
@@ -73,14 +73,14 @@
(def: (= reference sample)
(\ (list.equivalence (\ (:representation reference) &equivalence))
- = (..to_list reference) (..to_list sample))))
+ = (..list reference) (..list sample))))
)
(def: #export (sub? super sub)
{#.doc (doc "Is 'sub' a sub-set of 'super'?")}
(All [a] (-> (Set a) (Set a) Bit))
(|> sub
- ..to_list
+ ..list
(list.every? (..member? super))))
(def: #export (super? sub super)
diff --git a/stdlib/source/library/lux/data/color.lux b/stdlib/source/library/lux/data/color.lux
index ad79c9fd8..433dd9bc3 100644
--- a/stdlib/source/library/lux/data/color.lux
+++ b/stdlib/source/library/lux/data/color.lux
@@ -27,8 +27,8 @@
[type
abstract]]])
-(def: rgb 256)
-(def: top (dec rgb))
+(def: rgb_limit 256)
+(def: top (dec rgb_limit))
(def: rgb_factor
(|> top .int int.frac))
@@ -69,11 +69,11 @@
(def: #export (of_rgb [red green blue])
(-> RGB Color)
- (:abstraction {#red (n.% ..rgb red)
- #green (n.% ..rgb green)
- #blue (n.% ..rgb blue)}))
+ (:abstraction {#red (n.% ..rgb_limit red)
+ #green (n.% ..rgb_limit green)
+ #blue (n.% ..rgb_limit blue)}))
- (def: #export to_rgb
+ (def: #export rgb
(-> Color RGB)
(|>> :representation))
@@ -148,9 +148,9 @@
#blue (n.min lB rB)}))))
)
-(def: #export (to_hsl color)
+(def: #export (hsl color)
(-> Color HSL)
- (let [[red green blue] (to_rgb color)
+ (let [[red green blue] (rgb color)
red (..down red)
green (..down green)
blue (..down blue)
@@ -183,24 +183,24 @@
saturation
luminance]))))
-(def: (hue_to_rgb p q t)
- (-> Frac Frac Frac Frac)
+(def: (hue_rgb p q t)
+ (-> Frac Frac Frac Nat)
(let [t (cond (f.< +0.0 t) (f.+ +1.0 t)
(f.> +1.0 t) (f.- +1.0 t)
## else
t)
f2/3 (f./ +3.0 +2.0)]
- (cond (f.< (f./ +6.0 +1.0) t)
- (|> q (f.- p) (f.* +6.0) (f.* t) (f.+ p))
-
- (f.< (f./ +2.0 +1.0) t)
- q
-
- (f.< f2/3 t)
- (|> q (f.- p) (f.* (|> f2/3 (f.- t))) (f.* +6.0) (f.+ p))
-
- ## else
- p)))
+ (..up (cond (f.< (f./ +6.0 +1.0) t)
+ (|> q (f.- p) (f.* +6.0) (f.* t) (f.+ p))
+
+ (f.< (f./ +2.0 +1.0) t)
+ q
+
+ (f.< f2/3 t)
+ (|> q (f.- p) (f.* (|> f2/3 (f.- t))) (f.* +6.0) (f.+ p))
+
+ ## else
+ p))))
(def: #export (of_hsl [hue saturation luminance])
(-> HSL Color)
@@ -216,13 +216,13 @@
(|> luminance (f.+ saturation) (f.- (f.* saturation luminance))))
p (|> luminance (f.* +2.0) (f.- q))
third (|> +1.0 (f./ +3.0))]
- (of_rgb {#red (..up (|> hue (f.+ third) (hue_to_rgb p q)))
- #green (..up (|> hue (hue_to_rgb p q)))
- #blue (..up (|> hue (f.- third) (hue_to_rgb p q)))}))))
+ (of_rgb {#red (|> hue (f.+ third) (hue_rgb p q))
+ #green (|> hue (hue_rgb p q))
+ #blue (|> hue (f.- third) (hue_rgb p q))}))))
-(def: #export (to_hsb color)
+(def: #export (hsb color)
(-> Color HSB)
- (let [[red green blue] (to_rgb color)
+ (let [[red green blue] (rgb color)
red (..down red)
green (..down green)
blue (..down blue)
@@ -269,9 +269,9 @@
#green (..up green)
#blue (..up blue)})))
-(def: #export (to_cmyk color)
+(def: #export (cmyk color)
(-> Color CMYK)
- (let [[red green blue] (to_rgb color)
+ (let [[red green blue] (rgb color)
red (..down red)
green (..down green)
blue (..down blue)
@@ -324,8 +324,8 @@
(f.+ (|> end .int int.frac (f.* dE)))
f.int
.nat)))
- [redS greenS blueS] (to_rgb start)
- [redE greenE blueE] (to_rgb end)]
+ [redS greenS blueS] (rgb start)
+ [redE greenE blueE] (rgb end)]
(of_rgb {#red (interpolated' redE redS)
#green (interpolated' greenE greenS)
#blue (interpolated' blueE blueS)})))
@@ -342,7 +342,7 @@
(template [<op> <name>]
[(def: #export (<name> ratio color)
(-> Frac Color Color)
- (let [[hue saturation luminance] (to_hsl color)]
+ (let [[hue saturation luminance] (hsl color)]
(of_hsl [hue
(|> saturation
(f.* (|> +1.0 (<op> (..normal ratio))))
@@ -355,7 +355,7 @@
(def: #export (gray_scale color)
(-> Color Color)
- (let [[_ _ luminance] (to_hsl color)]
+ (let [[_ _ luminance] (hsl color)]
(of_hsl [+0.0
+0.0
luminance])))
@@ -369,7 +369,7 @@
[(`` (def: #export (<name> color)
(~~ (..color_scheme_documentation <name>))
(-> Color [Color Color Color])
- (let [[hue saturation luminance] (to_hsl color)]
+ (let [[hue saturation luminance] (hsl color)]
[color
(of_hsl [(|> hue (f.+ <1>) ..normal)
saturation
@@ -387,7 +387,7 @@
[(`` (def: #export (<name> color)
(~~ (..color_scheme_documentation <name>))
(-> Color [Color Color Color Color])
- (let [[hue saturation luminance] (to_hsb color)]
+ (let [[hue saturation luminance] (hsb color)]
[color
(of_hsb [(|> hue (f.+ <1>) ..normal)
saturation
@@ -417,7 +417,7 @@
(`` (def: #export (analogous spread variations color)
(~~ (..palette_documentation analogous))
Palette
- (let [[hue saturation brightness] (to_hsb color)
+ (let [[hue saturation brightness] (hsb color)
spread (..normal spread)]
(list\map (function (_ idx)
(of_hsb [(|> idx inc .int int.frac (f.* spread) (f.+ hue) ..normal)
@@ -428,7 +428,7 @@
(`` (def: #export (monochromatic spread variations color)
(~~ (..palette_documentation monochromatic))
Palette
- (let [[hue saturation brightness] (to_hsb color)
+ (let [[hue saturation brightness] (hsb color)
spread (..normal spread)]
(|> (list.indices variations)
(list\map (|>> inc .int int.frac
diff --git a/stdlib/source/library/lux/data/format/binary.lux b/stdlib/source/library/lux/data/format/binary.lux
index b1279b292..918119cb2 100644
--- a/stdlib/source/library/lux/data/format/binary.lux
+++ b/stdlib/source/library/lux/data/format/binary.lux
@@ -133,7 +133,7 @@
(def: #export frac
(Writer Frac)
- (|>> frac.to_bits ..bits/64))
+ (|>> frac.bits ..bits/64))
(def: #export (segment size)
{#.doc (doc "Writes at most 'size' bytes of an input binary blob.")}
@@ -192,7 +192,7 @@
original_count)
value (if (n.= original_count capped_count)
value
- (|> value row.to_list (list.take capped_count) row.of_list))
+ (|> value row.list (list.take capped_count) row.of_list))
(^open "specification\.") ..monoid
[size mutation] (|> value
(row\map valueW)
@@ -225,7 +225,7 @@
(def: #export (set value)
(All [a] (-> (Writer a) (Writer (Set a))))
- (|>> set.to_list (..list value)))
+ (|>> set.list (..list value)))
(def: #export name
(Writer Name)
diff --git a/stdlib/source/library/lux/data/format/css/value.lux b/stdlib/source/library/lux/data/format/css/value.lux
index cff3affb0..6dbf1c3f4 100644
--- a/stdlib/source/library/lux/data/format/css/value.lux
+++ b/stdlib/source/library/lux/data/format/css/value.lux
@@ -820,7 +820,7 @@
(def: #export (rgb color)
(-> color.Color (Value Color))
- (let [[red green blue] (color.to_rgb color)]
+ (let [[red green blue] (color.rgb color)]
(..apply "rgb" (list (%.nat red)
(%.nat green)
(%.nat blue)))))
@@ -828,7 +828,7 @@
(def: #export (rgba pigment)
(-> color.Pigment (Value Color))
(let [(^slots [#color.color #color.alpha]) pigment
- [red green blue] (color.to_rgb color)]
+ [red green blue] (color.rgb color)]
(..apply "rgba" (list (%.nat red)
(%.nat green)
(%.nat blue)
@@ -946,7 +946,9 @@
(:abstraction (format (%.nat (n.% ..degree_limit value)) "deg")))
(template [<degree> <name>]
- [(def: #export <name> Angle (..degree <degree>))]
+ [(def: #export <name>
+ Angle
+ (..degree <degree>))]
[000 to_top]
[090 to_right]
diff --git a/stdlib/source/library/lux/data/format/json.lux b/stdlib/source/library/lux/data/format/json.lux
index cc186e849..60bcfd107 100644
--- a/stdlib/source/library/lux/data/format/json.lux
+++ b/stdlib/source/library/lux/data/format/json.lux
@@ -254,7 +254,7 @@
(def: (array_format format)
(-> (-> JSON Text) (-> Array Text))
(|>> (row\map format)
- row.to_list
+ row.list
(text.join_with ..value_separator)
(text.enclosed [..array_start ..array_end])))
diff --git a/stdlib/source/library/lux/data/format/tar.lux b/stdlib/source/library/lux/data/format/tar.lux
index 1f4f71967..1f1451790 100644
--- a/stdlib/source/library/lux/data/format/tar.lux
+++ b/stdlib/source/library/lux/data/format/tar.lux
@@ -276,7 +276,7 @@
(do <>.monad
[string (<binary>.segment <size>)
end <binary>.bits/8
- #let [expected (`` (char (~~ (static ..null))))]
+ .let [expected (`` (char (~~ (static ..null))))]
_ (<>.assertion (exception.error ..wrong_character [expected end])
(n.= expected end))]
(<>.lift
@@ -318,7 +318,7 @@
(do <>.monad
[string (<binary>.segment ..magic_size)
end <binary>.bits/8
- #let [expected (`` (char (~~ (static ..null))))]
+ .let [expected (`` (char (~~ (static ..null))))]
_ (<>.assertion (exception.error ..wrong_character [expected end])
(n.= expected end))]
(<>.lift
@@ -800,7 +800,7 @@
[header ..header_parser
_ (<>.assertion (exception.error ..wrong_link_flag [expected (get@ #link_flag header)])
(is? expected (get@ #link_flag header)))
- #let [size (get@ #size header)
+ .let [size (get@ #size header)
rounded_size (..rounded_content_size size)]
content (<binary>.segment (..from_big size))
content (<>.lift (..content content))
@@ -811,7 +811,7 @@
..from_big
.int
duration.of_millis
- (duration.up (|> duration.second duration.to_millis .nat))
+ (duration.up (|> duration.second duration.millis .nat))
instant.absolute)
(get@ #mode header)
{#user {#name (get@ #user_name header)
diff --git a/stdlib/source/library/lux/data/format/xml.lux b/stdlib/source/library/lux/data/format/xml.lux
index d065f1def..843a35c91 100644
--- a/stdlib/source/library/lux/data/format/xml.lux
+++ b/stdlib/source/library/lux/data/format/xml.lux
@@ -172,7 +172,7 @@
[_ (<text>.this "<")
tag (..spaced^ tag^)
attrs (..spaced^ attrs^)
- #let [no_children^ ($_ <>.either
+ .let [no_children^ ($_ <>.either
(do <>.monad
[_ (<text>.this "/>")]
(in (#Node tag attrs (list))))
@@ -197,10 +197,6 @@
(<>.before (<>.some ..null^))
(<>.after (<>.maybe ..xml_header^))))
-(def: read
- (-> Text (Try XML))
- (<text>.run xml^))
-
(def: (sanitize_value input)
(-> Text Text)
(|> input
@@ -222,14 +218,6 @@
(-> Attribute Text)
..tag)
-(def: (write_attrs attrs)
- (-> Attrs Text)
- (|> attrs
- dictionary.entries
- (list\map (function (_ [key value])
- ($_ text\compose (..attribute key) "=" text.double_quote (sanitize_value value) text.double_quote)))
- (text.join_with " ")))
-
(def: xml_header
Text
(let [quote (: (-> Text Text)
@@ -241,45 +229,51 @@
" encoding=" (quote "UTF-8")
"?>")))
-(def: (write input)
- (-> XML Text)
- ($_ text\compose
- ..xml_header text.new_line
- (loop [prefix ""
- input input]
- (case input
- (#Text value)
- (sanitize_value value)
-
- (^ (#Node xml_tag xml_attrs (list (#Text value))))
- (let [tag (..tag xml_tag)
- attrs (if (dictionary.empty? xml_attrs)
- ""
- ($_ text\compose " " (..write_attrs xml_attrs)))]
- ($_ text\compose
- prefix "<" tag attrs ">"
- (sanitize_value value)
- "</" tag ">"))
-
- (#Node xml_tag xml_attrs xml_children)
- (let [tag (..tag xml_tag)
- attrs (if (dictionary.empty? xml_attrs)
- ""
- ($_ text\compose " " (..write_attrs xml_attrs)))]
- (if (list.empty? xml_children)
- ($_ text\compose prefix "<" tag attrs "/>")
- ($_ text\compose prefix "<" tag attrs ">"
- (|> xml_children
- (list\map (|>> (recur (text\compose prefix text.tab)) (text\compose text.new_line)))
- (text.join_with ""))
- text.new_line prefix "</" tag ">")))))
- ))
-
(implementation: #export codec
(Codec Text XML)
- (def: encode ..write)
- (def: decode ..read))
+ (def: encode
+ (let [attributes (: (-> Attrs Text)
+ (function (_ attrs)
+ (|> attrs
+ dictionary.entries
+ (list\map (function (_ [key value])
+ ($_ text\compose (..attribute key) "=" text.double_quote (sanitize_value value) text.double_quote)))
+ (text.join_with " "))))]
+ (function (_ input)
+ ($_ text\compose
+ ..xml_header text.new_line
+ (loop [prefix ""
+ input input]
+ (case input
+ (#Text value)
+ (sanitize_value value)
+
+ (^ (#Node xml_tag xml_attrs (list (#Text value))))
+ (let [tag (..tag xml_tag)
+ attrs (if (dictionary.empty? xml_attrs)
+ ""
+ ($_ text\compose " " (attributes xml_attrs)))]
+ ($_ text\compose
+ prefix "<" tag attrs ">"
+ (sanitize_value value)
+ "</" tag ">"))
+
+ (#Node xml_tag xml_attrs xml_children)
+ (let [tag (..tag xml_tag)
+ attrs (if (dictionary.empty? xml_attrs)
+ ""
+ ($_ text\compose " " (attributes xml_attrs)))]
+ (if (list.empty? xml_children)
+ ($_ text\compose prefix "<" tag attrs "/>")
+ ($_ text\compose prefix "<" tag attrs ">"
+ (|> xml_children
+ (list\map (|>> (recur (text\compose prefix text.tab)) (text\compose text.new_line)))
+ (text.join_with ""))
+ text.new_line prefix "</" tag ">")))))
+ ))))
+ (def: decode
+ (<text>.run ..xml^)))
(implementation: #export equivalence
(Equivalence XML)
diff --git a/stdlib/source/library/lux/data/maybe.lux b/stdlib/source/library/lux/data/maybe.lux
index 7d6ac8dfa..bab93295d 100644
--- a/stdlib/source/library/lux/data/maybe.lux
+++ b/stdlib/source/library/lux/data/maybe.lux
@@ -1,6 +1,6 @@
(.module:
[library
- [lux #*
+ [lux (#- list)
[abstract
[monoid (#+ Monoid)]
[equivalence (#+ Equivalence)]
@@ -127,14 +127,14 @@
"=>"
+20)}
(case tokens
- (^ (list else maybe))
+ (^ (.list else maybe))
(let [g!temp (: Code [location.dummy (#.Identifier ["" ""])])]
- (#.Right [state (list (` (case (~ maybe)
- (#.Some (~ g!temp))
- (~ g!temp)
+ (#.Right [state (.list (` (case (~ maybe)
+ (#.Some (~ g!temp))
+ (~ g!temp)
- #.None
- (~ else))))]))
+ #.None
+ (~ else))))]))
_
(#.Left "Wrong syntax for else")))
@@ -146,7 +146,7 @@
(All [a] (-> (Maybe a) a))
(|>> (..else (undefined))))
-(def: #export (to_list value)
+(def: #export (list value)
(All [a] (-> (Maybe a) (List a)))
(case value
#.None
@@ -154,3 +154,18 @@
(#.Some value)
(#.Item value #.End)))
+
+(macro: #export (when tokens state)
+ {#.doc (doc "Can be used as a guard in (co)monadic be/do expressions."
+ (do monad
+ [value (do_something 1 2 3)
+ ..when (passes_test? value)]
+ (do_something_else 4 5 6)))}
+ (case tokens
+ (^ (.list test then))
+ (#.Right [state (.list (` (.if (~ test)
+ (~ then)
+ #.None)))])
+
+ _
+ (#.Left "Wrong syntax for when")))
diff --git a/stdlib/source/library/lux/data/text.lux b/stdlib/source/library/lux/data/text.lux
index 76ae69e33..f4870ecf5 100644
--- a/stdlib/source/library/lux/data/text.lux
+++ b/stdlib/source/library/lux/data/text.lux
@@ -66,7 +66,7 @@
(-> Text Text (Maybe Nat))
(index_of' 0 pattern input))
-(def: #export (last_index_of' from part text)
+(def: (last_index_of' from part text)
(-> Nat Text Text (Maybe Nat))
(loop [from from
output (: (Maybe Nat)
diff --git a/stdlib/source/library/lux/data/text/regex.lux b/stdlib/source/library/lux/data/text/regex.lux
index 0c5d42d02..8c353db1c 100644
--- a/stdlib/source/library/lux/data/text/regex.lux
+++ b/stdlib/source/library/lux/data/text/regex.lux
@@ -282,7 +282,7 @@
(do <>.monad
[parts (<>.many (<>.or (re_complex^ current_module)
(re_scoped^ current_module)))
- #let [g!total (code.identifier ["" "0total"])
+ .let [g!total (code.identifier ["" "0total"])
g!temp (code.identifier ["" "0temp"])
[_ names steps] (list\fold (: (-> (Either Code [Re_Group Code])
[Nat (List Code) (List (List Code))]
@@ -293,7 +293,7 @@
[idx
names
(list& (list g!temp complex
- (' #let) (` [(~ g!total) (\ (~! //.monoid) (~' compose) (~ g!total) (~ g!temp))]))
+ (` .let) (` [(~ g!total) (\ (~! //.monoid) (~' compose) (~ g!total) (~ g!temp))]))
steps)]
(#.Right [(#Capturing [?name num_captures]) scoped])
@@ -309,7 +309,7 @@
[idx!
(list& name! names)
(list& (list name! scoped
- (' #let) (` [(~ g!total) (\ (~! //.monoid) (~' compose) (~ g!total) (~ access))]))
+ (` .let) (` [(~ g!total) (\ (~! //.monoid) (~' compose) (~ g!total) (~ access))]))
steps)])
)))
[0
@@ -320,7 +320,7 @@
(list.size names)
0)
(` ((~! do) (~! <>.monad)
- [(~ (' #let)) [(~ g!total) ""]
+ [.let [(~ g!total) ""]
(~+ (|> steps list.reversed list\join))]
((~ (' in)) [(~ g!total) (~+ (list.reversed names))])))])
))
@@ -371,7 +371,7 @@
Text
(Parser [Nat Code]))
(do <>.monad
- [#let [sub^ (re_sequential^ capturing? re_scoped^ current_module)]
+ [.let [sub^ (re_sequential^ capturing? re_scoped^ current_module)]
head sub^
tail (<>.some (<>.after (<text>.this "|") sub^))]
(if (list.empty? tail)
diff --git a/stdlib/source/library/lux/debug.lux b/stdlib/source/library/lux/debug.lux
index bb4292eca..0fbd4657a 100644
--- a/stdlib/source/library/lux/debug.lux
+++ b/stdlib/source/library/lux/debug.lux
@@ -135,7 +135,7 @@
(~~ (as_is)))]
(`` (|>> (:as (array.Array Any))
<adaption>
- array.to_list
+ array.list
(list\map inspection)
(text.join_with " ")
(text.enclosed ["[" "]"])))))
@@ -563,7 +563,7 @@
(do {! meta.monad}
[location meta.location
locals meta.locals
- #let [environment (|> locals
+ .let [environment (|> locals
list.concat
## The list is reversed to make sure that, when building the dictionary,
## later bindings overshadow earlier ones if they have the same name.
diff --git a/stdlib/source/library/lux/ffi.jvm.lux b/stdlib/source/library/lux/ffi.jvm.lux
index 81202885a..536960c9a 100644
--- a/stdlib/source/library/lux/ffi.jvm.lux
+++ b/stdlib/source/library/lux/ffi.jvm.lux
@@ -393,21 +393,21 @@
(def: (make_get_const_parser class_name field_name)
(-> Text Text (Parser Code))
(do <>.monad
- [#let [dotted_name (format "::" field_name)]
+ [.let [dotted_name (format "::" field_name)]
_ (<code>.this! (code.identifier ["" dotted_name]))]
(in (get_static_field class_name field_name))))
(def: (make_get_var_parser class_name field_name self_name)
(-> Text Text Text (Parser Code))
(do <>.monad
- [#let [dotted_name (format "::" field_name)]
+ [.let [dotted_name (format "::" field_name)]
_ (<code>.this! (code.identifier ["" dotted_name]))]
(in (get_virtual_field class_name field_name (code.local_identifier self_name)))))
(def: (make_put_var_parser class_name field_name self_name)
(-> Text Text Text (Parser Code))
(do <>.monad
- [#let [dotted_name (format "::" field_name)]
+ [.let [dotted_name (format "::" field_name)]
[_ _ value] (: (Parser [Any Any Code])
(<code>.form ($_ <>.and (<code>.this! (' :=)) (<code>.this! (code.identifier ["" dotted_name])) <code>.any)))]
(in (`' ("jvm member put virtual"
@@ -472,7 +472,7 @@
(def: (make_static_method_parser class_name method_name arguments)
(-> Text Text (List Argument) (Parser Code))
(do <>.monad
- [#let [dotted_name (format "::" method_name "!")]
+ [.let [dotted_name (format "::" method_name "!")]
args (: (Parser (List Code))
(<code>.form (<>.after (<code>.this! (code.identifier ["" dotted_name]))
(<code>.tuple (<>.exactly (list.size arguments) <code>.any)))))]
@@ -485,7 +485,7 @@
[(def: (<name> class_name method_name arguments self_name)
(-> Text Text (List Argument) Text (Parser Code))
(do <>.monad
- [#let [dotted_name (format "::" method_name "!")]
+ [.let [dotted_name (format "::" method_name "!")]
args (: (Parser (List Code))
(<code>.form (<>.after (<code>.this! (code.identifier ["" dotted_name]))
(<code>.tuple (<>.exactly (list.size arguments) <code>.any)))))]
@@ -568,7 +568,7 @@
(-> (-> (List (Type Var)) (Parser (Type Parameter)))
(-> (List (Type Var)) (Parser (Type Class))))
(do <>.monad
- [#let [class_name^ (..valid_class_name type_vars)]
+ [.let [class_name^ (..valid_class_name type_vars)]
[name parameters] (: (Parser [External (List (Type Parameter))])
($_ <>.either
(<>.and class_name^ (<>\in (list)))
@@ -725,7 +725,7 @@
(-> (List (Type Var)) (Parser [Member_Declaration MethodDecl]))
(<code>.form (do <>.monad
[tvars (<>.else (list) ..vars^)
- #let [total_vars (list\compose tvars type_vars)]
+ .let [total_vars (list\compose tvars type_vars)]
name <code>.local_identifier
anns ..annotations^
inputs (<code>.tuple (<>.some (..type^ total_vars)))
@@ -783,7 +783,7 @@
[pm privacy_modifier^
strict_fp? (<>.parses? (<code>.this! (' #strict)))
method_vars (<>.else (list) ..vars^)
- #let [total_vars (list\compose class_vars method_vars)]
+ .let [total_vars (list\compose class_vars method_vars)]
[_ self_name arguments] (<code>.form ($_ <>.and
(<code>.this! (' new))
<code>.local_identifier
@@ -804,7 +804,7 @@
strict_fp? (<>.parses? (<code>.this! (' #strict)))
final? (<>.parses? (<code>.this! (' #final)))
method_vars (<>.else (list) ..vars^)
- #let [total_vars (list\compose class_vars method_vars)]
+ .let [total_vars (list\compose class_vars method_vars)]
[name self_name arguments] (<code>.form ($_ <>.and
<code>.local_identifier
<code>.local_identifier
@@ -824,7 +824,7 @@
[strict_fp? (<>.parses? (<code>.this! (' #strict)))
owner_class ..declaration^
method_vars (<>.else (list) ..vars^)
- #let [total_vars (list\compose (product.right (parser.declaration owner_class))
+ .let [total_vars (list\compose (product.right (parser.declaration owner_class))
method_vars)]
[name self_name arguments] (<code>.form ($_ <>.and
<code>.local_identifier
@@ -846,7 +846,7 @@
strict_fp? (<>.parses? (<code>.this! (' #strict)))
_ (<code>.this! (' #static))
method_vars (<>.else (list) ..vars^)
- #let [total_vars method_vars]
+ .let [total_vars method_vars]
[name arguments] (<code>.form (<>.and <code>.local_identifier
(..arguments^ total_vars)))
return_type (..return^ total_vars)
@@ -864,7 +864,7 @@
[pm privacy_modifier^
_ (<code>.this! (' #abstract))
method_vars (<>.else (list) ..vars^)
- #let [total_vars method_vars]
+ .let [total_vars method_vars]
[name arguments] (<code>.form (<>.and <code>.local_identifier
(..arguments^ total_vars)))
return_type (..return^ total_vars)
@@ -881,7 +881,7 @@
[pm privacy_modifier^
_ (<code>.this! (' #native))
method_vars (<>.else (list) ..vars^)
- #let [total_vars method_vars]
+ .let [total_vars method_vars]
[name arguments] (<code>.form (<>.and <code>.local_identifier
(..arguments^ total_vars)))
return_type (..return^ total_vars)
@@ -950,7 +950,7 @@
[tvars (<>.else (list) ..vars^)
_ (<code>.identifier! ["" "new"])
?alias import_member_alias^
- #let [total_vars (list\compose owner_vars tvars)]
+ .let [total_vars (list\compose owner_vars tvars)]
?prim_mode (<>.maybe primitive_mode^)
args (..import_member_args^ total_vars)
[io? try? maybe?] import_member_return_flags^]
@@ -971,7 +971,7 @@
tvars (<>.else (list) ..vars^)
name <code>.local_identifier
?alias import_member_alias^
- #let [total_vars (list\compose owner_vars tvars)]
+ .let [total_vars (list\compose owner_vars tvars)]
?prim_mode (<>.maybe primitive_mode^)
args (..import_member_args^ total_vars)
[io? try? maybe?] import_member_return_flags^
@@ -1200,7 +1200,7 @@
(type.class "java.lang.Object" (list)))
(syntax: #export (class:
- {#let [! <>.monad]}
+ {.let [! <>.monad]}
{im inheritance_modifier^}
{[full_class_name class_vars] (\ ! map parser.declaration ..declaration^)}
{super (<>.else $Object
@@ -1242,7 +1242,7 @@
"(::resolve! container [value]) for calling the 'resolve' method."
)}
(do meta.monad
- [#let [fully_qualified_class_name full_class_name
+ [.let [fully_qualified_class_name full_class_name
method_parser (: (Parser Code)
(|> methods
(list\map (method->parser fully_qualified_class_name))
@@ -1257,7 +1257,7 @@
[(~+ (list\map (method_def$ fully_qualified_class_name method_parser super fields) methods))]))))))
(syntax: #export (interface:
- {#let [! <>.monad]}
+ {.let [! <>.monad]}
{[full_class_name class_vars] (\ ! map parser.declaration ..declaration^)}
{supers (<>.else (list)
(<code>.tuple (<>.some (class^ class_vars))))}
@@ -1425,7 +1425,7 @@
(with_gensyms [arg_name]
(in [maybe? arg_name]))))
import_member_args)
- #let [input_jvm_types (list\map product.right import_member_args)
+ .let [input_jvm_types (list\map product.right import_member_args)
arg_types (list\map (: (-> [Bit (Type Value)] Code)
(function (_ [maybe? arg])
(let [arg_type (value_type (get@ #import_member_mode commons) arg)]
@@ -1571,7 +1571,7 @@
(case member
(#EnumDecl enum_members)
(do meta.monad
- [#let [enum_type (: Code
+ [.let [enum_type (: Code
(case class_tvars
#.End
(` (primitive (~ (code.text full_name))))
@@ -1589,7 +1589,7 @@
(#ConstructorDecl [commons _])
(do meta.monad
- [#let [classT (type.class full_name (list))
+ [.let [classT (type.class full_name (list))
def_name (code.identifier ["" (..import_name import_format method_prefix (get@ #import_member_alias commons))])
jvm_interop (|> [classT
(` ("jvm member invoke constructor"
@@ -1609,7 +1609,7 @@
(#MethodDecl [commons method])
(with_gensyms [g!obj]
(do meta.monad
- [#let [def_name (code.identifier ["" (..import_name import_format method_prefix (get@ #import_member_alias commons))])
+ [.let [def_name (code.identifier ["" (..import_name import_format method_prefix (get@ #import_member_alias commons))])
(^slots [#import_member_kind]) commons
(^slots [#import_method_name]) method
[jvm_op object_ast] (: [Text (List Code)]
@@ -1662,7 +1662,7 @@
(#FieldAccessDecl fad)
(do meta.monad
- [#let [(^open ".") fad
+ [.let [(^open ".") fad
getter_name (code.identifier ["" (..import_name import_format method_prefix import_field_name)])
setter_name (code.identifier ["" (..import_name import_format method_prefix (format import_field_name "!"))])]
getter_interop (with_gensyms [g!obj]
@@ -1741,7 +1741,7 @@
(syntax: #export (import:
{declaration ..declaration^}
- {#let [[class_name class_type_vars] (parser.declaration declaration)]}
+ {.let [[class_name class_type_vars] (parser.declaration declaration)]}
{bundles (<>.some (..bundle class_type_vars))})
{#.doc (doc "Allows importing JVM classes, and using them as types."
"Their methods, fields and enum options can also be imported."
@@ -1931,7 +1931,7 @@
(do meta.monad
[array_type (meta.type array_name)
array_jvm_type (lux_type->jvm_type array_type)
- #let [g!extension (code.text (`` (cond (~~ (template [<primitive> <extension>]
+ .let [g!extension (code.text (`` (cond (~~ (template [<primitive> <extension>]
[(\ type.equivalence =
(type.array <primitive>)
array_jvm_type)
@@ -1967,7 +1967,7 @@
(do meta.monad
[array_type (meta.type array_name)
array_jvm_type (lux_type->jvm_type array_type)
- #let [g!idx (` (.|> (~ idx)
+ .let [g!idx (` (.|> (~ idx)
(.: .Nat)
(.:as (.primitive (~ (code.text box.long))))
"jvm object cast"
@@ -2005,7 +2005,7 @@
(do meta.monad
[array_type (meta.type array_name)
array_jvm_type (lux_type->jvm_type array_type)
- #let [g!idx (` (.|> (~ idx)
+ .let [g!idx (` (.|> (~ idx)
(.: .Nat)
(.:as (.primitive (~ (code.text box.long))))
"jvm object cast"
diff --git a/stdlib/source/library/lux/ffi.old.lux b/stdlib/source/library/lux/ffi.old.lux
index 89feff739..6b8ff867d 100644
--- a/stdlib/source/library/lux/ffi.old.lux
+++ b/stdlib/source/library/lux/ffi.old.lux
@@ -387,21 +387,21 @@
(def: (get_const_parser class_name field_name)
(-> Text Text (Parser Code))
(do <>.monad
- [#let [dotted_name (format "::" field_name)]
+ [.let [dotted_name (format "::" field_name)]
_ (<code>.this! (code.identifier ["" dotted_name]))]
(in (`' ((~ (code.text (format "jvm getstatic" ":" class_name ":" field_name))))))))
(def: (get_var_parser class_name field_name)
(-> Text Text (Parser Code))
(do <>.monad
- [#let [dotted_name (format "::" field_name)]
+ [.let [dotted_name (format "::" field_name)]
_ (<code>.this! (code.identifier ["" dotted_name]))]
(in (`' ((~ (code.text (format "jvm getfield" ":" class_name ":" field_name))) _jvm_this)))))
(def: (put_var_parser class_name field_name)
(-> Text Text (Parser Code))
(do <>.monad
- [#let [dotted_name (format "::" field_name)]
+ [.let [dotted_name (format "::" field_name)]
[_ _ value] (: (Parser [Any Any Code])
(<code>.form ($_ <>.and (<code>.this! (' :=)) (<code>.this! (code.identifier ["" dotted_name])) <code>.any)))]
(in (`' ((~ (code.text (format "jvm putfield" ":" class_name ":" field_name))) _jvm_this (~ value))))))
@@ -450,18 +450,18 @@
[args (: (Parser (List Code))
(<code>.form (<>.after (<code>.this! (' ::new!))
(<code>.tuple (<>.exactly (list.size arg_decls) <code>.any)))))
- #let [arg_decls' (: (List Text) (list\map (|>> product.right (simple_class$ params)) arg_decls))]]
+ .let [arg_decls' (: (List Text) (list\map (|>> product.right (simple_class$ params)) arg_decls))]]
(in (` ((~ (code.text (format "jvm new" ":" class_name ":" (text.join_with "," arg_decls'))))
(~+ args))))))
(def: (static_method_parser params class_name method_name arg_decls)
(-> (List Type_Parameter) Text Text (List ArgDecl) (Parser Code))
(do <>.monad
- [#let [dotted_name (format "::" method_name "!")]
+ [.let [dotted_name (format "::" method_name "!")]
args (: (Parser (List Code))
(<code>.form (<>.after (<code>.this! (code.identifier ["" dotted_name]))
(<code>.tuple (<>.exactly (list.size arg_decls) <code>.any)))))
- #let [arg_decls' (: (List Text) (list\map (|>> product.right (simple_class$ params)) arg_decls))]]
+ .let [arg_decls' (: (List Text) (list\map (|>> product.right (simple_class$ params)) arg_decls))]]
(in (`' ((~ (code.text (format "jvm invokestatic" ":" class_name ":" method_name ":" (text.join_with "," arg_decls'))))
(~+ args))))))
@@ -469,11 +469,11 @@
[(def: (<name> params class_name method_name arg_decls)
(-> (List Type_Parameter) Text Text (List ArgDecl) (Parser Code))
(do <>.monad
- [#let [dotted_name (format "::" method_name "!")]
+ [.let [dotted_name (format "::" method_name "!")]
args (: (Parser (List Code))
(<code>.form (<>.after (<code>.this! (code.identifier ["" dotted_name]))
(<code>.tuple (<>.exactly (list.size arg_decls) <code>.any)))))
- #let [arg_decls' (: (List Text) (list\map (|>> product.right (simple_class$ params)) arg_decls))]]
+ .let [arg_decls' (: (List Text) (list\map (|>> product.right (simple_class$ params)) arg_decls))]]
(in (`' ((~ (code.text (format <jvm_op> ":" class_name ":" method_name ":" (text.join_with "," arg_decls'))))
(~' _jvm_this) (~+ args))))))]
@@ -713,7 +713,7 @@
[pm privacy_modifier^
strict_fp? (<>.parses? (<code>.this! (' #strict)))
method_vars ..type_params^
- #let [total_vars (list\compose class_vars method_vars)]
+ .let [total_vars (list\compose class_vars method_vars)]
[_ arg_decls] (<code>.form (<>.and (<code>.this! (' new))
(..arg_decls^ total_vars)))
constructor_args (..constructor_args^ total_vars)
@@ -732,7 +732,7 @@
strict_fp? (<>.parses? (<code>.this! (' #strict)))
final? (<>.parses? (<code>.this! (' #final)))
method_vars ..type_params^
- #let [total_vars (list\compose class_vars method_vars)]
+ .let [total_vars (list\compose class_vars method_vars)]
[name this_name arg_decls] (<code>.form ($_ <>.and
<code>.local_identifier
<code>.local_identifier
@@ -755,7 +755,7 @@
[strict_fp? (<>.parses? (<code>.this! (' #strict)))
owner_class ..class_decl^
method_vars ..type_params^
- #let [total_vars (list\compose (product.right owner_class) method_vars)]
+ .let [total_vars (list\compose (product.right owner_class) method_vars)]
[name this_name arg_decls] (<code>.form ($_ <>.and
<code>.local_identifier
<code>.local_identifier
@@ -779,7 +779,7 @@
strict_fp? (<>.parses? (<code>.this! (' #strict)))
_ (<code>.this! (' #static))
method_vars ..type_params^
- #let [total_vars method_vars]
+ .let [total_vars method_vars]
[name arg_decls] (<code>.form (<>.and <code>.local_identifier
(..arg_decls^ total_vars)))
return_type (..generic_type^ total_vars)
@@ -797,7 +797,7 @@
[pm privacy_modifier^
_ (<code>.this! (' #abstract))
method_vars ..type_params^
- #let [total_vars method_vars]
+ .let [total_vars method_vars]
[name arg_decls] (<code>.form (<>.and <code>.local_identifier
(..arg_decls^ total_vars)))
return_type (..generic_type^ total_vars)
@@ -814,7 +814,7 @@
[pm privacy_modifier^
_ (<code>.this! (' #native))
method_vars ..type_params^
- #let [total_vars method_vars]
+ .let [total_vars method_vars]
[name arg_decls] (<code>.form (<>.and <code>.local_identifier
(..arg_decls^ total_vars)))
return_type (..generic_type^ total_vars)
@@ -879,7 +879,7 @@
[tvars ..type_params^
_ (<code>.this! (' new))
?alias import_member_alias^
- #let [total_vars (list\compose owner_vars tvars)]
+ .let [total_vars (list\compose owner_vars tvars)]
?prim_mode (<>.maybe primitive_mode^)
args (..import_member_args^ total_vars)
[io? try? maybe?] import_member_return_flags^]
@@ -900,7 +900,7 @@
tvars ..type_params^
name <code>.local_identifier
?alias import_member_alias^
- #let [total_vars (list\compose owner_vars tvars)]
+ .let [total_vars (list\compose owner_vars tvars)]
?prim_mode (<>.maybe primitive_mode^)
args (..import_member_args^ total_vars)
[io? try? maybe?] import_member_return_flags^
@@ -1095,7 +1095,7 @@
(let [super_replacer (parser_replacer (<code>.form (do <>.monad
[_ (<code>.this! (' ::super!))
args (<code>.tuple (<>.exactly (list.size arg_decls) <code>.any))
- #let [arg_decls' (: (List Text) (list\map (|>> product.right (simple_class$ (list)))
+ .let [arg_decls' (: (List Text) (list\map (|>> product.right (simple_class$ (list)))
arg_decls))]]
(in (`' ((~ (code.text (format "jvm invokespecial"
":" (get@ #super_class_name super_class)
@@ -1168,8 +1168,8 @@
(syntax: #export (class:
{im inheritance_modifier^}
{class_decl ..class_decl^}
- {#let [full_class_name (product.left class_decl)]}
- {#let [class_vars (product.right class_decl)]}
+ {.let [full_class_name (product.left class_decl)]}
+ {.let [class_vars (product.right class_decl)]}
{super (<>.else object_super_class
(..super_class_decl^ class_vars))}
{interfaces (<>.else (list)
@@ -1209,7 +1209,7 @@
)}
(do meta.monad
[current_module meta.current_module_name
- #let [fully_qualified_class_name (format (safe current_module) "." full_class_name)
+ .let [fully_qualified_class_name (format (safe current_module) "." full_class_name)
field_parsers (list\map (field_parser fully_qualified_class_name) fields)
method_parsers (list\map (method_parser (product.right class_decl) fully_qualified_class_name) methods)
replacer (parser_replacer (list\fold <>.either
@@ -1227,7 +1227,7 @@
(syntax: #export (interface:
{class_decl ..class_decl^}
- {#let [class_vars (product.right class_decl)]}
+ {.let [class_vars (product.right class_decl)]}
{supers (<>.else (list)
(<code>.tuple (<>.some (..super_class_decl^ class_vars))))}
{annotations ..annotations^}
@@ -1394,7 +1394,7 @@
(with_gensyms [arg_name]
(in [maybe? arg_name]))))
import_member_args)
- #let [arg_classes (: (List Text)
+ .let [arg_classes (: (List Text)
(list\map (|>> product.right (simple_class$ (list\compose type_params import_member_tvars)))
import_member_args))
arg_types (list\map (: (-> [Bit GenericType] Code)
@@ -1449,7 +1449,7 @@
#.End #1
_ #0))
-(def: (type_param_to_type_arg [name _])
+(def: (lux_type_parameter [name _])
(-> Type_Parameter Code)
(code.identifier ["" name]))
@@ -1498,11 +1498,11 @@
full_name (safe full_name)
all_params (|> (member_type_vars class_tvars member)
(list.only free_type_param?)
- (list\map type_param_to_type_arg))]
+ (list\map lux_type_parameter))]
(case member
(#EnumDecl enum_members)
(do {! meta.monad}
- [#let [enum_type (: Code
+ [.let [enum_type (: Code
(case class_tvars
#.End
(` (primitive (~ (code.text full_name))))
@@ -1510,7 +1510,7 @@
_
(let [=class_tvars (|> class_tvars
(list.only free_type_param?)
- (list\map type_param_to_type_arg))]
+ (list\map lux_type_parameter))]
(` (All [(~+ =class_tvars)] (primitive (~ (code.text full_name)) [(~+ =class_tvars)]))))))
getter_interop (: (-> Text Code)
(function (_ name)
@@ -1522,7 +1522,7 @@
(#ConstructorDecl [commons _])
(do meta.monad
- [#let [def_name (code.identifier ["" (..import_name import_format method_prefix (get@ #import_member_alias commons))])
+ [.let [def_name (code.identifier ["" (..import_name import_format method_prefix (get@ #import_member_alias commons))])
jvm_extension (code.text (format "jvm new" ":" full_name ":" (text.join_with "," arg_classes)))
jvm_interop (|> (` ((~ jvm_extension)
(~+ (jvm_extension_inputs (get@ #import_member_mode commons) arg_classes arg_function_inputs))))
@@ -1535,7 +1535,7 @@
(#MethodDecl [commons method])
(with_gensyms [g!obj]
(do meta.monad
- [#let [def_name (code.identifier ["" (..import_name import_format method_prefix (get@ #import_member_alias commons))])
+ [.let [def_name (code.identifier ["" (..import_name import_format method_prefix (get@ #import_member_alias commons))])
(^slots [#import_member_kind]) commons
(^slots [#import_method_name]) method
[jvm_op object_ast] (: [Text (List Code)]
@@ -1567,7 +1567,7 @@
(#FieldAccessDecl fad)
(do meta.monad
- [#let [(^open ".") fad
+ [.let [(^open ".") fad
base_gtype (class_type import_field_mode type_params import_field_type)
classC (class_decl_type$ class)
typeC (if import_field_maybe?
@@ -1576,7 +1576,7 @@
tvar_asts (: (List Code)
(|> class_tvars
(list.only free_type_param?)
- (list\map type_param_to_type_arg)))
+ (list\map lux_type_parameter)))
getter_name (code.identifier ["" (..import_name import_format method_prefix import_field_name)])
setter_name (code.identifier ["" (..import_name import_format method_prefix (format import_field_name "!"))])]
getter_interop (with_gensyms [g!obj]
diff --git a/stdlib/source/library/lux/macro.lux b/stdlib/source/library/lux/macro.lux
index 04a9324c4..91025dcaf 100644
--- a/stdlib/source/library/lux/macro.lux
+++ b/stdlib/source/library/lux/macro.lux
@@ -145,7 +145,7 @@
(^ (list [_ (#.Tuple identifiers)] body))
(do {! //.monad}
[identifier_names (monad.map ! ..get_local_identifier identifiers)
- #let [identifier_defs (list\join (list\map (: (-> Text (List Code))
+ .let [identifier_defs (list\join (list\map (: (-> Text (List Code))
(function (_ name) (list (code.identifier ["" name]) (` (gensym (~ (code.text name)))))))
identifier_names))]]
(in (list (` ((~! do) (~! //.monad)
@@ -194,7 +194,7 @@
(do //.monad
[location //.location
output (<func> token)
- #let [_ ("lux io log" ($_ text\compose (name\encode macro_name) " " (location.format location)))
+ .let [_ ("lux io log" ($_ text\compose (name\encode macro_name) " " (location.format location)))
_ (list\map (|>> code.format "lux io log")
output)
_ ("lux io log" "")]]
diff --git a/stdlib/source/library/lux/macro/local.lux b/stdlib/source/library/lux/macro/local.lux
index 2872adb12..f6dcb0590 100644
--- a/stdlib/source/library/lux/macro/local.lux
+++ b/stdlib/source/library/lux/macro/local.lux
@@ -51,7 +51,7 @@
(-> [Name Macro] (Meta Any))
(do meta.monad
[[module_name definition_name] (meta.normal name)
- #let [definition (: Global (#.Definition [false .Macro (' {}) macro]))
+ .let [definition (: Global (#.Definition [false .Macro (' {}) macro]))
add_macro! (: (-> (PList Global) (PList Global))
(plist.put definition_name definition))]]
(..with_module module_name
@@ -68,7 +68,7 @@
(-> Name (Meta Any))
(do meta.monad
[[module_name definition_name] (meta.normal name)
- #let [remove_macro! (: (-> (PList Global) (PList Global))
+ .let [remove_macro! (: (-> (PList Global) (PList Global))
(plist.remove definition_name))]]
(..with_module module_name
(function (_ module)
diff --git a/stdlib/source/library/lux/macro/poly.lux b/stdlib/source/library/lux/macro/poly.lux
index a92c9bd96..f89f7568c 100644
--- a/stdlib/source/library/lux/macro/poly.lux
+++ b/stdlib/source/library/lux/macro/poly.lux
@@ -70,7 +70,7 @@
_
(<>.failure "derived: was given no explicit name, and cannot generate one from given information."))
- #let [impl (case ?custom_impl
+ .let [impl (case ?custom_impl
(#.Some custom_impl)
custom_impl
@@ -81,12 +81,12 @@
{#.implementation? #1}
(~ impl)))))))
-(def: #export (to_code env type)
+(def: #export (code env type)
(-> Env Type Code)
(`` (case type
(#.Primitive name params)
(` (#.Primitive (~ (code.text name))
- (list (~+ (list\map (to_code env) params)))))
+ (.list (~+ (list\map (code env) params)))))
(^template [<tag>]
[(<tag> idx)
@@ -96,24 +96,24 @@
(#.Parameter idx)
(let [idx (<type>.adjusted_idx env idx)]
(if (n.= 0 idx)
- (|> (dictionary.get idx env) maybe.assume product.left (to_code env))
+ (|> (dictionary.get idx env) maybe.assume product.left (code env))
(` (.$ (~ (code.nat (dec idx)))))))
(#.Apply (#.Named [(~~ (static .prelude_module)) "Nothing"] _) (#.Parameter idx))
(let [idx (<type>.adjusted_idx env idx)]
(if (n.= 0 idx)
- (|> (dictionary.get idx env) maybe.assume product.left (to_code env))
+ (|> (dictionary.get idx env) maybe.assume product.left (code env))
(undefined)))
(^template [<tag>]
[(<tag> left right)
- (` (<tag> (~ (to_code env left))
- (~ (to_code env right))))])
+ (` (<tag> (~ (code env left))
+ (~ (code env right))))])
([#.Function] [#.Apply])
(^template [<macro> <tag> <flattener>]
[(<tag> left right)
- (` (<macro> (~+ (list\map (to_code env) (<flattener> type)))))])
+ (` (<macro> (~+ (list\map (code env) (<flattener> type)))))])
([.Variant #.Sum type.flat_variant]
[.Tuple #.Product type.flat_tuple])
@@ -122,7 +122,7 @@
(^template [<tag>]
[(<tag> scope body)
- (` (<tag> (list (~+ (list\map (to_code env) scope)))
- (~ (to_code env body))))])
+ (` (<tag> (.list (~+ (list\map (code env) scope)))
+ (~ (code env body))))])
([#.UnivQ] [#.ExQ])
)))
diff --git a/stdlib/source/library/lux/macro/syntax.lux b/stdlib/source/library/lux/macro/syntax.lux
index 1e80a355f..99bb28c0e 100644
--- a/stdlib/source/library/lux/macro/syntax.lux
+++ b/stdlib/source/library/lux/macro/syntax.lux
@@ -46,8 +46,8 @@
"The inputs to the macro can be parsed in complex ways through the use of syntax parsers."
"The macro body is also (implicitly) run in the Meta monad, to save some typing."
"Also, the compiler state can be accessed through the *compiler* binding."
- (syntax: #export (object {#let [imports (class_imports *compiler*)]}
- {#let [class_vars (list)]}
+ (syntax: #export (object {.let [imports (class_imports *compiler*)]}
+ {.let [class_vars (list)]}
{super (opt (super_class_decl^ imports class_vars))}
{interfaces (tuple (some (super_class_decl^ imports class_vars)))}
{constructor_args (constructor_args^ imports class_vars)}
@@ -87,14 +87,18 @@
(function (_ arg)
(case arg
(^ [_ (#.Record (list [var parser]))])
- (case var
- [_ (#.Tag ["" "let"])]
- (in [var parser])
+ (with_expansions [<default> (in [var
+ (` ((~! ..self_documenting) (' (~ var))
+ (~ parser)))])]
+ (case var
+ [_ (#.Identifier ["" _])]
+ <default>
- _
- (in [var
- (` ((~! ..self_documenting) (' (~ var))
- (~ parser)))]))
+ [_ (#.Identifier _)]
+ (in [var parser])
+
+ _
+ <default>))
[_ (#.Identifier var_name)]
(in [arg
@@ -105,7 +109,7 @@
(meta.failure "Syntax pattern expects records or identifiers."))))
args)
this_module meta.current_module_name
- #let [g!state (code.identifier ["" "*compiler*"])
+ .let [g!state (code.identifier ["" "*compiler*"])
error_msg (code.text (macro.wrong_syntax_error [this_module name]))
export_ast (: (List Code)
(if exported?
diff --git a/stdlib/source/library/lux/math/logic/fuzzy.lux b/stdlib/source/library/lux/math/logic/fuzzy.lux
index d869eb4a7..a449f1ca6 100644
--- a/stdlib/source/library/lux/math/logic/fuzzy.lux
+++ b/stdlib/source/library/lux/math/logic/fuzzy.lux
@@ -67,7 +67,7 @@
//.true
//.false)))
-(def: #export (to_predicate treshold set)
+(def: #export (predicate treshold set)
(All [a] (-> Rev (Fuzzy a) (Predicate a)))
(function (_ elem)
(/.> treshold (set elem))))
diff --git a/stdlib/source/library/lux/math/modulus.lux b/stdlib/source/library/lux/math/modulus.lux
index 8f490d236..05a0ef26d 100644
--- a/stdlib/source/library/lux/math/modulus.lux
+++ b/stdlib/source/library/lux/math/modulus.lux
@@ -20,29 +20,29 @@
(exception: #export zero_cannot_be_a_modulus)
-(abstract: #export (Modulus m)
+(abstract: #export (Modulus %)
Int
{#.doc (doc "A number used as a modulus in modular arithmetic."
"It cannot be 0.")}
(def: #export (modulus value)
- (Ex [m] (-> Int (Try (Modulus m))))
+ (Ex [%] (-> Int (Try (Modulus %))))
(if (i.= +0 value)
(exception.except ..zero_cannot_be_a_modulus [])
(#try.Success (:abstraction value))))
(def: #export divisor
- (All [m] (-> (Modulus m) Int))
+ (All [%] (-> (Modulus %) Int))
(|>> :representation))
(def: #export (= reference subject)
- (All [r s] (-> (Modulus r) (Modulus s) Bit))
+ (All [%r %s] (-> (Modulus %r) (Modulus %s) Bit))
(i.= (:representation reference)
(:representation subject)))
(def: #export (congruent? modulus reference subject)
- (All [m] (-> (Modulus m) Int Int Bit))
+ (All [%] (-> (Modulus %) Int Int Bit))
(|> subject
(i.- reference)
(i.% (:representation modulus))
@@ -50,6 +50,11 @@
)
(syntax: #export (literal {divisor <code>.int})
+ {#.doc (doc "Success!"
+ (literal 123)
+
+ "Failure!"
+ (literal 0))}
(meta.lift
(do try.monad
[_ (..modulus divisor)]
diff --git a/stdlib/source/library/lux/math/number/frac.lux b/stdlib/source/library/lux/math/number/frac.lux
index d2ed4651a..c602db1c5 100644
--- a/stdlib/source/library/lux/math/number/frac.lux
+++ b/stdlib/source/library/lux/math/number/frac.lux
@@ -247,7 +247,7 @@
(def: smallest_exponent
(..log/2 ..smallest))
-(def: #export (to_bits input)
+(def: #export (bits input)
(-> Frac I64)
(.i64 (cond (..not_a_number? input)
..not_a_number_bits
@@ -349,7 +349,7 @@
(..* exponent)
(..* sign)))))
-(def: (split_exponent codec representation)
+(def: (representation_exponent codec representation)
(-> (Codec Text Nat) Text (Try [Text Int]))
(case [("lux text index" 0 "e+" representation)
("lux text index" 0 "E+" representation)
@@ -358,7 +358,7 @@
(^template [<factor> <patterns>]
[<patterns>
(do try.monad
- [#let [after_offset (//nat.+ 2 split_index)
+ [.let [after_offset (//nat.+ 2 split_index)
after_length (//nat.- after_offset ("lux text size" representation))]
exponent (|> representation
("lux text clip" after_offset after_length)
@@ -378,7 +378,7 @@
(Codec Text Frac)
(def: (encode value)
- (let [bits (..to_bits value)
+ (let [bits (..bits value)
mantissa (..mantissa bits)
exponent (//int.- (.int ..double_bias) (..exponent bits))
sign (..sign bits)]
@@ -396,11 +396,11 @@
positive? (text.starts_with? "+" representation)]
(if (or negative? positive?)
(do {! try.monad}
- [[mantissa exponent] (..split_exponent <nat> representation)
+ [[mantissa exponent] (..representation_exponent <nat> representation)
[whole decimal] (case ("lux text index" 0 "." mantissa)
(#.Some split_index)
(do !
- [#let [after_offset (inc split_index)
+ [.let [after_offset (inc split_index)
after_length (//nat.- after_offset ("lux text size" mantissa))]
decimal (|> mantissa
("lux text clip" after_offset after_length)
@@ -410,11 +410,11 @@
#.None
(#try.Failure ("lux text concat" <error> representation)))
- #let [whole ("lux text clip" 1 (dec ("lux text size" whole)) whole)]
+ .let [whole ("lux text clip" 1 (dec ("lux text size" whole)) whole)]
mantissa (\ <nat> decode (case decimal
0 whole
_ ("lux text concat" whole (\ <nat> encode decimal))))
- #let [sign (if negative? 1 0)]]
+ .let [sign (if negative? 1 0)]]
(in (..of_bits
($_ //i64.or
(//i64.left_shifted ..sign_offset (.i64 sign))
@@ -431,7 +431,7 @@
(Hash Frac)
(def: &equivalence ..equivalence)
- (def: hash ..to_bits))
+ (def: hash ..bits))
(def: #export (approximately? margin_of_error standard value)
(-> Frac Frac Frac Bit)
diff --git a/stdlib/source/library/lux/math/number/int.lux b/stdlib/source/library/lux/math/number/int.lux
index 64984968e..610ad296e 100644
--- a/stdlib/source/library/lux/math/number/int.lux
+++ b/stdlib/source/library/lux/math/number/int.lux
@@ -84,21 +84,25 @@
)
(def: #export (/% param subject)
+ {#.doc "Int(eger) [division remainder]."}
(-> Int Int [Int Int])
[(../ param subject)
(..% param subject)])
(def: #export (opposite value)
+ {#.doc (doc "A value of equal magnitude and opposite sign.")}
(-> Int Int)
(..- value +0))
(def: #export (abs x)
+ {#.doc (doc "A value of equal magnitude and positive sign.")}
(-> Int Int)
(if (..< +0 x)
(..* -1 x)
x))
(def: #export (signum x)
+ {#.doc (doc "A value (either -1, 0 or +0) which represents the sign.")}
(-> Int Int)
(cond (..= +0 x) +0
(..< +0 x) -1
@@ -107,6 +111,8 @@
## https://rob.conery.io/2018/08/21/mod-and-remainder-are-not-the-same/
(def: #export (mod divisor dividend)
+ {#.doc (doc "Integer modulo."
+ "Note: The modulo and the remainder are not the same.")}
(All [m] (-> Int Int Int))
(let [remainder (..% divisor dividend)]
(if (or (and (..< +0 divisor)
@@ -124,6 +130,7 @@
(-> Int Bit)
(|>> ..even? not))
+## https://en.wikipedia.org/wiki/Greatest_common_divisor
(def: #export (gcd a b)
{#.doc "Greatest Common Divisor."}
(-> Int Int Int)
@@ -149,6 +156,7 @@
y1 (- (* q y1) y)
b1 (- (* q b1) a1))))))
+## https://en.wikipedia.org/wiki/Least_common_multiple
(def: #export (lcm a b)
{#.doc "Least Common Multiple."}
(-> Int Int Int)
@@ -157,8 +165,7 @@
+0
_
- (|> a (/ (gcd a b)) (* b))
- ))
+ (|> a (/ (gcd a b)) (* b))))
(def: #export frac
(-> Int Frac)
diff --git a/stdlib/source/library/lux/math/number/ratio.lux b/stdlib/source/library/lux/math/number/ratio.lux
index c97849629..a53f87dd9 100644
--- a/stdlib/source/library/lux/math/number/ratio.lux
+++ b/stdlib/source/library/lux/math/number/ratio.lux
@@ -24,6 +24,7 @@
["n" nat ("#\." decimal)]])
(type: #export Ratio
+ {#.doc (doc "An unsigned ratio of numbers.")}
{#numerator Nat
#denominator Nat})
diff --git a/stdlib/source/library/lux/math/random.lux b/stdlib/source/library/lux/math/random.lux
index c2dce8f0a..7d80d6f76 100644
--- a/stdlib/source/library/lux/math/random.lux
+++ b/stdlib/source/library/lux/math/random.lux
@@ -142,6 +142,7 @@
(\ ..monad map (|>> .i64 f.of_bits) ..nat))
(def: #export safe_frac
+ {#.doc (doc "A number in the interval [0.0,1.0].")}
(Random Frac)
(let [mantissa_range (.int (i64.left_shifted 53 1))
mantissa_max (i.frac (dec mantissa_range))]
@@ -270,34 +271,34 @@
[stack Stack (list\fold stack.push stack.empty)]
)
-(def: #export (set Hash<a> size value_gen)
+(def: #export (set hash size value_gen)
(All [a] (-> (Hash a) Nat (Random a) (Random (Set a))))
(if (n.> 0 size)
(do {! ..monad}
- [xs (set Hash<a> (dec size) value_gen)]
+ [xs (set hash (dec size) value_gen)]
(loop [_ []]
(do !
[x value_gen
- #let [xs+ (set.add x xs)]]
+ .let [xs+ (set.add x xs)]]
(if (n.= size (set.size xs+))
(in xs+)
(recur [])))))
- (\ ..monad in (set.empty Hash<a>))))
+ (\ ..monad in (set.empty hash))))
-(def: #export (dictionary Hash<a> size key_gen value_gen)
+(def: #export (dictionary hash size key_gen value_gen)
(All [k v] (-> (Hash k) Nat (Random k) (Random v) (Random (Dictionary k v))))
(if (n.> 0 size)
(do {! ..monad}
- [kv (dictionary Hash<a> (dec size) key_gen value_gen)]
+ [kv (dictionary hash (dec size) key_gen value_gen)]
(loop [_ []]
(do !
[k key_gen
v value_gen
- #let [kv+ (dictionary.put k v kv)]]
+ .let [kv+ (dictionary.put k v kv)]]
(if (n.= size (dictionary.size kv+))
(in kv+)
(recur [])))))
- (\ ..monad in (dictionary.empty Hash<a>))))
+ (\ ..monad in (dictionary.empty hash))))
(def: #export instant
(Random Instant)
@@ -353,13 +354,13 @@
[(recur (update state))
(return state)])))
-(def: #export (pcg32 [increase seed])
+(def: #export (pcg_32 [increase seed])
{#.doc (doc "An implementation of the PCG32 algorithm."
"For more information, please see: http://www.pcg-random.org/")}
(-> [(I64 Any) (I64 Any)] PRNG)
(let [magic 6364136223846793005]
(function (_ _)
- [(|> seed .nat (n.* magic) ("lux i64 +" increase) [increase] pcg32)
+ [(|> seed .nat (n.* magic) ("lux i64 +" increase) [increase] pcg_32)
(let [rot (|> seed .i64 (i64.right_shifted 59))]
(|> seed
(i64.right_shifted 18)
diff --git a/stdlib/source/library/lux/meta.lux b/stdlib/source/library/lux/meta.lux
index 26d7d44c7..a3ae310b0 100644
--- a/stdlib/source/library/lux/meta.lux
+++ b/stdlib/source/library/lux/meta.lux
@@ -279,7 +279,7 @@
(-> Name (Meta Global))
(do ..monad
[name (..normal name)
- #let [[normal_module normal_short] name]]
+ .let [[normal_module normal_short] name]]
(function (_ compiler)
(case (: (Maybe Global)
(do maybe.monad
@@ -364,7 +364,7 @@
{#.doc "Looks-up the type of either a local variable or a definition."}
(-> Name (Meta Type))
(do ..monad
- [#let [[_ _name] name]]
+ [.let [[_ _name] name]]
(case name
["" _name]
(either (var_type _name)
@@ -439,7 +439,7 @@
{#.doc "All the tags associated with a type definition."}
(-> Name (Meta (Maybe (List Name))))
(do ..monad
- [#let [[module name] type_name]
+ [.let [[module name] type_name]
module (..module module)]
(case (plist.get name (get@ #.types module))
(#.Some [tags _])
@@ -488,7 +488,7 @@
{#.doc "Given a tag, finds out what is its index, its related tag-list and its associated type."}
(-> Name (Meta [Nat (List Name) Type]))
(do ..monad
- [#let [[module name] tag_name]
+ [.let [[module name] tag_name]
=module (..module module)
this_module_name ..current_module_name
imported! (..imported? module)]
diff --git a/stdlib/source/library/lux/meta/annotation.lux b/stdlib/source/library/lux/meta/annotation.lux
index a9892473f..b49dd5d8e 100644
--- a/stdlib/source/library/lux/meta/annotation.lux
+++ b/stdlib/source/library/lux/meta/annotation.lux
@@ -1,4 +1,5 @@
(.module:
+ {#.doc (.doc "Machinary for querying annotations on modules and definitions.")}
[library
[lux (#- nat int rev)
[abstract
@@ -70,7 +71,7 @@
[implementation? #.implementation?]
[recursive_type? #.type_rec?]
- [signature? #.sig?]
+ [interface? #.interface?]
)
(def: (text_parser input)
diff --git a/stdlib/source/library/lux/meta/location.lux b/stdlib/source/library/lux/meta/location.lux
index 8738d873a..9216889f0 100644
--- a/stdlib/source/library/lux/meta/location.lux
+++ b/stdlib/source/library/lux/meta/location.lux
@@ -19,13 +19,16 @@
#.column 0})
(macro: #export (here tokens compiler)
+ {#.doc (doc "The Location of the current form."
+ (here))}
(case tokens
#.End
(let [location (get@ #.location compiler)]
(#.Right [compiler
- (list (` [(~ [..dummy (#.Text (get@ #.module location))])
- (~ [..dummy (#.Nat (get@ #.line location))])
- (~ [..dummy (#.Nat (get@ #.column location))])]))]))
+ (list (` (.: .Location
+ [(~ [..dummy (#.Text (get@ #.module location))])
+ (~ [..dummy (#.Nat (get@ #.line location))])
+ (~ [..dummy (#.Nat (get@ #.column location))])])))]))
_
(#.Left (`` (("lux in-module" (~~ (static .prelude_module)) wrong_syntax_error) (name_of ..here))))))
diff --git a/stdlib/source/library/lux/target/jvm/bytecode.lux b/stdlib/source/library/lux/target/jvm/bytecode.lux
index c281f119f..a22ff102b 100644
--- a/stdlib/source/library/lux/target/jvm/bytecode.lux
+++ b/stdlib/source/library/lux/target/jvm/bytecode.lux
@@ -787,7 +787,7 @@
(function (_ [pool environment tracker])
(do try.monad
[actual (/environment.stack environment)
- #let [@here (get@ #program_counter tracker)]
+ .let [@here (get@ #program_counter tracker)]
program_counter' (step estimator @here)]
(in (let [@from @here]
[[pool
@@ -973,7 +973,7 @@
(<method> (..reflection class))
{#//constant/pool.name method
#//constant/pool.descriptor (type.descriptor type)})
- #let [consumption (|> inputs
+ .let [consumption (|> inputs
(list\map ..type_size)
(list\fold n.+ (if <static?> 0 1))
//unsigned.u1
diff --git a/stdlib/source/library/lux/target/jvm/bytecode/environment.lux b/stdlib/source/library/lux/target/jvm/bytecode/environment.lux
index 289e3bd99..6fbdadfa3 100644
--- a/stdlib/source/library/lux/target/jvm/bytecode/environment.lux
+++ b/stdlib/source/library/lux/target/jvm/bytecode/environment.lux
@@ -95,7 +95,7 @@
(do try.monad
[previous (..stack environment)
current (/stack.push amount previous)
- #let [limit (|> environment
+ .let [limit (|> environment
(get@ [#..limit #/limit.stack])
(/stack.max current))]]
(in (|> environment
diff --git a/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux b/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux
index c2532933a..3302b60dc 100644
--- a/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux
+++ b/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux
@@ -616,7 +616,7 @@
[amount_of_afterwards (|> amount_of_afterwards .int ///signed.s4)
maximum (///signed.+/4 minimum amount_of_afterwards)
_ (binary.write/8 offset (hex "AA") binary)
- #let [offset (n.+ (///unsigned.value ..opcode_size) offset)]
+ .let [offset (n.+ (///unsigned.value ..opcode_size) offset)]
_ (case padding
3 (do !
[_ (binary.write/8 offset 0 binary)]
@@ -624,11 +624,11 @@
2 (binary.write/16 offset 0 binary)
1 (binary.write/8 offset 0 binary)
_ (in binary))
- #let [offset (n.+ padding offset)]
+ .let [offset (n.+ padding offset)]
_ (binary.write/32 offset (///signed.value default) binary)
- #let [offset (n.+ (///unsigned.value ..big_jump_size) offset)]
+ .let [offset (n.+ (///unsigned.value ..big_jump_size) offset)]
_ (binary.write/32 offset (///signed.value minimum) binary)
- #let [offset (n.+ (///unsigned.value ..integer_size) offset)]
+ .let [offset (n.+ (///unsigned.value ..integer_size) offset)]
_ (binary.write/32 offset (///signed.value maximum) binary)]
(loop [offset (n.+ (///unsigned.value ..integer_size) offset)
afterwards (: (List Big_Jump)
@@ -678,7 +678,7 @@
(try.assumed
(do {! try.monad}
[_ (binary.write/8 offset (hex "AB") binary)
- #let [offset (n.+ (///unsigned.value ..opcode_size) offset)]
+ .let [offset (n.+ (///unsigned.value ..opcode_size) offset)]
_ (case padding
3 (do !
[_ (binary.write/8 offset 0 binary)]
@@ -686,9 +686,9 @@
2 (binary.write/16 offset 0 binary)
1 (binary.write/8 offset 0 binary)
_ (in binary))
- #let [offset (n.+ padding offset)]
+ .let [offset (n.+ padding offset)]
_ (binary.write/32 offset (///signed.value default) binary)
- #let [offset (n.+ (///unsigned.value ..big_jump_size) offset)]
+ .let [offset (n.+ (///unsigned.value ..big_jump_size) offset)]
_ (binary.write/32 offset amount_of_cases binary)]
(loop [offset (n.+ (///unsigned.value ..integer_size) offset)
cases cases]
diff --git a/stdlib/source/library/lux/target/jvm/constant/pool.lux b/stdlib/source/library/lux/target/jvm/constant/pool.lux
index 6c85e6e61..d050b1e34 100644
--- a/stdlib/source/library/lux/target/jvm/constant/pool.lux
+++ b/stdlib/source/library/lux/target/jvm/constant/pool.lux
@@ -102,14 +102,14 @@
(-> Text (Resource (Index String)))
(do ..monad
[@value (utf8 value)
- #let [value (//.string @value)]]
+ .let [value (//.string @value)]]
(!add #//.String (//.value_equivalence //index.equivalence) value)))
(def: #export (class name)
(-> Internal (Resource (Index Class)))
(do ..monad
[@name (utf8 (//name.read name))
- #let [value (//.class @name)]]
+ .let [value (//.class @name)]]
(!add #//.Class //.class_equivalence value)))
(def: #export (descriptor value)
diff --git a/stdlib/source/library/lux/target/jvm/method.lux b/stdlib/source/library/lux/target/jvm/method.lux
index 6df81d091..a2868b2ac 100644
--- a/stdlib/source/library/lux/target/jvm/method.lux
+++ b/stdlib/source/library/lux/target/jvm/method.lux
@@ -68,7 +68,7 @@
(#try.Failure error)
(function (_ _) (#try.Failure error)))
[environment exceptions instruction output] (//bytecode.resolve environment code)
- #let [bytecode (|> instruction //bytecode/instruction.run format.instance)]
+ .let [bytecode (|> instruction //bytecode/instruction.run format.instance)]
@code (//attribute.code {#//attribute/code.limit (get@ #//bytecode/environment.limit environment)
#//attribute/code.code bytecode
#//attribute/code.exception_table exceptions
diff --git a/stdlib/source/library/lux/target/jvm/reflection.lux b/stdlib/source/library/lux/target/jvm/reflection.lux
index 086a394bb..6827f2be9 100644
--- a/stdlib/source/library/lux/target/jvm/reflection.lux
+++ b/stdlib/source/library/lux/target/jvm/reflection.lux
@@ -174,7 +174,7 @@
(do {! try.monad}
[paramsT (|> reflection
java/lang/reflect/ParameterizedType::getActualTypeArguments
- array.to_list
+ array.list
(monad.map ! parameter))]
(in (/.class (|> raw
(:as (java/lang/Class java/lang/Object))
@@ -297,7 +297,7 @@
(case type
(#.Primitive name params)
(let [class_name (java/lang/Class::getName class)
- class_params (array.to_list (java/lang/Class::getTypeParameters class))
+ class_params (array.list (java/lang/Class::getTypeParameters class))
num_class_params (list.size class_params)
num_type_params (list.size params)]
(if (text\= class_name name)
@@ -360,7 +360,7 @@
(def: #export deprecated?
(-> (array.Array java/lang/annotation/Annotation) Bit)
- (|>> array.to_list
+ (|>> array.list
(list.all (|>> (ffi.check java/lang/Deprecated)))
list.empty?
not))
@@ -370,7 +370,7 @@
(-> Text (java/lang/Class java/lang/Object) (Try [Bit Bit (/.Type Value)]))
(do {! try.monad}
[fieldJ (..field field class)
- #let [modifiers (java/lang/reflect/Field::getModifiers fieldJ)]]
+ .let [modifiers (java/lang/reflect/Field::getModifiers fieldJ)]]
(case (java/lang/reflect/Modifier::isStatic modifiers)
<then?> (|> fieldJ
java/lang/reflect/Field::getGenericType
diff --git a/stdlib/source/library/lux/test.lux b/stdlib/source/library/lux/test.lux
index e3007a55f..f37c0a3c9 100644
--- a/stdlib/source/library/lux/test.lux
+++ b/stdlib/source/library/lux/test.lux
@@ -142,7 +142,7 @@
(-> Text (Random Bit) Test)
(random\map (..assertion message) random))
-(def: pcg32_magic_inc
+(def: pcg_32_magic_inc
Nat
(hex "FEDCBA9876543210"))
@@ -153,7 +153,7 @@
(def: #export (seed value test)
(-> Seed Test Test)
(function (_ prng)
- (let [[_ result] (random.run (random.pcg32 [..pcg32_magic_inc value])
+ (let [[_ result] (random.run (random.pcg_32 [..pcg_32_magic_inc value])
test)]
[prng result])))
@@ -175,7 +175,7 @@
_ (do random.monad
[seed random.nat]
(function (recur prng)
- (let [[prng' instance] (random.run (random.pcg32 [..pcg32_magic_inc seed]) test)]
+ (let [[prng' instance] (random.run (random.pcg_32 [..pcg_32_magic_inc seed]) test)]
[prng' (do {! async.monad}
[[tally documentation] instance]
(if (..failed? tally)
@@ -196,7 +196,7 @@
unexpected (set.difference (get@ #expected_coverage tally)
(get@ #actual_coverage tally))
report (: (-> (Set Name) Text)
- (|>> set.to_list
+ (|>> set.list
(list.sort (\ name.order <))
(exception.listing %.name)))
expected_definitions_to_cover (set.size (get@ #expected_coverage tally))
@@ -244,11 +244,11 @@
(-> Test (Async Nothing))
(do async.monad
[pre (async.future instant.now)
- #let [seed (instant.to_millis pre)
- prng (random.pcg32 [..pcg32_magic_inc seed])]
+ .let [seed (instant.millis pre)
+ prng (random.pcg_32 [..pcg_32_magic_inc seed])]
[tally documentation] (|> test (random.run prng) product.right)
post (async.future instant.now)
- #let [duration (instant.span pre post)
+ .let [duration (instant.span pre post)
_ (debug.log! (format documentation text.new_line text.new_line
(..description duration tally)
text.new_line))]]
@@ -353,9 +353,9 @@
(syntax: #export (covering {module <code>.identifier}
test)
(do meta.monad
- [#let [module (name.module module)]
+ [.let [module (name.module module)]
definitions (meta.definitions module)
- #let [coverage (|> definitions
+ .let [coverage (|> definitions
(list\fold (function (_ [short [exported? _]] aggregate)
(if exported?
(#.Item short aggregate)
@@ -380,7 +380,7 @@
expected_tests
(do random.monad
[seed random.nat
- #let [prng (random.pcg32 [..pcg32_magic_inc seed])
+ .let [prng (random.pcg_32 [..pcg_32_magic_inc seed])
run! (: (-> Test Assertion)
(|>> (random.run prng)
product.right
diff --git a/stdlib/source/library/lux/time.lux b/stdlib/source/library/lux/time.lux
index 42b850964..c1ab45cd2 100644
--- a/stdlib/source/library/lux/time.lux
+++ b/stdlib/source/library/lux/time.lux
@@ -36,7 +36,7 @@
(def: limit
Nat
- (.nat (duration.to_millis duration.day)))
+ (.nat (duration.millis duration.day)))
(exception: #export (time_exceeds_a_day {time Nat})
(exception.report
@@ -92,7 +92,7 @@
(#try.Success (:abstraction milli_seconds))
(exception.except ..time_exceeds_a_day [milli_seconds])))
- (def: #export to_millis
+ (def: #export millis
(-> Time Nat)
(|>> :representation))
@@ -127,12 +127,12 @@
(def: #export parser
(Parser Time)
- (let [to_millis (: (-> Duration Nat)
- (|>> duration.to_millis .nat))
- hour (to_millis duration.hour)
- minute (to_millis duration.minute)
- second (to_millis duration.second)
- millis (to_millis duration.milli_second)]
+ (let [millis (: (-> Duration Nat)
+ (|>> duration.millis .nat))
+ hour (millis duration.hour)
+ minute (millis duration.minute)
+ second (millis duration.second)
+ millis (millis duration.milli_second)]
(do {! <>.monad}
[utc_hour ..hour_parser
_ (<text>.this ..separator)
@@ -154,7 +154,7 @@
(text\compose "0" (n\encode value))
(n\encode value)))
-(def: (adjust_negative space duration)
+(def: (positive space duration)
(-> Duration Duration Duration)
(if (duration.negative? duration)
(duration.merged space duration)
@@ -176,7 +176,7 @@
(def: #export (clock time)
(-> Time Clock)
- (let [time (|> time ..to_millis .int duration.of_millis)
+ (let [time (|> time ..millis .int duration.of_millis)
[hours time] [(duration.query duration.hour time) (duration.framed duration.hour time)]
[minutes time] [(duration.query duration.minute time) (duration.framed duration.minute time)]
[seconds millis] [(duration.query duration.second time) (duration.framed duration.second time)]]
@@ -184,8 +184,8 @@
#minute (.nat minutes)
#second (.nat seconds)
#milli_second (|> millis
- (..adjust_negative duration.second)
- duration.to_millis
+ (..positive duration.second)
+ duration.millis
.nat)}))
(def: #export (time clock)
@@ -195,7 +195,7 @@
(duration.up (get@ #minute clock) duration.minute)
(duration.up (get@ #second clock) duration.second)
(duration.of_millis (.int (get@ #milli_second clock))))
- duration.to_millis
+ duration.millis
.nat
..of_millis))
diff --git a/stdlib/source/library/lux/time/date.lux b/stdlib/source/library/lux/time/date.lux
index c634c8405..92d2a5199 100644
--- a/stdlib/source/library/lux/time/date.lux
+++ b/stdlib/source/library/lux/time/date.lux
@@ -72,15 +72,18 @@
#month Month
#day Nat}
- (def: #export (date year month day)
+ {#.doc (doc "A date specified as a year/month/day triplet.")}
+
+ (def: #export (date year month day_of_month)
+ {#.doc (doc "A date, within the allowed limits.")}
(-> Year Month Nat (Try Date))
- (if (..day_is_within_limits? year month day)
+ (if (..day_is_within_limits? year month day_of_month)
(#try.Success
(:abstraction
{#year year
#month month
- #day day}))
- (exception.except ..invalid_day [year month day])))
+ #day day_of_month}))
+ (exception.except ..invalid_day [year month day_of_month])))
(def: #export epoch
Date
@@ -175,7 +178,7 @@
_ (<text>.this ..separator)
utc_month ..month_parser
_ (<text>.this ..separator)
- #let [month (maybe.assume (dictionary.get utc_month ..month_by_number))]
+ .let [month (maybe.assume (dictionary.get utc_month ..month_by_number))]
utc_day ..section_parser]
(<>.lift (..date utc_year month utc_day))))
@@ -282,7 +285,7 @@
utc_year)))
## http://howardhinnant.github.io/date_algorithms.html
-(def: #export (to_days date)
+(def: #export (days date)
(-> Date Int)
(let [utc_month (|> date ..month //month.number)
civil_year (..civil_year utc_month (..year date))
@@ -345,7 +348,7 @@
(def: &order ..order)
(def: succ
- (|>> ..to_days inc ..of_days))
+ (|>> ..days inc ..of_days))
(def: pred
- (|>> ..to_days dec ..of_days)))
+ (|>> ..days dec ..of_days)))
diff --git a/stdlib/source/library/lux/time/day.lux b/stdlib/source/library/lux/time/day.lux
index d5379cdc1..58bc46c1d 100644
--- a/stdlib/source/library/lux/time/day.lux
+++ b/stdlib/source/library/lux/time/day.lux
@@ -3,11 +3,12 @@
[lux (#- nat)
[abstract
[equivalence (#+ Equivalence)]
+ [hash (#+ Hash)]
[order (#+ Order)]
[enum (#+ Enum)]
[codec (#+ Codec)]]
[control
- ["." try]
+ ["." try (#+ Try)]
["." exception (#+ exception:)]]
[data
["." text]]
@@ -18,6 +19,7 @@
["n" nat]]]]])
(type: #export Day
+ {#.doc (doc "A day of the week.")}
#Sunday
#Monday
#Tuesday
@@ -119,3 +121,62 @@
[#..Saturday]
[#..Sunday])
_ (exception.except ..not_a_day_of_the_week [value]))))
+
+(def: #export week
+ {#.doc (doc "All the days, ordered by when they come in a week.")}
+ (List Day)
+ (list #Sunday
+ #Monday
+ #Tuesday
+ #Wednesday
+ #Thursday
+ #Friday
+ #Saturday))
+
+(with_expansions [<pairs> (as_is [01 #Sunday]
+ [02 #Monday]
+ [03 #Tuesday]
+ [04 #Wednesday]
+ [05 #Thursday]
+ [06 #Friday]
+ [07 #Saturday])]
+ (def: #export (number day)
+ (-> Day Nat)
+ (case day
+ (^template [<number> <day>]
+ [<day> <number>])
+ (<pairs>)))
+
+ (exception: #export (invalid_day {number Nat})
+ (exception.report
+ ["Number" (\ n.decimal encode number)]
+ ["Valid range" ($_ "lux text concat"
+ (\ n.decimal encode (..number #Sunday))
+ " ~ "
+ (\ n.decimal encode (..number #Saturday)))]))
+
+ (def: #export (by_number number)
+ (-> Nat (Try Day))
+ (case number
+ (^template [<number> <day>]
+ [<number> (#try.Success <day>)])
+ (<pairs>)
+ _ (exception.except ..invalid_day [number])))
+ )
+
+(implementation: #export hash
+ (Hash Day)
+
+ (def: &equivalence ..equivalence)
+ (def: (hash day)
+ (case day
+ (^template [<prime> <day>]
+ [<day>
+ <prime>])
+ ([02 #Sunday]
+ [03 #Monday]
+ [05 #Tuesday]
+ [07 #Wednesday]
+ [11 #Thursday]
+ [13 #Friday]
+ [17 #Saturday]))))
diff --git a/stdlib/source/library/lux/time/duration.lux b/stdlib/source/library/lux/time/duration.lux
index c133b1045..ff9ad24d3 100644
--- a/stdlib/source/library/lux/time/duration.lux
+++ b/stdlib/source/library/lux/time/duration.lux
@@ -11,7 +11,7 @@
[control
["." try]
["<>" parser
- ["<t>" text (#+ Parser)]]]
+ ["<.>" text (#+ Parser)]]]
[data
["." text ("#\." monoid)]]
[math
@@ -32,7 +32,7 @@
(-> Int Duration)
(|>> :abstraction))
- (def: #export to_millis
+ (def: #export millis
(-> Duration Int)
(|>> :representation))
@@ -144,7 +144,7 @@
[hours time_left] [(query hour time_left) (framed hour time_left)]
[minutes time_left] [(query minute time_left) (framed minute time_left)]
[seconds time_left] [(query second time_left) (framed second time_left)]
- millis (to_millis time_left)]
+ millis (..millis time_left)]
($_ text\compose
(if signed? ..negative_sign ..positive_sign)
(if (i.= +0 days) "" (text\compose (nat\encode (.nat days)) ..day_suffix))
@@ -158,22 +158,22 @@
(Parser Duration)
(let [section (: (-> Text Text (Parser Nat))
(function (_ suffix false_suffix)
- (|> (<t>.many <t>.decimal)
+ (|> (<text>.many <text>.decimal)
(<>.codec nat.decimal)
(<>.before (case false_suffix
- "" (<t>.this suffix)
- _ (<>.after (<>.not (<t>.this false_suffix))
- (<t>.this suffix))))
+ "" (<text>.this suffix)
+ _ (<>.after (<>.not (<text>.this false_suffix))
+ (<text>.this suffix))))
(<>.else 0))))]
(do <>.monad
- [sign (<>.or (<t>.this ..negative_sign)
- (<t>.this ..positive_sign))
+ [sign (<>.or (<text>.this ..negative_sign)
+ (<text>.this ..positive_sign))
days (section ..day_suffix "")
hours (section hour_suffix "")
minutes (section ..minute_suffix ..milli_second_suffix)
seconds (section ..second_suffix "")
millis (section ..milli_second_suffix "")
- #let [span (|> ..empty
+ .let [span (|> ..empty
(..merged (..up days ..day))
(..merged (..up hours ..hour))
(..merged (..up minutes ..minute))
@@ -187,7 +187,7 @@
(Codec Text Duration)
(def: encode ..encode)
- (def: decode (<t>.run ..parser)))
+ (def: decode (<text>.run ..parser)))
(def: #export (difference from to)
(-> Duration Duration Duration)
diff --git a/stdlib/source/library/lux/time/instant.lux b/stdlib/source/library/lux/time/instant.lux
index c136a6e15..c89ffbd09 100644
--- a/stdlib/source/library/lux/time/instant.lux
+++ b/stdlib/source/library/lux/time/instant.lux
@@ -35,13 +35,13 @@
(abstract: #export Instant
Int
- {#.doc "Instant is defined as milliseconds since the epoch."}
+ {#.doc "Instant is defined as milli-seconds since the epoch."}
(def: #export of_millis
(-> Int Instant)
(|>> :abstraction))
- (def: #export to_millis
+ (def: #export millis
(-> Instant Int)
(|>> :representation))
@@ -49,9 +49,9 @@
(-> Instant Instant Duration)
(duration.of_millis (i.- (:representation from) (:representation to))))
- (def: #export (shift duration instant)
+ (def: #export (after duration instant)
(-> Duration Instant Instant)
- (:abstraction (i.+ (duration.to_millis duration) (:representation instant))))
+ (:abstraction (i.+ (duration.millis duration) (:representation instant))))
(def: #export (relative instant)
(-> Instant Duration)
@@ -59,7 +59,7 @@
(def: #export (absolute offset)
(-> Duration Instant)
- (|> offset duration.to_millis :abstraction))
+ (|> offset duration.millis :abstraction))
(implementation: #export equivalence
(Equivalence Instant)
@@ -87,16 +87,16 @@
)
(def: #export epoch
- {#.doc "The instant corresponding to 1970-01-01T00:00:00Z"}
+ {#.doc "The instant corresponding to 1970-01-01T00:00:00Z."}
Instant
(..of_millis +0))
(def: millis_per_day
(duration.query duration.milli_second duration.day))
-(def: (split_date_time instant)
+(def: (date_time instant)
(-> Instant [Date Duration])
- (let [offset (..to_millis instant)
+ (let [offset (..millis instant)
bce? (i.< +0 offset)
[days day_time] (if bce?
(let [[days millis] (i./% ..millis_per_day offset)]
@@ -119,14 +119,14 @@
(|> (if (\ duration.order < duration.empty duration)
(duration.merged duration.day duration)
duration)
- duration.to_millis
+ duration.millis
.nat
//.of_millis
try.assumed))
(def: (format instant)
(-> Instant Text)
- (let [[date time] (..split_date_time instant)
+ (let [[date time] (..date_time instant)
time (..clock_time time)]
($_ text\compose
(\ date.codec encode date) ..date_suffix
@@ -135,9 +135,9 @@
(def: parser
(Parser Instant)
(do {! <>.monad}
- [days (\ ! map date.to_days date.parser)
+ [days (\ ! map date.days date.parser)
_ (<text>.this ..date_suffix)
- time (\ ! map //.to_millis //.parser)
+ time (\ ! map //.millis //.parser)
_ (<text>.this ..time_suffix)]
(in (|> (if (i.< +0 days)
(|> duration.day
@@ -156,6 +156,7 @@
(def: decode (<text>.run ..parser)))
(def: #export now
+ {#.doc (doc "Yields the current instant, as measured from the operating-system's clock.")}
(IO Instant)
(io (..of_millis (for {@.old ("jvm invokestatic:java.lang.System:currentTimeMillis:")
@.jvm (|> ("jvm member invoke static" [] "java.lang.System" "currentTimeMillis" [])
@@ -199,7 +200,7 @@
(template [<field> <type> <post_processing>]
[(def: #export (<field> instant)
(-> Instant <type>)
- (let [[date time] (..split_date_time instant)]
+ (let [[date time] (..date_time instant)]
(|> <field> <post_processing>)))]
[date Date (|>)]
@@ -232,7 +233,7 @@
(def: #export (of_date_time date time)
(-> Date Time Instant)
- (|> (date.to_days date)
- (i.* (duration.to_millis duration.day))
- (i.+ (.int (//.to_millis time)))
+ (|> (date.days date)
+ (i.* (duration.millis duration.day))
+ (i.+ (.int (//.millis time)))
..of_millis))
diff --git a/stdlib/source/library/lux/time/month.lux b/stdlib/source/library/lux/time/month.lux
index 89dc069f2..d2e7fb0e0 100644
--- a/stdlib/source/library/lux/time/month.lux
+++ b/stdlib/source/library/lux/time/month.lux
@@ -19,6 +19,7 @@
["n" nat]]]]])
(type: #export Month
+ {#.doc (doc "A month of the year.")}
#January
#February
#March
@@ -96,7 +97,23 @@
(Hash Month)
(def: &equivalence ..equivalence)
- (def: hash ..number))
+ (def: (hash month)
+ (case month
+ (^template [<prime> <month>]
+ [<month>
+ <prime>])
+ ([02 #January]
+ [03 #February]
+ [05 #March]
+ [07 #April]
+ [11 #May]
+ [13 #June]
+ [17 #July]
+ [19 #August]
+ [23 #September]
+ [29 #October]
+ [31 #November]
+ [37 #December]))))
(implementation: #export order
(Order Month)
@@ -142,6 +159,7 @@
#January #December)))
(def: #export (days month)
+ {#.doc (doc "The amount of days of a month.")}
(-> Month Nat)
(case month
(^template [<days> <month>]
@@ -163,12 +181,14 @@
[31 #December])))
(def: #export (leap_year_days month)
+ {#.doc (doc "The amount of days of a month (in a leap year).")}
(-> Month Nat)
(case month
#February (inc (..days month))
_ (..days month)))
(def: #export year
+ {#.doc (doc "All the months, ordered by when they come in a year.")}
(List Month)
(list #January
#February
diff --git a/stdlib/source/library/lux/tool/compiler/default/init.lux b/stdlib/source/library/lux/tool/compiler/default/init.lux
index ecd883cfe..898f0edd3 100644
--- a/stdlib/source/library/lux/tool/compiler/default/init.lux
+++ b/stdlib/source/library/lux/tool/compiler/default/init.lux
@@ -125,13 +125,13 @@
(///directive.Operation anchor expression directive
[Source (Payload directive)])))
(do ///phase.monad
- [#let [module (get@ #///.module input)]
+ [.let [module (get@ #///.module input)]
_ (///directive.set_current_module module)]
(///directive.lift_analysis
(do {! ///phase.monad}
[_ (module.create hash module)
_ (monad.map ! module.import dependencies)
- #let [source (///analysis.source (get@ #///.module input) (get@ #///.code input))]
+ .let [source (///analysis.source (get@ #///.module input) (get@ #///.code input))]
_ (///analysis.set_source_code source)]
(in [source [///generation.empty_buffer
artifact.empty]])))))
@@ -176,7 +176,7 @@
(///directive.Operation anchor expression directive
[Requirements (Payload directive)]))))
(do ///phase.monad
- [#let [[pre_buffer pre_registry] pre_payoad]
+ [.let [[pre_buffer pre_registry] pre_payoad]
_ (///directive.lift_generation
(///generation.set_buffer pre_buffer))
_ (///directive.lift_generation
@@ -238,10 +238,10 @@
{#///.dependencies dependencies
#///.process (function (_ state archive)
(do {! try.monad}
- [#let [hash (text\hash (get@ #///.code input))]
+ [.let [hash (text\hash (get@ #///.code input))]
[state [source buffer]] (<| (///phase.run' state)
(..begin dependencies hash input))
- #let [module (get@ #///.module input)]]
+ .let [module (get@ #///.module input)]]
(loop [iteration (<| (///phase.run' state)
(..iteration archive expander module source buffer ///syntax.no_aliases))]
(do !
@@ -250,7 +250,7 @@
#.None
(do !
[[state [analysis_module [final_buffer final_registry]]] (///phase.run' state (..end module))
- #let [descriptor {#descriptor.hash hash
+ .let [descriptor {#descriptor.hash hash
#descriptor.name module
#descriptor.file (get@ #///.file input)
#descriptor.references (set.of_list text.hash dependencies)
diff --git a/stdlib/source/library/lux/tool/compiler/default/platform.lux b/stdlib/source/library/lux/tool/compiler/default/platform.lux
index 8a3f17237..9e54b2522 100644
--- a/stdlib/source/library/lux/tool/compiler/default/platform.lux
+++ b/stdlib/source/library/lux/tool/compiler/default/platform.lux
@@ -104,12 +104,12 @@
(do {! ..monad}
[_ (ioW.prepare system static module_id)
_ (for {@.python (|> output
- row.to_list
+ row.list
(list.chunk 128)
(monad.map ! (monad.map ! write_artifact!))
(: (Action (List (List Any)))))}
(|> output
- row.to_list
+ row.list
(monad.map ..monad write_artifact!)
(: (Action (List Any)))))
document (\ async.monad in
@@ -152,7 +152,7 @@
(do ///phase.monad
[[registry payload] (///directive.lift_generation
(..compile_runtime! platform))
- #let [[descriptor document] [(..runtime_descriptor registry) ..runtime_document]]
+ .let [[descriptor document] [(..runtime_descriptor registry) ..runtime_document]]
archive (///phase.lift (if (archive.reserved? archive archive.runtime_module)
(archive.add archive.runtime_module [descriptor document payload] archive)
(do try.monad
@@ -236,7 +236,7 @@
Import (List Context)
(Async (Try [<State+> Archive]))))
(do {! (try.with async.monad)}
- [#let [state (//init.state (get@ #static.host static)
+ [.let [state (//init.state (get@ #static.host static)
module
expander
host_analysis
@@ -245,7 +245,7 @@
generation_bundle)]
_ (ioW.enable (get@ #&file_system platform) static)
[archive analysis_state bundles] (ioW.thaw (get@ #host platform) (get@ #&file_system platform) static import compilation_sources)
- #let [with_missing_extensions
+ .let [with_missing_extensions
(: (All [<type_vars>]
(-> <Platform> (Program expression directive) <State+> (Async (Try <State+>))))
(function (_ platform program state)
@@ -333,7 +333,7 @@
(list\fold (function (_ previous)
(dictionary.upsert previous ..empty (set.add target)))
with_dependence+transitives
- (set.to_list backward))))))]
+ (set.list backward))))))]
(|> dependence
(update@ #depends_on
(update_dependence
@@ -370,7 +370,7 @@
{duplicates (Set Module)})
(exception.report
["Importer" (%.text importer)]
- ["Duplicates" (%.list %.text (set.to_list duplicates))]))
+ ["Duplicates" (%.list %.text (set.list duplicates))]))
(def: (verify_dependencies importer importee dependence)
(-> Module Module Dependence (Try Any))
@@ -448,7 +448,7 @@
(#try.Success [module_id archive])
(do !
[_ (stm.write [archive state] current)
- #let [[return signal] (:sharing [<type_vars>]
+ .let [[return signal] (:sharing [<type_vars>]
<Context>
initial
@@ -496,7 +496,7 @@
lux_module (document.read $.key document)]
(in [module lux_module])))
(archive.archived archive))
- #let [additions (|> modules
+ .let [additions (|> modules
(list\map product.left)
(set.of_list text.hash))]]
(in (update@ [#extension.state
@@ -538,7 +538,7 @@
context
(function (_ importer import! module_id [archive state] module)
(do {! (try.with async.monad)}
- [#let [state (..set_current_module module state)]
+ [.let [state (..set_current_module module state)]
input (context.read (get@ #&file_system platform)
importer
import
@@ -550,7 +550,7 @@
all_dependencies (: (Set Module)
(set.of_list text.hash (list)))]
(do !
- [#let [new_dependencies (get@ #///.dependencies compilation)
+ [.let [new_dependencies (get@ #///.dependencies compilation)
continue! (:sharing [<type_vars>]
<Platform>
platform
@@ -583,7 +583,7 @@
[archive,document+ (|> new_dependencies
(list\map (import! module))
(monad.seq ..monad))
- #let [archive (|> archive,document+
+ .let [archive (|> archive,document+
(list\map product.left)
(list\fold archive.merged archive))]]
(in [archive (try.assumed
@@ -604,7 +604,7 @@
(#.Right [descriptor document output])
(do !
- [#let [_ (debug.log! (..module_compilation_log module state))
+ [.let [_ (debug.log! (..module_compilation_log module state))
descriptor (set@ #descriptor.references all_dependencies descriptor)]
_ (..cache_module static platform module_id [descriptor document output])]
(case (archive.add module [descriptor document output] archive)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux
index fe7de804f..7f539ae4e 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux
@@ -291,7 +291,7 @@
[idx group variantT] (///extension.lift (meta.tag tag))
_ (//type.with_env
(check.check inputT variantT))
- #let [[lefts right?] (/.choice (list.size group) idx)]]
+ .let [[lefts right?] (/.choice (list.size group) idx)]]
(analyse_pattern (#.Some (list.size group)) inputT (` ((~ (code.nat lefts)) (~ (code.bit right?)) (~+ values))) next)))
_
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux
index a0d02badc..91052853b 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux
@@ -145,7 +145,7 @@
(#/.Complex (#/.Variant [lefts right? value]))
(do ////.monad
[value_coverage (determine value)
- #let [idx (if right?
+ .let [idx (if right?
(inc lefts)
lefts)]]
(in (#Variant (if right?
@@ -324,7 +324,7 @@
## merges can be done.
[_ (#Alt leftS rightS)]
(do {! try.monad}
- [#let [fuse_once (: (-> Coverage (List Coverage)
+ [.let [fuse_once (: (-> Coverage (List Coverage)
(Try [(Maybe Coverage)
(List Coverage)]))
(function (_ coverageA possibilitiesSF)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/function.lux
index d50f72630..0ebfb304f 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/function.lux
@@ -81,7 +81,7 @@
(do !
[[input_id inputT] (//type.with_env check.var)
[output_id outputT] (//type.with_env check.var)
- #let [functionT (#.Function inputT outputT)]
+ .let [functionT (#.Function inputT outputT)]
functionA (recur functionT)
_ (//type.with_env
(check.check expectedT functionT))]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux
index e9e68deb3..3ccfd3551 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux
@@ -190,7 +190,7 @@
#.End
(exception.except ..cannot_get_next_reference_when_there_is_no_scope [])))))
-(def: (ref_to_variable ref)
+(def: (ref_variable ref)
(-> Ref Variable)
(case ref
(#.Local register)
@@ -203,4 +203,4 @@
(-> Scope (List Variable))
(|> scope
(get@ [#.captured #.mappings])
- (list\map (function (_ [_ [_ ref]]) (ref_to_variable ref)))))
+ (list\map (function (_ [_ [_ ref]]) (ref_variable ref)))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux
index 1a787efec..5e3717c5b 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux
@@ -264,7 +264,7 @@
(do {! ///.monad}
[tag (///extension.lift (meta.normal tag))
[idx group variantT] (///extension.lift (meta.tag tag))
- #let [case_size (list.size group)
+ .let [case_size (list.size group)
[lefts right?] (/.choice case_size idx)]
expectedT (///extension.lift meta.expected_type)]
(case expectedT
@@ -309,12 +309,12 @@
(do {! ///.monad}
[head_k (///extension.lift (meta.normal head_k))
[_ tag_set recordT] (///extension.lift (meta.tag head_k))
- #let [size_record (list.size record)
+ .let [size_record (list.size record)
size_ts (list.size tag_set)]
_ (if (n.= size_ts size_record)
(in [])
(/.except ..record_size_mismatch [size_ts size_record recordT record]))
- #let [tuple_range (list.indices size_ts)
+ .let [tuple_range (list.indices size_ts)
tag->idx (dictionary.of_list name.hash (list.zipped/2 tag_set tuple_range))]
idx->val (monad.fold !
(function (_ [key val] idx->val)
@@ -331,7 +331,7 @@
(: (Dictionary Nat Code)
(dictionary.empty n.hash))
record)
- #let [ordered_tuple (list\map (function (_ idx) (maybe.assume (dictionary.get idx idx->val)))
+ .let [ordered_tuple (list\map (function (_ idx) (maybe.assume (dictionary.get idx idx->val)))
tuple_range)]]
(in [ordered_tuple recordT]))
))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux
index 64a9b36b0..a0c430e81 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux
@@ -196,7 +196,7 @@
[($_ <>.and <c>.nat <c>.any)
(function (_ extension phase archive [arity abstractionC])
(do phase.monad
- [#let [inputT (type.tuple (list.repeat arity Any))]
+ [.let [inputT (type.tuple (list.repeat arity Any))]
abstractionA (analysis/type.with_type (-> inputT Any)
(phase archive abstractionC))
_ (analysis/type.infer (for {@.js ffi.Function}
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux
index 8d38f4754..87dca360f 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux
@@ -859,30 +859,30 @@
[reflection_return Return luxT.return]
)
-(def: (class_candidate_parents class_loader from_name fromT to_name to_class)
+(def: (class_candidate_parents class_loader source_name fromT target_name target_class)
(-> java/lang/ClassLoader External .Type External (java/lang/Class java/lang/Object) (Operation (List [[Text .Type] Bit])))
(do {! phase.monad}
- [from_class (phase.lift (reflection!.load class_loader from_name))
- mapping (phase.lift (reflection!.correspond from_class fromT))]
+ [source_class (phase.lift (reflection!.load class_loader source_name))
+ mapping (phase.lift (reflection!.correspond source_class fromT))]
(monad.map !
(function (_ superJT)
(do !
[superJT (phase.lift (reflection!.type superJT))
- #let [super_name (|> superJT ..reflection)]
+ .let [super_name (|> superJT ..reflection)]
super_class (phase.lift (reflection!.load class_loader super_name))
superT (reflection_type mapping superJT)]
- (in [[super_name superT] (java/lang/Class::isAssignableFrom super_class to_class)])))
- (case (java/lang/Class::getGenericSuperclass from_class)
+ (in [[super_name superT] (java/lang/Class::isAssignableFrom super_class target_class)])))
+ (case (java/lang/Class::getGenericSuperclass source_class)
(#.Some super)
- (list& super (array.to_list (java/lang/Class::getGenericInterfaces from_class)))
+ (list& super (array.list (java/lang/Class::getGenericInterfaces source_class)))
#.None
- (if (java/lang/reflect/Modifier::isInterface (java/lang/Class::getModifiers from_class))
+ (if (java/lang/reflect/Modifier::isInterface (java/lang/Class::getModifiers source_class))
(#.Item (:as java/lang/reflect/Type (ffi.class_for java/lang/Object))
- (array.to_list (java/lang/Class::getGenericInterfaces from_class)))
- (array.to_list (java/lang/Class::getGenericInterfaces from_class)))))))
+ (array.list (java/lang/Class::getGenericInterfaces source_class)))
+ (array.list (java/lang/Class::getGenericInterfaces source_class)))))))
-(def: (inheritance_candidate_parents class_loader fromT to_class toT fromC)
+(def: (inheritance_candidate_parents class_loader fromT target_class toT fromC)
(-> java/lang/ClassLoader .Type (java/lang/Class java/lang/Object) .Type Code (Operation (List [[Text .Type] Bit])))
(case fromT
(^ (#.Primitive _ (list& self_classT super_classT super_interfacesT+)))
@@ -892,7 +892,7 @@
[super_name (\ ! map ..reflection (check_jvm superT))
super_class (phase.lift (reflection!.load class_loader super_name))]
(in [[super_name superT]
- (java/lang/Class::isAssignableFrom super_class to_class)])))
+ (java/lang/Class::isAssignableFrom super_class target_class)])))
(list& super_classT super_interfacesT+))
_
@@ -905,18 +905,18 @@
(^ (list fromC))
(do {! phase.monad}
[toT (///.lift meta.expected_type)
- to_name (\ ! map ..reflection (check_jvm toT))
+ target_name (\ ! map ..reflection (check_jvm toT))
[fromT fromA] (typeA.with_inference
(analyse archive fromC))
- from_name (\ ! map ..reflection (check_jvm fromT))
+ source_name (\ ! map ..reflection (check_jvm fromT))
can_cast? (: (Operation Bit)
(`` (cond (~~ (template [<primitive> <object>]
[(let [=primitive (reflection.reflection <primitive>)]
- (or (and (text\= =primitive from_name)
- (or (text\= <object> to_name)
- (text\= =primitive to_name)))
- (and (text\= <object> from_name)
- (text\= =primitive to_name))))
+ (or (and (text\= =primitive source_name)
+ (or (text\= <object> target_name)
+ (text\= =primitive target_name)))
+ (and (text\= <object> source_name)
+ (text\= =primitive target_name))))
(in true)]
[reflection.boolean box.boolean]
@@ -930,25 +930,25 @@
## else
(do !
- [_ (phase.assertion ..primitives_are_not_objects [from_name]
- (not (dictionary.key? ..boxes from_name)))
- _ (phase.assertion ..primitives_are_not_objects [to_name]
- (not (dictionary.key? ..boxes to_name)))
- to_class (phase.lift (reflection!.load class_loader to_name))
- _ (if (text\= ..inheritance_relationship_type_name from_name)
+ [_ (phase.assertion ..primitives_are_not_objects [source_name]
+ (not (dictionary.key? ..boxes source_name)))
+ _ (phase.assertion ..primitives_are_not_objects [target_name]
+ (not (dictionary.key? ..boxes target_name)))
+ target_class (phase.lift (reflection!.load class_loader target_name))
+ _ (if (text\= ..inheritance_relationship_type_name source_name)
(in [])
(do !
- [from_class (phase.lift (reflection!.load class_loader from_name))]
+ [source_class (phase.lift (reflection!.load class_loader source_name))]
(phase.assertion ..cannot_cast [fromT toT fromC]
- (java/lang/Class::isAssignableFrom from_class to_class))))]
- (loop [[current_name currentT] [from_name fromT]]
- (if (text\= to_name current_name)
+ (java/lang/Class::isAssignableFrom source_class target_class))))]
+ (loop [[current_name currentT] [source_name fromT]]
+ (if (text\= target_name current_name)
(in true)
(do !
[candidate_parents (: (Operation (List [[Text .Type] Bit]))
(if (text\= ..inheritance_relationship_type_name current_name)
- (inheritance_candidate_parents class_loader currentT to_class toT fromC)
- (class_candidate_parents class_loader current_name currentT to_name to_class)))]
+ (inheritance_candidate_parents class_loader currentT target_class toT fromC)
+ (class_candidate_parents class_loader current_name currentT target_name target_class)))]
(case (|> candidate_parents
(list.only product.right)
(list\map product.left))
@@ -958,8 +958,8 @@
#.End
(in false)))))))))]
(if can_cast?
- (in (#/////analysis.Extension extension_name (list (/////analysis.text from_name)
- (/////analysis.text to_name)
+ (in (#/////analysis.Extension extension_name (list (/////analysis.text source_name)
+ (/////analysis.text target_name)
fromA)))
(/////analysis.except ..cannot_cast [fromT toT fromC])))
@@ -1089,10 +1089,10 @@
(-> Aliasing (java/lang/Class java/lang/Object) Text Method_Style (List (Type Value)) java/lang/reflect/Method (Operation Bit))
(do phase.monad
[parameters (|> (java/lang/reflect/Method::getGenericParameterTypes method)
- array.to_list
+ array.list
(monad.map try.monad reflection!.type)
phase.lift)
- #let [modifiers (java/lang/reflect/Method::getModifiers method)
+ .let [modifiers (java/lang/reflect/Method::getModifiers method)
correct_class? (java/lang/Object::equals class (java/lang/reflect/Method::getDeclaringClass method))
correct_method? (text\= method_name (java/lang/reflect/Method::getName method))
static_matches? (case method_style
@@ -1135,7 +1135,7 @@
(-> Aliasing (java/lang/Class java/lang/Object) (List (Type Value)) (java/lang/reflect/Constructor java/lang/Object) (Operation Bit))
(do phase.monad
[parameters (|> (java/lang/reflect/Constructor::getGenericParameterTypes constructor)
- array.to_list
+ array.list
(monad.map try.monad reflection!.type)
phase.lift)]
(in (and (java/lang/Object::equals class (java/lang/reflect/Constructor::getDeclaringClass constructor))
@@ -1155,7 +1155,7 @@
true
(list.zipped/2 parameters inputsJT))))))
-(def: idx_to_parameter
+(def: index_parameter
(-> Nat .Type)
(|>> (n.* 2) inc #.Parameter))
@@ -1166,7 +1166,7 @@
list.reversed
list.enumeration
(list\map (function (_ [idx name])
- [name (idx_to_parameter idx)]))
+ [name (index_parameter idx)]))
list.reversed)
num_owner_tvars (list.size owner_tvars)
owner_tvarsT (|> lux_tvars (list.take num_owner_tvars) (list\map product.right))
@@ -1182,15 +1182,15 @@
_
(|> (java/lang/Class::getTypeParameters owner)
- array.to_list
+ array.list
(list\map (|>> java/lang/reflect/TypeVariable::getName))))
method_tvars (|> (java/lang/reflect/Method::getTypeParameters method)
- array.to_list
+ array.list
(list\map (|>> java/lang/reflect/TypeVariable::getName)))
[owner_tvarsT mapping] (jvm_type_var_mapping owner_tvars method_tvars)]
(do {! phase.monad}
[inputsT (|> (java/lang/reflect/Method::getGenericParameterTypes method)
- array.to_list
+ array.list
(monad.map ! (|>> reflection!.type phase.lift))
(phase\map (monad.map ! (..reflection_type mapping)))
phase\join)
@@ -1201,11 +1201,11 @@
(phase\map (..reflection_return mapping))
phase\join)
exceptionsT (|> (java/lang/reflect/Method::getGenericExceptionTypes method)
- array.to_list
+ array.list
(monad.map ! (|>> reflection!.type phase.lift))
(phase\map (monad.map ! (..reflection_type mapping)))
phase\join)
- #let [methodT (<| (type.univ_q (dictionary.size mapping))
+ .let [methodT (<| (type.univ_q (dictionary.size mapping))
(type.function (case method_style
#Static
inputsT
@@ -1222,24 +1222,24 @@
(-> (java/lang/reflect/Constructor java/lang/Object) (Operation Method_Signature))
(let [owner (java/lang/reflect/Constructor::getDeclaringClass constructor)
owner_tvars (|> (java/lang/Class::getTypeParameters owner)
- array.to_list
+ array.list
(list\map (|>> java/lang/reflect/TypeVariable::getName)))
method_tvars (|> (java/lang/reflect/Constructor::getTypeParameters constructor)
- array.to_list
+ array.list
(list\map (|>> java/lang/reflect/TypeVariable::getName)))
[owner_tvarsT mapping] (jvm_type_var_mapping owner_tvars method_tvars)]
(do {! phase.monad}
[inputsT (|> (java/lang/reflect/Constructor::getGenericParameterTypes constructor)
- array.to_list
+ array.list
(monad.map ! (|>> reflection!.type phase.lift))
(phase\map (monad.map ! (reflection_type mapping)))
phase\join)
exceptionsT (|> (java/lang/reflect/Constructor::getGenericExceptionTypes constructor)
- array.to_list
+ array.list
(monad.map ! (|>> reflection!.type phase.lift))
(phase\map (monad.map ! (reflection_type mapping)))
phase\join)
- #let [objectT (#.Primitive (java/lang/Class::getName owner) owner_tvarsT)
+ .let [objectT (#.Primitive (java/lang/Class::getName owner) owner_tvarsT)
constructorT (<| (type.univ_q (dictionary.size mapping))
(type.function inputsT)
objectT)]]
@@ -1268,7 +1268,7 @@
[(def: <name>
(-> <type> (List (Type Var)))
(|>> <method>
- array.to_list
+ array.list
(list\map (|>> java/lang/reflect/TypeVariable::getName jvm.var))))]
[class_type_variables (java/lang/Class java/lang/Object) java/lang/Class::getTypeParameters]
@@ -1286,15 +1286,15 @@
(-> java/lang/ClassLoader (List (Type Var)) External (List (Type Var)) Text Method_Style (List (Type Value)) (Operation Method_Signature))
(do {! phase.monad}
[class (phase.lift (reflection!.load class_loader class_name))
- #let [expected_class_tvars (class_type_variables class)]
+ .let [expected_class_tvars (class_type_variables class)]
candidates (|> class
java/lang/Class::getDeclaredMethods
- array.to_list
+ array.list
(list.only (|>> java/lang/reflect/Method::getName (text\= method_name)))
(monad.map ! (: (-> java/lang/reflect/Method (Operation Evaluation))
(function (_ method)
(do !
- [#let [expected_method_tvars (method_type_variables method)
+ [.let [expected_method_tvars (method_type_variables method)
aliasing (dictionary.merged (..aliasing expected_class_tvars actual_class_tvars)
(..aliasing expected_method_tvars actual_method_tvars))]
passes? (check_method aliasing class method_name method_style inputsJT method)]
@@ -1319,13 +1319,13 @@
(-> java/lang/ClassLoader (List (Type Var)) External (List (Type Var)) (List (Type Value)) (Operation Method_Signature))
(do {! phase.monad}
[class (phase.lift (reflection!.load class_loader class_name))
- #let [expected_class_tvars (class_type_variables class)]
+ .let [expected_class_tvars (class_type_variables class)]
candidates (|> class
java/lang/Class::getConstructors
- array.to_list
+ array.list
(monad.map ! (function (_ constructor)
(do !
- [#let [expected_method_tvars (constructor_type_variables constructor)
+ [.let [expected_method_tvars (constructor_type_variables constructor)
aliasing (dictionary.merged (..aliasing expected_class_tvars actual_class_tvars)
(..aliasing expected_method_tvars actual_method_tvars))]
passes? (check_constructor aliasing class inputsJT constructor)]
@@ -1374,7 +1374,7 @@
(function (_ extension_name analyse archive [class_tvars [class method] method_tvars argsTC])
(do phase.monad
[_ (..ensure_fresh_class! class_loader class)
- #let [argsT (list\map product.left argsTC)]
+ .let [argsT (list\map product.left argsTC)]
[methodT deprecated? exceptionsT] (..method_candidate class_loader class_tvars class method_tvars method #Static argsT)
_ (phase.assertion ..deprecated_method [class method methodT]
(not deprecated?))
@@ -1392,12 +1392,12 @@
(function (_ extension_name analyse archive [class_tvars [class method] method_tvars objectC argsTC])
(do phase.monad
[_ (..ensure_fresh_class! class_loader class)
- #let [argsT (list\map product.left argsTC)]
+ .let [argsT (list\map product.left argsTC)]
[methodT deprecated? exceptionsT] (..method_candidate class_loader class_tvars class method_tvars method #Virtual argsT)
_ (phase.assertion ..deprecated_method [class method methodT]
(not deprecated?))
[outputT allA] (inferenceA.general archive analyse methodT (list& objectC (list\map product.right argsTC)))
- #let [[objectA argsA] (case allA
+ .let [[objectA argsA] (case allA
(#.Item objectA argsA)
[objectA argsA]
@@ -1417,7 +1417,7 @@
(function (_ extension_name analyse archive [class_tvars [class method] method_tvars objectC argsTC])
(do phase.monad
[_ (..ensure_fresh_class! class_loader class)
- #let [argsT (list\map product.left argsTC)]
+ .let [argsT (list\map product.left argsTC)]
[methodT deprecated? exceptionsT] (..method_candidate class_loader class_tvars class method_tvars method #Special argsT)
_ (phase.assertion ..deprecated_method [class method methodT]
(not deprecated?))
@@ -1435,7 +1435,7 @@
(function (_ extension_name analyse archive [class_tvars [class_name method] method_tvars objectC argsTC])
(do phase.monad
[_ (..ensure_fresh_class! class_loader class_name)
- #let [argsT (list\map product.left argsTC)]
+ .let [argsT (list\map product.left argsTC)]
class (phase.lift (reflection!.load class_loader class_name))
_ (phase.assertion non_interface class_name
(java/lang/reflect/Modifier::isInterface (java/lang/Class::getModifiers class)))
@@ -1443,7 +1443,7 @@
_ (phase.assertion ..deprecated_method [class_name method methodT]
(not deprecated?))
[outputT allA] (inferenceA.general archive analyse methodT (list& objectC (list\map product.right argsTC)))
- #let [[objectA argsA] (case allA
+ .let [[objectA argsA] (case allA
(#.Item objectA argsA)
[objectA argsA]
@@ -1464,7 +1464,7 @@
(function (_ extension_name analyse archive [class_tvars class method_tvars argsTC])
(do phase.monad
[_ (..ensure_fresh_class! class_loader class)
- #let [argsT (list\map product.left argsTC)]
+ .let [argsT (list\map product.left argsTC)]
[methodT deprecated? exceptionsT] (..constructor_candidate class_loader class_tvars class method_tvars argsT)
_ (phase.assertion ..deprecated_method [class ..constructor_method methodT]
(not deprecated?))
@@ -1547,23 +1547,23 @@
(-> (java/lang/Class java/lang/Object)
(Try (List [Text (Type Method)])))
(|>> java/lang/Class::getDeclaredMethods
- array.to_list
+ array.list
<only>
(monad.map try.monad
(function (_ method)
(do {! try.monad}
- [#let [type_variables (|> (java/lang/reflect/Method::getTypeParameters method)
- array.to_list
+ [.let [type_variables (|> (java/lang/reflect/Method::getTypeParameters method)
+ array.list
(list\map (|>> java/lang/reflect/TypeVariable::getName
jvm.var)))]
inputs (|> (java/lang/reflect/Method::getGenericParameterTypes method)
- array.to_list
+ array.list
(monad.map ! reflection!.type))
return (|> method
java/lang/reflect/Method::getGenericReturnType
reflection!.return)
exceptions (|> (java/lang/reflect/Method::getGenericExceptionTypes method)
- array.to_list
+ array.list
(monad.map ! reflection!.class))]
(in [(java/lang/reflect/Method::getName method)
(jvm.method [type_variables inputs return exceptions])]))))))]
@@ -2059,10 +2059,10 @@
(def: (super_aliasing class_loader class)
(-> java/lang/ClassLoader (Type Class) (Operation Aliasing))
(do phase.monad
- [#let [[name actual_parameters] (jvm_parser.read_class class)]
+ [.let [[name actual_parameters] (jvm_parser.read_class class)]
class (phase.lift (reflection!.load class_loader name))
- #let [expected_parameters (|> (java/lang/Class::getTypeParameters class)
- array.to_list
+ .let [expected_parameters (|> (java/lang/Class::getTypeParameters class)
+ array.list
(list\map (|>> java/lang/reflect/TypeVariable::getName)))]
_ (phase.assertion ..class_parameter_mismatch [expected_parameters actual_parameters]
(n.= (list.size expected_parameters)
@@ -2100,7 +2100,7 @@
exceptions])
(jvm_alias.method aliasing))])))
methods)
- #let [missing_abstract_methods (mismatched_methods overriden_methods required_abstract_methods)
+ .let [missing_abstract_methods (mismatched_methods overriden_methods required_abstract_methods)
invalid_overriden_methods (mismatched_methods available_methods overriden_methods)]
_ (phase.assertion ..missing_abstract_methods missing_abstract_methods
(list.empty? missing_abstract_methods))
@@ -2127,7 +2127,7 @@
_ (monad.map ! (|>> ..reflection (..ensure_fresh_class! class_loader)) super_interfaces)
parameters (typeA.with_env
(..parameter_types parameters))
- #let [mapping (list\fold (function (_ [parameterJ parameterT] mapping)
+ .let [mapping (list\fold (function (_ [parameterJ parameterT] mapping)
(dictionary.put (jvm_parser.name parameterJ)
parameterT
mapping))
@@ -2153,7 +2153,7 @@
(analyse archive term))]
(in [type termA])))
constructor_args)
- #let [supers (#.Item super_class super_interfaces)]
+ .let [supers (#.Item super_class super_interfaces)]
_ (..require_complete_method_concretion class_loader supers methods)
methodsA (monad.map ! (analyse_overriden_method analyse archive selfT mapping supers) methods)]
(in (#/////analysis.Extension extension_name
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lua.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lua.lux
index 923880ebd..50c8dfe2a 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lua.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lua.lux
@@ -228,7 +228,7 @@
[($_ <>.and <code>.nat <code>.any)
(function (_ extension phase archive [arity abstractionC])
(do phase.monad
- [#let [inputT (type.tuple (list.repeat arity Any))]
+ [.let [inputT (type.tuple (list.repeat arity Any))]
abstractionA (analysis/type.with_type (-> inputT Any)
(phase archive abstractionC))
_ (analysis/type.infer ..Function)]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux
index b5a81bc65..00a5a803a 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux
@@ -196,7 +196,7 @@
[($_ <>.and <code>.nat <code>.any)
(function (_ extension phase archive [arity abstractionC])
(do phase.monad
- [#let [inputT (type.tuple (list.repeat arity Any))]
+ [.let [inputT (type.tuple (list.repeat arity Any))]
abstractionA (analysis/type.with_type (-> inputT Any)
(phase archive abstractionC))
_ (analysis/type.infer ..Function)]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux
index a3265adb0..446c63e08 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux
@@ -263,7 +263,7 @@
[parameters (directive.lift_analysis
(typeA.with_env
(jvm.parameter_types parameters)))
- #let [mapping (list\fold (function (_ [parameterJ parameterT] mapping)
+ .let [mapping (list\fold (function (_ [parameterJ parameterT] mapping)
(dictionary.put (parser.name parameterJ) parameterT mapping))
luxT.fresh
parameters)]
@@ -275,11 +275,11 @@
(monad.map check.monad
(|>> ..signature (luxT.check (luxT.class mapping)))
super_interfaces)))
- #let [selfT (jvm.inheritance_relationship_type (#.Primitive name (list\map product.right parameters))
+ .let [selfT (jvm.inheritance_relationship_type (#.Primitive name (list\map product.right parameters))
super_classT
super_interfaceT+)]
state (extension.lift phase.get_state)
- #let [analyse (get@ [#directive.analysis #directive.phase] state)
+ .let [analyse (get@ [#directive.analysis #directive.phase] state)
synthesize (get@ [#directive.synthesis #directive.phase] state)
generate (get@ [#directive.generation #directive.phase] state)]
methods (monad.map ! (..method_definition [mapping selfT] [analyse synthesize generate])
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux
index d12359d68..ce82ca51e 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux
@@ -88,7 +88,7 @@
(-> Archive Type Code (Operation anchor expression directive [Type expression Any])))
(do phase.monad
[state (///.lift phase.get_state)
- #let [analyse (get@ [#/////directive.analysis #/////directive.phase] state)
+ .let [analyse (get@ [#/////directive.analysis #/////directive.phase] state)
synthesize (get@ [#/////directive.synthesis #/////directive.phase] state)
generate (get@ [#/////directive.generation #/////directive.phase] state)]
[_ codeA] (/////directive.lift_analysis
@@ -124,7 +124,7 @@
(Operation anchor expression directive [Type expression Any])))
(do {! phase.monad}
[state (///.lift phase.get_state)
- #let [analyse (get@ [#/////directive.analysis #/////directive.phase] state)
+ .let [analyse (get@ [#/////directive.analysis #/////directive.phase] state)
synthesize (get@ [#/////directive.synthesis #/////directive.phase] state)
generate (get@ [#/////directive.generation #/////directive.phase] state)]
[_ code//type codeA] (/////directive.lift_analysis
@@ -176,7 +176,7 @@
(Operation anchor expression directive [expression Any])))
(do phase.monad
[state (///.lift phase.get_state)
- #let [analyse (get@ [#/////directive.analysis #/////directive.phase] state)
+ .let [analyse (get@ [#/////directive.analysis #/////directive.phase] state)
synthesize (get@ [#/////directive.synthesis #/////directive.phase] state)
generate (get@ [#/////directive.generation #/////directive.phase] state)]
[_ codeA] (/////directive.lift_analysis
@@ -199,7 +199,7 @@
(-> Expander /////analysis.Bundle (Operation anchor expression directive Any)))
(do phase.monad
[[bundle state] phase.get_state
- #let [eval (/////analysis/evaluation.evaluator expander
+ .let [eval (/////analysis/evaluation.evaluator expander
(get@ [#/////directive.synthesis #/////directive.state] state)
(get@ [#/////directive.generation #/////directive.state] state)
(get@ [#/////directive.generation #/////directive.phase] state))]]
@@ -224,7 +224,7 @@
(do phase.monad
[current_module (/////directive.lift_analysis
(///.lift meta.current_module_name))
- #let [full_name [current_module short_name]]
+ .let [full_name [current_module short_name]]
[type valueT value] (..definition archive full_name #.None valueC)
[_ annotationsT annotations] (evaluate! archive Code annotationsC)
_ (/////directive.lift_analysis
@@ -244,9 +244,9 @@
(do phase.monad
[current_module (/////directive.lift_analysis
(///.lift meta.current_module_name))
- #let [full_name [current_module short_name]]
+ .let [full_name [current_module short_name]]
[_ annotationsT annotations] (evaluate! archive Code annotationsC)
- #let [annotations (:as Code annotations)]
+ .let [annotations (:as Code annotations)]
[type valueT value] (..definition archive full_name (#.Some .Type) valueC)
_ (/////directive.lift_analysis
(do phase.monad
@@ -269,7 +269,7 @@
(function (_ extension_name phase archive [annotationsC imports])
(do {! phase.monad}
[[_ annotationsT annotationsV] (evaluate! archive Code annotationsC)
- #let [annotationsV (:as Code annotationsV)]
+ .let [annotationsV (:as Code annotationsV)]
_ (/////directive.lift_analysis
(do !
[_ (monad.map ! (function (_ [module alias])
@@ -403,7 +403,7 @@
(^ (list programC))
(do phase.monad
[state (///.lift phase.get_state)
- #let [analyse (get@ [#/////directive.analysis #/////directive.phase] state)
+ .let [analyse (get@ [#/////directive.analysis #/////directive.phase] state)
synthesize (get@ [#/////directive.synthesis #/////directive.phase] state)
generate (get@ [#/////directive.generation #/////directive.phase] state)]
programS (prepare_program archive analyse synthesize programC)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux
index 33267e376..240bec8b5 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux
@@ -50,7 +50,7 @@
(template [<name> <op>]
[(def: (<name> [paramG subjectG])
(Binary Expression)
- (<op> subjectG (//runtime.i64//to_number paramG)))]
+ (<op> subjectG (//runtime.i64//number paramG)))]
[i64//left_shifted //runtime.i64//left_shifted]
[i64//right_shifted //runtime.i64//right_shifted]
@@ -67,7 +67,7 @@
(def: i64//char
(Unary Expression)
- (|>> //runtime.i64//to_number
+ (|>> //runtime.i64//number
(list)
(_.apply/* (_.var "String.fromCharCode"))))
@@ -141,7 +141,7 @@
(/.install "*" (binary (product.uncurry //runtime.i64//*)))
(/.install "/" (binary (product.uncurry //runtime.i64///)))
(/.install "%" (binary (product.uncurry //runtime.i64//%)))
- (/.install "f64" (unary //runtime.i64//to_number))
+ (/.install "f64" (unary //runtime.i64//number))
(/.install "char" (unary i64//char))
)))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/host.lux
index 6bb747d54..ff601d308 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/host.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/host.lux
@@ -132,7 +132,7 @@
(function (_ extension phase archive [arity abstractionS])
(do {! ////////phase.monad}
[abstractionG (phase archive abstractionS)
- #let [variable (: (-> Text (Operation Var))
+ .let [variable (: (-> Text (Operation Var))
(|>> generation.gensym
(\ ! map _.var)))]
g!inputs (monad.map ! (function (_ _) (variable "input"))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/common.lux
index 78c75a17b..61d56f794 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/common.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/common.lux
@@ -123,7 +123,7 @@
branchG
(_.goto @end))])))
conditionalsS))
- #let [table (|> conditionalsG+
+ .let [table (|> conditionalsG+
(list\map product.left)
list\join)
conditionalsG (|> conditionalsG+
@@ -225,7 +225,7 @@
[f64::= f64::< type.double _.dcmpg]
)
-(def: (to_string class from)
+(def: (::toString class from)
(-> (Type Class) (Type Primitive) (Bytecode Any))
(_.invokestatic class "toString" (type.method [(list from) ..$String (list)])))
@@ -248,7 +248,7 @@
($_ _.compose
_.l2i
_.i2c
- (..to_string ..$Character type.char))]
+ (..::toString ..$Character type.char))]
[f64::i64
(///value.unwrap type.double)
@@ -258,7 +258,7 @@
[f64::encode
(///value.unwrap type.double)
- (..to_string ..$Double type.double)]
+ (..::toString ..$Double type.double)]
[f64::decode
..ensure_string
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux
index 8f61e7ea8..60e733c8a 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux
@@ -642,7 +642,7 @@
[($_ <>.and <s>.text <s>.text <s>.text)
(function (_ extension_name generate archive [class field unboxed])
(do //////.monad
- [#let [$class (type.class class (list))]]
+ [.let [$class (type.class class (list))]]
(case (dictionary.get unboxed ..primitives)
(#.Some primitive)
(in (_.getstatic $class field primitive))
@@ -659,7 +659,7 @@
(function (_ extension_name generate archive [class field unboxed valueS])
(do //////.monad
[valueG (generate archive valueS)
- #let [$class (type.class class (list))]]
+ .let [$class (type.class class (list))]]
(case (dictionary.get unboxed ..primitives)
(#.Some primitive)
(in ($_ _.compose
@@ -681,7 +681,7 @@
(function (_ extension_name generate archive [class field unboxed objectS])
(do //////.monad
[objectG (generate archive objectS)
- #let [$class (type.class class (list))
+ .let [$class (type.class class (list))
getG (case (dictionary.get unboxed ..primitives)
(#.Some primitive)
(_.getfield $class field primitive)
@@ -701,7 +701,7 @@
(do //////.monad
[valueG (generate archive valueS)
objectG (generate archive objectS)
- #let [$class (type.class class (list))
+ .let [$class (type.class class (list))
putG (case (dictionary.get unboxed ..primitives)
(#.Some primitive)
(_.putfield $class field primitive)
@@ -1011,7 +1011,7 @@
overriden_methods])
(do {! //////.monad}
[[context _] (//////generation.with_new_context archive (in []))
- #let [[module_id artifact_id] context
+ .let [[module_id artifact_id] context
anonymous_class_name (///runtime.class_name context)
class (type.class anonymous_class_name (list))
total_environment (|> overriden_methods
@@ -1021,7 +1021,7 @@
list\join
## Remove duplicates.
(set.from_list //////synthesis.hash)
- set.to_list)
+ set.list)
global_mapping (|> total_environment
## Give them names as "foreign" variables.
list.enumeration
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux
index 3c8338304..f1f6ccaa1 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux
@@ -77,7 +77,7 @@
_.nil))
branchG])))
conditionals))
- #let [closure (_.closure (list @input)
+ .let [closure (_.closure (list @input)
(list\fold (function (_ [test then] else)
(_.if test (_.return then) else))
(_.return elseG)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/host.lux
index b728760c0..873a37be7 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/host.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/host.lux
@@ -170,7 +170,7 @@
(function (_ extension phase archive [arity abstractionS])
(do {! ////////phase.monad}
[abstractionG (phase archive abstractionS)
- #let [variable (: (-> Text (Operation Var))
+ .let [variable (: (-> Text (Operation Var))
(|>> generation.gensym
(\ ! map _.var)))]
g!inputs (monad.map ! (function (_ _)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/common.lux
index ca4de50cf..6cc7e61d0 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/common.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/common.lux
@@ -81,12 +81,12 @@
_.null))
branchG])))
conditionals))
- #let [foreigns (|> conditionals
+ .let [foreigns (|> conditionals
(list\map (|>> product.right synthesis.path/then //case.dependencies))
(list& (//case.dependencies (synthesis.path/then else)))
list.concat
(set.of_list _.hash)
- set.to_list)
+ set.list)
@expression (_.constant (reference.artifact [context_module context_artifact]))
directive (_.define_function @expression (list& (_.parameter @input) (list\map _.reference foreigns))
(list\fold (function (_ [test then] else)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux
index 81107aba9..5be155ab3 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux
@@ -75,7 +75,7 @@
_.none))
branchG])))
conditionals))
- #let [closure (_.lambda (list @input)
+ .let [closure (_.lambda (list @input)
(list\fold (function (_ [test then] else)
(_.? test then else))
elseG
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/host.lux
index 57e53f579..87f343233 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/host.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/host.lux
@@ -130,7 +130,7 @@
(function (_ extension phase archive [arity abstractionS])
(do {! ////////phase.monad}
[abstractionG (phase archive abstractionS)
- #let [variable (: (-> Text (Operation SVar))
+ .let [variable (: (-> Text (Operation SVar))
(|>> generation.gensym
(\ ! map _.var)))]
g!inputs (monad.map ! (function (_ _) (variable "input"))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux
index 7eb4e2a5b..c2119b731 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux
@@ -74,7 +74,7 @@
_.nil))
branchG])))
conditionals))
- #let [closure (_.lambda #.None (list @input)
+ .let [closure (_.lambda #.None (list @input)
(list\fold (function (_ [test then] else)
(_.if test (_.return then) else))
(_.return elseG)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/case.lux
index 098674e45..43c2cab45 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/case.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/case.lux
@@ -246,10 +246,10 @@
[initG (expression archive valueS)
$output (\ ! map (|>> %.nat (format "lux_case_output") _.var) /////generation.next)
pattern_matching! (pattern_matching $output expression archive pathP)
- #let [storage (|> pathP
+ .let [storage (|> pathP
////synthesis/case.storage
(get@ #////synthesis/case.bindings)
- set.to_list
+ set.list
(list\map (function (_ register)
[(..register register)
_.nil])))]]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/function.lux
index fab6fe24c..ad4bedbfa 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/function.lux
@@ -67,7 +67,7 @@
(/////generation.with_anchor [@scope 1]
(expression archive bodyS)))
closureG+ (monad.map ! (expression archive) environment)
- #let [@curried (_.var "curried")
+ .let [@curried (_.var "curried")
@missing (_.var "missing")
arityG (|> arity .int _.int)
@num_args (_.var "num_args")
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/loop.lux
index 5ceb08bc3..61b5cf216 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/loop.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/loop.lux
@@ -62,7 +62,7 @@
(do {! ///////phase.monad}
[[tag offset] /////generation.anchor
argsO+ (monad.map ! (expression archive) argsS+)
- #let [bindings (|> argsO+
+ .let [bindings (|> argsO+
list.enumeration
(list\map (|>> product.left (n.+ offset) //case.register))
_.args)]]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/function.lux
index d4b81f29b..f2f326f8f 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/function.lux
@@ -74,7 +74,7 @@
(/////generation.context archive))]
(/////generation.with_anchor [1 scope]
(statement expression archive bodyS))))
- #let [arityO (|> arity .int _.i32)
+ .let [arityO (|> arity .int _.i32)
@num_args (_.var "num_args")
@scope (..@scope function_name)
@self (_.var (///reference.artifact function_name))
@@ -88,7 +88,7 @@
initialize_self!
(list.indices arity))]
environment (monad.map ! (expression archive) environment)
- #let [[definition instantiation] (with_closure @self environment
+ .let [[definition instantiation] (with_closure @self environment
($_ _.then
(_.define @num_args (_.the "length" @@arguments))
(_.cond (list [(|> @num_args (_.= arityO))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux
index d351cd6ac..350faeeec 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux
@@ -297,7 +297,7 @@
(|> i64 (_.the ..i64_low_field))
(|> i64 (_.the ..i64_low_field) (_.+ i64//2^32)))))
-(runtime: (i64//to_number i64)
+(runtime: (i64//number i64)
(_.return (|> i64
(_.the ..i64_high_field)
(_.* i64//2^32)
@@ -593,8 +593,8 @@
(let [approximate_result' (i64//of_number approximate)
approx_remainder (i64//* parameter approximate_result)]
($_ _.then
- (_.define approximate (|> (i64//to_number remainder)
- (_./ (i64//to_number parameter))
+ (_.define approximate (|> (i64//number remainder)
+ (_./ (i64//number parameter))
(_.apply/1 (_.var "Math.floor"))
(_.apply/2 (_.var "Math.max") (_.i32 +1))))
(_.define log2 (|> approximate
@@ -646,7 +646,7 @@
@i64//=
@i64//+
@i64//opposite
- @i64//to_number
+ @i64//number
@i64//of_number
@i64//-
@i64//*
@@ -659,7 +659,7 @@
(runtime: (text//index start part text)
(with_vars [idx]
($_ _.then
- (_.define idx (|> text (_.do "indexOf" (list part (i64//to_number start)))))
+ (_.define idx (|> text (_.do "indexOf" (list part (i64//number start)))))
(_.return (_.? (_.= (_.i32 -1) idx)
..none
(..some (i64//of_number idx)))))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux
index 640543f45..d13e7ebed 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux
@@ -102,7 +102,7 @@
[function_context bodyG] (generation.with_new_context archive
(generation.with_anchor [@begin ..this_offset]
(generate archive bodyS)))
- #let [function_class (//runtime.class_name function_context)]
+ .let [function_class (//runtime.class_name function_context)]
[fields methods instance] (..with generate archive @begin function_class environment arity bodyG)
class (phase.lift (class.class version.v6_0
..modifier
@@ -111,7 +111,7 @@
fields
methods
(row.row)))
- #let [bytecode (format.run class.writer class)]
+ .let [bytecode (format.run class.writer class)]
_ (generation.execute! [function_class bytecode])
_ (generation.save! function_class #.None [function_class bytecode])]
(in instance)))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/apply.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/apply.lux
index d3e13091a..46b871096 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/apply.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/apply.lux
@@ -97,7 +97,7 @@
@labelsT (|> _.new_label
(list.repeat (dec num_partials))
(monad.seq _.monad))
- #let [cases (|> (list\compose (#.Item [@labelsH @labelsT])
+ .let [cases (|> (list\compose (#.Item [@labelsH @labelsT])
(list @default))
list.enumeration
(list\map (function (_ [stage @case])
@@ -121,15 +121,15 @@
_.areturn)
has_more_than_necessary?
- (let [inputs_to_completion (|> function_arity (n.- stage))
- inputs_left (|> apply_arity (n.- inputs_to_completion))]
+ (let [arity_inputs (|> function_arity (n.- stage))
+ additional_inputs (|> apply_arity (n.- arity_inputs))]
($_ _.compose
////reference.this
(_.invokevirtual class //reset.name (//reset.type class))
current_partials
- (..inputs ..this_offset inputs_to_completion)
+ (..inputs ..this_offset arity_inputs)
(_.invokevirtual class //implementation.name (//implementation.type function_arity))
- (apply (n.+ ..this_offset inputs_to_completion) inputs_left)
+ (apply (n.+ ..this_offset arity_inputs) additional_inputs)
_.areturn))
## (i.< over_extent (.int stage))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux
index f8961db37..91c433788 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux
@@ -51,7 +51,7 @@
..no_op])
(do !
[fetchG (translate archive updateS)
- #let [storeG (_.astore register)]]
+ .let [storeG (_.astore register)]]
(in [fetchG storeG]))))))]
(in ($_ _.compose
## It may look weird that first I fetch all the values separately,
@@ -78,7 +78,7 @@
initsI+ (monad.map ! (translate archive) initsS+)
iterationG (generation.with_anchor [@begin offset]
(translate archive iterationS))
- #let [initializationG (|> (list.enumeration initsI+)
+ .let [initializationG (|> (list.enumeration initsI+)
(list\map (function (_ [index initG])
($_ _.compose
initG
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux
index 80315db66..a1ae79528 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux
@@ -296,7 +296,7 @@
@tags_match! _.new_label
@maybe_nested _.new_label
@mismatch! _.new_label
- #let [::tag ($_ _.compose
+ .let [::tag ($_ _.compose
(..get ..variant_tag)
(//value.unwrap type.int))
::last? (..get ..variant_last?)
@@ -397,7 +397,7 @@
(do _.monad
[@loop _.new_label
@recursive _.new_label
- #let [::left ($_ _.compose
+ .let [::left ($_ _.compose
$lefts _.aaload)]]
($_ _.compose
(_.set_label @loop)
@@ -416,7 +416,7 @@
[@loop _.new_label
@not_tail _.new_label
@slice _.new_label
- #let [$right ($_ _.compose
+ .let [$right ($_ _.compose
$lefts
_.iconst_1
_.iadd)
@@ -468,7 +468,7 @@
(do _.monad
[@try _.new_label
@handler _.new_label
- #let [$unsafe ..this
+ .let [$unsafe ..this
unit _.aconst_null
^StringWriter (type.class "java.io.StringWriter" (list))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/case.lux
index 6d1fda16c..273e1d0ae 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/case.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/case.lux
@@ -251,7 +251,7 @@
(-> Path (List Var))
(|>> ////synthesis/case.storage
(get@ #////synthesis/case.dependencies)
- set.to_list
+ set.list
(list\map (function (_ variable)
(.case variable
(#///////variable.Local register)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/function.lux
index 28c33a86a..21c78c6f9 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/function.lux
@@ -73,7 +73,7 @@
(/////generation.with_anchor [1 @scope]
(statement expression archive bodyS))))
closureO+ (monad.map ! (expression archive) environment)
- #let [@curried (_.var "curried")
+ .let [@curried (_.var "curried")
arityO (|> arity .int _.int)
@num_args (_.var "num_args")
@scope (..@scope function_name)
@@ -88,7 +88,7 @@
pack (|>> (list) _.array)
unpack (_.apply/1 (_.var "table.unpack"))
@var_args (_.var "...")]
- #let [[definition instantiation] (with_closure closureO+ @self (list @var_args)
+ .let [[definition instantiation] (with_closure closureO+ @self (list @var_args)
($_ _.then
(_.local/1 @curried (pack @var_args))
(_.local/1 @num_args (_.length @curried))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/loop.lux
index 5d44bcc3c..d9ae9c51f 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/loop.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/loop.lux
@@ -83,7 +83,7 @@
(do {! ///////phase.monad}
[[[artifact_module artifact_id] [initsO+ scope!]] (/////generation.with_new_context archive
(scope! statement expression archive true [start initsS+ bodyS]))
- #let [@loop (_.var (///reference.artifact [artifact_module artifact_id]))
+ .let [@loop (_.var (///reference.artifact [artifact_module artifact_id]))
locals (|> initsO+
list.enumeration
(list\map (|>> product.left (n.+ start) //case.register)))
@@ -92,7 +92,7 @@
//case.dependencies
(set.of_list _.hash)
(set.difference (set.of_list _.hash locals))
- set.to_list)
+ set.list)
#.End
[(_.function @loop locals
scope!)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/case.lux
index 549d19954..3bbbd7d21 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/case.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/case.lux
@@ -265,7 +265,7 @@
(-> Path (List Var))
(|>> ////synthesis/case.storage
(get@ #////synthesis/case.dependencies)
- set.to_list
+ set.list
(list\map (function (_ variable)
(.case variable
(#///////variable.Local register)
@@ -289,7 +289,7 @@
(do {! ///////phase.monad}
[[[case_module case_artifact] case!] (/////generation.with_new_context archive
(case! statement expression archive [valueS pathP]))
- #let [@case (_.constant (///reference.artifact [case_module case_artifact]))
+ .let [@case (_.constant (///reference.artifact [case_module case_artifact]))
@dependencies+ (..dependencies (/////synthesis.path/seq (/////synthesis.path/then valueS)
pathP))
directive (_.define_function @case (list\map _.parameter @dependencies+) case!)]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/function.lux
index 6318a9d88..93a099ce0 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/function.lux
@@ -77,7 +77,7 @@
(/////generation.with_anchor [1 @scope]
(statement expression archive bodyS))))
closureG+ (monad.map ! (expression archive) environment)
- #let [@curried (_.var "curried")
+ .let [@curried (_.var "curried")
arityG (|> arity .int _.int)
@num_args (_.var "num_args")
@scope (..@scope function_name)
@@ -90,7 +90,7 @@
(_.set! (..input post) (_.item (|> post .int _.int) @curried))))
initialize_self!
(list.indices arity))]
- #let [[definition instantiation] (..with_closure closureG+ @selfG @selfL
+ .let [[definition instantiation] (..with_closure closureG+ @selfG @selfL
($_ _.then
(_.set! @num_args (_.func_num_args/0 []))
(_.set! @curried (_.func_get_args/0 []))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/loop.lux
index 0c3c94f1f..54a001a41 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/loop.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/loop.lux
@@ -78,7 +78,7 @@
(do {! ///////phase.monad}
[[[loop_module loop_artifact] scope!] (/////generation.with_new_context archive
(..scope! statement expression archive [start initsS+ bodyS]))
- #let [locals (|> initsS+
+ .let [locals (|> initsS+
list.enumeration
(list\map (|>> product.left (n.+ start) //case.register _.parameter)))
@loop (_.constant (///reference.artifact [loop_module loop_artifact]))
@@ -91,7 +91,7 @@
(case (|> (list\map referenced_variables initsS+)
(list\fold set.union (referenced_variables bodyS))
(set.difference loop_variables)
- set.to_list)
+ set.list)
#.End
[(_.define_function @loop (list) scope!)
@loop]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux
index fa1a42e49..59ccb6098 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux
@@ -299,7 +299,7 @@
(-> Path (List SVar))
(|>> case.storage
(get@ #case.dependencies)
- set.to_list
+ set.list
(list\map (function (_ variable)
(.case variable
(#///////variable.Local register)
@@ -324,7 +324,7 @@
(do ///////phase.monad
[[[case_module case_artifact] pattern_matching!] (/////generation.with_new_context archive
(case! true statement expression archive [valueS pathP]))
- #let [@case (_.var (///reference.artifact [case_module case_artifact]))
+ .let [@case (_.var (///reference.artifact [case_module case_artifact]))
@dependencies+ (..dependencies (/////synthesis.path/seq (/////synthesis.path/then valueS)
pathP))
directive (_.def @case @dependencies+
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/function.lux
index fd225dfe4..c7ff46333 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/function.lux
@@ -53,7 +53,7 @@
_
(do {! ///////phase.monad}
- [#let [directive (_.def @function
+ [.let [directive (_.def @function
(|> (list.enumeration inits)
(list\map (|>> product.left ..capture)))
($_ _.then
@@ -73,7 +73,7 @@
(/////generation.with_anchor 1
(statement expression archive bodyS)))
environment (monad.map ! (expression archive) environment)
- #let [@curried (_.var "curried")
+ .let [@curried (_.var "curried")
arityO (|> arity .int _.int)
@num_args (_.var "num_args")
@self (_.var (///reference.artifact [function_module function_artifact]))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/loop.lux
index 37296dd7c..8f4386405 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/loop.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/loop.lux
@@ -78,7 +78,7 @@
[[loop_module loop_artifact] body!] (/////generation.with_new_context archive
(/////generation.with_anchor start
(statement expression archive bodyS)))
- #let [@loop (_.var (///reference.artifact [loop_module loop_artifact]))
+ .let [@loop (_.var (///reference.artifact [loop_module loop_artifact]))
locals (|> initsS+
list.enumeration
(list\map (|>> product.left (n.+ start) //case.register)))
@@ -90,7 +90,7 @@
//case.dependencies
(set.of_list _.hash)
(set.difference (set.of_list _.hash locals))
- set.to_list)
+ set.list)
#.End
[actual_loop
@loop]
@@ -112,7 +112,7 @@
[offset /////generation.anchor
@temp (//case.gensym "lux_recur_values")
argsO+ (monad.map ! (expression archive) argsS+)
- #let [re_binds (|> argsO+
+ .let [re_binds (|> argsO+
list.enumeration
(list\map (function (_ [idx _])
(_.item (_.int (.int idx)) @temp))))]]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/function.lux
index 850f99475..dfdec59ce 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/function.lux
@@ -51,7 +51,7 @@
_
(do ///////phase.monad
- [#let [closure_definition (_.set! $function
+ [.let [closure_definition (_.set! $function
(_.function (|> inits
list.size
list.indices
@@ -81,7 +81,7 @@
(/////generation.with_anchor $self
(expression archive bodyS))))
closureO+ (monad.map ! (expression archive) environment)
- #let [arityO (|> arity .int _.int)
+ .let [arityO (|> arity .int _.int)
$num_args (_.var "num_args")
$self (_.var (///reference.artifact [function_module function_artifact]))
apply_poly (.function (_ args func)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux
index 7de7310d6..18157701d 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux
@@ -251,7 +251,7 @@
(install "%" (binary int//rem))
(install "=" (binary int//=))
(install "<" (binary int//<))
- (install "to-frac" (unary runtimeT.int//to_float))
+ (install "to-frac" (unary runtimeT.int//float))
(install "char" (unary int//char)))))
(def: (frac//encode value)
@@ -310,7 +310,7 @@
(def: (io//exit input)
Unary
(r.apply_kw (list)
- (list ["status" (runtimeT.int//to_float input)])
+ (list ["status" (runtimeT.int//float input)])
(r.global "quit")))
(def: (void code)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux
index f71070979..824f53012 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux
@@ -185,7 +185,7 @@
low
(|> low (_.+ f2^32))))))
-(runtime: (i64::to_float input)
+(runtime: (i64::float input)
(let [high (|> input
(_.item (_.string ..i64_high_field))
high_shift)
@@ -481,7 +481,7 @@
(_.set! remainder subject)
(_.while (|> (|> remainder (i64::< param))
(_.or (|> remainder (i64::= param))))
- (let [calc_rough_estimate (_.apply (list (|> (i64::to_float remainder) (_./ (i64::to_float param))))
+ (let [calc_rough_estimate (_.apply (list (|> (i64::float remainder) (_./ (i64::float param))))
(_.var "floor"))
calc_approximate_result (i64::of_float approximate)
calc_approximate_remainder (|> approximate_result (i64::* param))
@@ -698,7 +698,7 @@
@i64::opposite
@i64::-one
@i64::unsigned_low
- @i64::to_float
+ @i64::float
@i64::*
@i64::/
@i64::%
@@ -743,7 +743,7 @@
(runtime: (text::index subject param start)
(with_vars [idx startF subjectL]
($_ _.then
- (_.set! startF (i64::to_float start))
+ (_.set! startF (i64::float start))
(_.set! subjectL (text_length subject))
(_.if (|> startF (within? subjectL))
($_ _.then
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/function.lux
index e7e831a77..281ea380a 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/function.lux
@@ -70,7 +70,7 @@
(/////generation.with_anchor 1
(statement expression archive bodyS)))
closureO+ (monad.map ! (expression archive) environment)
- #let [function_name (///reference.artifact [function_module function_artifact])
+ .let [function_name (///reference.artifact [function_module function_artifact])
@curried (_.local "curried")
arityO (|> arity .int _.int)
limitO (|> arity dec .int _.int)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/loop.lux
index 5c255fcc9..2cf1506c7 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/loop.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/loop.lux
@@ -86,7 +86,7 @@
[offset /////generation.anchor
@temp (//case.gensym "lux_recur_values")
argsO+ (monad.map ! (expression archive) argsS+)
- #let [re_binds (|> argsO+
+ .let [re_binds (|> argsO+
list.enumeration
(list\map (function (_ [idx _])
(_.item (_.int (.int idx)) @temp))))]]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/function.lux
index dd19db665..7feb087f2 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/function.lux
@@ -70,7 +70,7 @@
(/////generation.with_anchor @self
(expression archive bodyS))))
closureO+ (monad.map ! (expression archive) environment)
- #let [arityO (|> arity .int _.int)
+ .let [arityO (|> arity .int _.int)
apply_poly (.function (_ args func)
(_.apply/2 (_.var "apply") func args))
@num_args (_.var "num_args")
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux
index ab798a01b..db9cbdc59 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux
@@ -295,22 +295,22 @@
(#/.Seq pre post)
(do try.monad
- [#let [baseline (|> redundancy
+ [.let [baseline (|> redundancy
dictionary.keys
(set.of_list n.hash))]
[redundancy pre] (recur [redundancy pre])
- #let [bindings (|> redundancy
+ .let [bindings (|> redundancy
dictionary.keys
(set.of_list n.hash)
(set.difference baseline))]
[redundancy post] (recur [redundancy post])
- #let [redundants (|> redundancy
+ .let [redundants (|> redundancy
dictionary.entries
(list.only (function (_ [register redundant?])
(and (set.member? bindings register)
redundant?)))
(list\map product.left))]]
- (in [(list\fold dictionary.remove redundancy (set.to_list bindings))
+ (in [(list\fold dictionary.remove redundancy (set.list bindings))
(|> redundants
(list.sort n.>)
(list\fold (..remove_local_from_path ..remove_local) (#/.Seq pre post)))]))
@@ -367,7 +367,7 @@
[[redundancy input] (optimization' [redundancy input])
redundancy (..declare register redundancy)
[redundancy output] (optimization' [redundancy output])
- #let [redundant? (|> redundancy
+ .let [redundant? (|> redundancy
(dictionary.get register)
(maybe.else ..necessary!))]]
(in [(dictionary.remove register redundancy)
@@ -403,7 +403,7 @@
(#/.Scope [start inits iteration])
(do try.monad
[[redundancy inits] (..list_optimization optimization' [redundancy inits])
- #let [[extension redundancy] (..extended start (list.size inits) redundancy)]
+ .let [[extension redundancy] (..extended start (list.size inits) redundancy)]
[redundancy iteration] (optimization' [redundancy iteration])]
(in [(list\fold dictionary.remove redundancy extension)
(#/.Control (#/.Loop (#/.Scope [start inits iteration])))]))
diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/artifact.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/artifact.lux
index 76266ad19..cab4eb2d3 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/archive/artifact.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/archive/artifact.lux
@@ -81,7 +81,7 @@
(|> registry
:representation
(get@ #artifacts)
- row.to_list
+ row.list
(list.all (|>> (get@ #category)
(case> (<tag> name) (#.Some name)
_ #.None)))))]
diff --git a/stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux b/stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux
index 4d9af7859..ecce5c337 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux
@@ -55,13 +55,13 @@
(let [memo (: (Memo Module Ancestry)
(function (_ recur module)
(do {! state.monad}
- [#let [parents (case (archive.find module archive)
+ [.let [parents (case (archive.find module archive)
(#try.Success [descriptor document])
(get@ #descriptor.references descriptor)
(#try.Failure error)
..fresh)]
- ancestors (monad.map ! recur (set.to_list parents))]
+ ancestors (monad.map ! recur (set.list parents))]
(in (list\fold set.union parents ancestors)))))
ancestry (memo.open memo)]
(list\fold (function (_ module memory)
diff --git a/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux b/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux
index c5ebc6bad..125360e58 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux
@@ -101,7 +101,7 @@
(def: #export (prepare fs static module_id)
(-> (file.System Async) Static archive.ID (Async (Try Any)))
(do {! async.monad}
- [#let [module (..module fs static module_id)]
+ [.let [module (..module fs static module_id)]
module_exists? (\ fs directory? module)]
(if module_exists?
(in (#try.Success []))
@@ -216,7 +216,7 @@
(Try [(Document .Module) Bundles Output])))
(do {! try.monad}
[[definitions bundles] (: (Try [Definitions Bundles Output])
- (loop [input (row.to_list expected)
+ (loop [input (row.list expected)
definitions (: Definitions
(dictionary.empty text.hash))
bundles ..empty_bundles
@@ -226,12 +226,12 @@
(#.Item [[artifact_id artifact_category] input'])
(case (do !
[data (try.of_maybe (dictionary.get (format (%.nat artifact_id) extension) actual))
- #let [context [module_id artifact_id]
+ .let [context [module_id artifact_id]
directive (\ host ingest context data)]]
(case artifact_category
#artifact.Anonymous
(do !
- [#let [output (row.add [artifact_id #.None data] output)]
+ [.let [output (row.add [artifact_id #.None data] output)]
_ (\ host re_learn context #.None directive)]
(in [definitions
[analysers
@@ -260,7 +260,7 @@
(#artifact.Analyser extension)
(do !
- [#let [output (row.add [artifact_id #.None data] output)]
+ [.let [output (row.add [artifact_id #.None data] output)]
value (\ host re_load context #.None directive)]
(in [definitions
[(dictionary.put extension (:as analysis.Handler value) analysers)
@@ -271,7 +271,7 @@
(#artifact.Synthesizer extension)
(do !
- [#let [output (row.add [artifact_id #.None data] output)]
+ [.let [output (row.add [artifact_id #.None data] output)]
value (\ host re_load context #.None directive)]
(in [definitions
[analysers
@@ -282,7 +282,7 @@
(#artifact.Generator extension)
(do !
- [#let [output (row.add [artifact_id #.None data] output)]
+ [.let [output (row.add [artifact_id #.None data] output)]
value (\ host re_load context #.None directive)]
(in [definitions
[analysers
@@ -293,7 +293,7 @@
(#artifact.Directive extension)
(do !
- [#let [output (row.add [artifact_id #.None data] output)]
+ [.let [output (row.add [artifact_id #.None data] output)]
value (\ host re_load context #.None directive)]
(in [definitions
[analysers
@@ -304,7 +304,7 @@
(#artifact.Custom name)
(do !
- [#let [output (row.add [artifact_id (#.Some name) data] output)]
+ [.let [output (row.add [artifact_id (#.Some name) data] output)]
_ (\ host re_learn context (#.Some name) directive)]
(in [definitions
[analysers
@@ -345,14 +345,14 @@
Bundles]))))
(do (try.with async.monad)
[actual (cached_artifacts fs static module_id)
- #let [expected (|> descriptor (get@ #descriptor.registry) artifact.artifacts)]
+ .let [expected (|> descriptor (get@ #descriptor.registry) artifact.artifacts)]
[document bundles output] (async\in (loaded_document (get@ #static.artifact_extension static) host_environment module_id expected actual document))]
(in [[descriptor document output] bundles])))
(def: (purge! fs static [module_name module_id])
(-> (file.System Async) Static [Module archive.ID] (Async (Try Any)))
(do {! (try.with async.monad)}
- [#let [cache (..module fs static module_id)]
+ [.let [cache (..module fs static module_id)]
_ (|> cache
(\ fs directory_files)
(\ ! map (monad.map ! (\ fs delete)))
@@ -391,7 +391,7 @@
purge
(if (|> descriptor
(get@ #descriptor.references)
- set.to_list
+ set.list
(list.any? purged?))
(dictionary.put module_name module_id purge)
purge))))
@@ -429,7 +429,7 @@
(\ try.monad map (dependency.load_order $.key))
(\ try.monad join)
async\in)
- #let [purge (..full_purge pre_loaded_caches load_order)]
+ .let [purge (..full_purge pre_loaded_caches load_order)]
_ (|> purge
dictionary.entries
(monad.map ! (..purge! fs static)))
diff --git a/stdlib/source/library/lux/tool/compiler/meta/packager.lux b/stdlib/source/library/lux/tool/compiler/meta/packager.lux
index 6cb17c7b6..07ac4be8c 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/packager.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/packager.lux
@@ -37,6 +37,6 @@
(|> descriptor
(get@ #descriptor.registry)
artifact.artifacts
- row.to_list
+ row.list
(list\map (|>> (get@ #artifact.id)))
[module_id]))))
diff --git a/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux b/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux
index 3ebdae788..c138ef6ce 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux
@@ -158,7 +158,7 @@
(function (_ [artifact custom content] sink)
(..write_class static module artifact custom content sink))
sink
- (row.to_list output)))
+ (row.list output)))
(def: (read_jar_entry_with_unknown_size input)
(-> java/util/jar/JarInputStream [Nat Binary])
@@ -247,7 +247,7 @@
(function (_ host_dependencies archive program)
(do {! try.monad}
[order (dependency.load_order $.key archive)
- #let [buffer (java/io/ByteArrayOutputStream::new (.int ..mebi_byte))]
+ .let [buffer (java/io/ByteArrayOutputStream::new (.int ..mebi_byte))]
sink (|> order
(list\map (function (_ [module [module_id [descriptor document output]]])
[module_id output]))
@@ -259,7 +259,7 @@
[(set.empty text.hash)
(set.empty text.hash)
sink]))
- #let [_ (do_to sink
+ .let [_ (do_to sink
(java/io/Flushable::flush)
(java/io/Closeable::close))]]
(in (java/io/ByteArrayOutputStream::toByteArray buffer)))))
diff --git a/stdlib/source/library/lux/tool/compiler/meta/packager/scheme.lux b/stdlib/source/library/lux/tool/compiler/meta/packager/scheme.lux
index 6af912b14..081a43829 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/packager/scheme.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/packager/scheme.lux
@@ -3,7 +3,7 @@
[lux (#- Module)
[type (#+ :sharing)]
[abstract
- ["." monad (#+ Monad do)]]
+ ["." monad (#+ do)]]
[control
["." try (#+ Try)]]
[data
@@ -56,7 +56,7 @@
(def: bundle_module
(-> Output (Try _.Expression))
- (|>> row.to_list
+ (|>> row.list
(list\map product.right)
(monad.fold try.monad
(function (_ content so_far)
@@ -105,7 +105,7 @@
entry_content (: (Try tar.Content)
(|> descriptor
(get@ #descriptor.references)
- set.to_list
+ set.list
(list.all (function (_ module) (dictionary.get module mapping)))
(list\map (|>> ..module_file _.string _.load_relative/1))
(list\fold ..then bundle)
@@ -121,7 +121,7 @@
(function (package host_dependencies archive program)
(do {! try.monad}
[order (dependency.load_order $.key archive)
- #let [mapping (|> order
+ .let [mapping (|> order
(list\map (function (_ [module [module_id [descriptor document output]]])
[module module_id]))
(dictionary.of_list text.hash)
diff --git a/stdlib/source/library/lux/tool/compiler/meta/packager/script.lux b/stdlib/source/library/lux/tool/compiler/meta/packager/script.lux
index 080765231..0f3f33a29 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/packager/script.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/packager/script.lux
@@ -38,7 +38,7 @@
(-> (-> directive directive directive) [archive.ID Output] directive
(Try directive)))
(|> output
- row.to_list
+ row.list
(list\map (|>> product.right product.right))
(monad.fold try.monad
(function (_ content so_far)
@@ -54,7 +54,7 @@
(sequence so_far)))))
so_far)))
-(def: #export (package header to_code sequence scope)
+(def: #export (package header code sequence scope)
(All [directive]
(-> directive
(-> directive Text)
@@ -68,4 +68,4 @@
(list\map (function (_ [module [module_id [descriptor document output]]])
[module_id output]))
(monad.fold ! (..write_module sequence) header)
- (\ ! map (|>> scope to_code (\ utf8.codec encode)))))))
+ (\ ! map (|>> scope code (\ utf8.codec encode)))))))
diff --git a/stdlib/source/library/lux/tool/compiler/phase.lux b/stdlib/source/library/lux/tool/compiler/phase.lux
index 0a0db986e..cfae348ce 100644
--- a/stdlib/source/library/lux/tool/compiler/phase.lux
+++ b/stdlib/source/library/lux/tool/compiler/phase.lux
@@ -107,9 +107,9 @@
(-> Name Text (Operation s a) (Operation s a)))
(do ..monad
[_ (in [])
- #let [pre (io.run instant.now)]
+ .let [pre (io.run instant.now)]
output operation
- #let [_ (|> instant.now
+ .let [_ (|> instant.now
io.run
instant.relative
(duration.difference (instant.relative pre))
diff --git a/stdlib/source/library/lux/tool/interpreter.lux b/stdlib/source/library/lux/tool/interpreter.lux
index c374d9bd1..f60aaf134 100644
--- a/stdlib/source/library/lux/tool/interpreter.lux
+++ b/stdlib/source/library/lux/tool/interpreter.lux
@@ -102,7 +102,7 @@
(-> Code <Interpretation>))
(do {! phase.monad}
[state (extension.lift phase.get_state)
- #let [analyse (get@ [#directive.analysis #directive.phase] state)
+ .let [analyse (get@ [#directive.analysis #directive.phase] state)
synthesize (get@ [#directive.synthesis #directive.phase] state)
generate (get@ [#directive.generation #directive.phase] state)]
[_ codeT codeA] (directive.lift_analysis
@@ -171,7 +171,7 @@
(All [anchor expression directive]
(-> <Context> (Try [<Context> Text])))
(do try.monad
- [#let [[_where _offset _code] (get@ #source context)]
+ [.let [[_where _offset _code] (get@ #source context)]
[source' input] (syntax.parse ..module syntax.no_aliases (text.size _code) (get@ #source context))
[state' representation] (let [## TODO: Simplify ASAP
state (:sharing [anchor expression directive]
diff --git a/stdlib/source/library/lux/type.lux b/stdlib/source/library/lux/type.lux
index 950d71c63..ed808b8e9 100644
--- a/stdlib/source/library/lux/type.lux
+++ b/stdlib/source/library/lux/type.lux
@@ -245,12 +245,12 @@
_
#.None)))
-(def: #export (to_code type)
+(def: #export (code type)
(-> Type Code)
(case type
(#.Primitive name params)
(` (#.Primitive (~ (code.text name))
- (.list (~+ (list\map to_code params)))))
+ (.list (~+ (list\map code params)))))
(^template [<tag>]
[(<tag> idx)
@@ -259,8 +259,8 @@
(^template [<tag>]
[(<tag> left right)
- (` (<tag> (~ (to_code left))
- (~ (to_code right))))])
+ (` (<tag> (~ (code left))
+ (~ (code right))))])
([#.Sum] [#.Product] [#.Function] [#.Apply])
(#.Named name sub_type)
@@ -268,8 +268,8 @@
(^template [<tag>]
[(<tag> env body)
- (` (<tag> (.list (~+ (list\map to_code env)))
- (~ (to_code body))))])
+ (` (<tag> (.list (~+ (list\map code env)))
+ (~ (code body))))])
([#.UnivQ] [#.ExQ])
))
@@ -395,7 +395,7 @@
(do meta.monad
[location meta.location
valueT (meta.type valueN)
- #let [_ ("lux io log"
+ .let [_ ("lux io log"
($_ text\compose
(name\encode (name_of ..:log!)) " " (location.format location) text.new_line
"Expression: " (case valueC
diff --git a/stdlib/source/library/lux/type/abstract.lux b/stdlib/source/library/lux/type/abstract.lux
index 66560bc4f..7eb42acb2 100644
--- a/stdlib/source/library/lux/type/abstract.lux
+++ b/stdlib/source/library/lux/type/abstract.lux
@@ -213,7 +213,7 @@
{primitives (<>.some <code>.any)})
(do meta.monad
[current_module meta.current_module_name
- #let [type_varsC (list\map code.local_identifier type_vars)
+ .let [type_varsC (list\map code.local_identifier type_vars)
abstraction_declaration (` ((~ (code.local_identifier name)) (~+ type_varsC)))
representation_declaration (` ((~ (code.local_identifier (representation_definition_name name)))
(~+ type_varsC)))]
diff --git a/stdlib/source/library/lux/type/check.lux b/stdlib/source/library/lux/type/check.lux
index dcdf4ba58..0b47df0ab 100644
--- a/stdlib/source/library/lux/type/check.lux
+++ b/stdlib/source/library/lux/type/check.lux
@@ -372,7 +372,7 @@
(do {! ..monad}
[ring (..ring id)
_ (..assertion "" (n.> 1 (set.size ring)))
- _ (monad.map ! (update type) (set.to_list ring))]
+ _ (monad.map ! (update type) (set.list ring))]
then)
(do ..monad
[?bound (read id)]
@@ -444,14 +444,14 @@
[_ (link_3 interpose to idE)]
(in interpose)))
targetE
- (set.to_list ringA))]
+ (set.list ringA))]
(in assumptions))))
(^template [<pattern> <id> <type>]
[<pattern>
(do !
[ring (..ring <id>)
- _ (monad.map ! (update <type>) (set.to_list ring))]
+ _ (monad.map ! (update <type>) (set.list ring))]
(in assumptions))])
([[(#.Var _) _] idE atype]
[[_ (#.Var _)] idA etype])
diff --git a/stdlib/source/library/lux/type/implicit.lux b/stdlib/source/library/lux/type/implicit.lux
index 80e2f1ca2..a1d7c160c 100644
--- a/stdlib/source/library/lux/type/implicit.lux
+++ b/stdlib/source/library/lux/type/implicit.lux
@@ -2,7 +2,7 @@
[library
[lux #*
[abstract
- ["." monad (#+ Monad do)]
+ ["." monad (#+ do)]
["." equivalence]]
[control
["." try]
@@ -94,7 +94,7 @@
[this_module_name meta.current_module_name
imp_mods (meta.imported_modules this_module_name)
tag_lists (monad.map ! meta.tag_lists imp_mods)
- #let [tag_lists (|> tag_lists list\join (list\map product.left) list\join)
+ .let [tag_lists (|> tag_lists list\join (list\map product.left) list\join)
candidates (list.only (|>> product.right (text\= simple_name))
tag_lists)]]
(case candidates
@@ -132,7 +132,7 @@
(Meta (List [Name Type]))
(do meta.monad
[local_batches meta.locals
- #let [total_locals (list\fold (function (_ [name type] table)
+ .let [total_locals (list\fold (function (_ [name type] table)
(try.else table (dictionary.try_put name type table)))
(: (Dictionary Text Type)
(dictionary.empty text.hash))
@@ -215,7 +215,7 @@
(case (check.run context
(do {! check.monad}
[[tvars alt_type] (concrete_type alt_type)
- #let [[deps alt_type] (type.flat_function alt_type)]
+ .let [[deps alt_type] (type.flat_function alt_type)]
_ (check.check dep alt_type)
context' check.context
=deps (monad.map ! (provision compiler context') deps)]
@@ -264,7 +264,7 @@
(case (<| (check.run context)
(do {! check.monad}
[[tvars alt_type] (concrete_type alt_type)
- #let [[deps alt_type] (type.flat_function alt_type)]
+ .let [[deps alt_type] (type.flat_function alt_type)]
_ (check.check alt_type sig_type)
member_type (member_type member_idx alt_type)
_ (ensure_function_application! member_type input_types output_type)
diff --git a/stdlib/source/library/lux/type/resource.lux b/stdlib/source/library/lux/type/resource.lux
index b61fb2d9f..1ddc43d99 100644
--- a/stdlib/source/library/lux/type/resource.lux
+++ b/stdlib/source/library/lux/type/resource.lux
@@ -137,9 +137,9 @@
(#.Item head tail)
(do {! meta.monad}
- [#let [max_idx (list\fold n.max head tail)]
+ [.let [max_idx (list\fold n.max head tail)]
g!inputs (<| (monad.seq !) (list.repeat (inc max_idx)) (macro.gensym "input"))
- #let [g!outputs (|> (monad.fold maybe.monad
+ .let [g!outputs (|> (monad.fold maybe.monad
(function (_ from to)
(do maybe.monad
[input (list.item from g!inputs)]
@@ -147,7 +147,7 @@
(: (Row Code) row.empty)
swaps)
maybe.assume
- row.to_list)
+ row.list)
g!inputsT+ (list\map (|>> (~) (..Key ..Commutative) (`)) g!inputs)
g!outputsT+ (list\map (|>> (~) (..Key ..Commutative) (`)) g!outputs)]]
(in (list (` (: (All [(~ g!!) (~+ g!inputs) (~ g!context)]
diff --git a/stdlib/source/library/lux/type/unit.lux b/stdlib/source/library/lux/type/unit.lux
index 941c52167..b04ad62e9 100644
--- a/stdlib/source/library/lux/type/unit.lux
+++ b/stdlib/source/library/lux/type/unit.lux
@@ -90,7 +90,7 @@
{annotations (<>.else |annotations|.empty |annotations|.parser)})
(do meta.monad
[@ meta.current_module_name
- #let [g!type (code.local_identifier type_name)]]
+ .let [g!type (code.local_identifier type_name)]]
(in (list (` (type: (~+ (|export|.format export)) (~ g!type)
(~ (|annotations|.format annotations))
(primitive (~ (code.text (%.name [@ type_name]))))))
@@ -121,7 +121,7 @@
{annotations (<>.else |annotations|.empty |annotations|.parser)})
(do meta.monad
[@ meta.current_module_name
- #let [g!scale (code.local_identifier type_name)]]
+ .let [g!scale (code.local_identifier type_name)]]
(in (list (` (type: (~+ (|export|.format export)) ((~ g!scale) (~' u))
(~ (|annotations|.format annotations))
(primitive (~ (code.text (%.name [@ type_name]))) [(~' u)])))
@@ -143,7 +143,7 @@
[(~ (code.nat numerator)) (~ (code.nat denominator))])))
))))
-(def: #export (re_scale from to quantity)
+(def: #export (re_scaled from to quantity)
(All [si so u] (-> (Scale si) (Scale so) (Qty (si u)) (Qty (so u))))
(let [[numerator denominator] (ratio./ (\ from ratio)
(\ to ratio))]
diff --git a/stdlib/source/library/lux/world/db/jdbc/input.lux b/stdlib/source/library/lux/world/db/jdbc/input.lux
index 10cf48c86..6033224eb 100644
--- a/stdlib/source/library/lux/world/db/jdbc/input.lux
+++ b/stdlib/source/library/lux/world/db/jdbc/input.lux
@@ -97,7 +97,7 @@
(function (_ value [idx statement])
(do try.monad
[_ (<setter> (.int idx)
- (<constructor> (instant.to_millis value))
+ (<constructor> (instant.millis value))
statement)]
(in [(.inc idx) statement]))))]
diff --git a/stdlib/source/library/lux/world/file.lux b/stdlib/source/library/lux/world/file.lux
index f3ce90305..2d09acf8a 100644
--- a/stdlib/source/library/lux/world/file.lux
+++ b/stdlib/source/library/lux/world/file.lux
@@ -230,7 +230,7 @@
(case ?children
(#.Some children)
(|> children
- array.to_list
+ array.list
(monad.only ! (|>> <method>))
(\ ! map (monad.map ! (|>> java/io/File::getAbsolutePath)))
(\ ! join))
@@ -258,9 +258,9 @@
(def: (read path)
(do (try.with io.monad)
- [#let [file (java/io/File::new path)]
+ [.let [file (java/io/File::new path)]
size (java/io/File::length file)
- #let [data (binary.create (.nat size))]
+ .let [data (binary.create (.nat size))]
stream (java/io/FileInputStream::new file)
bytes_read (java/io/InputStream::read data stream)
_ (java/lang/AutoCloseable::close stream)]
@@ -276,7 +276,7 @@
(def: (modify time_stamp path)
(|> path
java/io/File::new
- (java/io/File::setLastModified (|> time_stamp instant.relative duration.to_millis))))
+ (java/io/File::setLastModified (|> time_stamp instant.relative duration.millis))))
(~~ (template [<name> <flag>]
[(def: (<name> data path)
@@ -428,7 +428,7 @@
(def: (make_directory path)
(do async.monad
- [#let [node_fs (..node_fs [])]
+ [.let [node_fs (..node_fs [])]
outcome (with_async write! (Try Any)
(Fs::access [path
(|> node_fs Fs::constants FsConstants::F_OK)
@@ -445,11 +445,11 @@
(~~ (template [<name> <method>]
[(def: (<name> path)
(do {! (try.with async.monad)}
- [#let [node_fs (..node_fs [])]
+ [.let [node_fs (..node_fs [])]
subs (with_async write! (Try (Array ffi.String))
(Fs::readdir [path (..value_callback write!)] node_fs))]
(|> subs
- array.to_list
+ array.list
(list\map (|>> (format path ..js_separator)))
(monad.map ! (function (_ sub)
(\ ! map (|>> (<method> []) [sub])
@@ -504,7 +504,7 @@
(def: (delete path)
(do (try.with async.monad)
- [#let [node_fs (..node_fs [])]
+ [.let [node_fs (..node_fs [])]
stats (with_async write! (Try Stats)
(Fs::stat [path (..value_callback write!)] node_fs))]
(with_async write! (Try Any)
@@ -514,7 +514,7 @@
(def: (modify time_stamp path)
(with_async write! (Try Any)
- (let [when (|> time_stamp instant.relative duration.to_millis i.frac)]
+ (let [when (|> time_stamp instant.relative duration.millis i.frac)]
(Fs::utimes [path when when (..any_callback write!)]
(..node_fs [])))))
@@ -596,7 +596,7 @@
(let [! (try.with io.monad)]
(|> path
os::listdir
- (\ ! map (|>> array.to_list
+ (\ ! map (|>> array.list
(list\map (|>> (format path ..python_separator)))
(monad.map ! (function (_ sub)
(\ ! map (|>> [sub]) (<method> [sub]))))
@@ -637,7 +637,7 @@
(os::rmdir [path]))))
(def: (modify time_stamp path)
- (let [when (|> time_stamp instant.relative duration.to_millis (i./ +1,000))]
+ (let [when (|> time_stamp instant.relative duration.millis (i./ +1,000))]
(os::utime [path (..tuple [when when])])))
(~~ (template [<name> <mode>]
@@ -723,7 +723,7 @@
[self (RubyDir::open [path])
children (RubyDir::children [] self)
output (loop [input (|> children
- array.to_list
+ array.list
(list\map (|>> (format path ..ruby_separator))))
output (: (List ..Path)
(list))]
@@ -777,7 +777,7 @@
(def: (modify moment path)
(let [moment (|> moment
instant.relative
- duration.to_millis
+ duration.millis
i.frac
(f./ +1,000.0)
RubyTime::at)]
@@ -885,7 +885,7 @@
## (def: (modify moment)
## (do {! (try.with io.monad)}
- ## [verdict (..touch [path (|> moment instant.relative duration.to_millis (i./ +1,000))])]
+ ## [verdict (..touch [path (|> moment instant.relative duration.millis (i./ +1,000))])]
## (if (bit\= false (:as Bit verdict))
## (\ io.monad in (exception.except ..cannot_find_file [path]))
## (in []))))
@@ -916,7 +916,7 @@
## (do {! (try.with io.monad)}
## [children (..scandir [path])]
## (loop [input (|> children
- ## array.to_list
+ ## array.list
## (list.only (function (_ child)
## (not (or (text\= "." child)
## (text\= ".." child))))))
@@ -963,7 +963,7 @@
## (def: (make_file path)
## (do {! (try.with io.monad)}
- ## [verdict (..touch [path (|> instant.now io.run instant.relative duration.to_millis (i./ +1,000))])]
+ ## [verdict (..touch [path (|> instant.now io.run instant.relative duration.millis (i./ +1,000))])]
## (\ io.monad in
## (if verdict
## (#try.Success (..file path))
diff --git a/stdlib/source/library/lux/world/file/watch.lux b/stdlib/source/library/lux/world/file/watch.lux
index bfe64cca1..5800e68e1 100644
--- a/stdlib/source/library/lux/world/file/watch.lux
+++ b/stdlib/source/library/lux/world/file/watch.lux
@@ -149,7 +149,7 @@
(List //.Path)]])))
(do {! (try.with async.monad)}
[current_files (..poll_files fs directory)
- #let [creations (if (..creation? concern)
+ .let [creations (if (..creation? concern)
(list.only (|>> product.left (dictionary.key? file_tracker) not)
current_files)
(list))
@@ -236,7 +236,7 @@
(dictionary.of_list text.hash))
tracker))]
(in (#try.Success [])))
- #let [[creations modifications deletions]
+ .let [[creations modifications deletions]
(list\fold (function (_ [_ [creations modifications deletions]]
[all_creations all_modifications all_deletions])
[(list\compose creations all_creations)
@@ -378,7 +378,7 @@
[valid? (java/nio/file/WatchKey::reset key)]
(if valid?
(do !
- [#let [path (|> key
+ [.let [path (|> key
java/nio/file/WatchKey::watchable
(:as java/nio/file/Path)
java/nio/file/Path::toString
@@ -410,7 +410,7 @@
(do (try.with io.monad)
[watcher (java/nio/file/FileSystem::newWatchService
(java/nio/file/FileSystems::getDefault))
- #let [tracker (stm.var (: (Dictionary //.Path [Concern java/nio/file/WatchKey])
+ .let [tracker (stm.var (: (Dictionary //.Path [Concern java/nio/file/WatchKey])
(dictionary.empty text.hash)))
stop (: (-> //.Path (Async (Try Concern)))
diff --git a/stdlib/source/library/lux/world/net/http/client.lux b/stdlib/source/library/lux/world/net/http/client.lux
index 0861d7d96..fd79fc81b 100644
--- a/stdlib/source/library/lux/world/net/http/client.lux
+++ b/stdlib/source/library/lux/world/net/http/client.lux
@@ -121,7 +121,7 @@
(if partial?
(loop [so_far +0]
(do {! (try.with io.monad)}
- [#let [remaining (i.- so_far (.int buffer_size))]
+ [.let [remaining (i.- so_far (.int buffer_size))]
bytes_read (java/io/BufferedInputStream::read buffer so_far remaining input)]
(case bytes_read
-1 (do !
@@ -134,7 +134,7 @@
(loop [so_far +0
output (\ binary.monoid identity)]
(do {! (try.with io.monad)}
- [#let [remaining (i.- so_far (.int buffer_size))]
+ [.let [remaining (i.- so_far (.int buffer_size))]
bytes_read (java/io/BufferedInputStream::read buffer so_far remaining input)]
(case bytes_read
-1 (do !
@@ -177,7 +177,7 @@
(: (IO (Try (//.Response IO)))
(do {! (try.with io.monad)}
[connection (|> url java/net/URL::new java/net/URL::openConnection)
- #let [connection (:as java/net/HttpURLConnection connection)]
+ .let [connection (:as java/net/HttpURLConnection connection)]
_ (java/net/HttpURLConnection::setRequestMethod (..jvm_method method) connection)
_ (monad.map ! (function (_ [name value])
(java/net/URLConnection::setRequestProperty name value connection))
diff --git a/stdlib/source/library/lux/world/net/http/route.lux b/stdlib/source/library/lux/world/net/http/route.lux
index a390c51bb..0dd3f6c5b 100644
--- a/stdlib/source/library/lux/world/net/http/route.lux
+++ b/stdlib/source/library/lux/world/net/http/route.lux
@@ -68,7 +68,7 @@
(function (_ request)
(do async.monad
[response (primary request)
- #let [[status message] response]]
+ .let [[status message] response]]
(if (n.= //status.not_found status)
(alternative request)
(in response)))))
diff --git a/stdlib/source/library/lux/world/program.lux b/stdlib/source/library/lux/world/program.lux
index f73621cae..460acdc66 100644
--- a/stdlib/source/library/lux/world/program.lux
+++ b/stdlib/source/library/lux/world/program.lux
@@ -315,23 +315,23 @@
(case (ffi.constant Object [process env])
(#.Some process/env)
(|> (Object::entries [process/env])
- array.to_list
+ array.list
(list\map (|>> (array.read 0) maybe.assume)))
#.None
(list))
(list)))
- @.python (\ io.monad map array.to_list (os/environ::keys []))
+ @.python (\ io.monad map array.list (os/environ::keys []))
## Lua offers no way to get all the environment variables available.
@.lua (io.io (list))
@.ruby (|> (RubyEnv::keys [])
- array.to_list
+ array.list
io.io)
## @.php (do io.monad
## [environment (..getenv/0 [])]
## (in (|> environment
## ..array_keys
- ## array.to_list
+ ## array.list
## (list\map (function (_ variable)
## [variable ("php array read" (:as Nat variable) environment)]))
## (dictionary.of_list text.hash))))
@@ -414,7 +414,7 @@
(io.io <default>))
@.python (os::getcwd [])
@.lua (do io.monad
- [#let [default <default>]
+ [.let [default <default>]
on_windows (..run_command default "cd")]
(if (is? default on_windows)
(..run_command default "pwd")
diff --git a/stdlib/source/library/lux/world/shell.lux b/stdlib/source/library/lux/world/shell.lux
index 4f389ce78..696a0a730 100644
--- a/stdlib/source/library/lux/world/shell.lux
+++ b/stdlib/source/library/lux/world/shell.lux
@@ -232,7 +232,7 @@
[jvm_input (java/lang/Process::getInputStream process)
jvm_error (java/lang/Process::getErrorStream process)
jvm_output (java/lang/Process::getOutputStream process)
- #let [jvm_input (|> jvm_input
+ .let [jvm_input (|> jvm_input
java/io/InputStreamReader::new
java/io/BufferedReader::new)
jvm_error (|> jvm_error
@@ -291,7 +291,7 @@
(def: (execute [environment working_directory command arguments])
(do {! (try.with io.monad)}
- [#let [builder (|> (list& command arguments)
+ [.let [builder (|> (list& command arguments)
..jvm::arguments_array
java/lang/ProcessBuilder::new
(java/lang/ProcessBuilder::directory (java/io/File::new working_directory)))]
diff --git a/stdlib/source/poly/lux/abstract/equivalence.lux b/stdlib/source/poly/lux/abstract/equivalence.lux
index b1d4f413f..1c8aa70e1 100644
--- a/stdlib/source/poly/lux/abstract/equivalence.lux
+++ b/stdlib/source/poly/lux/abstract/equivalence.lux
@@ -43,12 +43,12 @@
(poly: #export equivalence
(`` (do {! <>.monad}
- [#let [g!_ (code.local_identifier "_____________")]
+ [.let [g!_ (code.local_identifier "_____________")]
*env* <type>.env
inputT <type>.peek
- #let [@Equivalence (: (-> Type Code)
+ .let [@Equivalence (: (-> Type Code)
(function (_ type)
- (` ((~! /.Equivalence) (~ (poly.to_code *env* type))))))]]
+ (` ((~! /.Equivalence) (~ (poly.code *env* type))))))]]
($_ <>.either
## Basic types
(~~ (template [<matcher> <eq>]
@@ -108,7 +108,7 @@
## Variants
(do !
[members (<type>.variant (<>.many equivalence))
- #let [last (dec (list.size members))
+ .let [last (dec (list.size members))
g!_ (code.local_identifier "_____________")
g!left (code.local_identifier "_____________left")
g!right (code.local_identifier "_____________right")]]
@@ -129,7 +129,7 @@
## Tuples
(do !
[g!eqs (<type>.tuple (<>.many equivalence))
- #let [g!_ (code.local_identifier "_____________")
+ .let [g!_ (code.local_identifier "_____________")
indices (list.indices (list.size g!eqs))
g!lefts (list\map (|>> nat\encode (text\compose "left") code.local_identifier) indices)
g!rights (list\map (|>> nat\encode (text\compose "right") code.local_identifier) indices)]]
@@ -141,7 +141,7 @@
## Type recursion
(do !
[[g!self bodyC] (<type>.recursive equivalence)
- #let [g!_ (code.local_identifier "_____________")]]
+ .let [g!_ (code.local_identifier "_____________")]]
(in (` (: (~ (@Equivalence inputT))
((~! /.rec) (.function ((~ g!_) (~ g!self))
(~ bodyC)))))))
@@ -157,7 +157,7 @@
[[funcC varsC bodyC] (<type>.polymorphic equivalence)]
(in (` (: (All [(~+ varsC)]
(-> (~+ (list\map (|>> (~) ((~! /.Equivalence)) (`)) varsC))
- ((~! /.Equivalence) ((~ (poly.to_code *env* inputT)) (~+ varsC)))))
+ ((~! /.Equivalence) ((~ (poly.code *env* inputT)) (~+ varsC)))))
(function ((~ funcC) (~+ varsC))
(~ bodyC))))))
<type>.recursive_call
diff --git a/stdlib/source/poly/lux/abstract/functor.lux b/stdlib/source/poly/lux/abstract/functor.lux
index 089d5119b..ff797b29c 100644
--- a/stdlib/source/poly/lux/abstract/functor.lux
+++ b/stdlib/source/poly/lux/abstract/functor.lux
@@ -26,34 +26,34 @@
(poly: #export functor
(do {! p.monad}
- [#let [type_funcC (code.local_identifier "____________type_funcC")
+ [.let [type_funcC (code.local_identifier "____________type_funcC")
funcC (code.local_identifier "____________funcC")
inputC (code.local_identifier "____________inputC")]
*env* <type>.env
inputT <type>.peek
[polyC varsC non_functorT] (<type>.local (list inputT)
(<type>.polymorphic <type>.any))
- #let [num_vars (list.size varsC)]
- #let [@Functor (: (-> Type Code)
+ .let [num_vars (list.size varsC)]
+ .let [@Functor (: (-> Type Code)
(function (_ unwrappedT)
(if (n.= 1 num_vars)
- (` ((~! /.Functor) (~ (poly.to_code *env* unwrappedT))))
+ (` ((~! /.Functor) (~ (poly.code *env* unwrappedT))))
(let [paramsC (|> num_vars dec list.indices (list\map (|>> %.nat code.local_identifier)))]
(` (All [(~+ paramsC)]
- ((~! /.Functor) ((~ (poly.to_code *env* unwrappedT)) (~+ paramsC)))))))))
+ ((~! /.Functor) ((~ (poly.code *env* unwrappedT)) (~+ paramsC)))))))))
Arg<?> (: (-> Code (<type>.Parser Code))
(function (Arg<?> valueC)
($_ p.either
## Type-var
(do p.monad
- [#let [varI (|> num_vars (n.* 2) dec)]
+ [.let [varI (|> num_vars (n.* 2) dec)]
_ (<type>.parameter! varI)]
(in (` ((~ funcC) (~ valueC)))))
## Variants
(do !
[_ (in [])
membersC (<type>.variant (p.many (Arg<?> valueC)))
- #let [last (dec (list.size membersC))]]
+ .let [last (dec (list.size membersC))]]
(in (` (case (~ valueC)
(~+ (list\join (list\map (function (_ [tag memberC])
(if (n.= last tag)
@@ -81,11 +81,11 @@
## Functions
(do !
[_ (in [])
- #let [g! (code.local_identifier "____________")
+ .let [g! (code.local_identifier "____________")
outL (code.local_identifier "____________outL")]
[inT+ outC] (<type>.function (p.many <type>.any)
(Arg<?> outL))
- #let [inC+ (|> (list.size inT+)
+ .let [inC+ (|> (list.size inT+)
list.indices
(list\map (|>> %.nat (format "____________inC") code.local_identifier)))]]
(in (` (function ((~ g!) (~+ inC+))
diff --git a/stdlib/source/poly/lux/data/format/json.lux b/stdlib/source/poly/lux/data/format/json.lux
index d8eecd816..c4cae2881 100644
--- a/stdlib/source/poly/lux/data/format/json.lux
+++ b/stdlib/source/poly/lux/data/format/json.lux
@@ -4,8 +4,7 @@
[lux #*
["." debug]
[abstract
- [monad (#+ Monad do)]
- [equivalence (#+ Equivalence)]
+ [monad (#+ do)]
["." codec]]
[control
["." try]
@@ -13,26 +12,22 @@
["<.>" type]
["</>" json]]]
[data
- ["." bit]
- maybe
- ["." sum]
- ["." product]
- ["." text ("#\." equivalence)
+ ["." text
["%" format (#+ format)]]
[collection
- ["." list ("#\." fold monad)]
- ["." row (#+ Row row) ("#\." monad)]
- ["d" dictionary]]]
+ ["." list ("#\." monad)]
+ ["." row (#+ row)]
+ ["." dictionary]]]
[macro
[syntax (#+ syntax:)]
["." code]
["." poly (#+ poly:)]]
[math
[number
- ["." i64]
["n" nat ("#\." decimal)]
+ ["." i64]
["." int]
- ["." frac ("#\." decimal)]]]
+ ["." frac]]]
[time
## ["." instant]
## ["." duration]
@@ -104,7 +99,7 @@
(with_expansions
[<basic> (template [<matcher> <encoder>]
[(do !
- [#let [g!_ (code.local_identifier "_______")]
+ [.let [g!_ (code.local_identifier "_______")]
_ <matcher>]
(in (` (: (~ (@JSON\encode inputT))
<encoder>))))]
@@ -128,9 +123,9 @@
[month.Month month.codec])]
(do {! <>.monad}
[*env* <type>.env
- #let [@JSON\encode (: (-> Type Code)
+ .let [@JSON\encode (: (-> Type Code)
(function (_ type)
- (` (-> (~ (poly.to_code *env* type)) /.JSON))))]
+ (` (-> (~ (poly.code *env* type)) /.JSON))))]
inputT <type>.peek]
($_ <>.either
<basic>
@@ -141,18 +136,18 @@
(in (` (: (~ (@JSON\encode inputT))
(\ (~! qty_codec) (~' encode))))))
(do !
- [#let [g!_ (code.local_identifier "_______")
+ [.let [g!_ (code.local_identifier "_______")
g!key (code.local_identifier "_______key")
g!val (code.local_identifier "_______val")]
[_ _ =val=] (<type>.applied ($_ <>.and
- (<type>.exactly d.Dictionary)
+ (<type>.exactly dictionary.Dictionary)
(<type>.exactly .Text)
encode))]
(in (` (: (~ (@JSON\encode inputT))
- (|>> ((~! d.entries))
+ (|>> ((~! dictionary.entries))
((~! list\map) (function ((~ g!_) [(~ g!key) (~ g!val)])
[(~ g!key) ((~ =val=) (~ g!val))]))
- ((~! d.of_list) (~! text.hash))
+ ((~! dictionary.of_list) (~! text.hash))
#/.Object)))))
(do !
[[_ =sub=] (<type>.applied ($_ <>.and
@@ -167,27 +162,27 @@
(in (` (: (~ (@JSON\encode inputT))
(|>> ((~! list\map) (~ =sub=)) ((~! row.of_list)) #/.Array)))))
(do !
- [#let [g!_ (code.local_identifier "_______")
+ [.let [g!_ (code.local_identifier "_______")
g!input (code.local_identifier "_______input")]
members (<type>.variant (<>.many encode))
- #let [last (dec (list.size members))]]
+ .let [last (dec (list.size members))]]
(in (` (: (~ (@JSON\encode inputT))
(function ((~ g!_) (~ g!input))
(case (~ g!input)
(~+ (list\join (list\map (function (_ [tag g!encode])
(if (n.= last tag)
- (list (` ((~ (code.nat (dec tag))) #1 (~ g!input)))
- (` ((~! /.json) [(~ (code.frac (..tag (dec tag))))
- #1
- ((~ g!encode) (~ g!input))])))
- (list (` ((~ (code.nat tag)) #0 (~ g!input)))
- (` ((~! /.json) [(~ (code.frac (..tag tag)))
- #0
- ((~ g!encode) (~ g!input))])))))
+ (.list (` ((~ (code.nat (dec tag))) #1 (~ g!input)))
+ (` ((~! /.json) [(~ (code.frac (..tag (dec tag))))
+ #1
+ ((~ g!encode) (~ g!input))])))
+ (.list (` ((~ (code.nat tag)) #0 (~ g!input)))
+ (` ((~! /.json) [(~ (code.frac (..tag tag)))
+ #0
+ ((~ g!encode) (~ g!input))])))))
(list.enumeration members))))))))))
(do !
[g!encoders (<type>.tuple (<>.many encode))
- #let [g!_ (code.local_identifier "_______")
+ .let [g!_ (code.local_identifier "_______")
g!members (|> (list.size g!encoders)
list.indices
(list\map (|>> n\encode code.local_identifier)))]]
@@ -199,7 +194,7 @@
## Type recursion
(do !
[[selfC non_recC] (<type>.recursive encode)
- #let [g! (code.local_identifier "____________")]]
+ .let [g! (code.local_identifier "____________")]]
(in (` (: (~ (@JSON\encode inputT))
((~! ..rec_encode) (.function ((~ g!) (~ selfC))
(~ non_recC)))))))
@@ -214,7 +209,7 @@
(in (` (: (All [(~+ varsC)]
(-> (~+ (list\map (function (_ varC) (` (-> (~ varC) /.JSON)))
varsC))
- (-> ((~ (poly.to_code *env* inputT)) (~+ varsC))
+ (-> ((~ (poly.code *env* inputT)) (~+ varsC))
/.JSON)))
(function ((~ funcC) (~+ varsC))
(~ bodyC))))))
@@ -251,9 +246,9 @@
[month.Month month.codec])]
(do {! <>.monad}
[*env* <type>.env
- #let [@JSON\decode (: (-> Type Code)
+ .let [@JSON\decode (: (-> Type Code)
(function (_ type)
- (` (</>.Parser (~ (poly.to_code *env* type))))))]
+ (` (</>.Parser (~ (poly.code *env* type))))))]
inputT <type>.peek]
($_ <>.either
<basic>
@@ -265,7 +260,7 @@
((~! <>.codec) (~! qty_codec) (~! </>.any))))))
(do !
[[_ _ valC] (<type>.applied ($_ <>.and
- (<type>.exactly d.Dictionary)
+ (<type>.exactly dictionary.Dictionary)
(<type>.exactly .Text)
decode))]
(in (` (: (~ (@JSON\decode inputT))
@@ -282,7 +277,7 @@
((~! </>.array) ((~! <>.some) (~ subC)))))))
(do !
[members (<type>.variant (<>.many decode))
- #let [last (dec (list.size members))]]
+ .let [last (dec (list.size members))]]
(in (` (: (~ (@JSON\decode inputT))
($_ ((~! <>.or))
(~+ (list\map (function (_ [tag memberC])
@@ -303,7 +298,7 @@
## Type recursion
(do !
[[selfC bodyC] (<type>.recursive decode)
- #let [g! (code.local_identifier "____________")]]
+ .let [g! (code.local_identifier "____________")]]
(in (` (: (~ (@JSON\decode inputT))
((~! <>.rec) (.function ((~ g!) (~ selfC))
(~ bodyC)))))))
@@ -317,7 +312,7 @@
[[funcC varsC bodyC] (<type>.polymorphic decode)]
(in (` (: (All [(~+ varsC)]
(-> (~+ (list\map (|>> (~) </>.Parser (`)) varsC))
- (</>.Parser ((~ (poly.to_code *env* inputT)) (~+ varsC)))))
+ (</>.Parser ((~ (poly.code *env* inputT)) (~+ varsC)))))
(function ((~ funcC) (~+ varsC))
(~ bodyC))))))
<type>.parameter
@@ -344,10 +339,10 @@
#dictionary (Dictionary Text Frac)})
(derived: (..codec Record)))}
- (in (list (` (: (codec.Codec /.JSON (~ inputT))
- (implementation
- (def: (~' encode)
- ((~! ..encode) (~ inputT)))
- (def: (~' decode)
- ((~! </>.run) ((~! ..decode) (~ inputT))))
- ))))))
+ (in (.list (` (: (codec.Codec /.JSON (~ inputT))
+ (implementation
+ (def: (~' encode)
+ ((~! ..encode) (~ inputT)))
+ (def: (~' decode)
+ ((~! </>.run) ((~! ..decode) (~ inputT))))
+ ))))))
diff --git a/stdlib/source/program/aedifex.lux b/stdlib/source/program/aedifex.lux
index 060f38855..e6dae7bbc 100644
--- a/stdlib/source/program/aedifex.lux
+++ b/stdlib/source/program/aedifex.lux
@@ -67,7 +67,7 @@
(def: repositories
(-> /.Profile (List (Repository Async)))
(|>> (get@ #/.repositories)
- set.to_list
+ set.list
(list\map (|>> (/repository/remote.repository http.default #.None) /repository.async))))
(def: (with_dependencies program console command profile)
diff --git a/stdlib/source/program/aedifex/command/auto.lux b/stdlib/source/program/aedifex/command/auto.lux
index 975ee26ba..f4e2ab18f 100644
--- a/stdlib/source/program/aedifex/command/auto.lux
+++ b/stdlib/source/program/aedifex/command/auto.lux
@@ -54,7 +54,7 @@
(do {! async.monad}
[targets (|> profile
(get@ #///.sources)
- set.to_list
+ set.list
(monad.map ! (..targets fs))
(\ ! map list.concat))]
(do {! ///action.monad}
diff --git a/stdlib/source/program/aedifex/command/build.lux b/stdlib/source/program/aedifex/command/build.lux
index 00791f787..23429f123 100644
--- a/stdlib/source/program/aedifex/command/build.lux
+++ b/stdlib/source/program/aedifex/command/build.lux
@@ -271,11 +271,11 @@
(#.Some program_module)
(do async.monad
[environment (program.environment async.monad program)
- #let [home (\ program home)
+ .let [home (\ program home)
working_directory (\ program directory)]]
(do ///action.monad
[[resolution compiler] (async\in (..compiler resolution (get@ #///.compiler profile)))
- #let [host_dependencies (..host_dependencies fs home resolution)
+ .let [host_dependencies (..host_dependencies fs home resolution)
[[command compiler_params] output] (case compiler
(#JVM dependency)
[(|> (..path fs home dependency)
@@ -295,11 +295,11 @@
/ (\ fs separator)
cache_directory (format working_directory / target)]
_ (console.write_line ..start console)
- #let [full_parameters (list.concat (list compiler_params
+ .let [full_parameters (list.concat (list compiler_params
(list "build")
(..plural "--library" (..libraries fs home resolution))
(..plural "--host_dependency" host_dependencies)
- (..plural "--source" (set.to_list (get@ #///.sources profile)))
+ (..plural "--source" (set.list (get@ #///.sources profile)))
(..singular "--target" cache_directory)
(..singular "--module" program_module)))]
process (\ shell execute [environment
diff --git a/stdlib/source/program/aedifex/command/clean.lux b/stdlib/source/program/aedifex/command/clean.lux
index c7443beb6..c03a09b49 100644
--- a/stdlib/source/program/aedifex/command/clean.lux
+++ b/stdlib/source/program/aedifex/command/clean.lux
@@ -33,7 +33,7 @@
(def: #export (do! console fs profile)
(-> (Console Async) (file.System Async) (Command Any))
(do {! async.monad}
- [#let [target (get@ #///.target profile)]
+ [.let [target (get@ #///.target profile)]
? (\ fs directory? target)
_ (let [! ///action.monad]
(if ?
diff --git a/stdlib/source/program/aedifex/command/deploy.lux b/stdlib/source/program/aedifex/command/deploy.lux
index 9e74a53a5..b7b08f517 100644
--- a/stdlib/source/program/aedifex/command/deploy.lux
+++ b/stdlib/source/program/aedifex/command/deploy.lux
@@ -61,7 +61,7 @@
(do {! ///action.monad}
[library (|> profile
(get@ #/.sources)
- set.to_list
+ set.list
(export.library fs)
(\ ! map (binary.run tar.writer)))
pom (\ async.monad in (///pom.write profile))
diff --git a/stdlib/source/program/aedifex/command/deps.lux b/stdlib/source/program/aedifex/command/deps.lux
index 3d26a042b..342c9c0bc 100644
--- a/stdlib/source/program/aedifex/command/deps.lux
+++ b/stdlib/source/program/aedifex/command/deps.lux
@@ -40,8 +40,8 @@
(def: #export (do! console local remotes new_repository profile)
(-> (Console Async) (Repository Async) (List (Repository Async)) (-> URL (Repository Async)) (Command Resolution))
(do async.monad
- [#let [dependencies (|> (get@ #///.dependencies profile)
- set.to_list
+ [.let [dependencies (|> (get@ #///.dependencies profile)
+ set.list
(#.Item (get@ #///.compiler profile)))]
[local_successes local_failures cache] (///dependency/resolution.all console
(list local)
@@ -67,7 +67,7 @@
["Remote successes" (|> remote_successes
(set.of_list ///dependency.hash)
(set.difference (set.of_list ///dependency.hash local_successes))
- set.to_list
+ set.list
(list.sort (\ ///dependency.order <))
(exception.listing ..format))]
["Remote failures" (|> remote_failures
diff --git a/stdlib/source/program/aedifex/command/install.lux b/stdlib/source/program/aedifex/command/install.lux
index ddc73ca36..b39b30f85 100644
--- a/stdlib/source/program/aedifex/command/install.lux
+++ b/stdlib/source/program/aedifex/command/install.lux
@@ -56,7 +56,7 @@
(do ///action.monad
[package (|> profile
(get@ #/.sources)
- set.to_list
+ set.list
(export.library fs))
pom (|> profile
///pom.write
diff --git a/stdlib/source/program/aedifex/command/test.lux b/stdlib/source/program/aedifex/command/test.lux
index 7af6a4351..78859819d 100644
--- a/stdlib/source/program/aedifex/command/test.lux
+++ b/stdlib/source/program/aedifex/command/test.lux
@@ -32,15 +32,15 @@
(-> (Console Async) (Program Async) (file.System Async) (Shell Async) Resolution (Command [Exit Any]))
(do async.monad
[environment (program.environment async.monad program)
- #let [working_directory (\ program directory)]]
+ .let [working_directory (\ program directory)]]
(do {! ///action.monad}
- [#let [home (\ program home)]
+ [.let [home (\ program home)]
[build_exit compiler program] (//build.do! console program fs shell resolution
(set@ #///.program (get@ #///.test profile) profile))]
(if (i.= shell.normal build_exit)
(do !
[_ (console.write_line ..start console)
- #let [host_dependencies (//build.host_dependencies fs home resolution)
+ .let [host_dependencies (//build.host_dependencies fs home resolution)
[test_command test_parameters] (case compiler
(#//build.JVM dependency)
(|> program
diff --git a/stdlib/source/program/aedifex/dependency/deployment.lux b/stdlib/source/program/aedifex/dependency/deployment.lux
index a6302d5f0..2b39403a9 100644
--- a/stdlib/source/program/aedifex/dependency/deployment.lux
+++ b/stdlib/source/program/aedifex/dependency/deployment.lux
@@ -91,7 +91,7 @@
(do try.monad
[now (: (Try ///artifact/time.Time)
(///artifact/time.of_instant now))
- #let [version_template (get@ #///artifact.version artifact)
+ .let [version_template (get@ #///artifact.version artifact)
snapshot (|> snapshot
(update@ [#///metadata/snapshot.versioning #///artifact/versioning.snapshot]
(function (_ snapshot)
@@ -119,7 +119,7 @@
(-> (Repository Async) Dependency Package (Async (Try Artifact)))
(do {! async.monad}
[now (async.future instant.now)
- #let [version_template (get@ #///artifact.version artifact)]]
+ .let [version_template (get@ #///artifact.version artifact)]]
(do (try.with !)
[_ (with_status repository version_template [artifact type] (get@ #///package.library package))
diff --git a/stdlib/source/program/aedifex/dependency/resolution.lux b/stdlib/source/program/aedifex/dependency/resolution.lux
index a48909375..c286c92c2 100644
--- a/stdlib/source/program/aedifex/dependency/resolution.lux
+++ b/stdlib/source/program/aedifex/dependency/resolution.lux
@@ -6,7 +6,7 @@
[abstract
[codec (#+ Codec)]
[equivalence (#+ Equivalence)]
- [monad (#+ Monad do)]]
+ [monad (#+ do)]]
[control
["." try (#+ Try) ("#\." functor)]
["." exception (#+ Exception exception:)]
@@ -128,7 +128,7 @@
extension (///artifact/extension.extension type)]
(do (try.with async.monad)
[snapshot (///metadata/snapshot.read repository artifact)
- #let [version_template (get@ [#///metadata/snapshot.artifact #///artifact.version] snapshot)
+ .let [version_template (get@ [#///metadata/snapshot.artifact #///artifact.version] snapshot)
artifact_version (value.format {#value.version version_template
#value.snapshot (get@ [#///metadata/snapshot.versioning #///artifact/versioning.snapshot] snapshot)})
artifact (set@ #///artifact.version artifact_version artifact)]
@@ -230,14 +230,14 @@
(case ?package
(#try.Success package)
(do !
- [#let [sub_dependencies (|> package
+ [.let [sub_dependencies (|> package
///package.dependencies
- (try\map set.to_list)
+ (try\map set.list)
(try.else (list)))
## For security reasons, it's not a good idea to allow dependencies to introduce repositories.
## package_repositories (|> package
## ///package.repositories
- ## (try\map set.to_list)
+ ## (try\map set.list)
## (try.else (list))
## (list\map new_repository))
## sub_repositories (list\compose repositories package_repositories)
diff --git a/stdlib/source/program/aedifex/format.lux b/stdlib/source/program/aedifex/format.lux
index c2c0849ac..c7adaa33e 100644
--- a/stdlib/source/program/aedifex/format.lux
+++ b/stdlib/source/program/aedifex/format.lux
@@ -90,7 +90,7 @@
(def: (on_set field value format aggregate)
(All [a]
(-> Text (Set a) (Format a) Aggregate Aggregate))
- (..on_list field (set.to_list value) format aggregate))
+ (..on_list field (set.list value) format aggregate))
(def: (on_dictionary field value key_format value_format aggregate)
(All [k v]
diff --git a/stdlib/source/program/aedifex/parser.lux b/stdlib/source/program/aedifex/parser.lux
index b2e6ab0f9..7405deebc 100644
--- a/stdlib/source/program/aedifex/parser.lux
+++ b/stdlib/source/program/aedifex/parser.lux
@@ -185,7 +185,7 @@
(dictionary.of_list text.hash)
(<code>.record (<>.some (<>.and <code>.local_tag
<code>.any))))
- #let [^parents (: (Parser (List /.Name))
+ .let [^parents (: (Parser (List /.Name))
(<>.else (list)
(..plural input "parents" <code>.text)))
^identity (: (Parser (Maybe Artifact))
diff --git a/stdlib/source/program/aedifex/pom.lux b/stdlib/source/program/aedifex/pom.lux
index e37bbe0e9..e1f242b69 100644
--- a/stdlib/source/program/aedifex/pom.lux
+++ b/stdlib/source/program/aedifex/pom.lux
@@ -128,11 +128,11 @@
(def: (info value)
(-> /.Info (List XML))
($_ list\compose
- (|> value (get@ #/.url) (maybe\map (..property ..url_tag)) maybe.to_list)
- (|> value (get@ #/.description) (maybe\map (..property "description")) maybe.to_list)
+ (|> value (get@ #/.url) (maybe\map (..property ..url_tag)) maybe.list)
+ (|> value (get@ #/.description) (maybe\map (..property "description")) maybe.list)
(|> value (get@ #/.licenses) (list\map ..license) (..group "licenses") list)
- (|> value (get@ #/.scm) (maybe\map ..scm) maybe.to_list)
- (|> value (get@ #/.organization) (maybe\map ..organization) maybe.to_list)
+ (|> value (get@ #/.scm) (maybe\map ..scm) maybe.list)
+ (|> value (get@ #/.organization) (maybe\map ..organization) maybe.list)
(|> value (get@ #/.developers) (list\map ..developer) (..group "developers") list)
(|> value (get@ #/.contributors) (list\map ..contributor) (..group "contributors") list)
))
@@ -147,8 +147,8 @@
($_ list\compose
(list ..version)
(..artifact identity)
- (|> value (get@ #/.repositories) set.to_list (list\map ..repository) (..group "repositories") list)
- (|> value (get@ #/.dependencies) set.to_list (list\map ..dependency) (..group ..dependencies_tag) list)
+ (|> value (get@ #/.repositories) set.list (list\map ..repository) (..group "repositories") list)
+ (|> value (get@ #/.dependencies) set.list (list\map ..dependency) (..group ..dependencies_tag) list)
)))
_
diff --git a/stdlib/source/program/aedifex/repository/local.lux b/stdlib/source/program/aedifex/repository/local.lux
index db9395c09..6cfdd0f0b 100644
--- a/stdlib/source/program/aedifex/repository/local.lux
+++ b/stdlib/source/program/aedifex/repository/local.lux
@@ -48,7 +48,7 @@
(def: (upload uri content)
(do {! async.monad}
- [#let [absolute_path (..absolute_path program (\ fs separator) uri)]
+ [.let [absolute_path (..absolute_path program (\ fs separator) uri)]
? (\ fs file? absolute_path)
_ (if ?
(in [])
diff --git a/stdlib/source/program/compositor.lux b/stdlib/source/program/compositor.lux
index 6d19548fb..543fdfdf9 100644
--- a/stdlib/source/program/compositor.lux
+++ b/stdlib/source/program/compositor.lux
@@ -76,9 +76,9 @@
(All [a]
(-> (Async (Try a)) (Async (Try a))))
(do async.monad
- [#let [start (io.run instant.now)]
+ [.let [start (io.run instant.now)]
output process
- #let [_ ("lux io log" (|> (io.run instant.now)
+ .let [_ ("lux io log" (|> (io.run instant.now)
(instant.span start)
%.duration
(format "Duration: ")))]]
@@ -135,7 +135,7 @@
(<| (or_crash! "Compilation failed:")
..timed
(do (try.with async.monad)
- [#let [[compilation_sources compilation_host_dependencies compilation_libraries compilation_target compilation_module] compilation]
+ [.let [[compilation_sources compilation_host_dependencies compilation_libraries compilation_target compilation_module] compilation]
import (/import.import (get@ #platform.&file_system platform) compilation_libraries)
[state archive] (:sharing [<parameters>]
(Platform <parameters>)
diff --git a/stdlib/source/program/compositor/import.lux b/stdlib/source/program/compositor/import.lux
index eec954cd5..b8e27ebc4 100644
--- a/stdlib/source/program/compositor/import.lux
+++ b/stdlib/source/program/compositor/import.lux
@@ -50,7 +50,7 @@
(\ ! map (let [! try.monad]
(|>> (\ ! map (<binary>.run tar.parser))
(\ ! join)
- (\ ! map (|>> row.to_list
+ (\ ! map (|>> row.list
(monad.fold ! (function (_ entry import)
(case entry
(#tar.Normal [path instant mode ownership content])
diff --git a/stdlib/source/program/scriptum.lux b/stdlib/source/program/scriptum.lux
index 941c55087..ba35a2169 100644
--- a/stdlib/source/program/scriptum.lux
+++ b/stdlib/source/program/scriptum.lux
@@ -66,7 +66,7 @@
(-> Nat Nat Nat)
(n.- (n./ 2 id) level))
-(def: (parameter_to_name [type_func_name type_function_arguments] level id)
+(def: (parameter_name [type_func_name type_function_arguments] level id)
(-> [Text (List Text)] Nat Nat Text)
(if (type_arg? id)
(let [arg_id (..arg_id level id)]
@@ -81,7 +81,7 @@
(sequence.item arg_id))))
type_func_name))
-(def: (level_to_args offset level)
+(def: (level_parameters offset level)
(-> Nat Nat (List Text))
(if (n.= 0 level)
(list)
@@ -97,13 +97,13 @@
(list\map (|>> (format prefix)))
(text.join_with text.new_line)))
-(def: (pprint_type_definition level type_func_info tags module signature? recursive_type? type)
+(def: (pprint_type_definition level type_func_info tags module interface? recursive_type? type)
(-> Nat [Text (List Text)] (List Name) Text Bit Bit Type Text)
(case tags
(^ (list [_ single_tag]))
- (if signature?
- (format "(: " (pprint_type_definition level type_func_info #.None module signature? recursive_type? type) text.new_line " " single_tag ")")
- (format "{#" single_tag " " (pprint_type_definition level type_func_info #.None module signature? recursive_type? type) "}"))
+ (if interface?
+ (format "(: " (pprint_type_definition level type_func_info #.None module interface? recursive_type? type) text.new_line " " single_tag ")")
+ (format "{#" single_tag " " (pprint_type_definition level type_func_info #.None module interface? recursive_type? type) "}"))
_
(case [recursive_type? type]
@@ -113,7 +113,7 @@
(format "(primitive " (%.text name) ")")
_
- (format "(primitive " (%.text name) " " (|> params (list\map (pprint_type_definition level type_func_info #.None module signature? recursive_type?)) (text.join_with " ")) ")"))
+ (format "(primitive " (%.text name) " " (|> params (list\map (pprint_type_definition level type_func_info #.None module interface? recursive_type?)) (text.join_with " ")) ")"))
[_ (#.Sum _)]
(let [members (type.flat_variant type)]
@@ -121,7 +121,7 @@
#.End
(format "(Or "
(|> members
- (list\map (pprint_type_definition level type_func_info #.None module signature? recursive_type?))
+ (list\map (pprint_type_definition level type_func_info #.None module interface? recursive_type?))
(text.join_with " "))
")")
@@ -134,41 +134,41 @@
(let [types (type.flat_tuple type)]
(format "(#" t_name " "
(|> types
- (list\map (pprint_type_definition level type_func_info #.None module signature? recursive_type?))
+ (list\map (pprint_type_definition level type_func_info #.None module interface? recursive_type?))
(text.join_with " "))
")"))
_
- (format "(#" t_name " " (pprint_type_definition level type_func_info #.None module signature? recursive_type? type) ")"))))
+ (format "(#" t_name " " (pprint_type_definition level type_func_info #.None module interface? recursive_type? type) ")"))))
(text.join_with text.new_line))))
[_ (#.Product _)]
(let [members (type.flat_tuple type)]
(case tags
#.End
- (format "[" (|> members (list\map (pprint_type_definition level type_func_info #.None module signature? recursive_type?)) (text.join_with " ")) "]")
+ (format "[" (|> members (list\map (pprint_type_definition level type_func_info #.None module interface? recursive_type?)) (text.join_with " ")) "]")
_
(let [member_docs (|> members
(list.zipped/2 tags)
(list\map (function (_ [[_ t_name] type])
- (if signature?
- (format "(: " (pprint_type_definition level type_func_info #.None module signature? recursive_type? type) text.new_line " " t_name ")")
- (format "#" t_name " " (pprint_type_definition level type_func_info #.None module signature? recursive_type? type)))))
+ (if interface?
+ (format "(: " (pprint_type_definition level type_func_info #.None module interface? recursive_type? type) text.new_line " " t_name ")")
+ (format "#" t_name " " (pprint_type_definition level type_func_info #.None module interface? recursive_type? type)))))
(text.join_with (format text.new_line " ")))]
- (if signature?
+ (if interface?
member_docs
(format "{" member_docs "}")))))
[_ (#.Function input output)]
(let [[ins out] (type.flat_function type)]
- (format "(-> " (|> ins (list\map (pprint_type_definition level type_func_info #.None module signature? recursive_type?)) (text.join_with " "))
+ (format "(-> " (|> ins (list\map (pprint_type_definition level type_func_info #.None module interface? recursive_type?)) (text.join_with " "))
" "
- (pprint_type_definition level type_func_info #.None module signature? recursive_type? out)
+ (pprint_type_definition level type_func_info #.None module interface? recursive_type? out)
")"))
[_ (#.Parameter idx)]
- (parameter_to_name type_func_info level idx)
+ (parameter_name type_func_info level idx)
(^template [<tag> <pre> <post>]
[[_ (<tag> id)]
@@ -179,8 +179,8 @@
(^template [<tag> <name> <flat>]
[[_ (<tag> _)]
(let [[level' body] (<flat> type)
- args (level_to_args level level')
- body_doc (pprint_type_definition (n.+ level level') type_func_info tags module signature? recursive_type? body)]
+ args (level_parameters level level')
+ body_doc (pprint_type_definition (n.+ level level') type_func_info tags module interface? recursive_type? body)]
(format "(" <name> " " "[" (text.join_with " " args) "]"
(case tags
#.End
@@ -197,7 +197,7 @@
[_ (#.Apply param fun)]
(let [[type_func type_arguments] (type.flat_application type)]
- (format "(" (pprint_type_definition level type_func_info tags module signature? recursive_type? type_func) " " (|> type_arguments (list\map (pprint_type_definition level type_func_info #.None module signature? recursive_type?)) (text.join_with " ")) ")"))
+ (format "(" (pprint_type_definition level type_func_info tags module interface? recursive_type? type_func) " " (|> type_arguments (list\map (pprint_type_definition level type_func_info #.None module interface? recursive_type?)) (text.join_with " ")) ")"))
[_ (#.Named [_module _name] type)]
(if (text\= module _module)
@@ -233,7 +233,7 @@
")"))
(#.Parameter idx)
- (parameter_to_name [type_func_name (list)] level idx)
+ (parameter_name [type_func_name (list)] level idx)
(^template [<tag> <pre> <post>]
[(<tag> id)
@@ -244,7 +244,7 @@
(^template [<tag> <name> <flat>]
[(<tag> _)
(let [[level' body] (<flat> type)
- args (level_to_args level level')
+ args (level_parameters level level')
body_doc (pprint_type (n.+ level level') type_func_name module body)]
(format "(" <name> " " "[" (|> args (list.interpose " ") (text.join_with "")) "]"
(format " " body_doc)
@@ -354,10 +354,10 @@
(#.Named type_name type)
(do meta.monad
[tags (meta.tags_of type_name)
- #let [[_ _name] type_name
+ .let [[_ _name] type_name
recursive_type? (annotation.recursive_type? def_annotations)
type_arguments (annotation.type_arguments def_annotations)
- signature? (annotation.signature? def_annotations)
+ interface? (annotation.interface? def_annotations)
usage (case type_arguments
#.End
_name
@@ -365,13 +365,13 @@
_
(format "(" (text.join_with " " (list& _name type_arguments)) ")"))
nesting (list.size type_arguments)]]
- (in (md.code (format (if signature? "(interface: " "(type: ")
+ (in (md.code (format (if interface? "(interface: " "(type: ")
(if recursive_type? "#rec " "")
usage text.new_line
(|> type
(unravel_type_func nesting)
(when> [(new> recursive_type? [])] [unrecurse_type])
- (pprint_type_definition (dec nesting) [_name type_arguments] (maybe.else (list) tags) module signature? recursive_type?)
+ (pprint_type_definition (dec nesting) [_name type_arguments] (maybe.else (list) tags) module interface? recursive_type?)
(text.split_all_with text.new_line)
(list\map (|>> (format " ")))
(text.join_with text.new_line))
@@ -387,7 +387,7 @@
(: (-> Value (Meta (Markdown Block)))
(function (_ [name def_annotations type])
(do meta.monad
- [#let [?doc (annotation.documentation def_annotations)]
+ [.let [?doc (annotation.documentation def_annotations)]
type_code (document_type module type def_annotations)]
(in ($_ md.then
(md.heading/3 name)
@@ -460,7 +460,7 @@
(def: (document_module [[module_name module] organization])
(-> [[Text Module] Organization] (Meta [Text (Markdown Block)]))
(do meta.monad
- [#let [(^slots [#types #macros #implementations #values]) organization
+ [.let [(^slots [#types #macros #implementations #values]) organization
annotations (|> module
(get@ #.module_annotations)
(maybe.else (' {}))
@@ -475,7 +475,7 @@
types_documentation (if (list.empty? types)
(in empty_block)
(document_types module_name types))
- #let [documentation ($_ md.then
+ .let [documentation ($_ md.then
types_documentation
(if (list.empty? macros) empty_block (document_macros module_name macros))
(if (list.empty? implementations) empty_block (document_implementations module_name implementations))
@@ -504,7 +504,7 @@
(macro: (gen_documentation! _)
(do {! meta.monad}
[all_modules meta.modules
- #let [lux_modules (|> all_modules
+ .let [lux_modules (|> all_modules
(list.only (function.compose lux_module? product.left))
(list.sort name_sort))]
lux_exports (monad.map ! (function.compose meta.exports product.left)
@@ -512,7 +512,7 @@
module_documentation (|> (list\map organize_definitions lux_exports)
(list.zipped/2 lux_modules)
(monad.map ! document_module))
- #let [_ (io.run (monad.map io.monad save_documentation! module_documentation))]]
+ .let [_ (io.run (monad.map io.monad save_documentation! module_documentation))]]
(in (list))))
(gen_documentation!)
diff --git a/stdlib/source/specification/aedifex/repository.lux b/stdlib/source/specification/aedifex/repository.lux
index 1b16d774d..059a467e4 100644
--- a/stdlib/source/specification/aedifex/repository.lux
+++ b/stdlib/source/specification/aedifex/repository.lux
@@ -29,11 +29,11 @@
[expected (_binary.random 100)]
(in ($_ _.and'
(do async.monad
- [#let [good_uri (/remote.uri (get@ #//artifact.version valid_artifact) valid_artifact //artifact/extension.lux_library)]
+ [.let [good_uri (/remote.uri (get@ #//artifact.version valid_artifact) valid_artifact //artifact/extension.lux_library)]
good_upload! (\ subject upload good_uri expected)
good_download! (\ subject download good_uri)
- #let [bad_uri (/remote.uri (get@ #//artifact.version invalid_artifact) invalid_artifact //artifact/extension.lux_library)]
+ .let [bad_uri (/remote.uri (get@ #//artifact.version invalid_artifact) invalid_artifact //artifact/extension.lux_library)]
bad_upload! (\ subject upload bad_uri expected)
bad_download! (\ subject download bad_uri)]
(_.cover' [/.Repository]
diff --git a/stdlib/source/specification/compositor.lux b/stdlib/source/specification/compositor.lux
index 5645b0164..8cc92ff33 100644
--- a/stdlib/source/specification/compositor.lux
+++ b/stdlib/source/specification/compositor.lux
@@ -50,7 +50,7 @@
Test))
(do r.monad
[_ (in [])
- #let [?state,runner,definer (<| io.run
+ .let [?state,runner,definer (<| io.run
(do io.monad
[platform platform])
(/common.executors platform
diff --git a/stdlib/source/specification/compositor/common.lux b/stdlib/source/specification/compositor/common.lux
index 0b7c7979a..fdd930ec8 100644
--- a/stdlib/source/specification/compositor/common.lux
+++ b/stdlib/source/specification/compositor/common.lux
@@ -73,7 +73,7 @@
[?state (platform.initialize target expander analysis_bundle platform generation_bundle directive_bundle program extender)]
(in (do try.monad
[[directive_bundle directive_state] ?state
- #let [generation_state (get@ [#directive.generation
+ .let [generation_state (get@ [#directive.generation
#directive.state]
directive_state)]]
(in [[directive_bundle directive_state]
diff --git a/stdlib/source/specification/compositor/generation/case.lux b/stdlib/source/specification/compositor/generation/case.lux
index 117aab697..0ef6fc025 100644
--- a/stdlib/source/specification/compositor/generation/case.lux
+++ b/stdlib/source/specification/compositor/generation/case.lux
@@ -68,7 +68,7 @@
[size ..size
idx (|> r.nat (\ ! map (n.% size)))
[subS subP] case
- #let [unitS (synthesis.text synthesis.unit)
+ .let [unitS (synthesis.text synthesis.unit)
caseS (synthesis.tuple
(list.concat (list (list.repeat idx unitS)
(list subS)
@@ -83,7 +83,7 @@
[size ..size
idx (|> r.nat (\ ! map (n.% size)))
[subS subP] case
- #let [right? (tail? size idx)
+ .let [right? (tail? size idx)
caseS (synthesis.variant
{#analysis.lefts idx
#analysis.right? right?
diff --git a/stdlib/source/specification/compositor/generation/common.lux b/stdlib/source/specification/compositor/generation/common.lux
index c13cd9eae..e17692b30 100644
--- a/stdlib/source/specification/compositor/generation/common.lux
+++ b/stdlib/source/specification/compositor/generation/common.lux
@@ -181,7 +181,7 @@
sample_alpha (|> (r.ascii/alpha sample_size)
(r.only (|>> (text\= sample_upper) not)))
char_idx (|> r.nat (\ ! map (n.% sample_size)))
- #let [sample_lowerS (synthesis.text sample_lower)
+ .let [sample_lowerS (synthesis.text sample_lower)
sample_upperS (synthesis.text sample_upper)
sample_alphaS (synthesis.text sample_alpha)
concatenatedS (#synthesis.Extension "lux text concat" (list sample_lowerS sample_upperS))
diff --git a/stdlib/source/specification/compositor/generation/function.lux b/stdlib/source/specification/compositor/generation/function.lux
index 5be34bfa5..3589cdf28 100644
--- a/stdlib/source/specification/compositor/generation/function.lux
+++ b/stdlib/source/specification/compositor/generation/function.lux
@@ -53,7 +53,7 @@
[[arity local functionS] ..function
partial_arity (|> r.nat (\ ! map (|>> (n.% arity) (n.max 1))))
inputs (r.list arity r.safe_frac)
- #let [expectation (maybe.assume (list.item (dec local) inputs))
+ .let [expectation (maybe.assume (list.item (dec local) inputs))
inputsS (list\map (|>> synthesis.f64) inputs)]]
($_ _.and
(_.test "Can read arguments."
diff --git a/stdlib/source/specification/compositor/generation/structure.lux b/stdlib/source/specification/compositor/generation/structure.lux
index 4cc4f0676..46c25c8a3 100644
--- a/stdlib/source/specification/compositor/generation/structure.lux
+++ b/stdlib/source/specification/compositor/generation/structure.lux
@@ -33,7 +33,7 @@
(do {! r.monad}
[num_tags (|> r.nat (\ ! map (|>> (n.% 10) (n.max 2))))
tag_in (|> r.nat (\ ! map (n.% num_tags)))
- #let [last?_in (|> num_tags dec (n.= tag_in))]
+ .let [last?_in (|> num_tags dec (n.= tag_in))]
value_in r.i64]
(_.test (%.name (name_of synthesis.variant))
(|> (synthesis.variant {#analysis.lefts (if last?_in
@@ -76,7 +76,7 @@
(and (n.= size (array.size tuple_out))
(list.every? (function (_ [left right])
(i.= left (:as Int right)))
- (list.zipped/2 tuple_in (array.to_list tuple_out)))))
+ (list.zipped/2 tuple_in (array.list tuple_out)))))
(#try.Failure _)
false)))))
diff --git a/stdlib/source/specification/lux/abstract/comonad.lux b/stdlib/source/specification/lux/abstract/comonad.lux
index 8b45adb88..0f5f18965 100644
--- a/stdlib/source/specification/lux/abstract/comonad.lux
+++ b/stdlib/source/specification/lux/abstract/comonad.lux
@@ -20,7 +20,7 @@
morphism (\ ! map (function (_ diff)
(|>> _//out (n.+ diff)))
random.nat)
- #let [start (injection sample)]]
+ .let [start (injection sample)]]
(_.test "Left identity."
(n.= (morphism start)
(|> start _//split (_//map morphism) _//out)))))
@@ -29,7 +29,7 @@
(All [f] (-> (Injection f) (Comparison f) (CoMonad f) Test))
(do random.monad
[sample random.nat
- #let [start (injection sample)
+ .let [start (injection sample)
== (comparison n.=)]]
(_.test "Right identity."
(== start
@@ -45,7 +45,7 @@
decrease (\ ! map (function (_ diff)
(|>> _//out(n.- diff)))
random.nat)
- #let [start (injection sample)
+ .let [start (injection sample)
== (comparison n.=)]]
(_.test "Associativity."
(== (|> start _//split (_//map (|>> _//split (_//map increase) decrease)))
diff --git a/stdlib/source/specification/lux/world/console.lux b/stdlib/source/specification/lux/world/console.lux
index 5632e5cd8..154f8faca 100644
--- a/stdlib/source/specification/lux/world/console.lux
+++ b/stdlib/source/specification/lux/world/console.lux
@@ -29,7 +29,7 @@
?close/good (\ console close [])
?close/bad (\ console close [])
- #let [can_write!
+ .let [can_write!
(case ?write
(#try.Success _)
true
diff --git a/stdlib/source/specification/lux/world/file.lux b/stdlib/source/specification/lux/world/file.lux
index 147593f14..83bfc2465 100644
--- a/stdlib/source/specification/lux/world/file.lux
+++ b/stdlib/source/specification/lux/world/file.lux
@@ -126,7 +126,7 @@
[made_sub? (\ fs make_directory sub_dir)
directory_files (\ fs directory_files parent)
sub_directories (\ fs sub_directories parent)
- #let [(^open "list\.") (list.equivalence text.equivalence)]]
+ .let [(^open "list\.") (list.equivalence text.equivalence)]]
(in (<| (try.else false)
(do try.monad
[_ made_sub?]
@@ -173,7 +173,7 @@
in
(do {! async.monad}
[fs (async.future fs)
- #let [path (/.rooted fs parent child)]
+ .let [path (/.rooted fs parent child)]
directory?&make_directory
(..directory?&make_directory fs parent)
@@ -215,7 +215,7 @@
in
(do {! async.monad}
[fs (async.future fs)
- #let [dir/1 (/.rooted fs dir/0 dir/1)
+ .let [dir/1 (/.rooted fs dir/0 dir/1)
dir/2 (/.rooted fs dir/1 dir/2)]
pre_dir/0 (\ fs directory? dir/0)
pre_dir/1 (\ fs directory? dir/1)
diff --git a/stdlib/source/test/aedifex/cache.lux b/stdlib/source/test/aedifex/cache.lux
index 614420fde..07d39f00f 100644
--- a/stdlib/source/test/aedifex/cache.lux
+++ b/stdlib/source/test/aedifex/cache.lux
@@ -54,7 +54,7 @@
(def: profile
(Random [Artifact Profile XML])
(random.one (function (_ profile)
- (try.to_maybe
+ (try.maybe
(do try.monad
[pom (//pom.write profile)
identity (try.of_maybe (get@ #//.identity profile))]
@@ -82,7 +82,7 @@
(do {! random.monad}
[[main_dependency main_package] ..package
dependencies (|> (//package.dependencies main_package)
- (\ try.monad map set.to_list)
+ (\ try.monad map set.list)
(try.else (list))
(monad.map ! (function (_ dependency)
(do !
@@ -91,7 +91,7 @@
(set@ #//.dependencies (set.empty //dependency.hash))
(set@ #//.identity (#.Some (get@ #//dependency.artifact dependency)))
//pom.write
- try.to_maybe))
+ try.maybe))
..profile)
content ..content]
(in [dependency
@@ -104,7 +104,7 @@
[[dependency expected_package] ..package
home (random.ascii/alpha 5)
working_directory (random.ascii/alpha 5)
- #let [fs (: (file.System Async)
+ .let [fs (: (file.System Async)
(file.mock (\ file.default separator)))
program (program.async (program.mock environment.empty home working_directory))]]
(in (do async.monad
@@ -125,7 +125,7 @@
[expected ..resolution
home (random.ascii/alpha 5)
working_directory (random.ascii/alpha 5)
- #let [fs (: (file.System Async)
+ .let [fs (: (file.System Async)
(file.mock (\ file.default separator)))
program (program.async (program.mock environment.empty home working_directory))]]
(in (do async.monad
diff --git a/stdlib/source/test/aedifex/command/auto.lux b/stdlib/source/test/aedifex/command/auto.lux
index fd08f541c..a5b598b11 100644
--- a/stdlib/source/test/aedifex/command/auto.lux
+++ b/stdlib/source/test/aedifex/command/auto.lux
@@ -68,13 +68,13 @@
(<| (_.covering /._)
(do {! random.monad}
[end_signal (random.ascii/alpha 5)
- #let [/ (\ file.default separator)
+ .let [/ (\ file.default separator)
[fs watcher] (watch.mock /)]
program (random.ascii/alpha 5)
target (random.ascii/alpha 5)
source (random.ascii/alpha 5)
- #let [empty_profile (: Profile
+ .let [empty_profile (: Profile
(\ ///.monoid identity))
with_target (: (-> Profile Profile)
(set@ #///.target target))
@@ -99,7 +99,7 @@
[verdict (do ///action.monad
[_ (\ fs make_directory source)
_ (\ fs write (binary.create 0) dummy_path)
- #let [[@runs command] (..command expected_runs end_signal fs dummy_path)]
+ .let [[@runs command] (..command expected_runs end_signal fs dummy_path)]
_ (\ watcher poll [])]
(do {! async.monad}
[no_dangling_process! (|> profile
diff --git a/stdlib/source/test/aedifex/command/build.lux b/stdlib/source/test/aedifex/command/build.lux
index 1a1ff7f60..be7c8b55e 100644
--- a/stdlib/source/test/aedifex/command/build.lux
+++ b/stdlib/source/test/aedifex/command/build.lux
@@ -109,7 +109,7 @@
(Random Dependency)
(do random.monad
[lux_version (random.ascii/alpha 5)
- #let [js_compiler {#///dependency.artifact {#///artifact.group /.lux_group
+ .let [js_compiler {#///dependency.artifact {#///artifact.group /.lux_group
#///artifact.name /.js_compiler_name
#///artifact.version lux_version}
#///dependency.type ///artifact/type.js_library}]]
@@ -142,13 +142,13 @@
(do {! random.monad}
[last_read (random.ascii/alpha 5)
last_error (random.ascii/alpha 5)
- #let [fs (file.mock (\ file.default separator))
+ .let [fs (file.mock (\ file.default separator))
shell (shell.async (..good_shell []))]
program (random.ascii/alpha 5)
target (random.ascii/alpha 5)
home (random.ascii/alpha 5)
working_directory (random.ascii/alpha 5)
- #let [empty_profile (: Profile
+ .let [empty_profile (: Profile
(\ ///.monoid identity))
with_target (: (-> Profile Profile)
(set@ #///.target target))
@@ -179,7 +179,7 @@
(#try.Failure error)
(exception.match? /.no_available_compiler error)))))
(do !
- [#let [console (@version.echo "")]
+ [.let [console (@version.echo "")]
[compiler resolution] ..resolution]
(in (do async.monad
[verdict (do ///action.monad
@@ -201,7 +201,7 @@
/.success]
(try.else false verdict)))))
(do !
- [#let [console (@version.echo "")]
+ [.let [console (@version.echo "")]
[compiler resolution] ..resolution]
(in (do async.monad
[verdict (do ///action.monad
diff --git a/stdlib/source/test/aedifex/command/clean.lux b/stdlib/source/test/aedifex/command/clean.lux
index 36ed10b8e..523cf6ccc 100644
--- a/stdlib/source/test/aedifex/command/clean.lux
+++ b/stdlib/source/test/aedifex/command/clean.lux
@@ -46,7 +46,7 @@
[count (\ ! map (n.% 10) random.nat)
names (random.set text.hash count ..node_name)
contents (random.list count ($binary.random 100))]
- (in (list.zipped/2 (list\map (|>> (format prefix)) (set.to_list names))
+ (in (list.zipped/2 (list\map (|>> (format prefix)) (set.list names))
contents))))
(def: (create_file! fs [path content])
@@ -87,7 +87,7 @@
[context ..node_name
target ..node_name
sub ..node_name
- #let [fs (file.mock (\ file.default separator))
+ .let [fs (file.mock (\ file.default separator))
/ (\ fs separator)
target_path (format context / target)
sub_path (format target_path / sub)]
@@ -96,7 +96,7 @@
dummy @profile.random]
(in (do async.monad
- [#let [console (@version.echo "")]
+ [.let [console (@version.echo "")]
verdict (do {! (try.with async.monad)}
[_ (..create_directory! fs target_path direct_files)
_ (..create_directory! fs sub_path sub_files)
diff --git a/stdlib/source/test/aedifex/command/deploy.lux b/stdlib/source/test/aedifex/command/deploy.lux
index b34584b19..d315c646c 100644
--- a/stdlib/source/test/aedifex/command/deploy.lux
+++ b/stdlib/source/test/aedifex/command/deploy.lux
@@ -54,7 +54,7 @@
Artifact ///.Profile
(Async (Try Text)))
(do ///action.monad
- [#let [console ($version.echo "")]
+ [.let [console ($version.echo "")]
_ ($install.make_sources! fs (get@ #///.sources profile))
_ (/.do! console repository fs artifact profile)]
(\ console read_line [])))
@@ -73,7 +73,7 @@
home (random.ascii/alpha 5)
working_directory (random.ascii/alpha 5)
- #let [repository (///repository.mock $repository.mock
+ .let [repository (///repository.mock $repository.mock
$repository.empty)
fs (file.mock (\ file.default separator))
program (program.async (program.mock environment.empty home working_directory))]]
@@ -82,7 +82,7 @@
[logging (..execute! program repository fs artifact profile)
expected_library (|> profile
(get@ #///.sources)
- set.to_list
+ set.list
(export.library fs)
(\ ! map (format.run tar.writer)))
@@ -99,7 +99,7 @@
[actual_md5 (\ utf8.codec decode actual_md5)]
(\ ///hash.md5_codec decode actual_md5)))
- #let [succeeded!
+ .let [succeeded!
(text\= /.success logging)
deployed_library!
diff --git a/stdlib/source/test/aedifex/command/deps.lux b/stdlib/source/test/aedifex/command/deps.lux
index 165c859b8..0d816ec02 100644
--- a/stdlib/source/test/aedifex/command/deps.lux
+++ b/stdlib/source/test/aedifex/command/deps.lux
@@ -67,7 +67,7 @@
[_ dependee_package] $///package.random
[_ depender_package] $///package.random
- #let [dependee {#///dependency.artifact dependee_artifact
+ .let [dependee {#///dependency.artifact dependee_artifact
#///dependency.type ///artifact/type.lux_library}
depender {#///dependency.artifact depender_artifact
#///dependency.type ///artifact/type.lux_library}
@@ -97,7 +97,7 @@
program (program.async (program.mock environment.empty home working_directory))]]
(in (do async.monad
[verdict (do ///action.monad
- [#let [console (@version.echo "")
+ [.let [console (@version.echo "")
local (///repository/local.repository program fs)]
pre (|> ///dependency/resolution.empty
(dictionary.put dependee dependee_package)
@@ -110,7 +110,7 @@
(function (_ url)
(///repository.mock $///dependency/resolution.nope []))))
- #let [had_dependee_before!
+ .let [had_dependee_before!
(set.member? pre dependee_artifact)
lacked_depender_before!
diff --git a/stdlib/source/test/aedifex/command/install.lux b/stdlib/source/test/aedifex/command/install.lux
index f68fcb732..ed0a3a7d3 100644
--- a/stdlib/source/test/aedifex/command/install.lux
+++ b/stdlib/source/test/aedifex/command/install.lux
@@ -44,7 +44,7 @@
(let [/ (\ fs separator)
! ///action.monad]
(|> sources
- set.to_list
+ set.list
(monad.map ! (function (_ head)
(do !
[_ (: (Async (Try Any))
@@ -55,7 +55,7 @@
(def: (execute! program fs sample)
(-> (Program Async) (file.System Async) ///.Profile (Async (Try Text)))
(do ///action.monad
- [#let [console ($version.echo "")]
+ [.let [console ($version.echo "")]
_ (..make_sources! fs (get@ #///.sources sample))
_ (/.do! console fs (///repository/local.repository program fs) sample)]
(\ console read_line [])))
@@ -69,10 +69,10 @@
$profile.random)
home (random.ascii/alpha 5)
working_directory (random.ascii/alpha 5)
- #let [/ (\ file.default separator)]]
+ .let [/ (\ file.default separator)]]
($_ _.and
(in (do {! async.monad}
- [#let [fs (file.mock /)
+ [.let [fs (file.mock /)
program (program.async (program.mock environment.empty home working_directory))
artifact_path (///local.uri (get@ #///artifact.version identity) identity)
@@ -95,7 +95,7 @@
(_.cover' [/.do! /.success]
(try.else false verdict))))
(in (do {! async.monad}
- [#let [fs (file.mock /)
+ [.let [fs (file.mock /)
program (program.async (program.mock environment.empty home working_directory))]
logging (..execute! program fs (set@ #///.identity #.None sample))]
(_.cover' [/.failure]
diff --git a/stdlib/source/test/aedifex/command/pom.lux b/stdlib/source/test/aedifex/command/pom.lux
index 6578e793f..54a365468 100644
--- a/stdlib/source/test/aedifex/command/pom.lux
+++ b/stdlib/source/test/aedifex/command/pom.lux
@@ -35,9 +35,9 @@
(<| (_.covering /._)
(do random.monad
[sample @profile.random
- #let [fs (file.mock (\ file.default separator))]]
+ .let [fs (file.mock (\ file.default separator))]]
(in (do {! async.monad}
- [#let [console (@version.echo "")]
+ [.let [console (@version.echo "")]
outcome (/.do! console fs sample)]
(case outcome
(#try.Success _)
@@ -53,7 +53,7 @@
(text\= /.success)
(\ console read_line []))
- #let [expected_content!
+ .let [expected_content!
(binary\= expected actual)]]
(in (and logging!
expected_content!)))]
diff --git a/stdlib/source/test/aedifex/command/test.lux b/stdlib/source/test/aedifex/command/test.lux
index b82a32678..52c167ee9 100644
--- a/stdlib/source/test/aedifex/command/test.lux
+++ b/stdlib/source/test/aedifex/command/test.lux
@@ -47,7 +47,7 @@
target (random.ascii/alpha 5)
home (random.ascii/alpha 5)
working_directory (random.ascii/alpha 5)
- #let [empty_profile (: Profile
+ .let [empty_profile (: Profile
(\ ///.monoid identity))
with_target (: (-> Profile Profile)
(set@ #///.target target))
@@ -81,7 +81,7 @@
console (@version.echo "")]
(in (do async.monad
[verdict (do ///action.monad
- [#let [bad_shell (shell.mock
+ [.let [bad_shell (shell.mock
(function (_ [actual_environment actual_working_directory actual_command actual_arguments])
(#try.Success
(: (shell.Mock [])
diff --git a/stdlib/source/test/aedifex/command/version.lux b/stdlib/source/test/aedifex/command/version.lux
index b501573d7..aaf320c60 100644
--- a/stdlib/source/test/aedifex/command/version.lux
+++ b/stdlib/source/test/aedifex/command/version.lux
@@ -69,7 +69,7 @@
(do random.monad
[profile @profile.random]
(in (do async.monad
- [#let [console (..echo "")]
+ [.let [console (..echo "")]
verdict (do (try.with async.monad)
[_ (/.do! console profile)
logging (\ console read_line [])]
diff --git a/stdlib/source/test/aedifex/dependency/deployment.lux b/stdlib/source/test/aedifex/dependency/deployment.lux
index 9c575ff53..8c1e2e61a 100644
--- a/stdlib/source/test/aedifex/dependency/deployment.lux
+++ b/stdlib/source/test/aedifex/dependency/deployment.lux
@@ -135,7 +135,7 @@
(Random [Dependency Artifact Package])
(do random.monad
[[profile package] $///package.random
- #let [artifact (|> profile
+ .let [artifact (|> profile
(get@ #profile.identity)
maybe.assume)
dependency (: Dependency
@@ -152,7 +152,7 @@
($_ _.and
(do {! random.monad}
[[dependency expected_artifact package] ..bundle
- #let [cache (: Cache
+ .let [cache (: Cache
(atom.atom (dictionary.empty text.hash)))
http (..http cache)
repository (repository.async (remote.repository http #.None address))]]
@@ -164,14 +164,14 @@
(try\map (verify_one 1 address package cache expected_artifact))
(try.else false))))))
(do {! random.monad}
- [#let [hash (: (Hash [Dependency Artifact Package])
+ [.let [hash (: (Hash [Dependency Artifact Package])
(\ hash.functor map (|>> product.right product.left product.left)
text.hash))]
num_bundles (\ ! map (n.% 10) random.nat)
bundles (|> ..bundle
(random.set hash num_bundles)
- (\ ! map set.to_list))
- #let [resolution (list\fold (function (_ [dependency expected_artifact package] resolution)
+ (\ ! map set.list))
+ .let [resolution (list\fold (function (_ [dependency expected_artifact package] resolution)
(dictionary.put dependency package resolution))
resolution.empty
bundles)
diff --git a/stdlib/source/test/aedifex/dependency/resolution.lux b/stdlib/source/test/aedifex/dependency/resolution.lux
index fa0391761..89e16691d 100644
--- a/stdlib/source/test/aedifex/dependency/resolution.lux
+++ b/stdlib/source/test/aedifex/dependency/resolution.lux
@@ -254,7 +254,7 @@
(\ ///package.equivalence = expected_package)
not)
$///package.random)
- #let [good (..single expected_artifact expected_package)
+ .let [good (..single expected_artifact expected_package)
bad_sha-1 (..bad_sha-1 expected_artifact expected_package dummy_package)
bad_md5 (..bad_md5 expected_artifact expected_package dummy_package)]]
(`` ($_ _.and
@@ -299,12 +299,12 @@
(\ ///package.equivalence = expected_package)
not)
$///package.random)
- #let [good (..single expected_artifact expected_package)
+ .let [good (..single expected_artifact expected_package)
bad_sha-1 (..bad_sha-1 expected_artifact expected_package dummy_package)
bad_md5 (..bad_md5 expected_artifact expected_package dummy_package)]]
($_ _.and
(in (do async.monad
- [#let [console ($///version.echo "")]
+ [.let [console ($///version.echo "")]
actual_package (/.any console
(list (///repository.mock bad_sha-1 [])
(///repository.mock bad_md5 [])
@@ -321,7 +321,7 @@
(#try.Failure _)
false))))
(in (do async.monad
- [#let [console ($///version.echo "")]
+ [.let [console ($///version.echo "")]
actual_package (/.any console
(list (///repository.mock bad_sha-1 [])
(///repository.mock bad_md5 []))
@@ -358,7 +358,7 @@
[_ depender_package] $///package.random
[_ ignored_package] $///package.random
- #let [dependee {#///dependency.artifact dependee_artifact
+ .let [dependee {#///dependency.artifact dependee_artifact
#///dependency.type ///artifact/type.lux_library}
depender {#///dependency.artifact depender_artifact
#///dependency.type ///artifact/type.lux_library}
@@ -407,7 +407,7 @@
(..packages [dependee_artifact depender_artifact ignored_artifact])]
($_ _.and
(in (do async.monad
- [#let [console ($///version.echo "")]
+ [.let [console ($///version.echo "")]
[successes failures resolution] (/.all console
(list (///repository.mock (..single dependee_artifact dependee_package) [])
(///repository.mock (..single depender_artifact depender_package) [])
diff --git a/stdlib/source/test/aedifex/input.lux b/stdlib/source/test/aedifex/input.lux
index e86efa6dd..4b2ee9ea2 100644
--- a/stdlib/source/test/aedifex/input.lux
+++ b/stdlib/source/test/aedifex/input.lux
@@ -46,11 +46,11 @@
(<| (_.covering /._)
(do {! random.monad}
[expected (\ ! map (set@ #//.parents (list)) $profile.random)
- #let [fs (: (file.System Async)
+ .let [fs (: (file.System Async)
(file.mock (\ file.default separator)))]]
(in (do async.monad
[verdict (do //action.monad
- [#let [profile (|> expected
+ [.let [profile (|> expected
//format.profile
%.code
(\ utf8.codec encode))]
diff --git a/stdlib/source/test/aedifex/metadata/artifact.lux b/stdlib/source/test/aedifex/metadata/artifact.lux
index 0d291d368..95897c212 100644
--- a/stdlib/source/test/aedifex/metadata/artifact.lux
+++ b/stdlib/source/test/aedifex/metadata/artifact.lux
@@ -72,7 +72,7 @@
(_.for [/.Metadata])
(do random.monad
[expected ..random
- #let [artifact {#///artifact.group (get@ #/.group expected)
+ .let [artifact {#///artifact.group (get@ #/.group expected)
#///artifact.name (get@ #/.name expected)
#///artifact.version (|> expected
(get@ #/.versions)
@@ -97,7 +97,7 @@
(do random.monad
[home (random.ascii/lower 5)
working_directory (random.ascii/lower 5)
- #let [program (program.async (program.mock environment.empty home working_directory))
+ .let [program (program.async (program.mock environment.empty home working_directory))
fs (file.mock (\ file.default separator))
repository (///repository/local.repository program fs)]]
(in (do async.monad
diff --git a/stdlib/source/test/aedifex/metadata/snapshot.lux b/stdlib/source/test/aedifex/metadata/snapshot.lux
index ff11ff7ab..4dd751639 100644
--- a/stdlib/source/test/aedifex/metadata/snapshot.lux
+++ b/stdlib/source/test/aedifex/metadata/snapshot.lux
@@ -91,7 +91,7 @@
(_.for [/.Metadata])
(do random.monad
[expected ..random
- #let [artifact (get@ #/.artifact expected)]]
+ .let [artifact (get@ #/.artifact expected)]]
($_ _.and
(_.for [/.equivalence]
($equivalence.spec /.equivalence ..random))
@@ -109,7 +109,7 @@
(do random.monad
[home (random.ascii/lower 5)
working_directory (random.ascii/lower 5)
- #let [program (program.async (program.mock environment.empty home working_directory))
+ .let [program (program.async (program.mock environment.empty home working_directory))
fs (file.mock (\ file.default separator))
repository (///repository/local.repository program fs)]]
(in (do async.monad
diff --git a/stdlib/source/test/aedifex/project.lux b/stdlib/source/test/aedifex/project.lux
index 58ee8c577..809bea253 100644
--- a/stdlib/source/test/aedifex/project.lux
+++ b/stdlib/source/test/aedifex/project.lux
@@ -63,7 +63,7 @@
(not (text\= dummy_name name))
(not (text\= sub_name name))))
(random.ascii/alpha 1))
- #let [project ($_ (\ /.monoid compose)
+ .let [project ($_ (\ /.monoid compose)
(/.project super_name super_profile)
(/.project dummy_name dummy_profile)
(/.project sub_name (set@ #//.parents (list super_name) sub_profile)))
diff --git a/stdlib/source/test/aedifex/repository/local.lux b/stdlib/source/test/aedifex/repository/local.lux
index eab07411f..a63f4c256 100644
--- a/stdlib/source/test/aedifex/repository/local.lux
+++ b/stdlib/source/test/aedifex/repository/local.lux
@@ -30,7 +30,7 @@
[/ (random.ascii/upper 1)
home (random.ascii/lower 10)
working_directory (random.ascii/lower 10)
- #let [fs (file.mock /)
+ .let [fs (file.mock /)
program (program.async (program.mock environment.empty home working_directory))
repo (/.repository program fs)]
diff --git a/stdlib/source/test/lux.lux b/stdlib/source/test/lux.lux
index ca533e853..9d5f719ed 100644
--- a/stdlib/source/test/lux.lux
+++ b/stdlib/source/test/lux.lux
@@ -232,7 +232,7 @@
Test
(do random.monad
[expected random.nat
- #let [local_returner (: (Returner Nat)
+ .let [local_returner (: (Returner Nat)
(/.implementation
(def: (return _)
expected)))]]
@@ -269,7 +269,7 @@
(do random.monad
[start random.nat
factor random.nat
- #let [expected (n.* factor (inc start))]]
+ .let [expected (n.* factor (inc start))]]
($_ _.and
(_.cover [/.|>]
(n.= expected
@@ -463,7 +463,7 @@
expected_left random.nat
expected_right random.nat
- #let [existential_type (\ ! map (|>> #.Ex) random.nat)]
+ .let [existential_type (\ ! map (|>> #.Ex) random.nat)]
expected/0 existential_type
expected/1 existential_type]
(<| (_.for [/.Type])
@@ -648,7 +648,7 @@
shift/s random.nat
shift/b random.nat
text (random.ascii/lower 1)
- #let [expected/s (n.+ shift/s start/s)
+ .let [expected/s (n.+ shift/s start/s)
expected/b (n.+ shift/b start/b)
sample {#big_left start/b
@@ -730,7 +730,7 @@
[left (random.ascii/lower 1)
mid (random.ascii/lower 1)
right (random.ascii/lower 1)
- #let [expected (text.join_with "" (list left mid right))]]
+ .let [expected (text.join_with "" (list left mid right))]]
(_.cover [/.$_ /._$]
(with_expansions [<left_association> (/._$ format
left
@@ -751,7 +751,7 @@
[left random.nat
right random.nat
dummy random.nat
- #let [expected (n.+ left right)]]
+ .let [expected (n.+ left right)]]
($_ _.and
(_.cover [/.as_is]
(`` (and (~~ (as_is true
@@ -985,7 +985,7 @@
(do random.monad
[factor (random\map (|>> (n.% 10) (n.max 1)) random.nat)
iterations (random\map (n.% 10) random.nat)
- #let [expected (n.* factor iterations)]]
+ .let [expected (n.* factor iterations)]]
(_.cover [/.loop]
(n.= expected
(/.loop [counter 0
@@ -996,7 +996,7 @@
(do random.monad
[pre random.nat
post (random.only (|>> (n.= pre) not) random.nat)
- #let [box (atom.atom pre)]]
+ .let [box (atom.atom pre)]]
(_.cover [/.exec]
(and (is? pre (io.run (atom.read box)))
(/.exec
diff --git a/stdlib/source/test/lux/abstract/enum.lux b/stdlib/source/test/lux/abstract/enum.lux
index 6284381d7..7eb4149a1 100644
--- a/stdlib/source/test/lux/abstract/enum.lux
+++ b/stdlib/source/test/lux/abstract/enum.lux
@@ -23,7 +23,7 @@
(do random.monad
[start limit
end limit
- #let [[start end] (if (n.< end start)
+ .let [[start end] (if (n.< end start)
[start end]
[end start])
range (/.range n.enum start end)]]
diff --git a/stdlib/source/test/lux/abstract/equivalence.lux b/stdlib/source/test/lux/abstract/equivalence.lux
index 10af6891d..bdf24150d 100644
--- a/stdlib/source/test/lux/abstract/equivalence.lux
+++ b/stdlib/source/test/lux/abstract/equivalence.lux
@@ -26,7 +26,7 @@
rightI random.int
sample random.nat
different (|> random.nat (random.only (|>> (n.= sample) not)))
- #let [equivalence (: (Equivalence (Equivalence Nat))
+ .let [equivalence (: (Equivalence (Equivalence Nat))
(implementation
(def: (= left right)
(and (bit\= (\ left = leftN leftN)
diff --git a/stdlib/source/test/lux/abstract/hash.lux b/stdlib/source/test/lux/abstract/hash.lux
index 894860935..eecb43227 100644
--- a/stdlib/source/test/lux/abstract/hash.lux
+++ b/stdlib/source/test/lux/abstract/hash.lux
@@ -23,7 +23,7 @@
(do random.monad
[leftN random.nat
rightN random.nat
- #let [hash (: (Equivalence (/.Hash Nat))
+ .let [hash (: (Equivalence (/.Hash Nat))
(implementation
(def: (= (^open "left\.") (^open "right\."))
(and (bit\= (left\= (left\hash leftN) (left\hash leftN))
diff --git a/stdlib/source/test/lux/abstract/interval.lux b/stdlib/source/test/lux/abstract/interval.lux
index 60eeba3df..40c78df27 100644
--- a/stdlib/source/test/lux/abstract/interval.lux
+++ b/stdlib/source/test/lux/abstract/interval.lux
@@ -68,7 +68,7 @@
(do random.monad
[bottom random.nat
top random.nat
- #let [interval (/.between n.enum bottom top)]]
+ .let [interval (/.between n.enum bottom top)]]
($_ _.and
(_.cover [/.between /.within?]
(and (/.within? interval bottom)
@@ -139,14 +139,14 @@
Test
(do {! random.monad}
[[l m r] (|> (random.set n.hash 3 random.nat)
- (\ ! map (|>> set.to_list
+ (\ ! map (|>> set.list
(list.sort n.<)
(case> (^ (list b t1 t2))
[b t1 t2]
_
(undefined)))))
- #let [left (/.singleton n.enum l)
+ .let [left (/.singleton n.enum l)
right (/.singleton n.enum r)]]
($_ _.and
(_.cover [/.precedes? /.succeeds?]
@@ -161,14 +161,14 @@
Test
(do {! random.monad}
[[b t1 t2] (|> (random.set n.hash 3 random.nat)
- (\ ! map (|>> set.to_list
+ (\ ! map (|>> set.list
(list.sort n.<)
(case> (^ (list b t1 t2))
[b t1 t2]
_
(undefined)))))
- #let [int_left (/.between n.enum t1 t2)
+ .let [int_left (/.between n.enum t1 t2)
int_right (/.between n.enum b t1)]]
($_ _.and
(_.cover [/.meets?]
@@ -188,7 +188,7 @@
(do {! random.monad}
[some_interval ..interval
[x0 x1 x2 x3] (|> (random.set n.hash 4 random.nat)
- (\ ! map (|>> set.to_list
+ (\ ! map (|>> set.list
(list.sort n.<)
(case> (^ (list x0 x1 x2 x3))
[x0 x1 x2 x3]
@@ -221,7 +221,7 @@
(do {! random.monad}
[some_interval ..interval
[x0 x1 x2 x3] (|> (random.set n.hash 4 random.nat)
- (\ ! map (|>> set.to_list
+ (\ ! map (|>> set.list
(list.sort n.<)
(case> (^ (list x0 x1 x2 x3))
[x0 x1 x2 x3]
diff --git a/stdlib/source/test/lux/abstract/order.lux b/stdlib/source/test/lux/abstract/order.lux
index 2974a8c88..1f84914f3 100644
--- a/stdlib/source/test/lux/abstract/order.lux
+++ b/stdlib/source/test/lux/abstract/order.lux
@@ -24,7 +24,7 @@
(do random.monad
[left random.nat
right (|> random.nat (random.only (|>> (n.= left) not)))
- #let [equivalence (: (Equivalence (/.Order Nat))
+ .let [equivalence (: (Equivalence (/.Order Nat))
(implementation
(def: (= leftO rightO)
(and (bit\= (\ leftO < left left)
diff --git a/stdlib/source/test/lux/abstract/predicate.lux b/stdlib/source/test/lux/abstract/predicate.lux
index b821865de..f0c7ffbbd 100644
--- a/stdlib/source/test/lux/abstract/predicate.lux
+++ b/stdlib/source/test/lux/abstract/predicate.lux
@@ -34,7 +34,7 @@
(do {! random.monad}
[sample random.nat
samples (random.list 10 random.nat)
- #let [equivalence (: (Equivalence (/.Predicate Nat))
+ .let [equivalence (: (Equivalence (/.Predicate Nat))
(implementation
(def: (= left right)
(bit\= (left sample)
diff --git a/stdlib/source/test/lux/control/concatenative.lux b/stdlib/source/test/lux/control/concatenative.lux
index fe7773eea..4f2774e2b 100644
--- a/stdlib/source/test/lux/control/concatenative.lux
+++ b/stdlib/source/test/lux/control/concatenative.lux
@@ -141,7 +141,7 @@
[choice random.bit
sample random.nat
start random.nat
- #let [distance 10
+ .let [distance 10
|inc| (/.apply/1 inc)
|test| (/.apply/1 (|>> (n.- start) (n.< distance)))]]
($_ _.and
diff --git a/stdlib/source/test/lux/control/concurrency/actor.lux b/stdlib/source/test/lux/control/concurrency/actor.lux
index 6ccc1a7b2..95566db38 100644
--- a/stdlib/source/test/lux/control/concurrency/actor.lux
+++ b/stdlib/source/test/lux/control/concurrency/actor.lux
@@ -49,7 +49,7 @@
Test
(do {! random.monad}
[initial_state random.nat
- #let [as_mail (: (All [a] (-> (-> a a) (/.Mail a)))
+ .let [as_mail (: (All [a] (-> (-> a a) (/.Mail a)))
(function (_ transform)
(function (_ state actor)
(|> state transform #try.Success async\in))))
@@ -201,7 +201,7 @@
[num_events (\ ! map (|>> (n.% 10) inc) random.nat)
events (random.list num_events random.nat)
num_observations (\ ! map (n.% num_events) random.nat)
- #let [expected (list.take num_observations events)
+ .let [expected (list.take num_observations events)
sink (: (Atom (Row Nat))
(atom.atom row.empty))]]
(in (do async.monad
@@ -224,5 +224,5 @@
_ (/.await agent)
actual (async.future (atom.read sink))]
(_.cover' [/.Stop /.observe /.await]
- (\ (list.equivalence n.equivalence) = expected (row.to_list actual))))))
+ (\ (list.equivalence n.equivalence) = expected (row.list actual))))))
))))
diff --git a/stdlib/source/test/lux/control/concurrency/async.lux b/stdlib/source/test/lux/control/concurrency/async.lux
index 8b7bafff8..063d3a9e0 100644
--- a/stdlib/source/test/lux/control/concurrency/async.lux
+++ b/stdlib/source/test/lux/control/concurrency/async.lux
@@ -54,10 +54,10 @@
Test
(<| (_.covering /._)
(do {! random.monad}
- [to_wait (|> random.nat (\ ! map (|>> (n.% ..delay) (n.+ ..delay))))
+ [waiting_time (|> random.nat (\ ! map (|>> (n.% ..delay) (n.+ ..delay))))
expected random.nat
dummy random.nat
- #let [not_dummy (|> random.nat (random.only (|>> (n.= dummy) not)))]
+ .let [not_dummy (|> random.nat (random.only (|>> (n.= dummy) not)))]
leftE not_dummy
rightE not_dummy]
($_ _.and
@@ -69,7 +69,7 @@
($monad.spec ..injection ..comparison /.monad))
(in (do /.monad
- [#let [[async resolver] (: [(/.Async Nat) (/.Resolver Nat)]
+ [.let [[async resolver] (: [(/.Async Nat) (/.Resolver Nat)]
(/.async []))]
resolved? (/.future (resolver expected))
actual async]
@@ -86,19 +86,19 @@
(n.= expected actual))))
(in (do /.monad
[pre (/.future instant.now)
- actual (/.schedule to_wait (io.io expected))
+ actual (/.schedule waiting_time (io.io expected))
post (/.future instant.now)]
(_.cover' [/.schedule]
(and (n.= expected actual)
- (i.>= (.int to_wait)
- (duration.to_millis (instant.span pre post)))))))
+ (i.>= (.int waiting_time)
+ (duration.millis (instant.span pre post)))))))
(in (do /.monad
[pre (/.future instant.now)
- _ (/.wait to_wait)
+ _ (/.wait waiting_time)
post (/.future instant.now)]
(_.cover' [/.wait]
- (i.>= (.int to_wait)
- (duration.to_millis (instant.span pre post))))))
+ (i.>= (.int waiting_time)
+ (duration.millis (instant.span pre post))))))
(in (do /.monad
[[leftA rightA] (/.and (/.future (io.io leftE))
(/.future (io.io rightE)))]
@@ -107,16 +107,16 @@
(n.+ leftA rightA)))))
(in (do /.monad
[pre (/.future instant.now)
- actual (/.delay to_wait expected)
+ actual (/.delay waiting_time expected)
post (/.future instant.now)]
(_.cover' [/.delay]
(and (n.= expected actual)
- (i.>= (.int to_wait)
- (duration.to_millis (instant.span pre post)))))))
+ (i.>= (.int waiting_time)
+ (duration.millis (instant.span pre post)))))))
(in (do /.monad
[?left (/.or (in leftE)
- (/.delay to_wait dummy))
- ?right (/.or (/.delay to_wait dummy)
+ (/.delay waiting_time dummy))
+ ?right (/.or (/.delay waiting_time dummy)
(in rightE))]
(_.cover' [/.or]
(case [?left ?right]
@@ -128,15 +128,15 @@
false))))
(in (do /.monad
[leftA (/.either (in leftE)
- (/.delay to_wait dummy))
- rightA (/.either (/.delay to_wait dummy)
+ (/.delay waiting_time dummy))
+ rightA (/.either (/.delay waiting_time dummy)
(in rightE))]
(_.cover' [/.either]
(n.= (n.+ leftE rightE)
(n.+ leftA rightA)))))
(in (do /.monad
[?actual (/.future (/.poll (/.resolved expected)))
- #let [[async resolver] (: [(/.Async Nat) (/.Resolver Nat)]
+ .let [[async resolver] (: [(/.Async Nat) (/.Resolver Nat)]
(/.async []))]
?never (/.future (/.poll async))]
(_.cover' [/.poll]
@@ -148,15 +148,15 @@
false))))
(in (do /.monad
[yep (/.future (/.resolved? (/.resolved expected)))
- #let [[async resolver] (: [(/.Async Nat) (/.Resolver Nat)]
+ .let [[async resolver] (: [(/.Async Nat) (/.Resolver Nat)]
(/.async []))]
nope (/.future (/.resolved? async))]
(_.cover' [/.resolved?]
(and yep
(not nope)))))
(in (do /.monad
- [?none (/.time_out 0 (/.delay to_wait dummy))
- ?actual (/.time_out to_wait (in expected))]
+ [?none (/.time_out 0 (/.delay waiting_time dummy))
+ ?actual (/.time_out waiting_time (in expected))]
(_.cover' [/.time_out]
(case [?none ?actual]
[#.None (#.Some actual)]
@@ -165,7 +165,7 @@
_
false))))
(in (do /.monad
- [#let [box (: (Atom Nat)
+ [.let [box (: (Atom Nat)
(atom.atom dummy))]
_ (/.future (/.await (function (_ value)
(atom.write value box))
diff --git a/stdlib/source/test/lux/control/concurrency/atom.lux b/stdlib/source/test/lux/control/concurrency/atom.lux
index d51af0737..49947d2d6 100644
--- a/stdlib/source/test/lux/control/concurrency/atom.lux
+++ b/stdlib/source/test/lux/control/concurrency/atom.lux
@@ -19,7 +19,7 @@
($_ _.and
(do random.monad
[expected random.nat
- #let [box (/.atom expected)]]
+ .let [box (/.atom expected)]]
(_.cover [/.Atom /.atom /.read]
(io.run
(do io.monad
@@ -29,7 +29,7 @@
[target random.nat
unknown (random.only (|>> (is? target) not) random.nat)
expected random.nat
- #let [box (/.atom target)]]
+ .let [box (/.atom target)]]
(_.cover [/.compare_and_swap]
(io.run
(do io.monad
@@ -42,7 +42,7 @@
(do random.monad
[init random.nat
shift random.nat
- #let [box (/.atom init)]]
+ .let [box (/.atom init)]]
(_.cover [/.update]
(io.run
(do io.monad
@@ -53,7 +53,7 @@
(do random.monad
[pre random.nat
post random.nat
- #let [box (/.atom pre)]]
+ .let [box (/.atom pre)]]
(_.cover [/.write]
(io.run
(do io.monad
diff --git a/stdlib/source/test/lux/control/concurrency/frp.lux b/stdlib/source/test/lux/control/concurrency/frp.lux
index 539ed17f0..f4705f140 100644
--- a/stdlib/source/test/lux/control/concurrency/frp.lux
+++ b/stdlib/source/test/lux/control/concurrency/frp.lux
@@ -86,7 +86,7 @@
(_.cover [/.Channel /.Sink /.channel]
(case (io.run
(do (try.with io.monad)
- [#let [[channel sink] (/.channel [])]
+ [.let [[channel sink] (/.channel [])]
_ (\ sink feed sample)
_ (\ sink close)]
(in channel)))
@@ -106,7 +106,7 @@
(_.cover [/.channel_is_already_closed]
(case (io.run
(do (try.with io.monad)
- [#let [[channel sink] (/.channel [])]
+ [.let [[channel sink] (/.channel [])]
_ (\ sink close)]
(\ sink feed sample)))
(#try.Success _)
@@ -138,7 +138,7 @@
(list\= (list.only n.even? inputs)
output))))
(in (do {! async.monad}
- [#let [[?signal !signal] (: [(async.Async Any) (async.Resolver Any)]
+ [.let [[?signal !signal] (: [(async.Async Any) (async.Resolver Any)]
(async.async []))
sink (: (Atom (Row Nat))
(atom.atom row.empty))]
@@ -157,7 +157,7 @@
listened (|> sink
atom.read
async.future
- (\ ! map row.to_list))]
+ (\ ! map row.list))]
(_.cover' [/.Subscriber /.subscribe]
(list\= inputs listened))))
(in (do async.monad
@@ -194,7 +194,7 @@
($_ _.and
(in (do {! async.monad}
[actual (..take_amount amount_of_polls (/.poll polling_delay (: (IO Nat) (io.io sample))))
- #let [correct_values!
+ .let [correct_values!
(list.every? (n.= sample) actual)
enough_polls!
@@ -207,7 +207,7 @@
(_.cover' [/.periodic]
(n.= amount_of_polls (list.size actual)))))))
(in (do async.monad
- [#let [max_iterations 10]
+ [.let [max_iterations 10]
actual (|> [0 sample]
(/.iterations (function (_ [iterations current])
(async.resolved
diff --git a/stdlib/source/test/lux/control/concurrency/semaphore.lux b/stdlib/source/test/lux/control/concurrency/semaphore.lux
index f5b851104..60bd31050 100644
--- a/stdlib/source/test/lux/control/concurrency/semaphore.lux
+++ b/stdlib/source/test/lux/control/concurrency/semaphore.lux
@@ -40,7 +40,7 @@
($_ _.and
(do {! random.monad}
[initial_open_positions (|> random.nat (\ ! map (|>> (n.% 10) (n.max 1))))
- #let [semaphore (/.semaphore initial_open_positions)]]
+ .let [semaphore (/.semaphore initial_open_positions)]]
(in (do async.monad
[result (async.time_out ..delay (/.wait semaphore))]
(_.cover' [/.semaphore]
@@ -52,7 +52,7 @@
false)))))
(do {! random.monad}
[initial_open_positions (|> random.nat (\ ! map (|>> (n.% 10) (n.max 1))))
- #let [semaphore (/.semaphore initial_open_positions)]]
+ .let [semaphore (/.semaphore initial_open_positions)]]
(in (do {! async.monad}
[_ (monad.map ! /.wait (list.repeat initial_open_positions semaphore))
result (async.time_out ..delay (/.wait semaphore))]
@@ -65,10 +65,10 @@
true)))))
(do {! random.monad}
[initial_open_positions (|> random.nat (\ ! map (|>> (n.% 10) (n.max 1))))
- #let [semaphore (/.semaphore initial_open_positions)]]
+ .let [semaphore (/.semaphore initial_open_positions)]]
(in (do {! async.monad}
[_ (monad.map ! /.wait (list.repeat initial_open_positions semaphore))
- #let [block (/.wait semaphore)]
+ .let [block (/.wait semaphore)]
result/0 (async.time_out ..delay block)
open_positions (/.signal semaphore)
result/1 (async.time_out ..delay block)]
@@ -81,7 +81,7 @@
false)))))
(do {! random.monad}
[initial_open_positions (|> random.nat (\ ! map (|>> (n.% 10) (n.max 1))))
- #let [semaphore (/.semaphore initial_open_positions)]]
+ .let [semaphore (/.semaphore initial_open_positions)]]
(in (do async.monad
[outcome (/.signal semaphore)]
(_.cover' [/.semaphore_is_maxed_out]
@@ -99,7 +99,7 @@
($_ _.and
(do {! random.monad}
[repetitions (|> random.nat (\ ! map (|>> (n.% 100) (n.max 10))))
- #let [resource (atom.atom "")
+ .let [resource (atom.atom "")
expected_As (text.join_with "" (list.repeat repetitions "A"))
expected_Bs (text.join_with "" (list.repeat repetitions "B"))
mutex (/.mutex [])
@@ -122,7 +122,7 @@
(in (do async.monad
[_ processA
_ processB
- #let [outcome (io.run (atom.read resource))]]
+ .let [outcome (io.run (atom.read resource))]]
(_.cover' [/.mutex /.synchronize]
(or (text\= (format expected_As expected_Bs)
outcome)
@@ -156,10 +156,10 @@
false)))
(do {! random.monad}
[limit (\ ! map (|>> (n.% 9) inc) random.nat)
- #let [barrier (/.barrier (maybe.assume (/.limit limit)))
+ .let [barrier (/.barrier (maybe.assume (/.limit limit)))
resource (atom.atom "")]]
(in (do {! async.monad}
- [#let [suffix "_"
+ [.let [suffix "_"
expected_ending (|> suffix
(list.repeat limit)
(text.join_with ""))
@@ -169,7 +169,7 @@
(exec (io.run (atom.update (|>> (format suffix)) resource))
(waiter resource barrier id))))
(monad.seq !))
- #let [outcome (io.run (atom.read resource))]]
+ .let [outcome (io.run (atom.read resource))]]
(_.cover' [/.barrier /.block]
(and (text.ends_with? expected_ending outcome)
(list.every? (function (_ id)
diff --git a/stdlib/source/test/lux/control/concurrency/stm.lux b/stdlib/source/test/lux/control/concurrency/stm.lux
index 67d73d61e..62d912f66 100644
--- a/stdlib/source/test/lux/control/concurrency/stm.lux
+++ b/stdlib/source/test/lux/control/concurrency/stm.lux
@@ -72,7 +72,7 @@
(and (n.= expected actual)
verdict))))
(in (do async.monad
- [#let [box (/.var dummy)]
+ [.let [box (/.var dummy)]
output (/.commit (do /.monad
[_ (/.update (n.+ expected) box)]
(/.read box)))]
@@ -80,7 +80,7 @@
(n.= (n.+ expected dummy)
output))))
(in (do async.monad
- [#let [box (/.var dummy)
+ [.let [box (/.var dummy)
[follower sink] (io.run (/.follow box))]
_ (/.commit (/.write expected box))
_ (/.commit (/.update (n.* 2) box))
diff --git a/stdlib/source/test/lux/control/concurrency/thread.lux b/stdlib/source/test/lux/control/concurrency/thread.lux
index 0758f48b3..28d751292 100644
--- a/stdlib/source/test/lux/control/concurrency/thread.lux
+++ b/stdlib/source/test/lux/control/concurrency/thread.lux
@@ -33,7 +33,7 @@
(n.> 0 /.parallelism))
(in (do async.monad
[reference_time (async.future instant.now)
- #let [box (atom.atom [reference_time dummy])]
+ .let [box (atom.atom [reference_time dummy])]
_ (async.future
(/.schedule delay (do io.monad
[execution_time instant.now]
@@ -43,7 +43,7 @@
(_.cover' [/.schedule]
(let [expected_delay!
(i.>= (.int delay)
- (duration.to_millis (instant.span reference_time execution_time)))
+ (duration.millis (instant.span reference_time execution_time)))
correct_value!
(n.= expected actual)]
diff --git a/stdlib/source/test/lux/control/continuation.lux b/stdlib/source/test/lux/control/continuation.lux
index 4103d1a1f..1e960d947 100644
--- a/stdlib/source/test/lux/control/continuation.lux
+++ b/stdlib/source/test/lux/control/continuation.lux
@@ -32,7 +32,7 @@
(<| (_.covering /._)
(do random.monad
[sample random.nat
- #let [(^open "_\.") /.apply
+ .let [(^open "_\.") /.apply
(^open "_\.") /.monad]
elems (random.list 3 random.nat)])
(_.for [/.Cont])
diff --git a/stdlib/source/test/lux/control/exception.lux b/stdlib/source/test/lux/control/exception.lux
index 7d1cbcf53..b0a957c21 100644
--- a/stdlib/source/test/lux/control/exception.lux
+++ b/stdlib/source/test/lux/control/exception.lux
@@ -29,7 +29,7 @@
[expected random.nat
wrong (|> random.nat (random.only (|>> (n.= expected) not)))
assertion_succeeded? random.bit
- #let [report_element (\ ! map %.nat random.nat)]
+ .let [report_element (\ ! map %.nat random.nat)]
field0 report_element
value0 report_element
field1 report_element
diff --git a/stdlib/source/test/lux/control/function/memo.lux b/stdlib/source/test/lux/control/function/memo.lux
index dbdeee0f6..d6765a1f1 100644
--- a/stdlib/source/test/lux/control/function/memo.lux
+++ b/stdlib/source/test/lux/control/function/memo.lux
@@ -39,7 +39,7 @@
(All [i o] (-> (-> i o) i (IO [Duration o])))
(do io.monad
[before instant.now
- #let [output (function input)]
+ .let [output (function input)]
after instant.now]
(in [(instant.span before after)
output])))
@@ -64,11 +64,11 @@
(_.cover [/.closed /.none]
(io.run
(do io.monad
- [#let [slow (/.none n.hash ..fibonacci)
+ [.let [slow (/.none n.hash ..fibonacci)
fast (/.closed n.hash fibonacci)]
[slow_time slow_output] (..time slow input)
[fast_time fast_output] (..time fast input)
- #let [same_output!
+ .let [same_output!
(n.= slow_output
fast_output)
@@ -80,13 +80,13 @@
(_.cover [/.open]
(io.run
(do io.monad
- [#let [none (/.none n.hash ..fibonacci)
+ [.let [none (/.none n.hash ..fibonacci)
memory (dictionary.empty n.hash)
open (/.open fibonacci)]
[none_time none_output] (..time none input)
[open_time [memory open_output]] (..time open [memory input])
[open_time/+1 _] (..time open [memory (inc input)])
- #let [same_output!
+ .let [same_output!
(n.= none_output
open_output)
diff --git a/stdlib/source/test/lux/control/function/mixin.lux b/stdlib/source/test/lux/control/function/mixin.lux
index 1ebf38e79..3d8299929 100644
--- a/stdlib/source/test/lux/control/function/mixin.lux
+++ b/stdlib/source/test/lux/control/function/mixin.lux
@@ -28,7 +28,7 @@
[input (|> random.nat (\ ! map (|>> (n.% 6) (n.+ 20))))
dummy random.nat
shift (|> random.nat (random.only (|>> (n.= dummy) not)))
- #let [equivalence (: (Equivalence (/.Mixin Nat Nat))
+ .let [equivalence (: (Equivalence (/.Mixin Nat Nat))
(implementation
(def: (= left right)
(n.= ((/.mixin left) input)
diff --git a/stdlib/source/test/lux/control/function/mutual.lux b/stdlib/source/test/lux/control/function/mutual.lux
index c9fbfbace..71248a1ee 100644
--- a/stdlib/source/test/lux/control/function/mutual.lux
+++ b/stdlib/source/test/lux/control/function/mutual.lux
@@ -19,7 +19,7 @@
Test
(do {! random.monad}
[sample (\ ! map (n.% 10) random.nat)
- #let [expected (n.even? sample)]]
+ .let [expected (n.even? sample)]]
(<| (_.cover [/.let])
(/.let [(even? number)
(-> Nat Bit)
@@ -52,7 +52,7 @@
Test
(do {! random.monad}
[sample (\ ! map (n.% 10) random.nat)
- #let [expected (n.even? sample)]]
+ .let [expected (n.even? sample)]]
(<| (_.cover [/.def:])
(and (bit\= expected (..even? sample))
(bit\= (not expected) (..odd? sample))))))
diff --git a/stdlib/source/test/lux/control/parser.lux b/stdlib/source/test/lux/control/parser.lux
index 717202488..c222cee77 100644
--- a/stdlib/source/test/lux/control/parser.lux
+++ b/stdlib/source/test/lux/control/parser.lux
@@ -261,7 +261,7 @@
[expected random.nat
even (random.only n.even? random.nat)
odd (random.only n.odd? random.nat)
- #let [nat^ <code>.nat
+ .let [nat^ <code>.nat
even^ (/.only n.even? <code>.nat)
odd^ (/.only n.odd? <code>.nat)]]
($_ _.and
diff --git a/stdlib/source/test/lux/control/parser/cli.lux b/stdlib/source/test/lux/control/parser/cli.lux
index 608ee9675..4f8d6d08f 100644
--- a/stdlib/source/test/lux/control/parser/cli.lux
+++ b/stdlib/source/test/lux/control/parser/cli.lux
@@ -32,7 +32,7 @@
(_.for [/.Parser])
(do {! random.monad}
[expected (\ ! map n\encode random.nat)
- #let [random_dummy (random.only (|>> (text\= expected) not)
+ .let [random_dummy (random.only (|>> (text\= expected) not)
(random.unicode 5))]
dummy random_dummy
short (random.unicode 1)
diff --git a/stdlib/source/test/lux/control/parser/json.lux b/stdlib/source/test/lux/control/parser/json.lux
index f0b63bfd5..e3a7189df 100644
--- a/stdlib/source/test/lux/control/parser/json.lux
+++ b/stdlib/source/test/lux/control/parser/json.lux
@@ -126,7 +126,7 @@
expected_number ..safe_frac
expected_string (random.unicode 1)
[boolean_field number_field string_field] (|> (random.set text.hash 3 (random.unicode 3))
- (\ ! map (|>> set.to_list
+ (\ ! map (|>> set.list
(case> (^ (list boolean_field number_field string_field))
[boolean_field number_field string_field]
@@ -150,7 +150,7 @@
[size (\ ! map (n.% 10) random.nat)
keys (random.list size (random.unicode 1))
values (random.list size (random.unicode 1))
- #let [expected (dictionary.of_list text.hash (list.zipped/2 keys values))]]
+ .let [expected (dictionary.of_list text.hash (list.zipped/2 keys values))]]
(_.cover [/.dictionary]
(|> (/.run (/.dictionary /.string)
(#json.Object
diff --git a/stdlib/source/test/lux/control/parser/text.lux b/stdlib/source/test/lux/control/parser/text.lux
index 1285428cd..97c76f0f5 100644
--- a/stdlib/source/test/lux/control/parser/text.lux
+++ b/stdlib/source/test/lux/control/parser/text.lux
@@ -74,7 +74,7 @@
(do {! random.monad}
[offset (\ ! map (n.% 50) random.nat)
range (\ ! map (|>> (n.% 50) (n.+ 10)) random.nat)
- #let [limit (n.+ offset range)]
+ .let [limit (n.+ offset range)]
expected (\ ! map (|>> (n.% range) (n.+ offset) text.of_char) random.nat)
out_of_range (case offset
0 (\ ! map (|>> (n.% 10) inc (n.+ limit) text.of_char) random.nat)
@@ -152,10 +152,10 @@
(and (..should_pass expected /.space)
(..should_fail invalid /.space))))
(do {! random.monad}
- [#let [num_options 3]
+ [.let [num_options 3]
options (|> (random.char unicode.character)
(random.set n.hash num_options)
- (\ ! map (|>> set.to_list
+ (\ ! map (|>> set.list
(list\map text.of_char)
(text.join_with ""))))
expected (\ ! map (function (_ value)
@@ -178,10 +178,10 @@
/.character_should_be)
)))
(do {! random.monad}
- [#let [num_options 3]
+ [.let [num_options 3]
options (|> (random.char unicode.character)
(random.set n.hash num_options)
- (\ ! map (|>> set.to_list
+ (\ ! map (|>> set.list
(list\map text.of_char)
(text.join_with ""))))
invalid (\ ! map (function (_ value)
@@ -212,7 +212,7 @@
(do {! random.monad}
[left (\ ! map (|>> (n.% 8) (\ n.octal encode)) random.nat)
right (\ ! map (|>> (n.% 8) (\ n.octal encode)) random.nat)
- #let [expected (format left right)]
+ .let [expected (format left right)]
invalid (|> random.nat
(\ ! map (n.% 16))
(random.only (n.>= 8))
@@ -225,7 +225,7 @@
(do {! random.monad}
[left (\ ! map (|>> (n.% 8) (\ n.octal encode)) random.nat)
right (\ ! map (|>> (n.% 8) (\ n.octal encode)) random.nat)
- #let [expected (format left right)]
+ .let [expected (format left right)]
invalid (|> random.nat
(\ ! map (n.% 16))
(random.only (n.>= 8))
@@ -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 encode)) 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 encode)) 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 encode)) 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 encode)) random.nat)]
first octal
second octal
third octal]
@@ -306,7 +306,7 @@
sample)
(!expect (#try.Failure _))))))
(do {! random.monad}
- [#let [size 10]
+ [.let [size 10]
expected (random.unicode size)
dummy (|> (random.unicode size)
(random.only (|>> (text\= expected) not)))]
@@ -359,7 +359,7 @@
(do {! random.monad}
[left (random.unicode 1)
right (random.unicode 1)
- #let [input (format left right)]]
+ .let [input (format left right)]]
(_.cover [/.remaining]
(|> input
(/.run (do <>.monad
@@ -400,7 +400,7 @@
expected (random.only (|>> (unicode/block.within? unicode/block.basic_latin/upper)
not)
(random.char unicode.character))
- #let [upper! (/.one_of! "ABCDEFGHIJKLMNOPQRSTUVWXYZ")]]
+ .let [upper! (/.one_of! "ABCDEFGHIJKLMNOPQRSTUVWXYZ")]]
(_.cover [/.not /.not! /.expected_to_fail]
(and (..should_pass (text.of_char expected) (/.not /.upper))
(|> invalid
@@ -420,7 +420,7 @@
(not (or (unicode/block.within? unicode/block.basic_latin/upper char)
(unicode/block.within? unicode/block.basic_latin/lower char))))
(random.char unicode.character))
- #let [upper! (/.one_of! "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
+ .let [upper! (/.one_of! "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
lower! (/.one_of! "abcdefghijklmnopqrstuvwxyz")]]
(_.cover [/.and /.and!]
(and (..should_pass (format upper lower) (/.and /.upper /.lower))
diff --git a/stdlib/source/test/lux/control/parser/xml.lux b/stdlib/source/test/lux/control/parser/xml.lux
index 966da9edd..ac3432fee 100644
--- a/stdlib/source/test/lux/control/parser/xml.lux
+++ b/stdlib/source/test/lux/control/parser/xml.lux
@@ -144,14 +144,14 @@
(/.attribute [expected expected]))
(#xml.Text expected)]])
(do {! random.monad}
- [#let [node (: (-> xml.Tag (List xml.XML) xml.XML)
+ [.let [node (: (-> xml.Tag (List xml.XML) xml.XML)
(function (_ tag children)
(#xml.Node tag (dictionary.empty name.hash) children)))]
parent ..random_tag
right ..random_tag
wrong (random.only (|>> (name\= right) not)
..random_tag)
- #let [parser (<| (/.node parent)
+ .let [parser (<| (/.node parent)
(do //.monad
[_ (<| /.somewhere
(/.node right)
diff --git a/stdlib/source/test/lux/control/region.lux b/stdlib/source/test/lux/control/region.lux
index abda4177c..3e2bc2610 100644
--- a/stdlib/source/test/lux/control/region.lux
+++ b/stdlib/source/test/lux/control/region.lux
@@ -100,7 +100,7 @@
(thread.run
(do {! thread.monad}
[clean_up_counter (thread.box 0)
- #let [//@ !
+ .let [//@ !
count_clean_up (function (_ value)
(do !
[_ (thread.update inc clean_up_counter)]
@@ -118,7 +118,7 @@
(thread.run
(do {! thread.monad}
[clean_up_counter (thread.box 0)
- #let [//@ !
+ .let [//@ !
count_clean_up (function (_ value)
(do !
[_ (thread.update inc clean_up_counter)]
@@ -137,7 +137,7 @@
(thread.run
(do {! thread.monad}
[clean_up_counter (thread.box 0)
- #let [//@ !
+ .let [//@ !
count_clean_up (function (_ value)
(do !
[_ (thread.update inc clean_up_counter)]
@@ -156,7 +156,7 @@
(thread.run
(do {! thread.monad}
[clean_up_counter (thread.box 0)
- #let [//@ !
+ .let [//@ !
count_clean_up (function (_ value)
(do !
[_ (thread.update inc clean_up_counter)]
@@ -176,7 +176,7 @@
(thread.run
(do {! thread.monad}
[clean_up_counter (thread.box 0)
- #let [//@ !]
+ .let [//@ !]
outcome (/.run !
(do (/.monad !)
[_ (/.lift //@ (thread.write expected_clean_ups clean_up_counter))]
diff --git a/stdlib/source/test/lux/control/remember.lux b/stdlib/source/test/lux/control/remember.lux
index 2243f8584..098ecaa28 100644
--- a/stdlib/source/test/lux/control/remember.lux
+++ b/stdlib/source/test/lux/control/remember.lux
@@ -32,7 +32,7 @@
(def: message (Random Text) (random\map %.bit random.bit))
(def: focus (Random Code) (random\map code.bit random.bit))
-(def: (to_remember macro deadline message focus)
+(def: (memory macro deadline message focus)
(-> Name Date Text (Maybe Code) Code)
(` ((~ (code.identifier macro))
(~ (code.text (%.date deadline)))
@@ -65,17 +65,17 @@
(syntax: (test_macro {macro <c>.identifier} {extra <c>.text})
(let [now (io.run instant.now)
today (instant.date now)
- yesterday (instant.date (instant.shift (duration.inverse duration.week) now))
- tomorrow (instant.date (instant.shift duration.week now))
- prng (random.pcg32 [(hex "0123456789ABCDEF")
- (instant.to_millis now)])
+ yesterday (instant.date (instant.after (duration.inverse duration.week) now))
+ tomorrow (instant.date (instant.after duration.week now))
+ prng (random.pcg_32 [(hex "0123456789ABCDEF")
+ (instant.millis now)])
message (product.right (random.run prng ..message))
expected (product.right (random.run prng ..focus))]
(do meta.monad
- [should_fail0 (..attempt (macro.expansion (to_remember macro yesterday message #.None)))
- should_fail1 (..attempt (macro.expansion (to_remember macro yesterday message (#.Some expected))))
- should_succeed0 (..attempt (macro.expansion (to_remember macro tomorrow message #.None)))
- should_succeed1 (..attempt (macro.expansion (to_remember macro tomorrow message (#.Some expected))))]
+ [should_fail0 (..attempt (macro.expansion (..memory macro yesterday message #.None)))
+ should_fail1 (..attempt (macro.expansion (..memory macro yesterday message (#.Some expected))))
+ should_succeed0 (..attempt (macro.expansion (..memory macro tomorrow message #.None)))
+ should_succeed1 (..attempt (macro.expansion (..memory macro tomorrow message (#.Some expected))))]
(in (list (code.bit (and (case should_fail0
(#try.Failure error)
(and (test_failure yesterday message #.None error)
diff --git a/stdlib/source/test/lux/control/security/capability.lux b/stdlib/source/test/lux/control/security/capability.lux
index 008d6e798..6e2e5cd77 100644
--- a/stdlib/source/test/lux/control/security/capability.lux
+++ b/stdlib/source/test/lux/control/security/capability.lux
@@ -27,7 +27,7 @@
(do random.monad
[shift random.nat
base random.nat
- #let [expected (n.+ shift base)]
+ .let [expected (n.+ shift base)]
pass_through (random.ascii 1)]
(_.for [/.Capability]
($_ _.and
diff --git a/stdlib/source/test/lux/control/security/policy.lux b/stdlib/source/test/lux/control/security/policy.lux
index 0f6266635..e1cae710a 100644
--- a/stdlib/source/test/lux/control/security/policy.lux
+++ b/stdlib/source/test/lux/control/security/policy.lux
@@ -72,9 +72,9 @@
(_.for [/.Policy
/.Can_Upgrade /.Can_Downgrade])
(do random.monad
- [#let [policy_0 (policy [])]
+ [.let [policy_0 (policy [])]
raw_password (random.ascii 10)
- #let [password (\ policy_0 password raw_password)]]
+ .let [password (\ policy_0 password raw_password)]]
($_ _.and
(_.for [/.Privacy /.Private /.Can_Conceal /.Can_Reveal
/.Safety /.Safe /.Can_Trust /.Can_Distrust]
diff --git a/stdlib/source/test/lux/control/state.lux b/stdlib/source/test/lux/control/state.lux
index e64833259..6c4bf6dc7 100644
--- a/stdlib/source/test/lux/control/state.lux
+++ b/stdlib/source/test/lux/control/state.lux
@@ -83,7 +83,7 @@
Test
(do {! random.monad}
[limit (|> random.nat (\ ! map (n.% 10)))
- #let [condition (do /.monad
+ .let [condition (do /.monad
[state /.get]
(in (n.< limit state)))]]
($_ _.and
diff --git a/stdlib/source/test/lux/control/try.lux b/stdlib/source/test/lux/control/try.lux
index 4959014f7..7715dc434 100644
--- a/stdlib/source/test/lux/control/try.lux
+++ b/stdlib/source/test/lux/control/try.lux
@@ -44,7 +44,7 @@
[expected random.nat
alternative (|> random.nat (random.only (|>> (n.= expected) not)))
error (random.unicode 1)
- #let [(^open "io\.") io.monad]])
+ .let [(^open "io\.") io.monad]])
($_ _.and
(_.for [/.equivalence]
($equivalence.spec (/.equivalence n.equivalence) (..attempt random.nat)))
diff --git a/stdlib/source/test/lux/data/binary.lux b/stdlib/source/test/lux/data/binary.lux
index 2d1a25092..7b5f5fab0 100644
--- a/stdlib/source/test/lux/data/binary.lux
+++ b/stdlib/source/test/lux/data/binary.lux
@@ -79,11 +79,11 @@
Test
(<| (_.covering /._)
(do {! random.monad}
- [#let [gen_size (|> random.nat (\ ! map (|>> (n.% 100) (n.max 8))))]
+ [.let [gen_size (|> random.nat (\ ! map (|>> (n.% 100) (n.max 8))))]
size gen_size
sample (..random size)
value random.nat
- #let [gen_idx (|> random.nat (\ ! map (n.% size)))]
+ .let [gen_idx (|> random.nat (\ ! map (n.% size)))]
offset gen_idx
length (\ ! map (n.% (n.- offset size)) random.nat)]
(_.for [/.Binary]
diff --git a/stdlib/source/test/lux/data/collection/array.lux b/stdlib/source/test/lux/data/collection/array.lux
index d5ea9badf..dc8527fdc 100644
--- a/stdlib/source/test/lux/data/collection/array.lux
+++ b/stdlib/source/test/lux/data/collection/array.lux
@@ -52,13 +52,13 @@
[size ..bounded_size
base random.nat
shift random.nat
- #let [expected (n.+ base shift)]
+ .let [expected (n.+ base shift)]
the_array (random.array size random.nat)]
($_ _.and
(_.cover [/.find]
(\ (maybe.equivalence n.equivalence) =
(/.find n.even? the_array)
- (list.find n.even? (/.to_list the_array))))
+ (list.find n.even? (/.list the_array))))
(_.cover [/.find+]
(case [(/.find n.even? the_array)
(/.find+ (function (_ idx member)
@@ -80,11 +80,11 @@
false))
(_.cover [/.every?]
(\ bit.equivalence =
- (list.every? n.even? (/.to_list the_array))
+ (list.every? n.even? (/.list the_array))
(/.every? n.even? the_array)))
(_.cover [/.any?]
(\ bit.equivalence =
- (list.any? n.even? (/.to_list the_array))
+ (list.any? n.even? (/.list the_array))
(/.any? n.even? the_array)))
)))
@@ -97,7 +97,7 @@
base random.nat
shift random.nat
dummy (random.only (|>> (n.= base) not) random.nat)
- #let [expected (n.+ base shift)]
+ .let [expected (n.+ base shift)]
the_array (random.array size random.nat)]
($_ _.and
..structures
@@ -182,10 +182,10 @@
(/.vacancy the_array)))))))
(do !
[the_list (random.list size random.nat)]
- (_.cover [/.of_list /.to_list]
- (and (|> the_list /.of_list /.to_list
+ (_.cover [/.of_list /.list]
+ (and (|> the_list /.of_list /.list
(\ (list.equivalence n.equivalence) = the_list))
- (|> the_array /.to_list /.of_list
+ (|> the_array /.list /.of_list
(\ (/.equivalence n.equivalence) = the_array)))))
(do !
[amount (\ ! map (n.% (inc size)) random.nat)]
@@ -194,31 +194,31 @@
(/.empty size))]
(exec (/.copy! amount 0 the_array 0 copy)
(\ (list.equivalence n.equivalence) =
- (list.take amount (/.to_list the_array))
- (/.to_list copy))))))
+ (list.take amount (/.list the_array))
+ (/.list copy))))))
(_.cover [/.clone]
(let [clone (/.clone the_array)]
(and (not (is? the_array clone))
(\ (/.equivalence n.equivalence) = the_array clone))))
(let [the_array (/.clone the_array)
- evens (|> the_array /.to_list (list.only n.even?))
- odds (|> the_array /.to_list (list.only n.odd?))]
+ evens (|> the_array /.list (list.only n.even?))
+ odds (|> the_array /.list (list.only n.odd?))]
(_.cover [/.filter!]
(exec (/.filter! n.even? the_array)
(and (n.= (list.size evens) (/.occupancy the_array))
(n.= (list.size odds) (/.vacancy the_array))
- (|> the_array /.to_list (\ (list.equivalence n.equivalence) = evens))))))
+ (|> the_array /.list (\ (list.equivalence n.equivalence) = evens))))))
(do !
- [#let [the_array (/.clone the_array)
- members (|> the_array /.to_list (set.of_list n.hash))]
+ [.let [the_array (/.clone the_array)
+ members (|> the_array /.list (set.of_list n.hash))]
default (random.only (function (_ value)
(not (or (n.even? value)
(set.member? members value))))
random.nat)]
- (_.cover [/.to_list']
+ (_.cover [/.list']
(exec (/.filter! n.even? the_array)
(list.every? (function (_ value)
(or (n.even? value)
(is? default value)))
- (/.to_list' default the_array)))))
+ (/.list' default the_array)))))
))))
diff --git a/stdlib/source/test/lux/data/collection/dictionary.lux b/stdlib/source/test/lux/data/collection/dictionary.lux
index 11c4b59cd..fe04241a1 100644
--- a/stdlib/source/test/lux/data/collection/dictionary.lux
+++ b/stdlib/source/test/lux/data/collection/dictionary.lux
@@ -31,7 +31,7 @@
(def: for_dictionaries
Test
(do {! random.monad}
- [#let [capped_nat (\ random.monad map (n.% 100) random.nat)]
+ [.let [capped_nat (\ random.monad map (n.% 100) random.nat)]
size capped_nat
dict (random.dictionary n.hash size random.nat capped_nat)
non_key (random.only (|>> (/.key? dict) not)
@@ -54,7 +54,7 @@
(do !
[constant random.nat
- #let [hash (: (Hash Nat)
+ .let [hash (: (Hash Nat)
(implementation
(def: &equivalence n.equivalence)
(def: (hash _)
@@ -133,7 +133,7 @@
(def: for_entries
Test
(do random.monad
- [#let [capped_nat (\ random.monad map (n.% 100) random.nat)]
+ [.let [capped_nat (\ random.monad map (n.% 100) random.nat)]
size capped_nat
dict (random.dictionary n.hash size random.nat capped_nat)
non_key (random.only (|>> (/.key? dict) not)
@@ -253,7 +253,7 @@
(<| (_.covering /._)
(_.for [/.Dictionary])
(do random.monad
- [#let [capped_nat (\ random.monad map (n.% 100) random.nat)]
+ [.let [capped_nat (\ random.monad map (n.% 100) random.nat)]
size capped_nat
dict (random.dictionary n.hash size random.nat capped_nat)
non_key (random.only (|>> (/.key? dict) not)
diff --git a/stdlib/source/test/lux/data/collection/dictionary/ordered.lux b/stdlib/source/test/lux/data/collection/dictionary/ordered.lux
index 4637d3058..fb57cd70e 100644
--- a/stdlib/source/test/lux/data/collection/dictionary/ordered.lux
+++ b/stdlib/source/test/lux/data/collection/dictionary/ordered.lux
@@ -49,8 +49,8 @@
random.nat)
extra_value random.nat
shift random.nat
- #let [pairs (list.zipped/2 (set.to_list keys)
- (set.to_list values))
+ .let [pairs (list.zipped/2 (set.list keys)
+ (set.list values))
sample (/.of_list n.order pairs)
sorted_pairs (list.sort (function (_ [left _] [right _])
(n.< left right))
diff --git a/stdlib/source/test/lux/data/collection/dictionary/plist.lux b/stdlib/source/test/lux/data/collection/dictionary/plist.lux
index 5ba785919..316d7c7ce 100644
--- a/stdlib/source/test/lux/data/collection/dictionary/plist.lux
+++ b/stdlib/source/test/lux/data/collection/dictionary/plist.lux
@@ -26,18 +26,18 @@
(do random.monad
[keys (random.set text.hash size gen_key)
values (random.list size gen_value)]
- (in (list.zipped/2 (set.to_list keys) values))))
+ (in (list.zipped/2 (set.list keys) values))))
(def: #export test
Test
(<| (_.covering /._)
(_.for [/.PList])
(do {! random.monad}
- [#let [gen_key (random.ascii/alpha 10)]
+ [.let [gen_key (random.ascii/alpha 10)]
size (\ ! map (n.% 100) random.nat)
sample (..random size gen_key random.nat)
- #let [keys (|> sample /.keys (set.of_list text.hash))]
+ .let [keys (|> sample /.keys (set.of_list text.hash))]
extra_key (random.only (|>> (set.member? keys) not)
gen_key)
extra_value random.nat
diff --git a/stdlib/source/test/lux/data/collection/list.lux b/stdlib/source/test/lux/data/collection/list.lux
index 209dfe143..a0c6fc685 100644
--- a/stdlib/source/test/lux/data/collection/list.lux
+++ b/stdlib/source/test/lux/data/collection/list.lux
@@ -43,7 +43,7 @@
[size ..bounded_size]
(|> random.nat
(random.set n.hash size)
- (\ ! map set.to_list))))
+ (\ ! map set.list))))
(def: signatures
Test
@@ -87,8 +87,8 @@
Test
(do {! random.monad}
[size ..bounded_size
- #let [(^open "/\.") (/.equivalence n.equivalence)]
- sample (\ ! map set.to_list (random.set n.hash size random.nat))]
+ .let [(^open "/\.") (/.equivalence n.equivalence)]
+ sample (\ ! map set.list (random.set n.hash size random.nat))]
($_ _.and
(_.cover [/.size]
(n.= size (/.size sample)))
@@ -133,7 +133,7 @@
(^open "/\.") /.functor]
(do {! random.monad}
[sample ..random
- #let [size (/.size sample)]]
+ .let [size (/.size sample)]]
($_ _.and
(_.cover [/.indices]
(let [indices (/.indices size)
@@ -183,7 +183,7 @@
(do {! random.monad}
[sample (random.only (|>> /.size (n.> 0))
..random)
- #let [size (/.size sample)]
+ .let [size (/.size sample)]
idx (\ ! map (n.% size) random.nat)
chunk_size (\ ! map (|>> (n.% size) inc) random.nat)]
($_ _.and
@@ -427,4 +427,10 @@
(\ /.fold fold n.+ 0 (/.take index sample)))
(/.indices (inc (/.size sample))))
(/.folds n.+ 0 sample)))
+ (do random.monad
+ [expected random.nat
+ .let [(^open "/\.") (/.equivalence n.equivalence)]]
+ (_.cover [/.when]
+ (and (/\= (list expected) (/.when true (list expected)))
+ (/\= (list) (/.when false (list expected))))))
)))))
diff --git a/stdlib/source/test/lux/data/collection/queue.lux b/stdlib/source/test/lux/data/collection/queue.lux
index b394220ef..36f6ef9a4 100644
--- a/stdlib/source/test/lux/data/collection/queue.lux
+++ b/stdlib/source/test/lux/data/collection/queue.lux
@@ -32,7 +32,7 @@
members (random.set n.hash size random.nat)
non_member (random.only (|>> (set.member? members) not)
random.nat)
- #let [members (set.to_list members)
+ .let [members (set.list members)
sample (/.of_list members)]]
($_ _.and
(_.for [/.equivalence]
@@ -40,8 +40,8 @@
(_.for [/.functor]
($functor.spec ..injection /.equivalence /.functor))
- (_.cover [/.of_list /.to_list]
- (|> members /.of_list /.to_list
+ (_.cover [/.of_list /.list]
+ (|> members /.of_list /.list
(\ (list.equivalence n.equivalence) = members)))
(_.cover [/.size]
(n.= size (/.size sample)))
@@ -71,7 +71,7 @@
(_.cover [/.member?]
(let [every_member_is_identified!
(list.every? (/.member? n.equivalence sample)
- (/.to_list sample))
+ (/.list sample))
non_member_is_not_identified!
(not (/.member? n.equivalence sample non_member))]
@@ -88,8 +88,8 @@
has_expected_order!
(\ (list.equivalence n.equivalence) =
- (list\compose (/.to_list sample) (list non_member))
- (/.to_list pushed))]
+ (list\compose (/.list sample) (list non_member))
+ (/.list pushed))]
(and size_increases!
new_member_is_identified!
has_expected_order!)))
@@ -108,7 +108,7 @@
has_expected_order!
(\ (list.equivalence n.equivalence) =
expected
- (/.to_list popped))]
+ (/.list popped))]
(and size_decreases!
popped_member_is_not_identified!
has_expected_order!))
diff --git a/stdlib/source/test/lux/data/collection/row.lux b/stdlib/source/test/lux/data/collection/row.lux
index 4eda82b14..343442e91 100644
--- a/stdlib/source/test/lux/data/collection/row.lux
+++ b/stdlib/source/test/lux/data/collection/row.lux
@@ -50,8 +50,8 @@
(do {! random.monad}
[size (\ ! map (n.% 100) random.nat)
sample (random.set n.hash size random.nat)
- #let [sample (|> sample set.to_list /.of_list)]
- #let [(^open "/\.") (/.equivalence n.equivalence)]]
+ .let [sample (|> sample set.list /.of_list)]
+ .let [(^open "/\.") (/.equivalence n.equivalence)]]
($_ _.and
(_.cover [/.size]
(n.= size (/.size sample)))
@@ -59,8 +59,8 @@
(bit\= (/.empty? sample) (n.= 0 (/.size sample))))
(_.cover [/.empty]
(/.empty? /.empty))
- (_.cover [/.to_list /.of_list]
- (|> sample /.to_list /.of_list (/\= sample)))
+ (_.cover [/.list /.of_list]
+ (|> sample /.list /.of_list (/\= sample)))
(_.cover [/.reversed]
(or (n.< 2 (/.size sample))
(let [not_same!
@@ -85,11 +85,11 @@
($_ _.and
(do !
[good_index (|> random.nat (\ ! map (n.% size)))
- #let [bad_index (n.+ size good_index)]
+ .let [bad_index (n.+ size good_index)]
sample (random.set n.hash size random.nat)
non_member (random.only (|>> (set.member? sample) not)
random.nat)
- #let [sample (|> sample set.to_list /.of_list)]]
+ .let [sample (|> sample set.list /.of_list)]]
($_ _.and
(_.cover [/.item]
(case (/.item good_index sample)
@@ -144,8 +144,8 @@
[sample (random.set n.hash size random.nat)
non_member (random.only (|>> (set.member? sample) not)
random.nat)
- #let [sample (|> sample set.to_list /.of_list)]
- #let [(^open "/\.") (/.equivalence n.equivalence)]]
+ .let [sample (|> sample set.list /.of_list)]
+ .let [(^open "/\.") (/.equivalence n.equivalence)]]
($_ _.and
(do !
[value/0 random.nat
@@ -156,7 +156,7 @@
(/.row value/0 value/1 value/2))))
(_.cover [/.member?]
(and (list.every? (/.member? n.equivalence sample)
- (/.to_list sample))
+ (/.list sample))
(not (/.member? n.equivalence sample non_member))))
(_.cover [/.add]
(let [added (/.add non_member sample)
diff --git a/stdlib/source/test/lux/data/collection/set.lux b/stdlib/source/test/lux/data/collection/set.lux
index d092dcf6f..df0c653b9 100644
--- a/stdlib/source/test/lux/data/collection/set.lux
+++ b/stdlib/source/test/lux/data/collection/set.lux
@@ -67,10 +67,10 @@
(_.cover [/.empty?]
(bit\= (/.empty? setL)
(n.= 0 (/.size setL))))
- (_.cover [/.to_list /.of_list]
- (|> setL /.to_list (/.of_list n.hash) (\= setL)))
+ (_.cover [/.list /.of_list]
+ (|> setL /.list (/.of_list n.hash) (\= setL)))
(_.cover [/.member?]
- (and (list.every? (/.member? setL) (/.to_list setL))
+ (and (list.every? (/.member? setL) (/.list setL))
(not (/.member? setL non_memberL))))
(_.cover [/.add]
(let [before_addition!
@@ -126,8 +126,8 @@
(_.cover [/.difference]
(let [setL+R (/.union setR setL)
setL_R (/.difference setR setL+R)]
- (and (list.every? (/.member? setL+R) (/.to_list setR))
- (not (list.any? (/.member? setL_R) (/.to_list setR))))))
+ (and (list.every? (/.member? setL+R) (/.list setR))
+ (not (list.any? (/.member? setL_R) (/.list setR))))))
(_.cover [/.predicate]
- (list.every? (/.predicate setL) (/.to_list setL)))
+ (list.every? (/.predicate setL) (/.list setL)))
))))))
diff --git a/stdlib/source/test/lux/data/collection/set/multi.lux b/stdlib/source/test/lux/data/collection/set/multi.lux
index 7f23bfe3d..37645cbed 100644
--- a/stdlib/source/test/lux/data/collection/set/multi.lux
+++ b/stdlib/source/test/lux/data/collection/set/multi.lux
@@ -34,7 +34,7 @@
(/.add count element set))
(/.empty hash)
(list.zipped/2 element_counts
- (set.to_list elements))))))
+ (set.list elements))))))
(def: signature
Test
@@ -69,16 +69,16 @@
no_left_changes! (list.every? (function (_ member)
(n.= (/.multiplicity sample member)
(/.multiplicity composed member)))
- (set.to_list sample_only))
+ (set.list sample_only))
no_right_changes! (list.every? (function (_ member)
(n.= (/.multiplicity another member)
(/.multiplicity composed member)))
- (set.to_list another_only))
+ (set.list another_only))
common_changes! (list.every? (function (_ member)
(n.= (<composition> (/.multiplicity sample member)
(/.multiplicity another member))
(/.multiplicity composed member)))
- (set.to_list common))]
+ (set.list common))]
(and no_left_changes!
no_right_changes!
common_changes!)))]
@@ -95,14 +95,14 @@
composed (/.intersection sample another)
left_removals! (list.every? (|>> (/.member? composed) not)
- (set.to_list sample_only))
+ (set.list sample_only))
right_removals! (list.every? (|>> (/.member? composed) not)
- (set.to_list another_only))
+ (set.list another_only))
common_changes! (list.every? (function (_ member)
(n.= (n.min (/.multiplicity sample member)
(/.multiplicity another member))
(/.multiplicity composed member)))
- (set.to_list common))]
+ (set.list common))]
(and left_removals!
right_removals!
common_changes!)))
@@ -121,13 +121,13 @@
partial_removal_count (\ ! map (n.% addition_count) random.nat)
another (..random diversity n.hash ..count random.nat)]
($_ _.and
- (_.cover [/.to_list /.of_list]
+ (_.cover [/.list /.of_list]
(|> sample
- /.to_list
+ /.list
(/.of_list n.hash)
(\ /.equivalence = sample)))
(_.cover [/.size]
- (n.= (list.size (/.to_list sample))
+ (n.= (list.size (/.list sample))
(/.size sample)))
(_.cover [/.empty?]
(bit\= (/.empty? sample)
@@ -136,14 +136,14 @@
(/.empty? (/.empty n.hash)))
(_.cover [/.support]
(list.every? (set.member? (/.support sample))
- (/.to_list sample)))
+ (/.list sample)))
(_.cover [/.member?]
(let [non_member_is_not_identified!
(not (/.member? sample non_member))
all_members_are_identified!
(list.every? (/.member? sample)
- (/.to_list sample))]
+ (/.list sample))]
(and non_member_is_not_identified!
all_members_are_identified!)))
(_.cover [/.multiplicity]
@@ -152,7 +152,7 @@
every_member_has_positive_multiplicity!
(list.every? (|>> (/.multiplicity sample) (n.> 0))
- (/.to_list sample))]
+ (/.list sample))]
(and non_members_have_0_multiplicity!
every_member_has_positive_multiplicity!)))
(_.cover [/.add]
@@ -197,7 +197,7 @@
(_.cover [/.of_set]
(let [unary (|> sample /.support /.of_set)]
(list.every? (|>> (/.multiplicity unary) (n.= 1))
- (/.to_list unary))))
+ (/.list unary))))
(_.cover [/.sub?]
(let [unary (|> sample /.support /.of_set)]
(and (/.sub? sample unary)
@@ -217,11 +217,11 @@
composed (/.difference sample another)
ommissions! (list.every? (|>> (/.member? composed) not)
- (set.to_list sample_only))
+ (set.list sample_only))
intact! (list.every? (function (_ member)
(n.= (/.multiplicity another member)
(/.multiplicity composed member)))
- (set.to_list another_only))
+ (set.list another_only))
subtractions! (list.every? (function (_ member)
(let [sample_multiplicity (/.multiplicity sample member)
another_multiplicity (/.multiplicity another member)]
@@ -230,7 +230,7 @@
(n.- sample_multiplicity
another_multiplicity))
(/.multiplicity composed member))))
- (set.to_list common))]
+ (set.list common))]
(and ommissions!
intact!
subtractions!)))
diff --git a/stdlib/source/test/lux/data/collection/set/ordered.lux b/stdlib/source/test/lux/data/collection/set/ordered.lux
index 89ce681b0..620a63289 100644
--- a/stdlib/source/test/lux/data/collection/set/ordered.lux
+++ b/stdlib/source/test/lux/data/collection/set/ordered.lux
@@ -46,9 +46,9 @@
usetL (random.set n.hash sizeL random.nat)
non_memberL (random.only (|>> (//.member? usetL) not)
random.nat)
- #let [listL (//.to_list usetL)]
- listR (|> (random.set n.hash sizeR random.nat) (\ ! map //.to_list))
- #let [(^open "/\.") /.equivalence
+ .let [listL (//.list usetL)]
+ listR (|> (random.set n.hash sizeR random.nat) (\ ! map //.list))
+ .let [(^open "/\.") /.equivalence
setL (/.of_list n.order listL)
setR (/.of_list n.order listR)
empty (/.empty n.order)]]
@@ -63,19 +63,19 @@
(/.empty? setL)))
(_.cover [/.empty]
(/.empty? (/.empty n.order)))
- (_.cover [/.to_list]
+ (_.cover [/.list]
(\ (list.equivalence n.equivalence) =
- (/.to_list (/.of_list n.order listL))
+ (/.list (/.of_list n.order listL))
(list.sort (\ n.order <) listL)))
(_.cover [/.of_list]
(|> setL
- /.to_list (/.of_list n.order)
+ /.list (/.of_list n.order)
(/\= setL)))
(~~ (template [<coverage> <comparison>]
[(_.cover [<coverage>]
(case (<coverage> setL)
(#.Some value)
- (|> setL /.to_list (list.every? (<comparison> value)))
+ (|> setL /.list (list.every? (<comparison> value)))
#.None
(/.empty? setL)))]
@@ -85,7 +85,7 @@
))
(_.cover [/.member?]
(let [members_are_identified!
- (list.every? (/.member? setL) (/.to_list setL))
+ (list.every? (/.member? setL) (/.list setL))
non_members_are_not_identified!
(not (/.member? setL non_memberL))]
@@ -164,7 +164,7 @@
difference!
(not (list.any? (/.member? (/.difference setL setR))
- (/.to_list setL)))
+ (/.list setL)))
idempotence!
(\ /.equivalence =
diff --git a/stdlib/source/test/lux/data/collection/tree/finger.lux b/stdlib/source/test/lux/data/collection/tree/finger.lux
index 496c25865..be46b8249 100644
--- a/stdlib/source/test/lux/data/collection/tree/finger.lux
+++ b/stdlib/source/test/lux/data/collection/tree/finger.lux
@@ -78,7 +78,7 @@
(\ ..builder leaf tag_left expected_left)
(\ ..builder leaf tag_right expected_right))))))
(do random.monad
- [#let [tags_equivalence (list.equivalence text.equivalence)
+ [.let [tags_equivalence (list.equivalence text.equivalence)
values_equivalence (list.equivalence n.equivalence)]
tags/H (random.ascii/alpha_num 1)
tags/T (random.list 5 (random.ascii/alpha_num 1))
diff --git a/stdlib/source/test/lux/data/collection/tree/zipper.lux b/stdlib/source/test/lux/data/collection/tree/zipper.lux
index 749a8c59b..756318c0b 100644
--- a/stdlib/source/test/lux/data/collection/tree/zipper.lux
+++ b/stdlib/source/test/lux/data/collection/tree/zipper.lux
@@ -159,7 +159,7 @@
[[size sample] (//.tree random.nat)
expected random.nat
dummy (random.only (|>> (n.= expected) not) random.nat)
- #let [(^open "tree\.") (tree.equivalence n.equivalence)
+ .let [(^open "tree\.") (tree.equivalence n.equivalence)
(^open "list\.") (list.equivalence n.equivalence)]]
($_ _.and
(_.for [/.equivalence]
diff --git a/stdlib/source/test/lux/data/color.lux b/stdlib/source/test/lux/data/color.lux
index 81c45a8e2..990eb6aea 100644
--- a/stdlib/source/test/lux/data/color.lux
+++ b/stdlib/source/test/lux/data/color.lux
@@ -48,8 +48,8 @@
(def: (distance/3 from to)
(-> /.Color /.Color Frac)
- (let [[fr fg fb] (/.to_rgb from)
- [tr tg tb] (/.to_rgb to)]
+ (let [[fr fg fb] (/.rgb from)
+ [tr tg tb] (/.rgb to)]
(square_root
($_ f.+
(|> (scale tr) (f.- (scale fr)) square)
@@ -61,7 +61,7 @@
(template [<field>]
[(def: (<field> color)
(-> /.Color Frac)
- (let [[hue saturation luminance] (/.to_hsl color)]
+ (let [[hue saturation luminance] (/.hsl color)]
<field>))]
[saturation]
@@ -71,19 +71,19 @@
(def: (encoding expected)
(-> /.Color Test)
($_ _.and
- (_.cover [/.RGB /.to_rgb /.of_rgb]
- (|> expected /.to_rgb /.of_rgb
+ (_.cover [/.RGB /.rgb /.of_rgb]
+ (|> expected /.rgb /.of_rgb
(\ /.equivalence = expected)))
- (_.cover [/.HSL /.to_hsl /.of_hsl]
- (|> expected /.to_hsl /.of_hsl
+ (_.cover [/.HSL /.hsl /.of_hsl]
+ (|> expected /.hsl /.of_hsl
(distance/3 expected)
(f.<= ..rgb_error_margin)))
- (_.cover [/.HSB /.to_hsb /.of_hsb]
- (|> expected /.to_hsb /.of_hsb
+ (_.cover [/.HSB /.hsb /.of_hsb]
+ (|> expected /.hsb /.of_hsb
(distance/3 expected)
(f.<= ..rgb_error_margin)))
- (_.cover [/.CMYK /.to_cmyk /.of_cmyk]
- (|> expected /.to_cmyk /.of_cmyk
+ (_.cover [/.CMYK /.cmyk /.of_cmyk]
+ (|> expected /.cmyk /.of_cmyk
(distance/3 expected)
(f.<= ..rgb_error_margin)))
))
@@ -133,9 +133,9 @@
(do {! random.monad}
[eH (\ ! map (|>> f.abs (f.% +0.9) (f.+ +0.05))
random.safe_frac)
- #let [eS +0.5]
+ .let [eS +0.5]
variations (\ ! map (|>> (n.% 3) (n.+ 2)) random.nat)
- #let [max_spread (f./ (|> variations inc .int int.frac)
+ .let [max_spread (f./ (|> variations inc .int int.frac)
+1.0)
min_spread (f./ +2.0 max_spread)
spread_space (f.- min_spread max_spread)]
diff --git a/stdlib/source/test/lux/data/format/json.lux b/stdlib/source/test/lux/data/format/json.lux
index 940f22cd8..1c4469df2 100644
--- a/stdlib/source/test/lux/data/format/json.lux
+++ b/stdlib/source/test/lux/data/format/json.lux
@@ -90,8 +90,8 @@
(do random.monad
[keys (random.set text.hash 3 (random.ascii/alpha 1))
values (random.set frac.hash 3 random.safe_frac)
- #let [expected (list.zipped/2 (set.to_list keys)
- (list\map (|>> #/.Number) (set.to_list values)))
+ .let [expected (list.zipped/2 (set.list keys)
+ (list\map (|>> #/.Number) (set.list values)))
object (/.object expected)]]
($_ _.and
(_.cover [/.object /.fields]
@@ -119,7 +119,7 @@
(<| (try.else false)
(do try.monad
[object (/.set key (#/.Number expected) (/.object (list)))
- #let [can_find_known_key!
+ .let [can_find_known_key!
(|> object
(/.get key)
(try\map (\= (#/.Number expected)))
diff --git a/stdlib/source/test/lux/data/format/tar.lux b/stdlib/source/test/lux/data/format/tar.lux
index 13c713f7f..34618433b 100644
--- a/stdlib/source/test/lux/data/format/tar.lux
+++ b/stdlib/source/test/lux/data/format/tar.lux
@@ -162,7 +162,7 @@
random.nat)
chunk (random.ascii/lower chunk_size)
chunks (\ ! map (n.% 100) random.nat)
- #let [content (|> chunk
+ .let [content (|> chunk
(list.repeat chunks)
(text.join_with "")
(\ utf8.codec encode))]]
@@ -174,7 +174,7 @@
tar (|> (row.row (<tag> expected_path))
(format.run /.writer)
(<b>.run /.parser))]
- (in (case (row.to_list tar)
+ (in (case (row.list tar)
(^ (list (<tag> actual_path)))
(text\= (/.from_path expected_path)
(/.from_path actual_path))
@@ -203,7 +203,7 @@
expected_content]))
(format.run /.writer)
(<b>.run /.parser))]
- (in (case (row.to_list tar)
+ (in (case (row.list tar)
(^ (list (<tag> [actual_path actual_moment actual_mode actual_ownership actual_content])))
(let [seconds (: (-> Instant Int)
(|>> instant.relative (duration.query duration.second)))]
@@ -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\fold /.and /.none modes)]]
(`` ($_ _.and
(_.cover [/.and]
(|> (do try.monad
@@ -261,7 +261,7 @@
content]))
(format.run /.writer)
(<b>.run /.parser))]
- (in (case (row.to_list tar)
+ (in (case (row.list tar)
(^ (list (#/.Normal [_ _ actual_mode _ _])))
(n.= (/.mode expected_mode)
(/.mode actual_mode))
@@ -284,7 +284,7 @@
content]))
(format.run /.writer)
(<b>.run /.parser))]
- (in (case (row.to_list tar)
+ (in (case (row.list tar)
(^ (list (#/.Normal [_ _ actual_mode _ _])))
(n.= (/.mode <expected_mode>)
(/.mode actual_mode))
@@ -351,7 +351,7 @@
content]))
(format.run /.writer)
(<b>.run /.parser))]
- (in (case (row.to_list tar)
+ (in (case (row.list tar)
(^ (list (#/.Normal [_ _ _ actual_ownership _])))
(and (text\= (/.from_name expected)
(/.from_name (get@ [#/.user #/.name] actual_ownership)))
@@ -375,7 +375,7 @@
content]))
(format.run /.writer)
(<b>.run /.parser))]
- (in (case (row.to_list tar)
+ (in (case (row.list tar)
(^ (list (#/.Normal [_ _ _ actual_ownership _])))
(and (text\= (/.from_name /.anonymous)
(/.from_name (get@ [#/.user #/.name] actual_ownership)))
diff --git a/stdlib/source/test/lux/data/lazy.lux b/stdlib/source/test/lux/data/lazy.lux
index 4fb2f6642..c30fd3692 100644
--- a/stdlib/source/test/lux/data/lazy.lux
+++ b/stdlib/source/test/lux/data/lazy.lux
@@ -40,7 +40,7 @@
(do random.monad
[left random.nat
right random.nat
- #let [expected <eager>]]
+ .let [expected <eager>]]
(_.for [/.Lazy]
($_ _.and
(_.for [/.equivalence]
diff --git a/stdlib/source/test/lux/data/maybe.lux b/stdlib/source/test/lux/data/maybe.lux
index 9aa890d9f..65d405473 100644
--- a/stdlib/source/test/lux/data/maybe.lux
+++ b/stdlib/source/test/lux/data/maybe.lux
@@ -48,7 +48,7 @@
(do random.monad
[left random.nat
right random.nat
- #let [expected (n.+ left right)]]
+ .let [expected (n.+ left right)]]
(let [lift (/.lift io.monad)]
(_.cover [/.with /.lift]
(|> (io.run (do (/.with io.monad)
@@ -75,8 +75,14 @@
(is? value (/.assume (#.Some value)))))
(do random.monad
[value random.nat]
- (_.cover [/.to_list]
+ (_.cover [/.list]
(\ (list.equivalence n.equivalence) =
(list value)
- (/.to_list (#.Some value)))))
+ (/.list (#.Some value)))))
+ (do random.monad
+ [expected random.nat
+ .let [(^open "/\.") (/.equivalence n.equivalence)]]
+ (_.cover [/.when]
+ (and (/\= (#.Some expected) (/.when true (#.Some expected)))
+ (/\= #.None (/.when false (#.Some expected))))))
)))
diff --git a/stdlib/source/test/lux/data/text.lux b/stdlib/source/test/lux/data/text.lux
index 3e063f73a..5d02dbfcf 100644
--- a/stdlib/source/test/lux/data/text.lux
+++ b/stdlib/source/test/lux/data/text.lux
@@ -56,7 +56,7 @@
(random.unicode 1))
left (random.unicode 1)
right (random.unicode 1)
- #let [full (\ /.monoid compose inner outer)
+ .let [full (\ /.monoid compose inner outer)
fake_index (dec 0)]]
(`` ($_ _.and
(~~ (template [<affix> <predicate>]
@@ -83,7 +83,7 @@
[inner (random.unicode 1)
outer (random.only (|>> (\ /.equivalence = inner) not)
(random.unicode 1))
- #let [fake_index (dec 0)]]
+ .let [fake_index (dec 0)]]
($_ _.and
(_.cover [/.contains?]
(let [full (\ /.monoid compose inner outer)]
@@ -122,24 +122,6 @@
(|> (/.last_index_of outer full)
(maybe.else fake_index)
(n.= 2)))))
- (_.cover [/.last_index_of']
- (let [full ($_ (\ /.monoid compose) outer inner outer)]
- (and (|> (/.last_index_of' 0 inner full)
- (maybe.else fake_index)
- (n.= 1))
- (|> (/.last_index_of' 2 inner full)
- (maybe.else fake_index)
- (n.= fake_index))
-
- (|> (/.last_index_of' 0 outer full)
- (maybe.else fake_index)
- (n.= 2))
- (|> (/.last_index_of' 2 outer full)
- (maybe.else fake_index)
- (n.= 2))
- (|> (/.last_index_of' 3 outer full)
- (maybe.else fake_index)
- (n.= fake_index)))))
)))
(def: char
@@ -166,7 +148,7 @@
(do {! random.monad}
[size (\ ! map (|>> (n.% 10) inc) random.nat)
characters (random.set /.hash size (random.ascii/alpha 1))
- #let [sample (|> characters set.to_list /.concat)]
+ .let [sample (|> characters set.list /.concat)]
expected (\ ! map (n.% size) random.nat)]
(_.cover [/.char]
(case (/.char expected sample)
@@ -200,9 +182,9 @@
characters (random.set /.hash size (random.ascii/alpha 1))
separator (random.only (|>> (set.member? characters) not)
(random.ascii/alpha 1))
- #let [with_no_separator (|> characters set.to_list /.concat)]
+ .let [with_no_separator (|> characters set.list /.concat)]
static (random.ascii/alpha 1)
- #let [dynamic (random.only (|>> (\ /.equivalence = static) not)
+ .let [dynamic (random.only (|>> (\ /.equivalence = static) not)
(random.ascii/alpha 1))]
pre dynamic
post dynamic
@@ -212,16 +194,16 @@
($_ _.and
(_.cover [/.concat]
(n.= (set.size characters)
- (/.size (/.concat (set.to_list characters)))))
+ (/.size (/.concat (set.list characters)))))
(_.cover [/.join_with /.split_all_with]
- (and (|> (set.to_list characters)
+ (and (|> (set.list characters)
(/.join_with separator)
(/.split_all_with separator)
(set.of_list /.hash)
(\ set.equivalence = characters))
(\ /.equivalence =
- (/.concat (set.to_list characters))
- (/.join_with "" (set.to_list characters)))))
+ (/.concat (set.list characters))
+ (/.join_with "" (set.list characters)))))
(_.cover [/.replace_once]
(\ /.equivalence =
(\ /.monoid compose post static)
@@ -303,7 +285,7 @@
sampleL (random.unicode sizeL)
sampleR (random.unicode sizeR)
middle (random.unicode 1)
- #let [sample (/.concat (list sampleL sampleR))
+ .let [sample (/.concat (list sampleL sampleR))
(^open "/\.") /.equivalence]]
($_ _.and
(_.cover [/.split]
@@ -332,16 +314,16 @@
(do {! random.monad}
[sizeP bounded_size
sizeL bounded_size
- #let [## The wider unicode charset includes control characters that
+ .let [## The wider unicode charset includes control characters that
## can make text replacement work improperly.
## Because of that, I restrict the charset.
normal_char_gen (|> random.nat (\ ! map (|>> (n.% 128) (n.max 1))))]
sep1 (random.text normal_char_gen 1)
sep2 (random.text normal_char_gen 1)
- #let [part_gen (|> (random.text normal_char_gen sizeP)
+ .let [part_gen (|> (random.text normal_char_gen sizeP)
(random.only (|>> (/.contains? sep1) not)))]
parts (random.list sizeL part_gen)
- #let [sample1 (/.concat (list.interpose sep1 parts))
+ .let [sample1 (/.concat (list.interpose sep1 parts))
sample2 (/.concat (list.interpose sep2 parts))
(^open "/\.") /.equivalence]]
(_.cover [/.replace_all]
diff --git a/stdlib/source/test/lux/data/text/escape.lux b/stdlib/source/test/lux/data/text/escape.lux
index 34f37de58..21266b277 100644
--- a/stdlib/source/test/lux/data/text/escape.lux
+++ b/stdlib/source/test/lux/data/text/escape.lux
@@ -72,7 +72,7 @@
(syntax: (static_sample)
(do meta.monad
[seed meta.seed
- #let [[_ expected] (random.run (random.pcg32 [seed seed])
+ .let [[_ expected] (random.run (random.pcg_32 [seed seed])
(random.ascii 10))]]
(in (list (code.text expected)))))
diff --git a/stdlib/source/test/lux/data/text/unicode/block.lux b/stdlib/source/test/lux/data/text/unicode/block.lux
index 9588ce6ce..e2a415abd 100644
--- a/stdlib/source/test/lux/data/text/unicode/block.lux
+++ b/stdlib/source/test/lux/data/text/unicode/block.lux
@@ -170,12 +170,12 @@
(<| (_.covering /._)
(_.for [/.Block])
(do {! random.monad}
- [#let [top_start (hex "AC00")
+ [.let [top_start (hex "AC00")
top_end (hex "D7AF")
end_range (n.- top_start top_end)]
start (\ ! map (|>> (n.% top_start) inc) random.nat)
end (\ ! map (|>> (n.% end_range) (n.+ top_start)) random.nat)
- #let [additional (n.- start end)
+ .let [additional (n.- start end)
sample (/.block start additional)
size (/.size sample)]
inside (\ ! map
diff --git a/stdlib/source/test/lux/data/text/unicode/set.lux b/stdlib/source/test/lux/data/text/unicode/set.lux
index cd74a038c..0f50a1dd7 100644
--- a/stdlib/source/test/lux/data/text/unicode/set.lux
+++ b/stdlib/source/test/lux/data/text/unicode/set.lux
@@ -42,7 +42,7 @@
random.nat)
left //block.random
right //block.random
- #let [equivalence (product.equivalence n.equivalence
+ .let [equivalence (product.equivalence n.equivalence
n.equivalence)]]
(`` ($_ _.and
(_.for [/.equivalence]
@@ -76,7 +76,7 @@
(~~ (template [<set>]
[(do random.monad
[char (random.char <set>)
- #let [start (/.start <set>)
+ .let [start (/.start <set>)
end (/.end <set>)]]
(_.cover [<set>]
(and (/.member? <set> char)
diff --git a/stdlib/source/test/lux/extension.lux b/stdlib/source/test/lux/extension.lux
index bab7b9007..76172c10d 100644
--- a/stdlib/source/test/lux/extension.lux
+++ b/stdlib/source/test/lux/extension.lux
@@ -109,7 +109,7 @@
## Directive
(directive: (..my_directive self phase archive {parameters (<>.some <code>.any)})
(do phase.monad
- [#let [_ (debug.log! (format "Successfully installed directive " (%.text self) "!"))]]
+ [.let [_ (debug.log! (format "Successfully installed directive " (%.text self) "!"))]]
(in directive.no_requirements)))
(`` ((~~ (static ..my_directive))))
diff --git a/stdlib/source/test/lux/ffi.jvm.lux b/stdlib/source/test/lux/ffi.jvm.lux
index e2d7e4f4d..c5f52200b 100644
--- a/stdlib/source/test/lux/ffi.jvm.lux
+++ b/stdlib/source/test/lux/ffi.jvm.lux
@@ -262,7 +262,7 @@
[expected random.nat
left random.int
right random.int
- #let [object/0 (/.object [] [test/TestInterface0]
+ .let [object/0 (/.object [] [test/TestInterface0]
[]
(test/TestInterface0
[] (actual0 self)
@@ -491,7 +491,7 @@
left random.int
right random.int
- #let [object/0 (test/TestClass0::new (.int expected))
+ .let [object/0 (test/TestClass0::new (.int expected))
example/0!
(n.= expected
(:as Nat (test/TestInterface0::actual0 object/0)))
@@ -543,13 +543,13 @@
(i.= expected
(test/TestInterface4::actual4 left right right object/8)))]
- #let [random_long (: (Random java/lang/Long)
+ .let [random_long (: (Random java/lang/Long)
(\ ! map (|>> (:as java/lang/Long))
random.int))]
dummy/0 random_long
dummy/1 random_long
dummy/2 random_long
- #let [object/9 (/.do_to (: (test/TestClass9 java/lang/Long)
+ .let [object/9 (/.do_to (: (test/TestClass9 java/lang/Long)
(test/TestClass9::new dummy/0))
(test/TestClass9::set_actual9 dummy/1)
(test/TestClass9::set_actual9 dummy/2))
diff --git a/stdlib/source/test/lux/locale.lux b/stdlib/source/test/lux/locale.lux
index 298b4cf7d..ea6ac14e2 100644
--- a/stdlib/source/test/lux/locale.lux
+++ b/stdlib/source/test/lux/locale.lux
@@ -76,11 +76,11 @@
[language ..random_language
territory ..random_territory
encoding ..random_encoding
- #let [l_locale (/.locale language #.None #.None)
+ .let [l_locale (/.locale language #.None #.None)
lt_locale (/.locale language (#.Some territory) #.None)
le_locale (/.locale language #.None (#.Some encoding))
lte_locale (/.locale language (#.Some territory) (#.Some encoding))]
- #let [language_check (and (text\= (language.code language)
+ .let [language_check (and (text\= (language.code language)
(/.code l_locale))
(list.every? (|>> /.code (text.starts_with? (language.code language)))
(list lt_locale le_locale lte_locale)))
diff --git a/stdlib/source/test/lux/locale/language.lux b/stdlib/source/test/lux/locale/language.lux
index 3fcda84d7..8577301d8 100644
--- a/stdlib/source/test/lux/locale/language.lux
+++ b/stdlib/source/test/lux/locale/language.lux
@@ -277,7 +277,7 @@
(def: #export random
(Random /.Language)
(let [options (|> ..languages
- (list\map (|>> (get@ #languages) set.to_list))
+ (list\map (|>> (get@ #languages) set.list))
list.concat)]
(do {! random.monad}
[choice (\ ! map (n.% (list.size options))
diff --git a/stdlib/source/test/lux/locale/territory.lux b/stdlib/source/test/lux/locale/territory.lux
index e03bd8dc6..a0dfbb4ee 100644
--- a/stdlib/source/test/lux/locale/territory.lux
+++ b/stdlib/source/test/lux/locale/territory.lux
@@ -203,7 +203,7 @@
(def: #export random
(Random /.Territory)
(let [options (|> ..territories
- (list\map (|>> (get@ #territories) set.to_list))
+ (list\map (|>> (get@ #territories) set.list))
list.concat)]
(do {! random.monad}
[choice (\ ! map (n.% (list.size options))
diff --git a/stdlib/source/test/lux/macro.lux b/stdlib/source/test/lux/macro.lux
index 248a63400..8dc0c64db 100644
--- a/stdlib/source/test/lux/macro.lux
+++ b/stdlib/source/test/lux/macro.lux
@@ -61,7 +61,7 @@
(do {! random.monad}
[seed random.nat
gensym_prefix (random.ascii/upper 1)
- #let [macro_module (name.module (name_of /._))
+ .let [macro_module (name.module (name_of /._))
current_module (name.module (name_of .._))]]
(in [seed
gensym_prefix
@@ -113,7 +113,7 @@
pow/1 (\ ! map code.nat random.nat)
repetitions (\ ! map (nat.% 10) random.nat)
- #let [single_expansion (` (..pow/2 (..pow/2 (~ pow/1))))
+ .let [single_expansion (` (..pow/2 (..pow/2 (~ pow/1))))
expansion (` (nat.* (..pow/2 (~ pow/1))
(..pow/2 (~ pow/1))))
full_expansion (` (nat.* (nat.* (~ pow/1) (~ pow/1))
diff --git a/stdlib/source/test/lux/macro/poly/equivalence.lux b/stdlib/source/test/lux/macro/poly/equivalence.lux
index c14525e7d..ca083482d 100644
--- a/stdlib/source/test/lux/macro/poly/equivalence.lux
+++ b/stdlib/source/test/lux/macro/poly/equivalence.lux
@@ -55,7 +55,7 @@
(Random Record)
(do {! random.monad}
[size (\ ! map (n.% 2) random.nat)
- #let [gen_int (|> random.int (\ ! map (|>> i.abs (i.% +1,000,000))))]]
+ .let [gen_int (|> random.int (\ ! map (|>> i.abs (i.% +1,000,000))))]]
($_ random.and
random.bit
gen_int
diff --git a/stdlib/source/test/lux/math.lux b/stdlib/source/test/lux/math.lux
index 96ba96e35..8eae10808 100644
--- a/stdlib/source/test/lux/math.lux
+++ b/stdlib/source/test/lux/math.lux
@@ -36,7 +36,7 @@
(<| (_.covering /._)
($_ _.and
(do {! random.monad}
- [#let [~= (f.approximately? ..margin_of_error)]
+ [.let [~= (f.approximately? ..margin_of_error)]
angle (|> random.safe_frac (\ ! map (f.* /.tau)))]
($_ _.and
(_.cover [/.sin /.asin]
@@ -90,7 +90,7 @@
(f.approximately? ..margin_of_error sample)))
))
(do {! random.monad}
- [#let [~= (f.approximately? ..margin_of_error)]
+ [.let [~= (f.approximately? ..margin_of_error)]
sample (\ ! map (f.* +10.0) random.safe_frac)
power (\ ! map (|>> (n.% 10) inc n.frac) random.nat)]
($_ _.and
@@ -106,7 +106,7 @@
(~= power))))
))
(do {! random.monad}
- [#let [~= (f.approximately? ..margin_of_error)]
+ [.let [~= (f.approximately? ..margin_of_error)]
angle (\ ! map (f.* /.tau) random.safe_frac)
sample (\ ! map f.abs random.safe_frac)
big (\ ! map (f.* +1,000,000,000.00) random.safe_frac)]
@@ -144,7 +144,7 @@
(and (f.>= x h)
(f.>= y h)))))
(do {! random.monad}
- [#let [~= (f.approximately? ..margin_of_error)
+ [.let [~= (f.approximately? ..margin_of_error)
tau/4 (f./ +4.0 /.tau)]
x (\ ! map (f.* tau/4) random.safe_frac)
y (\ ! map (f.* tau/4) random.safe_frac)]
diff --git a/stdlib/source/test/lux/math/logic/fuzzy.lux b/stdlib/source/test/lux/math/logic/fuzzy.lux
index 0beb03ada..bdbc790ac 100644
--- a/stdlib/source/test/lux/math/logic/fuzzy.lux
+++ b/stdlib/source/test/lux/math/logic/fuzzy.lux
@@ -44,7 +44,7 @@
threshold_1 (\ ! map (|>> (r.% .5) (r.+ .5))
random.rev)
- #let [bottom (r.min threshold_0 threshold_1)
+ .let [bottom (r.min threshold_0 threshold_1)
top (r.max threshold_0 threshold_1)]]
($_ _.and
(_.cover [/.gradient]
@@ -89,7 +89,7 @@
[bottom middle_bottom middle_top top]
(|> random.rev
(random.set r.hash 4)
- (\ ! map (|>> set.to_list (list.sort r.<)))
+ (\ ! map (|>> set.list (list.sort r.<)))
(random.one (function (_ thresholds)
(case thresholds
(^ (list threshold_0 threshold_1 threshold_2 threshold_3))
@@ -98,7 +98,7 @@
_
#.None))))
- #let [bottom_set (/.gradient bottom middle_bottom)
+ .let [bottom_set (/.gradient bottom middle_bottom)
top_set (/.gradient middle_top top)]]
($_ _.and
(_.cover [/.union]
@@ -173,7 +173,7 @@
[bottom middle_bottom middle_top top]
(|> random.rev
(random.set r.hash 4)
- (\ ! map (|>> set.to_list (list.sort r.<)))
+ (\ ! map (|>> set.list (list.sort r.<)))
(random.one (function (_ thresholds)
(case thresholds
(^ (list threshold_0 threshold_1 threshold_2 threshold_3))
@@ -291,7 +291,7 @@
Test
(do random.monad
[threshold random.nat
- #let [under? (n.< threshold)
+ .let [under? (n.< threshold)
set (set.of_list n.hash (list threshold))]
sample random.nat]
($_ _.and
@@ -312,7 +312,7 @@
threshold_0 random.rev
threshold_1 random.rev
- #let [bottom (r.min threshold_0 threshold_1)
+ .let [bottom (r.min threshold_0 threshold_1)
top (r.max threshold_0 threshold_1)]]
(in [[bottom top]
(/.gradient bottom top)])))
@@ -324,8 +324,8 @@
threshold random.rev
sample random.rev]
($_ _.and
- (_.cover [/.to_predicate]
- (bit\= (not ((/.to_predicate threshold set) sample))
+ (_.cover [/.predicate]
+ (bit\= (not ((/.predicate threshold set) sample))
(r.< threshold (/.membership set sample))))
(_.cover [/.cut]
(bit\= (r.= //.false (/.membership (/.cut threshold set) sample))
@@ -339,7 +339,7 @@
(do random.monad
[sample random.rev
[_ fuzzy] ..gradient
- #let [equivalence (: (Equivalence (/.Fuzzy Rev))
+ .let [equivalence (: (Equivalence (/.Fuzzy Rev))
(implementation
(def: (= left right)
(r.= (left sample)
diff --git a/stdlib/source/test/lux/math/number/frac.lux b/stdlib/source/test/lux/math/number/frac.lux
index 2a8e65062..7f59d94af 100644
--- a/stdlib/source/test/lux/math/number/frac.lux
+++ b/stdlib/source/test/lux/math/number/frac.lux
@@ -191,10 +191,10 @@
(let [test (: (-> Frac Bit)
(function (_ value)
(n.= (.nat (java/lang/Double::doubleToRawLongBits value))
- (/.to_bits value))))]
+ (/.bits value))))]
(do random.monad
[sample random.frac]
- (_.cover [/.to_bits]
+ (_.cover [/.bits]
(and (test sample)
(test /.biggest)
(test /.smallest)
@@ -214,13 +214,13 @@
@.jvm <jvm>}
(let [test (: (-> Frac Bit)
(function (_ expected)
- (let [actual (|> expected /.to_bits /.of_bits)]
+ (let [actual (|> expected /.bits /.of_bits)]
(or (/.= expected actual)
(and (/.not_a_number? expected)
(/.not_a_number? actual))))))]
(do random.monad
[sample random.frac]
- (_.cover [/.to_bits /.of_bits]
+ (_.cover [/.bits /.of_bits]
(and (test sample)
(test /.biggest)
(test /.smallest)
diff --git a/stdlib/source/test/lux/math/number/i16.lux b/stdlib/source/test/lux/math/number/i16.lux
index 5a9e36f88..bc1da4832 100644
--- a/stdlib/source/test/lux/math/number/i16.lux
+++ b/stdlib/source/test/lux/math/number/i16.lux
@@ -23,7 +23,7 @@
(<| (_.covering /._)
(_.for [/.I16])
(do {! random.monad}
- [#let [limit (|> (dec /.width)
+ [.let [limit (|> (dec /.width)
//i64.mask
.int
inc)]
diff --git a/stdlib/source/test/lux/math/number/i32.lux b/stdlib/source/test/lux/math/number/i32.lux
index 4cced31ad..211156ef2 100644
--- a/stdlib/source/test/lux/math/number/i32.lux
+++ b/stdlib/source/test/lux/math/number/i32.lux
@@ -23,7 +23,7 @@
(<| (_.covering /._)
(_.for [/.I32])
(do {! random.monad}
- [#let [limit (|> (dec /.width)
+ [.let [limit (|> (dec /.width)
//i64.mask
.int
inc)]
diff --git a/stdlib/source/test/lux/math/number/i64.lux b/stdlib/source/test/lux/math/number/i64.lux
index 1d097ca27..ddc907939 100644
--- a/stdlib/source/test/lux/math/number/i64.lux
+++ b/stdlib/source/test/lux/math/number/i64.lux
@@ -99,7 +99,7 @@
full!)))
(do !
[size (\ ! map (n.% /.width) random.nat)
- #let [spare (n.- size /.width)]
+ .let [spare (n.- size /.width)]
offset (\ ! map (n.% spare) random.nat)]
(_.cover [/.region]
(case size
@@ -130,12 +130,12 @@
(#.Some sub)
(do {! random.monad}
- [#let [limit (|> (dec (\ sub width))
+ [.let [limit (|> (dec (\ sub width))
/.mask
.int
inc)]
expected (\ ! map (i.% limit) random.int)
- #let [random (: (All [size]
+ .let [random (: (All [size]
(-> (-> I64 (I64 size)) (Random (I64 size))))
(function (_ narrow)
(\ random.functor map narrow random.i64)))]]
diff --git a/stdlib/source/test/lux/math/number/i8.lux b/stdlib/source/test/lux/math/number/i8.lux
index 8b454883d..6bd0a3c9f 100644
--- a/stdlib/source/test/lux/math/number/i8.lux
+++ b/stdlib/source/test/lux/math/number/i8.lux
@@ -23,7 +23,7 @@
(<| (_.covering /._)
(_.for [/.I8])
(do {! random.monad}
- [#let [limit (|> (dec /.width)
+ [.let [limit (|> (dec /.width)
//i64.mask
.int
inc)]
diff --git a/stdlib/source/test/lux/math/number/int.lux b/stdlib/source/test/lux/math/number/int.lux
index 18f46233a..6d8d2340b 100644
--- a/stdlib/source/test/lux/math/number/int.lux
+++ b/stdlib/source/test/lux/math/number/int.lux
@@ -135,7 +135,7 @@
(/.mod left right))))))
))
(do {! random.monad}
- [#let [random (|> random.int
+ [.let [random (|> random.int
(\ ! map (/.% +1,000))
(random.only (|>> (/.= +0) not)))]
left random
diff --git a/stdlib/source/test/lux/math/number/nat.lux b/stdlib/source/test/lux/math/number/nat.lux
index 05fbfb303..9b2a8d676 100644
--- a/stdlib/source/test/lux/math/number/nat.lux
+++ b/stdlib/source/test/lux/math/number/nat.lux
@@ -104,7 +104,7 @@
(/.= rem (/.% left right)))))
))
(do {! random.monad}
- [#let [random (\ ! map (|>> (/.% 1,000) inc) random.nat)]
+ [.let [random (\ ! map (|>> (/.% 1,000) inc) random.nat)]
left random
right random]
($_ _.and
diff --git a/stdlib/source/test/lux/math/number/ratio.lux b/stdlib/source/test/lux/math/number/ratio.lux
index 9383f97e3..c30830474 100644
--- a/stdlib/source/test/lux/math/number/ratio.lux
+++ b/stdlib/source/test/lux/math/number/ratio.lux
@@ -53,7 +53,7 @@
($codec.spec /.equivalence /.codec ..random))
(do random.monad
- [#let [(^open "\.") /.equivalence]
+ [.let [(^open "\.") /.equivalence]
denom/0 ..part
denom/1 ..part]
(_.cover [/.ratio]
diff --git a/stdlib/source/test/lux/math/number/rev.lux b/stdlib/source/test/lux/math/number/rev.lux
index 63c8c7135..3c9d07138 100644
--- a/stdlib/source/test/lux/math/number/rev.lux
+++ b/stdlib/source/test/lux/math/number/rev.lux
@@ -88,7 +88,7 @@
(and (/.< left (/.* left right))
(/.< right (/.* left right)))))
(do {! random.monad}
- [#let [dividend (\ ! map (i64.and (hex "FFFF"))
+ [.let [dividend (\ ! map (i64.and (hex "FFFF"))
random.rev)
divisor (\ ! map (|>> (i64.and (hex "F"))
(i64.or (hex "1"))
diff --git a/stdlib/source/test/lux/meta.lux b/stdlib/source/test/lux/meta.lux
index 6855ada9a..45a6b5b10 100644
--- a/stdlib/source/test/lux/meta.lux
+++ b/stdlib/source/test/lux/meta.lux
@@ -50,7 +50,7 @@
expected_seed random.nat
expected random.nat
dummy (random.only (|>> (n.= expected) not) random.nat)
- #let [expected_lux {#.info {#.target target
+ .let [expected_lux {#.info {#.target target
#.version version
#.mode #.Build}
#.source [location.dummy 0 source_code]
@@ -97,7 +97,7 @@
expected random.nat
dummy (random.only (|>> (n.= expected) not) random.nat)
expected_error (random.ascii/upper 1)
- #let [expected_lux {#.info {#.target target
+ .let [expected_lux {#.info {#.target target
#.version version
#.mode #.Build}
#.source [location.dummy 0 source_code]
@@ -177,7 +177,7 @@
(not (or (text\= expected_current_module module)
(text\= imported_module_name module))))
(random.ascii/upper 1))
- #let [imported_module {#.module_hash 0
+ .let [imported_module {#.module_hash 0
#.module_aliases (list)
#.definitions (list)
#.imports (list)
@@ -294,7 +294,7 @@
expected random.nat
dummy (random.only (|>> (n.= expected) not) random.nat)
expected_location ..random_location
- #let [type_context {#.ex_counter 0
+ .let [type_context {#.ex_counter 0
#.var_counter 0
#.var_bindings (list)}
expected_lux {#.info {#.target target
@@ -350,7 +350,7 @@
(random.ascii/upper 1))
expected_value (random.either (in .def:)
(in .macro:))
- #let [expected_lux
+ .let [expected_lux
(: (-> Bit (Maybe Type)
[(List [Text .Global])
(List [Text .Global])
@@ -468,10 +468,10 @@
expected_type (\ ! map (function (_ name)
(#.Primitive name (list)))
(random.ascii/upper 1))
- #let [expected_annotations (' [])]
+ .let [expected_annotations (' [])]
expected_value (random.either (in .def:)
(in .macro:))
- #let [expected_lux
+ .let [expected_lux
(: (-> Bit (Maybe Type)
[(List [Text .Global])
(List [Text .Global])
@@ -648,12 +648,12 @@
name_1 (random.only (|>> (text\= name_0) not)
(random.ascii/upper 1))
- #let [random_tag (\ ! map (|>> [tag_module])
+ .let [random_tag (\ ! map (|>> [tag_module])
(random.ascii/upper 1))]
all_tags (|> random_tag
(random.set name.hash 10)
- (\ ! map set.to_list))
- #let [tags_0 (list.take 5 all_tags)
+ (\ ! map set.list))
+ .let [tags_0 (list.take 5 all_tags)
tags_1 (list.drop 5 all_tags)
type_0 (#.Primitive name_0 (list))
@@ -750,7 +750,7 @@
[current_module (random.ascii/upper 1)
[name_0 name_1 name_2 name_3 name_4] (|> (random.ascii/upper 1)
(random.set text.hash 5)
- (\ ! map set.to_list)
+ (\ ! map set.list)
(random.one (function (_ values)
(case values
(^ (list name_0 name_1 name_2 name_3 name_4))
@@ -758,7 +758,7 @@
_
#.None))))
- #let [type_0 (#.Primitive name_0 (list))
+ .let [type_0 (#.Primitive name_0 (list))
type_1 (#.Primitive name_1 (list))
type_2 (#.Primitive name_2 (list))
type_3 (#.Primitive name_3 (list))
@@ -787,7 +787,7 @@
#.mappings (list [name_0 [type_0 0]])}
#.captured {#.counter 0
#.mappings (list)}})]
- #let [expected_lux
+ .let [expected_lux
(: Lux
{#.info {#.target ""
#.version ""
@@ -903,7 +903,7 @@
expected random.nat
dummy (random.only (|>> (n.= expected) not) random.nat)
expected_location ..random_location
- #let [expected_lux {#.info {#.target target
+ .let [expected_lux {#.info {#.target target
#.version version
#.mode #.Build}
#.source [expected_location 0 source_code]
diff --git a/stdlib/source/test/lux/meta/annotation.lux b/stdlib/source/test/lux/meta/annotation.lux
index 0447e3e6a..55a97ca60 100644
--- a/stdlib/source/test/lux/meta/annotation.lux
+++ b/stdlib/source/test/lux/meta/annotation.lux
@@ -115,7 +115,7 @@
[/.implementation? #.implementation?]
[/.recursive_type? #.type_rec?]
- [/.signature? #.sig?]
+ [/.interface? #.interface?]
))
))))
diff --git a/stdlib/source/test/lux/target/jvm.lux b/stdlib/source/test/lux/target/jvm.lux
index f15340fc4..9d9e17c80 100644
--- a/stdlib/source/test/lux/target/jvm.lux
+++ b/stdlib/source/test/lux/target/jvm.lux
@@ -121,7 +121,7 @@
[_ bytecode]
/.areturn))))
(row.row))
- #let [bytecode (format.run /class.writer class)
+ .let [bytecode (format.run /class.writer class)
loader (/loader.memory (/loader.new_library []))]
_ (/loader.define class_name bytecode loader)
class (io.run (/loader.load class_name loader))
@@ -498,7 +498,7 @@
(do random.monad
[reference ..$Long::random
subject ..$Long::random
- #let [expected (cond (i.= (:as Int reference) (:as Int subject))
+ .let [expected (cond (i.= (:as Int reference) (:as Int subject))
(:as java/lang/Long +0)
(i.> (:as Int reference) (:as Int subject))
@@ -590,11 +590,11 @@
comparison (: (-> (Bytecode Any) (-> java/lang/Float java/lang/Float Bit) (Random Bit))
(function (_ instruction standard)
(do random.monad
- [#let [valid_float (random.only (|>> ffi.float_to_double (:as Frac) f.not_a_number? not)
+ [.let [valid_float (random.only (|>> ffi.float_to_double (:as Frac) f.not_a_number? not)
..$Float::random)]
reference valid_float
subject valid_float
- #let [expected (if (for {@.old
+ .let [expected (if (for {@.old
("jvm feq" reference subject)
@.jvm
@@ -688,7 +688,7 @@
(do random.monad
[reference ..valid_double
subject ..valid_double
- #let [expected (if (for {@.old
+ .let [expected (if (for {@.old
("jvm deq" reference subject)
@.jvm
@@ -837,7 +837,7 @@
[class_name ..class_name
part0 ..$Long::random
part1 ..$Long::random
- #let [expected (: java/lang/Long
+ .let [expected (: java/lang/Long
(for {@.old
("jvm ladd" part0 part1)
@@ -1015,12 +1015,12 @@
(function (_ expected) (|>> (:as Text) (text\= (:as Text expected))))))
(<| (_.context "multi")
(do {! random.monad}
- [#let [size (\ ! map (|>> (n.% 5) (n.+ 1))
+ [.let [size (\ ! map (|>> (n.% 5) (n.+ 1))
random.nat)]
dimensions size
sizesH size
sizesT (random.list (dec dimensions) size)
- #let [type (loop [dimensions dimensions
+ .let [type (loop [dimensions dimensions
type (: (Type Object)
..$Object)]
(case dimensions
@@ -1052,7 +1052,7 @@
(function (_ from to instruction convert test)
(do random.monad
[input (get@ #random from)
- #let [expected (convert input)]]
+ .let [expected (convert input)]]
(..bytecode (test expected)
(do /.monad
[_ ((get@ #literal from) input)
@@ -1154,7 +1154,7 @@
[base ..$Byte::random
increment (\ ! map (|>> (n.% 100) /unsigned.u1 try.assumed)
random.nat)
- #let [expected (: java/lang/Long
+ .let [expected (: java/lang/Long
(for {@.old
("jvm ladd"
(ffi.byte_to_long base)
@@ -1233,10 +1233,10 @@
Test
(do random.monad
[expected/1 $String::random
- #let [object_test (: (-> Any Bit)
+ .let [object_test (: (-> Any Bit)
(|>> (:as Text) (text\= (:as Text expected/1))))]
dummy/1 $String::random
- #let [single ($_ _.and
+ .let [single ($_ _.and
(<| (_.lift "DUP & POP")
(..bytecode object_test)
(do /.monad
@@ -1268,10 +1268,10 @@
/.pop))
)]
expected/2 $Long::random
- #let [long_test (: (-> Any Bit)
+ .let [long_test (: (-> Any Bit)
(|>> (:as Int) (i.= (:as Int expected/2))))]
dummy/2 $Long::random
- #let [double ($_ _.and
+ .let [double ($_ _.and
(<| (_.lift "DUP2")
(..bytecode long_test)
(do /.monad
@@ -1321,11 +1321,11 @@
(do random.monad
[class_name ..class_name
primitive_method_name (random.ascii/upper 10)
- #let [primitive_method_type (/type.method [(list) (list) (get@ #unboxed primitive) (list)])]
+ .let [primitive_method_type (/type.method [(list) (list) (get@ #unboxed primitive) (list)])]
object_method_name (|> (random.ascii/upper 10)
(random.only (|>> (text\= primitive_method_name) not)))
expected (get@ #random primitive)
- #let [$Self (/type.class class_name (list))]]
+ .let [$Self (/type.class class_name (list))]]
(in (case (do try.monad
[class (/class.class /version.v6_0 /class.public
(/name.internal class_name)
@@ -1354,7 +1354,7 @@
_ (get@ #wrap primitive)]
/.areturn))))
(row.row))
- #let [bytecode (format.run /class.writer class)
+ .let [bytecode (format.run /class.writer class)
loader (/loader.memory (/loader.new_library []))]
_ (/loader.define class_name bytecode loader)
class (io.run (/loader.load class_name loader))
@@ -1388,7 +1388,7 @@
(do random.monad
[expected ..$Long::random
dummy ..$Long::random
- #let [if! (: (-> (-> Label (Bytecode Any)) (Bytecode Any) (Random Bit))
+ .let [if! (: (-> (-> Label (Bytecode Any)) (Bytecode Any) (Random Bit))
(function (_ instruction prelude)
(<| (..bytecode ((!::= java/lang/Long "jvm leq" "jvm long =") expected))
(do /.monad
@@ -1415,7 +1415,7 @@
reference ..$Integer::random
subject (|> ..$Integer::random
(random.only (|>> ((!::= java/lang/Integer "jvm ieq" "jvm int =") reference) not)))
- #let [[lesser greater] (if (for {@.old
+ .let [[lesser greater] (if (for {@.old
("jvm ilt" reference subject)
@.jvm
@@ -1450,7 +1450,7 @@
(do random.monad
[expected ..$Long::random
dummy ..$Long::random
- #let [jump (: (-> (-> Label (Bytecode Any)) (Random Bit))
+ .let [jump (: (-> (-> Label (Bytecode Any)) (Random Bit))
(function (_ goto)
(<| (..bytecode ((!::= java/lang/Long "jvm leq" "jvm long =") expected))
(do /.monad
@@ -1501,8 +1501,8 @@
options (|> random.int
(\ ! map (|>> (:as java/lang/Long) ffi.long_to_int ffi.int_to_long (:as Int)))
(random.set i.hash options)
- (\ ! map set.to_list))
- #let [choice (maybe.assume (list.item choice options))]
+ (\ ! map set.list))
+ .let [choice (maybe.assume (list.item choice options))]
expected ..$Long::random
dummy ..$Long::random])
(..bytecode ((!::= java/lang/Long "jvm leq" "jvm long =") expected))
@@ -1533,7 +1533,7 @@
(<| (_.lift "ATHROW")
(..bytecode ((!::= java/lang/Long "jvm leq" "jvm long =") expected))
(do /.monad
- [#let [$Exception (/type.class "java.lang.Exception" (list))]
+ [.let [$Exception (/type.class "java.lang.Exception" (list))]
@skipped /.new_label
@try /.new_label
@handler /.new_label
@@ -1596,7 +1596,7 @@
fake_part2 ..$Long::random
part3 ..$Long::random
part4 ..$Long::random
- #let [expected ($_ i.+
+ .let [expected ($_ i.+
(:as Int part0)
(:as Int part1)
(:as Int part2)
diff --git a/stdlib/source/test/lux/test.lux b/stdlib/source/test/lux/test.lux
index 04a4d0734..543eb94cd 100644
--- a/stdlib/source/test/lux/test.lux
+++ b/stdlib/source/test/lux/test.lux
@@ -65,12 +65,12 @@
/.Test
(do {! random.monad}
[seed random.nat
- #let [[read write] (: [(async.Async Nat) (async.Resolver Nat)]
+ .let [[read write] (: [(async.Async Nat) (async.Resolver Nat)]
(async.async []))]
pre (<| (/.seed seed)
(do !
[sample random.nat
- #let [wrote? (io.run (write sample))]]
+ .let [wrote? (io.run (write sample))]]
(/.test "" wrote?)))
post (<| (/.seed seed)
(do !
@@ -100,12 +100,12 @@
(n.= 1 (get@ #/.failures tally)))))))
(do {! random.monad}
[expected (\ ! map (|>> (n.% 10) inc) random.nat)
- #let [counter (: (Atom Nat)
+ .let [counter (: (Atom Nat)
(atom.atom 0))]
times_assertion (<| (/.times expected)
(do !
[_ (in [])
- #let [_ (io.run (atom.update inc counter))]]
+ .let [_ (io.run (atom.update inc counter))]]
(/.test "" true)))]
(in (do async.monad
[[tally error] times_assertion
@@ -121,14 +121,14 @@
($_ /.and
(do {! random.monad}
[expected (\ ! map (|>> (n.% 10) inc) random.nat)
- #let [counter (: (Atom Nat)
+ .let [counter (: (Atom Nat)
(atom.atom 0))]
assertion (<| /.in_parallel
(list.repeat expected)
(: /.Test)
(do !
[_ (in [])
- #let [_ (io.run (atom.update inc counter))]]
+ .let [_ (io.run (atom.update inc counter))]]
(/.test "" true)))]
(in (do async.monad
[[tally error] assertion
@@ -139,14 +139,14 @@
(n.= 0 (get@ #/.failures tally)))))))
(do {! random.monad}
[expected (\ ! map (|>> (n.% 10) inc) random.nat)
- #let [counter (: (Atom Nat)
+ .let [counter (: (Atom Nat)
(atom.atom 0))]
assertion (<| /.in_parallel
(list.repeat expected)
(: /.Test)
(do !
[_ (in [])
- #let [_ (undefined)
+ .let [_ (undefined)
_ (io.run (atom.update inc counter))]]
(/.test "" true)))]
(in (do async.monad
diff --git a/stdlib/source/test/lux/time.lux b/stdlib/source/test/lux/time.lux
index 593dc0d5c..91711a048 100644
--- a/stdlib/source/test/lux/time.lux
+++ b/stdlib/source/test/lux/time.lux
@@ -64,7 +64,7 @@
valid_second (\ ! map (|>> (n.% /.seconds) (n.max 10)) random.nat)
valid_milli_second (\ ! map (n.% /.milli_seconds) random.nat)
- #let [invalid_hour (|> valid_hour (n.+ /.hours))
+ .let [invalid_hour (|> valid_hour (n.+ /.hours))
invalid_minute (|> valid_minute (n.+ /.minutes) (n.min 99))
invalid_second (|> valid_second (n.+ /.seconds) (n.min 99))]]
(`` ($_ _.and
@@ -111,17 +111,17 @@
(<| (_.covering /._)
(_.for [/.Time])
(do {! random.monad}
- [#let [day (.nat (duration.to_millis duration.day))]
+ [.let [day (.nat (duration.millis duration.day))]
expected random.time
- out_of_bounds (\ ! map (|>> /.to_millis (n.+ day))
+ out_of_bounds (\ ! map (|>> /.millis (n.+ day))
random.time)]
(`` ($_ _.and
..for_implementation
- (_.cover [/.to_millis /.of_millis]
+ (_.cover [/.millis /.of_millis]
(|> expected
- /.to_millis
+ /.millis
/.of_millis
(try\map (\ /.equivalence = expected))
(try.else false)))
@@ -134,7 +134,7 @@
(exception.match? /.time_exceeds_a_day error)))
(_.cover [/.midnight]
(|> /.midnight
- /.to_millis
+ /.millis
(n.= 0)))
(_.cover [/.parser]
(|> expected
diff --git a/stdlib/source/test/lux/time/date.lux b/stdlib/source/test/lux/time/date.lux
index 0aa6674b6..8e77300da 100644
--- a/stdlib/source/test/lux/time/date.lux
+++ b/stdlib/source/test/lux/time/date.lux
@@ -60,14 +60,14 @@
false)))
(do random.monad
[expected random.date]
- (_.cover [/.to_days /.of_days]
+ (_.cover [/.days /.of_days]
(|> expected
- /.to_days
+ /.days
/.of_days
(\ /.equivalence = expected))))
(_.cover [/.epoch]
(|> /.epoch
- /.to_days
+ /.days
(i.= +0)))
(do random.monad
[expected random.date]
@@ -83,7 +83,7 @@
random.nat)
day (\ ! map (|>> (n.% 10) (n.+ 10))
random.nat)
- #let [input (format (%.nat year)
+ .let [input (format (%.nat year)
"-" (%.nat month)
"-" (%.nat day))]]
(_.cover [/.invalid_month]
diff --git a/stdlib/source/test/lux/time/day.lux b/stdlib/source/test/lux/time/day.lux
index 000b5d6e7..e65759f92 100644
--- a/stdlib/source/test/lux/time/day.lux
+++ b/stdlib/source/test/lux/time/day.lux
@@ -4,16 +4,24 @@
["_" test (#+ Test)]
[abstract
[monad (#+ do)]
+ ["." predicate]
[\\specification
["$." equivalence]
+ ["$." hash]
["$." order]
["$." enum]
["$." codec]]]
[control
- ["." try]
+ ["." try ("#\." functor)]
["." exception]]
+ [data
+ [collection
+ ["." list]
+ ["." set]]]
[math
- ["." random (#+ Random) ("#\." monad)]]]]
+ ["." random (#+ Random) ("#\." monad)]
+ [number
+ ["n" nat]]]]]
[\\library
["." /]])
@@ -31,23 +39,50 @@
Test
(<| (_.covering /._)
(_.for [/.Day])
- ($_ _.and
- (_.for [/.equivalence]
- ($equivalence.spec /.equivalence ..random))
- (_.for [/.order]
- ($order.spec /.order ..random))
- (_.for [/.enum]
- ($enum.spec /.enum ..random))
- (_.for [/.codec]
- ($codec.spec /.equivalence /.codec ..random))
+ (do random.monad
+ [expected ..random
+ invalid (random.only (predicate.or (n.< (/.number #/.Sunday))
+ (n.> (/.number #/.Saturday)))
+ random.nat)]
+ ($_ _.and
+ (_.for [/.equivalence]
+ ($equivalence.spec /.equivalence ..random))
+ (_.for [/.hash]
+ ($hash.spec /.hash ..random))
+ (_.for [/.order]
+ ($order.spec /.order ..random))
+ (_.for [/.enum]
+ ($enum.spec /.enum ..random))
+ (_.for [/.codec]
+ ($codec.spec /.equivalence /.codec ..random))
- (do random.monad
- [not_a_day (random.ascii/upper 1)]
- (_.cover [/.not_a_day_of_the_week]
- (case (\ /.codec decode not_a_day)
+ (do random.monad
+ [not_a_day (random.ascii/upper 1)]
+ (_.cover [/.not_a_day_of_the_week]
+ (case (\ /.codec decode not_a_day)
+ (#try.Failure error)
+ (exception.match? /.not_a_day_of_the_week error)
+
+ (#try.Success _)
+ false)))
+ (_.cover [/.number /.by_number]
+ (|> expected
+ /.number
+ /.by_number
+ (try\map (\ /.equivalence = expected))
+ (try.else false)))
+ (_.cover [/.invalid_day]
+ (case (/.by_number invalid)
(#try.Failure error)
- (exception.match? /.not_a_day_of_the_week error)
+ (exception.match? /.invalid_day error)
(#try.Success _)
- false)))
- )))
+ false))
+ (_.cover [/.week]
+ (let [all (list.size /.week)
+ uniques (set.size (set.of_list /.hash /.week))]
+ (and (n.= (/.number #/.Saturday)
+ all)
+ (n.= all
+ uniques))))
+ ))))
diff --git a/stdlib/source/test/lux/time/duration.lux b/stdlib/source/test/lux/time/duration.lux
index 5f1f3a74b..1493cfd21 100644
--- a/stdlib/source/test/lux/time/duration.lux
+++ b/stdlib/source/test/lux/time/duration.lux
@@ -38,10 +38,10 @@
(do random.monad
[duration random.duration]
- (_.cover [/.of_millis /.to_millis]
- (|> duration /.to_millis /.of_millis (\ /.equivalence = duration))))
+ (_.cover [/.of_millis /.millis]
+ (|> duration /.millis /.of_millis (\ /.equivalence = duration))))
(do random.monad
- [#let [(^open "\.") /.equivalence]
+ [.let [(^open "\.") /.equivalence]
expected random.duration
parameter random.duration]
($_ _.and
@@ -59,12 +59,12 @@
(/.neutral? (/.inverse expected)))))
))
(do random.monad
- [#let [(^open "\.") /.equivalence]
+ [.let [(^open "\.") /.equivalence]
factor random.nat]
(_.cover [/.up /.down]
(|> /.milli_second (/.up factor) (/.down factor) (\= /.milli_second))))
(do {! random.monad}
- [#let [(^open "\.") /.order
+ [.let [(^open "\.") /.order
positive (|> random.duration
(random.only (|>> (\= /.empty) not))
(\ ! map (function (_ duration)
diff --git a/stdlib/source/test/lux/time/instant.lux b/stdlib/source/test/lux/time/instant.lux
index c36097fe1..f737f7827 100644
--- a/stdlib/source/test/lux/time/instant.lux
+++ b/stdlib/source/test/lux/time/instant.lux
@@ -39,11 +39,11 @@
($codec.spec /.equivalence /.codec random.instant))
(do random.monad
- [#let [(^open "\.") /.equivalence]
+ [.let [(^open "\.") /.equivalence]
expected random.instant]
($_ _.and
- (_.cover [/.to_millis /.of_millis]
- (|> expected /.to_millis /.of_millis (\= expected)))
+ (_.cover [/.millis /.of_millis]
+ (|> expected /.millis /.of_millis (\= expected)))
(_.cover [/.relative /.absolute]
(|> expected /.relative /.absolute (\= expected)))
(_.cover [/.date /.time /.of_date_time]
@@ -52,22 +52,22 @@
(/.time expected))))
))
(do random.monad
- [#let [(^open "\.") /.equivalence
+ [.let [(^open "\.") /.equivalence
(^open "duration\.") duration.equivalence]
from random.instant
to random.instant]
($_ _.and
(_.cover [/.span]
(|> from (/.span from) (duration\= duration.empty)))
- (_.cover [/.shift]
- (|> from (/.shift (/.span from to)) (\= to)))
+ (_.cover [/.after]
+ (|> from (/.after (/.span from to)) (\= to)))
(_.cover [/.epoch]
(duration\= (/.relative to)
(/.span /.epoch to)))
))
(do random.monad
[instant random.instant
- #let [d0 (/.day_of_week instant)]]
+ .let [d0 (/.day_of_week instant)]]
(_.cover [/.day_of_week]
(let [apply (: (-> (-> Duration Duration) (-> Day Day) Nat Bit)
(function (_ polarity move steps)
@@ -75,7 +75,7 @@
d0
(list.repeat steps []))
instant_shift (|> instant
- (/.shift (polarity (duration.up steps duration.day)))
+ (/.after (polarity (duration.up steps duration.day)))
/.day_of_week)]
(day\= day_shift
instant_shift))))]
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/case.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/case.lux
index 425872c1a..752465bd0 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/case.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/case.lux
@@ -1,6 +1,7 @@
(.module:
[lux #*
- [abstract ["." monad (#+ do)]]
+ [abstract
+ ["." monad (#+ do)]]
[data
["%" text/format (#+ format)]
["." name]]
@@ -93,7 +94,7 @@
[_ (#.Record kvs)]
(do {! r.monad}
- [#let [ks (list\map product.left kvs)
+ [.let [ks (list\map product.left kvs)
vs (list\map product.right kvs)]
member_wise_patterns (monad.map ! (exhaustive_branches allow_literals? variantTC) vs)]
(in (|> member_wise_patterns
@@ -123,7 +124,7 @@
(r\map product.right _primitive.primitive)
(do {! r.monad}
[choice (|> r.nat (\ ! map (n.% (list.size variant_tags))))
- #let [choiceT (maybe.assume (list.item choice variant_tags))
+ .let [choiceT (maybe.assume (list.item choice variant_tags))
choiceC (maybe.assume (list.item choice primitivesC))]]
(in (` ((~ choiceT) (~ choiceC)))))
(do {! r.monad}
@@ -144,10 +145,10 @@
variant_name (r.unicode 5)
record_name (|> (r.unicode 5) (r.only (|>> (text\= variant_name) not)))
size (|> r.nat (\ ! map (|>> (n.% 10) (n.max 2))))
- variant_tags (|> (r.set text.hash size (r.unicode 5)) (\ ! map set.to_list))
- record_tags (|> (r.set text.hash size (r.unicode 5)) (\ ! map set.to_list))
+ variant_tags (|> (r.set text.hash size (r.unicode 5)) (\ ! map set.list))
+ record_tags (|> (r.set text.hash size (r.unicode 5)) (\ ! map set.list))
primitivesTC (r.list size _primitive.primitive)
- #let [primitivesT (list\map product.left primitivesTC)
+ .let [primitivesT (list\map product.left primitivesTC)
primitivesC (list\map product.right primitivesTC)
code_tag (|>> [module_name] code.tag)
variant_tags+ (list\map code_tag variant_tags)
@@ -156,7 +157,7 @@
inputC (input variant_tags+ record_tags+ primitivesC)
[outputT outputC] (r.only (|>> product.left (is? Any) not)
_primitive.primitive)
- #let [analyse_pm (function (_ branches)
+ .let [analyse_pm (function (_ branches)
(|> (/.case _primitive.phase branches archive.empty inputC)
(//type.with_type outputT)
////analysis.with_scope
@@ -169,7 +170,7 @@
(type.tuple primitivesT)))])
(//module.with_module 0 module_name)))]
exhaustive_patterns (exhaustive_branches true variantTC inputC)
- #let [exhaustive_branchesC (list\map (branch outputC)
+ .let [exhaustive_branchesC (list\map (branch outputC)
exhaustive_patterns)]]
($_ _.and
(_.test "Will reject empty pattern-matching (no branches)."
@@ -186,7 +187,7 @@
(do !
[redundant_patterns (exhaustive_branches false variantTC inputC)
redundancy_idx (|> r.nat (\ ! map (n.% (list.size redundant_patterns))))
- #let [redundant_branchesC (<| (list!map (branch outputC))
+ .let [redundant_branchesC (<| (list!map (branch outputC))
list.concat
(list (list.take redundancy_idx redundant_patterns)
(list (maybe.assume (list.item redundancy_idx redundant_patterns)))
@@ -198,7 +199,7 @@
[[heterogeneousT heterogeneousC] (r.only (|>> product.left (check.checks? outputT) not)
_primitive.primitive)
heterogeneous_idx (|> r.nat (\ ! map (n.% (list.size exhaustive_patterns))))
- #let [heterogeneous_branchesC (list.concat (list (list.take heterogeneous_idx exhaustive_branchesC)
+ .let [heterogeneous_branchesC (list.concat (list (list.take heterogeneous_idx exhaustive_branchesC)
(list (let [[_pattern _body] (maybe.assume (list.item heterogeneous_idx exhaustive_branchesC))]
[_pattern heterogeneousC]))
(list.drop (inc heterogeneous_idx) exhaustive_branchesC)))]]
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux
index c59de0da6..08bfc6e99 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/function.lux
@@ -56,7 +56,7 @@
arg_name (|> (r.unicode 5) (r.only (|>> (text\= func_name) not)))
[outputT outputC] _primitive.primitive
[inputT _] _primitive.primitive
- #let [g!arg (code.local_identifier arg_name)]]
+ .let [g!arg (code.local_identifier arg_name)]]
(<| (_.context (%.name (name_of /.function)))
($_ _.and
(_.test "Can analyse function."
@@ -85,10 +85,10 @@
partial_args (|> r.nat (\ ! map (n.% full_args)))
var_idx (|> r.nat (\ ! map (|>> (n.% full_args) (n.max 1))))
inputsTC (r.list full_args _primitive.primitive)
- #let [inputsT (list\map product.left inputsTC)
+ .let [inputsT (list\map product.left inputsTC)
inputsC (list\map product.right inputsTC)]
[outputT outputC] _primitive.primitive
- #let [funcT (type.function inputsT outputT)
+ .let [funcT (type.function inputsT outputT)
partialT (type.function (list.drop partial_args inputsT) outputT)
varT (#.Parameter 1)
polyT (<| (type.univ_q 1)
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/structure.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/structure.lux
index c4a1a50b9..11ca2b276 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/structure.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/analysis/structure.lux
@@ -123,7 +123,7 @@
primitives (r.list size _primitive.primitive)
+choice (|> r.nat (\ ! map (n.% (inc size))))
[_ +valueC] _primitive.primitive
- #let [variantT (type.variant (list\map product.left primitives))
+ .let [variantT (type.variant (list\map product.left primitives))
[valueT valueC] (maybe.assume (list.item choice primitives))
+size (inc size)
+primitives (list.concat (list (list.take choice primitives)
@@ -174,7 +174,7 @@
primitives (r.list size _primitive.primitive)
choice (|> r.nat (\ ! map (n.% size)))
[_ +valueC] _primitive.primitive
- #let [tupleT (type.tuple (list\map product.left primitives))
+ .let [tupleT (type.tuple (list\map product.left primitives))
[singletonT singletonC] (|> primitives (list.item choice) maybe.assume)
+primitives (list.concat (list (list.take choice primitives)
(list [(#.Parameter 1) +valueC])
@@ -231,13 +231,13 @@
(def: variant
(do {! r.monad}
[size (|> r.nat (\ ! map (|>> (n.% 10) (n.max 2))))
- tags (|> (r.set text.hash size (r.unicode 5)) (\ ! map set.to_list))
+ tags (|> (r.set text.hash size (r.unicode 5)) (\ ! map set.list))
choice (|> r.nat (\ ! map (n.% size)))
other_choice (|> r.nat (\ ! map (n.% size)) (r.only (|>> (n.= choice) not)))
primitives (r.list size _primitive.primitive)
module_name (r.unicode 5)
type_name (r.unicode 5)
- #let [with_name (|>> (#.Named [module_name type_name]))
+ .let [with_name (|>> (#.Named [module_name type_name]))
varT (#.Parameter 1)
primitivesT (list\map product.left primitives)
[choiceT choiceC] (maybe.assume (list.item choice primitives))
@@ -277,12 +277,12 @@
(def: record
(do {! r.monad}
[size (|> r.nat (\ ! map (|>> (n.% 10) (n.max 2))))
- tags (|> (r.set text.hash size (r.unicode 5)) (\ ! map set.to_list))
+ tags (|> (r.set text.hash size (r.unicode 5)) (\ ! map set.list))
primitives (r.list size _primitive.primitive)
module_name (r.unicode 5)
type_name (r.unicode 5)
choice (|> r.nat (\ ! map (n.% size)))
- #let [varT (#.Parameter 1)
+ .let [varT (#.Parameter 1)
tagsC (list\map (|>> [module_name] code.tag) tags)
primitivesT (list\map product.left primitives)
primitivesC (list\map product.right primitives)
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 d9dab4854..59cad9258 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
@@ -44,7 +44,7 @@
(do {! random.monad}
[maskedA //primitive.primitive
temp (|> random.nat (\ ! map (n.% 100)))
- #let [maskA (analysis.control/case
+ .let [maskA (analysis.control/case
[maskedA
[[(#analysis.Bind temp)
(#analysis.Reference (////reference.local temp))]
@@ -62,7 +62,7 @@
[registerA random.nat
inputA //primitive.primitive
outputA //primitive.primitive
- #let [letA (analysis.control/case
+ .let [letA (analysis.control/case
[inputA
[[(#analysis.Bind registerA)
outputA]
@@ -86,7 +86,7 @@
inputA //primitive.primitive
thenA //primitive.primitive
elseA //primitive.primitive
- #let [thenB (: Branch
+ .let [thenB (: Branch
[(#analysis.Simple (#analysis.Bit true))
thenA])
elseB (: Branch
@@ -151,7 +151,7 @@
(\ ! map (|>> analysis.tuple)))
pathA ..random_path
[pattern @member] (get_pattern pathA)
- #let [getA (analysis.control/case [recordA [[pattern
+ .let [getA (analysis.control/case [recordA [[pattern
(#analysis.Reference (////reference.local @member))]
(list)]])]]
(_.cover [/.synthesize_get]
@@ -184,7 +184,7 @@
(All [a] (-> (Hash a) (Random a) (Random [a a a a a])))
(|> random_element
(random.set hash 5)
- (\ random.monad map (|>> set.to_list
+ (\ random.monad map (|>> set.list
(case> (^ (list s0 s1 s2 s3 s4))
[s0 s1 s2 s3 s4]
@@ -233,7 +233,7 @@
[value/0 value/1 value/2 value/3 value/4] (random_five text.hash (random.unicode 1))
last_is_right? random.bit
[body/0 body/1 body/2 body/3 body/4] (random_five frac.hash random.frac)
- #let [path (: (-> Nat Bit Text Frac Path)
+ .let [path (: (-> Nat Bit Text Frac Path)
(function (_ lefts right? value body)
($_ #synthesis.Seq
(synthesis.path/side (if right?
@@ -271,7 +271,7 @@
body/first random.frac
body/mid (random.list mid_size random.frac)
body/last random.frac
- #let [path (: (-> Nat Bit Text Frac Path)
+ .let [path (: (-> Nat Bit Text Frac Path)
(function (_ lefts right? value body)
(if right?
($_ #synthesis.Seq
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 dce97193e..60a009be1 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
@@ -179,7 +179,7 @@
[loop?_output expected_output actual_output] (random_value output?)
lefts (|> random.nat (\ ! map (n.% 10)))
right? random.bit
- #let [side|member (if right?
+ .let [side|member (if right?
(#.Right lefts)
(#.Left lefts))]]
(in [(and loop?_input
@@ -344,7 +344,7 @@
(do {! random.monad}
[[loop?_output expected_output actual_output] (..random_nat output?)
arity (|> random.nat (\ ! map (|>> (n.% 5) inc)))
- #let [environment ($_ list\compose
+ .let [environment ($_ list\compose
(list\map (|>> #variable.Foreign)
(list.indices arity))
(list (#variable.Local 1)))]]
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux
index 36d59cfd9..a45c8af9e 100644
--- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/structure.lux
@@ -37,7 +37,7 @@
(do {! r.monad}
[size (|> r.nat (\ ! map (|>> (n.% 10) (n.+ 2))))
tagA (|> r.nat (\ ! map (n.% size)))
- #let [right? (n.= (dec size) tagA)
+ .let [right? (n.= (dec size) tagA)
lefts (if right?
(dec tagA)
tagA)]
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 9c34b539f..04fb82336 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
@@ -70,7 +70,7 @@
(do !
[let? random.bit
[expected_input actual_input] (..primitive_scenario context)
- #let [fake_register (n.+ (get@ #redundants context)
+ .let [fake_register (n.+ (get@ #redundants context)
(dictionary.size (get@ #necessary context)))]
[expected_output actual_output] (scenario (update@ #redundants inc context))]
(in [(synthesis.branch/case [expected_input
@@ -110,7 +110,7 @@
(do random.monad
[_ (in [])
[expected_input actual_input] (scenario context)
- #let [real_register (dictionary.size (get@ #necessary context))
+ .let [real_register (dictionary.size (get@ #necessary context))
fake_register (n.+ (get@ #redundants context)
(dictionary.size (get@ #necessary context)))]
[expected_output actual_output] (scenario (update@ #necessary (dictionary.put real_register fake_register) context))]
@@ -166,7 +166,7 @@
(#synthesis.Then actual_then))]))
(do {! random.monad}
[_ (in [])
- #let [real_register (dictionary.size (get@ #necessary context))
+ .let [real_register (dictionary.size (get@ #necessary context))
fake_register (n.+ (get@ #redundants context)
(dictionary.size (get@ #necessary context)))]
[expected_then actual_then] (scenario (update@ #necessary (dictionary.put real_register fake_register) context))]
@@ -238,7 +238,7 @@
(-> (Scenario Synthesis) (Scenario Synthesis))
(do {! random.monad}
[_ (in [])
- #let [real_start (dictionary.size (get@ #necessary context))
+ .let [real_start (dictionary.size (get@ #necessary context))
fake_start (n.+ (get@ #redundants context)
real_start)]
inits (random.list ..scope_arity (scenario context))
@@ -273,7 +273,7 @@
(-> (Scenario Synthesis) (Scenario Synthesis))
(do {! random.monad}
[_ (in [])
- #let [registers (dictionary.entries (get@ #necessary context))
+ .let [registers (dictionary.entries (get@ #necessary context))
expected_environment (list\map (|>> product.left #variable.Local) registers)
actual_environment (list\map (|>> product.right #variable.Local) registers)]
[expected_body actual_body] (..primitive_scenario context)]
diff --git a/stdlib/source/test/lux/type.lux b/stdlib/source/test/lux/type.lux
index 45d263509..f248a2adb 100644
--- a/stdlib/source/test/lux/type.lux
+++ b/stdlib/source/test/lux/type.lux
@@ -75,7 +75,7 @@
..random)
name/0 ..name
name/1 ..name
- #let [namedT (#.Named name/0 anonymousT)
+ .let [namedT (#.Named name/0 anonymousT)
aliasedT (#.Named name/1 namedT)]]
($_ _.and
(_.cover [/.de_aliased]
@@ -94,7 +94,7 @@
#1)))
(list.repeat size)
(monad.seq !))
- #let [(^open "/\.") /.equivalence
+ .let [(^open "/\.") /.equivalence
(^open "list\.") (list.equivalence /.equivalence)]]
(`` ($_ _.and
(~~ (template [<ctor> <dtor> <unit>]
@@ -127,7 +127,7 @@
_
#1))))
- #let [(^open "/\.") /.equivalence
+ .let [(^open "/\.") /.equivalence
(^open "list\.") (list.equivalence /.equivalence)]]
($_ _.and
(_.cover [/.function /.flat_function]
@@ -148,7 +148,7 @@
_
#1))))
- #let [(^open "/\.") /.equivalence]]
+ .let [(^open "/\.") /.equivalence]]
(`` ($_ _.and
(~~ (template [<ctor> <dtor>]
[(_.cover [<ctor> <dtor>]
@@ -174,7 +174,7 @@
_
#1))))
- #let [(^open "/\.") /.equivalence]]
+ .let [(^open "/\.") /.equivalence]]
($_ _.and
(_.cover [/.array /.flat_array]
(let [[flat_depth flat_element] (|> element_type (/.array depth) /.flat_array)]
@@ -202,7 +202,7 @@
(do random.monad
[left random.nat
right (random.ascii/lower 1)
- #let [left,right [left right]]]
+ .let [left,right [left right]]]
(_.cover [/.:cast]
(|> left,right
(/.:cast [l r] (And l r) (Or l r))
diff --git a/stdlib/source/test/lux/type/check.lux b/stdlib/source/test/lux/type/check.lux
index 6172608b3..84426d1f7 100644
--- a/stdlib/source/test/lux/type/check.lux
+++ b/stdlib/source/test/lux/type/check.lux
@@ -220,7 +220,7 @@
(exception.match? /.unknown_type_var error))))
(do random.monad
[nominal (random.ascii/upper 10)
- #let [expected (#.Primitive nominal (list))]]
+ .let [expected (#.Primitive nominal (list))]]
(_.cover [/.read]
(and (|> (do /.monad
[[var_id var_type] /.var]
@@ -248,7 +248,7 @@
false)))))
(do random.monad
[nominal (random.ascii/upper 10)
- #let [expected (#.Primitive nominal (list))]]
+ .let [expected (#.Primitive nominal (list))]]
(_.cover [/.read!]
(case (/.run /.fresh_context
(do /.monad
@@ -262,7 +262,7 @@
false)))
(do random.monad
[nominal (random.ascii/upper 10)
- #let [expected (#.Primitive nominal (list))]]
+ .let [expected (#.Primitive nominal (list))]]
(_.cover [/.unbound_type_var]
(case (/.run /.fresh_context
(do /.monad
@@ -451,7 +451,7 @@
[var/head/1 var/tail+/1 var/last/1] (..build_ring tail_size)
_ (/.check var/head/0 var/head/1)
_ (/.check var/head/0 nominal/0)
- #let [all_variables (list\compose (list& var/head/0 var/tail+/0)
+ .let [all_variables (list\compose (list& var/head/0 var/tail+/0)
(list& var/head/1 var/tail+/1))]
failures (monad.map ! (|>> (/.check nominal/1) ..verdict) all_variables)
successes (monad.map ! (|>> (/.check nominal/0) ..verdict) all_variables)]
diff --git a/stdlib/source/test/lux/type/implicit.lux b/stdlib/source/test/lux/type/implicit.lux
index bf6db29e6..6795b8aec 100644
--- a/stdlib/source/test/lux/type/implicit.lux
+++ b/stdlib/source/test/lux/type/implicit.lux
@@ -25,10 +25,10 @@
Test
(<| (_.covering /._)
(do {! random.monad}
- [#let [digit (\ ! map (n.% 10) random.nat)]
+ [.let [digit (\ ! map (n.% 10) random.nat)]
left digit
right digit
- #let [start (n.min left right)
+ .let [start (n.min left right)
end (n.max left right)]
left random.nat
diff --git a/stdlib/source/test/lux/type/quotient.lux b/stdlib/source/test/lux/type/quotient.lux
index 9a800b92d..b59879ef2 100644
--- a/stdlib/source/test/lux/type/quotient.lux
+++ b/stdlib/source/test/lux/type/quotient.lux
@@ -31,7 +31,7 @@
(<| (_.covering /._)
(do random.monad
[modulus (random.only (n.> 0) random.nat)
- #let [class (: (-> Nat Text)
+ .let [class (: (-> Nat Text)
(|>> (n.% modulus) %.nat))]
value random.nat]
($_ _.and
diff --git a/stdlib/source/test/lux/type/refinement.lux b/stdlib/source/test/lux/type/refinement.lux
index 80294a765..1dd71a4c6 100644
--- a/stdlib/source/test/lux/type/refinement.lux
+++ b/stdlib/source/test/lux/type/refinement.lux
@@ -29,7 +29,7 @@
(do {! random.monad}
[raw random.nat
modulus (\ ! map (|>> (n.% 10) (n.+ 2)) random.nat)
- #let [predicate (: (Predicate Nat)
+ .let [predicate (: (Predicate Nat)
(|>> (n.% modulus) (n.= 0)))]
total_raws (\ ! map (|>> (n.% 20) inc) random.nat)
raws (random.list total_raws random.nat)]
diff --git a/stdlib/source/test/lux/type/resource.lux b/stdlib/source/test/lux/type/resource.lux
index 4bfb49503..791c31e1f 100644
--- a/stdlib/source/test/lux/type/resource.lux
+++ b/stdlib/source/test/lux/type/resource.lux
@@ -31,7 +31,7 @@
(monad.do {! random.monad}
[pre (\ ! map %.nat random.nat)
post (\ ! map %.nat random.nat)
- #let [! identity.monad]]
+ .let [! identity.monad]]
(_.for [/.Linear /.run /.monad]
(`` ($_ _.and
(~~ (template [<coverage> <bindings>]
@@ -73,7 +73,7 @@
(monad.do {! random.monad}
[pre (\ ! map %.nat random.nat)
post (\ ! map %.nat random.nat)
- #let [! io.monad]]
+ .let [! io.monad]]
(_.for [/.Linear /.run /.monad]
(`` ($_ _.and
(~~ (template [<coverage> <bindings>]
@@ -116,7 +116,7 @@
(monad.do {! random.monad}
[pre (\ ! map %.nat random.nat)
post (\ ! map %.nat random.nat)
- #let [! async.monad]]
+ .let [! async.monad]]
(_.for [/.Linear /.run /.monad]
(`` ($_ _.and
(~~ (template [<coverage> <bindings>]
diff --git a/stdlib/source/test/lux/type/unit.lux b/stdlib/source/test/lux/type/unit.lux
index 9557d522d..32e2922a6 100644
--- a/stdlib/source/test/lux/type/unit.lux
+++ b/stdlib/source/test/lux/type/unit.lux
@@ -101,7 +101,7 @@
(\ ! map (i.% +1,000))
(\ ! map (i.* +1,000,000,000))
(\ ! map (\ /.meter in)))
- #let [(^open "meter\.") (: (Equivalence (/.Qty /.Meter))
+ .let [(^open "meter\.") (: (Equivalence (/.Qty /.Meter))
/.equivalence)]
unscaled (|> random.int
(\ ! map (i.% +1,000))
@@ -135,11 +135,11 @@
[/.Micro /.micro]
[/.Nano /.nano]
))
- (_.cover [/.re_scale]
+ (_.cover [/.re_scaled]
(|> large (: (/.Qty /.Meter))
(\ /.kilo scale) (: (/.Qty (/.Kilo /.Meter)))
- (/.re_scale /.kilo /.milli) (: (/.Qty (/.Milli /.Meter)))
- (/.re_scale /.milli /.kilo) (: (/.Qty (/.Kilo /.Meter)))
+ (/.re_scaled /.kilo /.milli) (: (/.Qty (/.Milli /.Meter)))
+ (/.re_scaled /.milli /.kilo) (: (/.Qty (/.Kilo /.Meter)))
(\ /.kilo de_scale) (: (/.Qty /.Meter))
(meter\= large)))
(_.cover [/.scale:]
@@ -155,7 +155,7 @@
(def: arithmetic
Test
(do random.monad
- [#let [zero (\ /.meter in +0)
+ [.let [zero (\ /.meter in +0)
(^open "meter\.") (: (Equivalence (/.Qty /.Meter))
/.equivalence)]
left (random.only (|>> (meter\= zero) not) (..meter 1,000))
diff --git a/stdlib/source/test/lux/world/console.lux b/stdlib/source/test/lux/world/console.lux
index 003c20c34..c51cce645 100644
--- a/stdlib/source/test/lux/world/console.lux
+++ b/stdlib/source/test/lux/world/console.lux
@@ -56,7 +56,7 @@
($/.spec (io.io (/.async (/.mock ..mock [false ""])))))
(do random.monad
[expected (random.ascii/alpha 10)
- #let [console (/.mock ..mock [false ""])]]
+ .let [console (/.mock ..mock [false ""])]]
(_.cover [/.write_line]
(io.run
(do io.monad
diff --git a/stdlib/source/test/lux/world/file/watch.lux b/stdlib/source/test/lux/world/file/watch.lux
index 88af80fdf..c5b89533b 100644
--- a/stdlib/source/test/lux/world/file/watch.lux
+++ b/stdlib/source/test/lux/world/file/watch.lux
@@ -53,7 +53,7 @@
[left ..concern
right (random.only (|>> (is? left) not)
..concern)
- #let [[left left?] left
+ .let [[left left?] left
[right right?] right]]
(_.cover [/.also]
(let [composition (/.also left right)]
@@ -69,7 +69,7 @@
Test
(do {! random.monad}
[directory (random.ascii/alpha 5)
- #let [[fs watcher] (/.mock "/")]]
+ .let [[fs watcher] (/.mock "/")]]
($_ _.and
(in (do async.monad
[?concern (\ watcher concern directory)
@@ -159,7 +159,7 @@
(do {! random.monad}
[directory (random.ascii/alpha 5)
- #let [/ "/"
+ .let [/ "/"
[fs watcher] (/.mock /)]
expected_path (\ ! map (|>> (format directory /))
(random.ascii/alpha 5))
@@ -185,7 +185,7 @@
(try.else false verdict)))))
(do random.monad
[directory (random.ascii/alpha 5)
- #let [/ "/"
+ .let [/ "/"
[fs watcher] (/.mock /)]]
(in (do async.monad
[started? ( \ watcher start /.all directory)]
diff --git a/stdlib/source/test/lux/world/input/keyboard.lux b/stdlib/source/test/lux/world/input/keyboard.lux
index e0064f29b..bfcc0db6c 100644
--- a/stdlib/source/test/lux/world/input/keyboard.lux
+++ b/stdlib/source/test/lux/world/input/keyboard.lux
@@ -157,7 +157,7 @@
(~~ (template [<pressed?> <function>]
[(do random.monad
[key ..random
- #let [sample (<function> key)]]
+ .let [sample (<function> key)]]
(_.cover [<function>]
(and (bit\= <pressed?> (get@ #/.pressed? sample))
(n.= key (get@ #/.input sample)))))]
diff --git a/stdlib/source/test/lux/world/net/http/client.lux b/stdlib/source/test/lux/world/net/http/client.lux
index 8a74d3e21..bdfad7989 100644
--- a/stdlib/source/test/lux/world/net/http/client.lux
+++ b/stdlib/source/test/lux/world/net/http/client.lux
@@ -43,7 +43,7 @@
on_trace random.nat
num_headers (\ ! map (nat.% 10) random.nat)
headers (random.dictionary text.hash num_headers (random.ascii/lower 3) (random.ascii/lower 3))
- #let [mock (: (/.Client IO)
+ .let [mock (: (/.Client IO)
(implementation
(def: (request method url headers data)
(io.io (let [value (case method
diff --git a/stdlib/source/test/lux/world/shell.lux b/stdlib/source/test/lux/world/shell.lux
index ecea6d8b9..0d67c79a0 100644
--- a/stdlib/source/test/lux/world/shell.lux
+++ b/stdlib/source/test/lux/world/shell.lux
@@ -38,8 +38,8 @@
(if dead?
(exception.except ..dead [])
(do try.monad
- [to_echo (try.of_maybe (list.head arguments))]
- (in [dead? to_echo]))))
+ [echo (try.of_maybe (list.head arguments))]
+ (in [dead? echo]))))
(def: (on_error dead?)
(if dead?
@@ -95,7 +95,7 @@
input (random.ascii/alpha 5)
destruction (random.ascii/alpha 5)
exit random.int
- #let [shell (/.async (..io_shell command oops input destruction exit))]]
+ .let [shell (/.async (..io_shell command oops input destruction exit))]]
(in (do {! async.monad}
[verdict (do (try.with !)
[process (\ shell execute [environment.empty "~" command (list)])