From 061fd8a209bbcaffc2bfb850ac6046752a567d50 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 27 Jul 2021 03:51:10 -0400 Subject: Re-named wrap => in && unwrap => out. --- stdlib/source/library/lux.lux | 466 +++++++------- stdlib/source/library/lux/abstract/apply.lux | 4 +- stdlib/source/library/lux/abstract/comonad.lux | 6 +- .../source/library/lux/abstract/comonad/cofree.lux | 2 +- stdlib/source/library/lux/abstract/monad.lux | 16 +- stdlib/source/library/lux/abstract/monad/free.lux | 2 +- .../source/library/lux/abstract/monad/indexed.lux | 24 +- stdlib/source/library/lux/abstract/predicate.lux | 14 +- .../source/library/lux/control/concatenative.lux | 36 +- .../library/lux/control/concurrency/actor.lux | 78 +-- .../library/lux/control/concurrency/async.lux | 8 +- .../library/lux/control/concurrency/atom.lux | 2 +- .../source/library/lux/control/concurrency/frp.lux | 46 +- .../library/lux/control/concurrency/semaphore.lux | 12 +- .../source/library/lux/control/concurrency/stm.lux | 22 +- .../library/lux/control/concurrency/thread.lux | 6 +- stdlib/source/library/lux/control/continuation.lux | 6 +- stdlib/source/library/lux/control/exception.lux | 33 +- .../library/lux/control/function/contract.lux | 18 +- .../source/library/lux/control/function/memo.lux | 4 +- .../source/library/lux/control/function/mixin.lux | 2 +- .../source/library/lux/control/function/mutual.lux | 82 +-- stdlib/source/library/lux/control/io.lux | 9 +- stdlib/source/library/lux/control/parser.lux | 14 +- .../source/library/lux/control/parser/analysis.lux | 12 +- .../source/library/lux/control/parser/binary.lux | 16 +- stdlib/source/library/lux/control/parser/cli.lux | 8 +- stdlib/source/library/lux/control/parser/code.lux | 35 +- .../library/lux/control/parser/environment.lux | 12 +- stdlib/source/library/lux/control/parser/json.lux | 37 +- .../library/lux/control/parser/synthesis.lux | 82 +-- stdlib/source/library/lux/control/parser/text.lux | 152 ++--- stdlib/source/library/lux/control/parser/tree.lux | 41 +- stdlib/source/library/lux/control/parser/type.lux | 73 ++- stdlib/source/library/lux/control/parser/xml.lux | 35 +- stdlib/source/library/lux/control/pipe.lux | 69 +-- stdlib/source/library/lux/control/reader.lux | 6 +- stdlib/source/library/lux/control/region.lux | 28 +- stdlib/source/library/lux/control/remember.lux | 26 +- .../library/lux/control/security/capability.lux | 30 +- .../source/library/lux/control/security/policy.lux | 68 ++- stdlib/source/library/lux/control/state.lux | 12 +- stdlib/source/library/lux/control/thread.lux | 4 +- stdlib/source/library/lux/control/try.lux | 8 +- stdlib/source/library/lux/control/writer.lux | 8 +- stdlib/source/library/lux/data/binary.lux | 22 +- .../library/lux/data/collection/dictionary.lux | 2 +- .../lux/data/collection/dictionary/ordered.lux | 68 +-- stdlib/source/library/lux/data/collection/list.lux | 8 +- stdlib/source/library/lux/data/collection/row.lux | 24 +- .../library/lux/data/collection/sequence.lux | 4 +- stdlib/source/library/lux/data/collection/tree.lux | 6 +- .../library/lux/data/collection/tree/zipper.lux | 42 +- stdlib/source/library/lux/data/format/binary.lux | 2 +- stdlib/source/library/lux/data/format/css.lux | 47 +- .../library/lux/data/format/css/property.lux | 2 +- .../source/library/lux/data/format/css/query.lux | 26 +- .../source/library/lux/data/format/css/value.lux | 2 +- stdlib/source/library/lux/data/format/json.lux | 53 +- stdlib/source/library/lux/data/format/tar.lux | 80 +-- stdlib/source/library/lux/data/format/xml.lux | 24 +- stdlib/source/library/lux/data/identity.lux | 4 +- stdlib/source/library/lux/data/lazy.lux | 4 +- stdlib/source/library/lux/data/maybe.lux | 8 +- stdlib/source/library/lux/data/store.lux | 2 +- stdlib/source/library/lux/data/text.lux | 4 +- stdlib/source/library/lux/data/text/escape.lux | 10 +- stdlib/source/library/lux/data/text/format.lux | 2 +- stdlib/source/library/lux/data/text/regex.lux | 154 ++--- stdlib/source/library/lux/data/trace.lux | 2 +- stdlib/source/library/lux/debug.lux | 126 ++-- stdlib/source/library/lux/extension.lux | 22 +- stdlib/source/library/lux/ffi.js.lux | 156 ++--- stdlib/source/library/lux/ffi.jvm.lux | 414 ++++++------- stdlib/source/library/lux/ffi.lua.lux | 120 ++-- stdlib/source/library/lux/ffi.old.lux | 314 +++++----- stdlib/source/library/lux/ffi.php.lux | 120 ++-- stdlib/source/library/lux/ffi.py.lux | 130 ++-- stdlib/source/library/lux/ffi.rb.lux | 126 ++-- stdlib/source/library/lux/ffi.scm.lux | 24 +- stdlib/source/library/lux/macro.lux | 62 +- stdlib/source/library/lux/macro/local.lux | 20 +- stdlib/source/library/lux/macro/poly.lux | 36 +- stdlib/source/library/lux/macro/syntax.lux | 40 +- .../library/lux/macro/syntax/declaration.lux | 2 +- .../source/library/lux/macro/syntax/definition.lux | 8 +- stdlib/source/library/lux/macro/syntax/export.lux | 4 +- stdlib/source/library/lux/macro/template.lux | 50 +- stdlib/source/library/lux/math/infix.lux | 25 +- stdlib/source/library/lux/math/modular.lux | 4 +- stdlib/source/library/lux/math/modulus.lux | 4 +- stdlib/source/library/lux/math/number/complex.lux | 9 +- stdlib/source/library/lux/math/number/frac.lux | 18 +- stdlib/source/library/lux/math/number/ratio.lux | 10 +- stdlib/source/library/lux/math/random.lux | 79 +-- stdlib/source/library/lux/meta.lux | 121 ++-- stdlib/source/library/lux/program.lux | 48 +- stdlib/source/library/lux/target/common_lisp.lux | 40 +- stdlib/source/library/lux/target/jvm/attribute.lux | 4 +- stdlib/source/library/lux/target/jvm/bytecode.lux | 280 ++++----- .../lux/target/jvm/bytecode/environment.lux | 16 +- .../lux/target/jvm/bytecode/environment/limit.lux | 4 +- .../lux/target/jvm/bytecode/instruction.lux | 8 +- stdlib/source/library/lux/target/jvm/class.lux | 58 +- .../library/lux/target/jvm/constant/pool.lux | 6 +- .../library/lux/target/jvm/encoding/signed.lux | 2 +- .../library/lux/target/jvm/encoding/unsigned.lux | 4 +- stdlib/source/library/lux/target/jvm/field.lux | 8 +- stdlib/source/library/lux/target/jvm/loader.lux | 4 +- stdlib/source/library/lux/target/jvm/method.lux | 14 +- stdlib/source/library/lux/target/jvm/modifier.lux | 12 +- .../source/library/lux/target/jvm/reflection.lux | 34 +- .../source/library/lux/target/jvm/type/alias.lux | 12 +- stdlib/source/library/lux/target/jvm/type/lux.lux | 28 +- .../source/library/lux/target/jvm/type/parser.lux | 4 +- stdlib/source/library/lux/target/lua.lux | 12 +- stdlib/source/library/lux/target/php.lux | 12 +- stdlib/source/library/lux/target/python.lux | 12 +- stdlib/source/library/lux/target/r.lux | 12 +- stdlib/source/library/lux/target/ruby.lux | 12 +- stdlib/source/library/lux/target/scheme.lux | 44 +- stdlib/source/library/lux/test.lux | 49 +- stdlib/source/library/lux/time.lux | 20 +- stdlib/source/library/lux/time/date.lux | 10 +- stdlib/source/library/lux/time/day.lux | 2 +- stdlib/source/library/lux/time/duration.lux | 6 +- stdlib/source/library/lux/time/instant.lux | 14 +- stdlib/source/library/lux/time/month.lux | 4 +- stdlib/source/library/lux/time/year.lux | 6 +- .../library/lux/tool/compiler/default/init.lux | 69 +-- .../library/lux/tool/compiler/default/platform.lux | 108 ++-- .../library/lux/tool/compiler/language/lux.lux | 2 +- .../lux/tool/compiler/language/lux/analysis.lux | 8 +- .../tool/compiler/language/lux/analysis/macro.lux | 2 +- .../lux/tool/compiler/language/lux/generation.lux | 32 +- .../tool/compiler/language/lux/phase/analysis.lux | 4 +- .../compiler/language/lux/phase/analysis/case.lux | 48 +- .../language/lux/phase/analysis/case/coverage.lux | 96 +-- .../language/lux/phase/analysis/function.lux | 8 +- .../language/lux/phase/analysis/inference.lux | 72 +-- .../language/lux/phase/analysis/module.lux | 28 +- .../language/lux/phase/analysis/primitive.lux | 4 +- .../language/lux/phase/analysis/reference.lux | 14 +- .../compiler/language/lux/phase/analysis/scope.lux | 6 +- .../language/lux/phase/analysis/structure.lux | 56 +- .../compiler/language/lux/phase/analysis/type.lux | 2 +- .../tool/compiler/language/lux/phase/directive.lux | 10 +- .../tool/compiler/language/lux/phase/extension.lux | 4 +- .../language/lux/phase/extension/analysis/js.lux | 32 +- .../language/lux/phase/extension/analysis/jvm.lux | 538 ++++++++--------- .../language/lux/phase/extension/analysis/lua.lux | 34 +- .../language/lux/phase/extension/analysis/lux.lux | 40 +- .../language/lux/phase/extension/analysis/php.lux | 28 +- .../lux/phase/extension/analysis/python.lux | 32 +- .../language/lux/phase/extension/analysis/ruby.lux | 26 +- .../lux/phase/extension/analysis/scheme.lux | 14 +- .../language/lux/phase/extension/directive/jvm.lux | 104 ++-- .../language/lux/phase/extension/directive/lux.lux | 38 +- .../extension/generation/common_lisp/common.lux | 6 +- .../lux/phase/extension/generation/js/common.lux | 16 +- .../lux/phase/extension/generation/js/host.lux | 24 +- .../lux/phase/extension/generation/jvm/common.lux | 160 ++--- .../lux/phase/extension/generation/jvm/host.lux | 670 ++++++++++----------- .../lux/phase/extension/generation/lua/common.lux | 20 +- .../lux/phase/extension/generation/lua/host.lux | 40 +- .../lux/phase/extension/generation/php/common.lux | 20 +- .../lux/phase/extension/generation/php/host.lux | 12 +- .../phase/extension/generation/python/common.lux | 20 +- .../lux/phase/extension/generation/python/host.lux | 22 +- .../lux/phase/extension/generation/r/common.lux | 6 +- .../lux/phase/extension/generation/ruby/common.lux | 20 +- .../lux/phase/extension/generation/ruby/host.lux | 10 +- .../phase/extension/generation/scheme/common.lux | 16 +- .../lux/phase/extension/generation/scheme/host.lux | 4 +- .../language/lux/phase/generation/common_lisp.lux | 2 +- .../lux/phase/generation/common_lisp/case.lux | 98 +-- .../lux/phase/generation/common_lisp/function.lux | 14 +- .../lux/phase/generation/common_lisp/loop.lux | 22 +- .../lux/phase/generation/common_lisp/runtime.lux | 60 +- .../lux/phase/generation/common_lisp/structure.lux | 2 +- .../language/lux/phase/generation/extension.lux | 34 +- .../compiler/language/lux/phase/generation/js.lux | 4 +- .../language/lux/phase/generation/js/case.lux | 130 ++-- .../language/lux/phase/generation/js/function.lux | 4 +- .../language/lux/phase/generation/js/loop.lux | 26 +- .../language/lux/phase/generation/js/runtime.lux | 70 +-- .../language/lux/phase/generation/js/structure.lux | 4 +- .../compiler/language/lux/phase/generation/jvm.lux | 2 +- .../language/lux/phase/generation/jvm/case.lux | 152 ++--- .../language/lux/phase/generation/jvm/debug.lux | 18 +- .../language/lux/phase/generation/jvm/function.lux | 28 +- .../jvm/function/field/variable/foreign.lux | 6 +- .../jvm/function/field/variable/partial.lux | 12 +- .../phase/generation/jvm/function/method/apply.lux | 6 +- .../jvm/function/method/implementation.lux | 2 +- .../phase/generation/jvm/function/method/new.lux | 2 +- .../phase/generation/jvm/function/method/reset.lux | 4 +- .../language/lux/phase/generation/jvm/host.lux | 67 ++- .../language/lux/phase/generation/jvm/loop.lux | 56 +- .../lux/phase/generation/jvm/primitive.lux | 62 +- .../lux/phase/generation/jvm/reference.lux | 14 +- .../lux/phase/generation/jvm/structure.lux | 36 +- .../compiler/language/lux/phase/generation/lua.lux | 6 +- .../language/lux/phase/generation/lua/case.lux | 110 ++-- .../language/lux/phase/generation/lua/function.lux | 4 +- .../language/lux/phase/generation/lua/loop.lux | 14 +- .../language/lux/phase/generation/lua/runtime.lux | 70 +-- .../lux/phase/generation/lua/structure.lux | 2 +- .../compiler/language/lux/phase/generation/php.lux | 4 +- .../language/lux/phase/generation/php/case.lux | 104 ++-- .../language/lux/phase/generation/php/function.lux | 4 +- .../language/lux/phase/generation/php/loop.lux | 26 +- .../language/lux/phase/generation/php/runtime.lux | 70 +-- .../lux/phase/generation/php/structure.lux | 2 +- .../language/lux/phase/generation/python.lux | 4 +- .../language/lux/phase/generation/python/case.lux | 110 ++-- .../lux/phase/generation/python/function.lux | 6 +- .../language/lux/phase/generation/python/loop.lux | 16 +- .../lux/phase/generation/python/runtime.lux | 62 +- .../lux/phase/generation/python/structure.lux | 2 +- .../compiler/language/lux/phase/generation/r.lux | 2 +- .../language/lux/phase/generation/r/case.lux | 108 ++-- .../language/lux/phase/generation/r/function.lux | 6 +- .../language/lux/phase/generation/r/loop.lux | 20 +- .../lux/phase/generation/r/procedure/common.lux | 8 +- .../lux/phase/generation/r/procedure/host.lux | 6 +- .../language/lux/phase/generation/r/runtime.lux | 60 +- .../language/lux/phase/generation/r/structure.lux | 2 +- .../language/lux/phase/generation/reference.lux | 2 +- .../language/lux/phase/generation/ruby.lux | 4 +- .../language/lux/phase/generation/ruby/case.lux | 134 ++--- .../lux/phase/generation/ruby/function.lux | 4 +- .../language/lux/phase/generation/ruby/loop.lux | 20 +- .../language/lux/phase/generation/ruby/runtime.lux | 64 +- .../lux/phase/generation/ruby/structure.lux | 2 +- .../language/lux/phase/generation/scheme.lux | 2 +- .../language/lux/phase/generation/scheme/case.lux | 84 +-- .../phase/generation/scheme/extension/common.lux | 38 +- .../lux/phase/generation/scheme/function.lux | 4 +- .../language/lux/phase/generation/scheme/loop.lux | 14 +- .../lux/phase/generation/scheme/runtime.lux | 58 +- .../lux/phase/generation/scheme/structure.lux | 2 +- .../tool/compiler/language/lux/phase/synthesis.lux | 6 +- .../compiler/language/lux/phase/synthesis/case.lux | 12 +- .../language/lux/phase/synthesis/function.lux | 110 ++-- .../compiler/language/lux/phase/synthesis/loop.lux | 36 +- .../language/lux/phase/synthesis/variable.lux | 84 +-- .../lux/tool/compiler/language/lux/program.lux | 8 +- .../library/lux/tool/compiler/meta/archive.lux | 28 +- .../lux/tool/compiler/meta/archive/descriptor.lux | 2 +- .../lux/tool/compiler/meta/archive/document.lux | 6 +- .../lux/tool/compiler/meta/cache/dependency.lux | 4 +- .../source/library/lux/tool/compiler/meta/io.lux | 2 +- .../library/lux/tool/compiler/meta/io/archive.lux | 162 ++--- .../library/lux/tool/compiler/meta/io/context.lux | 25 +- .../lux/tool/compiler/meta/packager/jvm.lux | 10 +- .../lux/tool/compiler/meta/packager/scheme.lux | 8 +- stdlib/source/library/lux/tool/compiler/phase.lux | 16 +- stdlib/source/library/lux/tool/interpreter.lux | 28 +- stdlib/source/library/lux/type.lux | 32 +- stdlib/source/library/lux/type/abstract.lux | 52 +- stdlib/source/library/lux/type/check.lux | 65 +- stdlib/source/library/lux/type/dynamic.lux | 16 +- stdlib/source/library/lux/type/implicit.lux | 106 ++-- stdlib/source/library/lux/type/quotient.lux | 12 +- stdlib/source/library/lux/type/refinement.lux | 10 +- stdlib/source/library/lux/type/resource.lux | 52 +- stdlib/source/library/lux/type/unit.lux | 58 +- stdlib/source/library/lux/world/console.lux | 18 +- stdlib/source/library/lux/world/db/jdbc.lux | 78 +-- stdlib/source/library/lux/world/db/jdbc/input.lux | 4 +- stdlib/source/library/lux/world/db/jdbc/output.lux | 30 +- stdlib/source/library/lux/world/file.lux | 210 +++---- stdlib/source/library/lux/world/file/watch.lux | 134 ++--- .../source/library/lux/world/net/http/client.lux | 22 +- .../source/library/lux/world/net/http/cookie.lux | 4 +- stdlib/source/library/lux/world/net/http/query.lux | 10 +- .../source/library/lux/world/net/http/request.lux | 6 +- .../source/library/lux/world/net/http/response.lux | 26 +- stdlib/source/library/lux/world/net/http/route.lux | 2 +- stdlib/source/library/lux/world/program.lux | 52 +- stdlib/source/library/lux/world/shell.lux | 66 +- stdlib/source/poly/lux/abstract/equivalence.lux | 76 +-- stdlib/source/poly/lux/abstract/functor.lux | 50 +- stdlib/source/poly/lux/data/format/json.lux | 185 +++--- stdlib/source/program/aedifex.lux | 14 +- .../source/program/aedifex/artifact/snapshot.lux | 2 +- .../program/aedifex/artifact/snapshot/build.lux | 2 +- .../program/aedifex/artifact/snapshot/stamp.lux | 2 +- .../program/aedifex/artifact/snapshot/time.lux | 2 +- .../program/aedifex/artifact/snapshot/version.lux | 4 +- stdlib/source/program/aedifex/artifact/time.lux | 6 +- .../source/program/aedifex/artifact/time/date.lux | 4 +- .../source/program/aedifex/artifact/versioning.lux | 2 +- stdlib/source/program/aedifex/command/build.lux | 14 +- stdlib/source/program/aedifex/command/clean.lux | 2 +- stdlib/source/program/aedifex/command/deploy.lux | 2 +- stdlib/source/program/aedifex/command/deps.lux | 2 +- stdlib/source/program/aedifex/command/install.lux | 2 +- stdlib/source/program/aedifex/command/pom.lux | 2 +- stdlib/source/program/aedifex/command/test.lux | 4 +- .../program/aedifex/dependency/deployment.lux | 28 +- .../program/aedifex/dependency/resolution.lux | 64 +- stdlib/source/program/aedifex/hash.lux | 6 +- .../source/program/aedifex/metadata/artifact.lux | 32 +- .../source/program/aedifex/metadata/snapshot.lux | 24 +- stdlib/source/program/aedifex/pom.lux | 32 +- stdlib/source/program/aedifex/project.lux | 12 +- stdlib/source/program/aedifex/repository.lux | 8 +- stdlib/source/program/aedifex/repository/local.lux | 4 +- .../source/program/aedifex/repository/remote.lux | 6 +- stdlib/source/program/compositor.lux | 14 +- stdlib/source/program/compositor/export.lux | 18 +- stdlib/source/program/compositor/import.lux | 4 +- stdlib/source/program/scriptum.lux | 72 +-- stdlib/source/specification/aedifex/repository.lux | 48 +- stdlib/source/specification/compositor.lux | 2 +- .../specification/compositor/analysis/type.lux | 10 +- stdlib/source/specification/compositor/common.lux | 16 +- .../specification/compositor/generation/case.lux | 12 +- .../compositor/generation/function.lux | 14 +- .../source/specification/lux/abstract/comonad.lux | 10 +- stdlib/source/specification/lux/abstract/monad.lux | 8 +- stdlib/source/specification/lux/world/console.lux | 62 +- stdlib/source/specification/lux/world/file.lux | 106 ++-- stdlib/source/specification/lux/world/program.lux | 16 +- stdlib/source/specification/lux/world/shell.lux | 60 +- stdlib/source/test/aedifex/artifact/snapshot.lux | 2 +- .../aedifex/artifact/snapshot/version/value.lux | 2 +- stdlib/source/test/aedifex/artifact/time.lux | 2 +- stdlib/source/test/aedifex/artifact/time/date.lux | 2 +- stdlib/source/test/aedifex/artifact/type.lux | 10 +- stdlib/source/test/aedifex/cache.lux | 66 +- stdlib/source/test/aedifex/cli.lux | 14 +- stdlib/source/test/aedifex/command/auto.lux | 58 +- stdlib/source/test/aedifex/command/build.lux | 166 ++--- stdlib/source/test/aedifex/command/clean.lux | 58 +- stdlib/source/test/aedifex/command/deploy.lux | 88 +-- stdlib/source/test/aedifex/command/deps.lux | 58 +- stdlib/source/test/aedifex/command/install.lux | 60 +- stdlib/source/test/aedifex/command/pom.lux | 58 +- stdlib/source/test/aedifex/command/test.lux | 98 +-- stdlib/source/test/aedifex/command/version.lux | 30 +- .../source/test/aedifex/dependency/deployment.lux | 60 +- .../source/test/aedifex/dependency/resolution.lux | 167 +++-- stdlib/source/test/aedifex/dependency/status.lux | 2 +- stdlib/source/test/aedifex/input.lux | 32 +- stdlib/source/test/aedifex/metadata/artifact.lux | 48 +- stdlib/source/test/aedifex/metadata/snapshot.lux | 50 +- stdlib/source/test/aedifex/package.lux | 8 +- stdlib/source/test/aedifex/profile.lux | 14 +- stdlib/source/test/aedifex/project.lux | 2 +- stdlib/source/test/aedifex/repository.lux | 8 +- stdlib/source/test/aedifex/repository/local.lux | 22 +- stdlib/source/test/aedifex/runtime.lux | 10 +- stdlib/source/test/lux.lux | 65 +- stdlib/source/test/lux/abstract/comonad.lux | 4 +- stdlib/source/test/lux/abstract/comonad/cofree.lux | 2 +- stdlib/source/test/lux/abstract/interval.lux | 6 +- stdlib/source/test/lux/abstract/monad.lux | 16 +- stdlib/source/test/lux/abstract/predicate.lux | 8 +- .../source/test/lux/control/concurrency/actor.lux | 268 ++++----- .../source/test/lux/control/concurrency/async.lux | 216 +++---- .../source/test/lux/control/concurrency/atom.lux | 18 +- stdlib/source/test/lux/control/concurrency/frp.lux | 236 ++++---- .../test/lux/control/concurrency/semaphore.lux | 132 ++-- stdlib/source/test/lux/control/concurrency/stm.lux | 102 ++-- .../source/test/lux/control/concurrency/thread.lux | 34 +- stdlib/source/test/lux/control/continuation.lux | 10 +- stdlib/source/test/lux/control/exception.lux | 16 +- stdlib/source/test/lux/control/function/memo.lux | 24 +- stdlib/source/test/lux/control/function/mixin.lux | 4 +- stdlib/source/test/lux/control/parser.lux | 16 +- stdlib/source/test/lux/control/parser/analysis.lux | 2 +- stdlib/source/test/lux/control/parser/binary.lux | 24 +- stdlib/source/test/lux/control/parser/code.lux | 4 +- .../source/test/lux/control/parser/environment.lux | 6 +- stdlib/source/test/lux/control/parser/text.lux | 38 +- stdlib/source/test/lux/control/parser/type.lux | 4 +- stdlib/source/test/lux/control/parser/xml.lux | 18 +- stdlib/source/test/lux/control/reader.lux | 6 +- stdlib/source/test/lux/control/region.lux | 56 +- stdlib/source/test/lux/control/remember.lux | 46 +- .../test/lux/control/security/capability.lux | 10 +- stdlib/source/test/lux/control/security/policy.lux | 3 +- stdlib/source/test/lux/control/state.lux | 8 +- stdlib/source/test/lux/control/thread.lux | 6 +- stdlib/source/test/lux/control/try.lux | 6 +- stdlib/source/test/lux/control/writer.lux | 6 +- stdlib/source/test/lux/data.lux | 2 +- stdlib/source/test/lux/data/binary.lux | 10 +- stdlib/source/test/lux/data/collection/bits.lux | 8 +- .../lux/data/collection/dictionary/ordered.lux | 4 +- .../test/lux/data/collection/dictionary/plist.lux | 2 +- stdlib/source/test/lux/data/collection/list.lux | 14 +- .../test/lux/data/collection/queue/priority.lux | 2 +- stdlib/source/test/lux/data/collection/row.lux | 12 +- .../source/test/lux/data/collection/set/multi.lux | 10 +- .../test/lux/data/collection/set/ordered.lux | 4 +- stdlib/source/test/lux/data/collection/tree.lux | 10 +- .../test/lux/data/collection/tree/zipper.lux | 38 +- stdlib/source/test/lux/data/format/json.lux | 24 +- stdlib/source/test/lux/data/format/tar.lux | 132 ++-- stdlib/source/test/lux/data/format/xml.lux | 2 +- stdlib/source/test/lux/data/maybe.lux | 12 +- stdlib/source/test/lux/data/text/encoding.lux | 2 +- stdlib/source/test/lux/data/text/escape.lux | 4 +- stdlib/source/test/lux/data/text/format.lux | 10 +- stdlib/source/test/lux/data/text/regex.lux | 12 +- stdlib/source/test/lux/data/text/unicode/block.lux | 2 +- stdlib/source/test/lux/data/text/unicode/set.lux | 2 +- stdlib/source/test/lux/debug.lux | 116 ++-- stdlib/source/test/lux/extension.lux | 8 +- stdlib/source/test/lux/locale.lux | 14 +- stdlib/source/test/lux/locale/language.lux | 2 +- stdlib/source/test/lux/locale/territory.lux | 2 +- stdlib/source/test/lux/macro.lux | 92 +-- stdlib/source/test/lux/macro/code.lux | 16 +- stdlib/source/test/lux/macro/local.lux | 4 +- stdlib/source/test/lux/macro/syntax.lux | 2 +- stdlib/source/test/lux/math/logic/fuzzy.lux | 4 +- stdlib/source/test/lux/math/modular.lux | 14 +- stdlib/source/test/lux/math/modulus.lux | 6 +- stdlib/source/test/lux/math/number/complex.lux | 6 +- stdlib/source/test/lux/math/number/ratio.lux | 2 +- stdlib/source/test/lux/meta.lux | 86 +-- stdlib/source/test/lux/program.lux | 2 +- stdlib/source/test/lux/target/jvm.lux | 136 ++--- stdlib/source/test/lux/test.lux | 306 +++++----- stdlib/source/test/lux/time/day.lux | 14 +- stdlib/source/test/lux/time/month.lux | 4 +- .../compiler/language/lux/phase/analysis/case.lux | 40 +- .../language/lux/phase/analysis/primitive.lux | 6 +- .../language/lux/phase/analysis/reference.lux | 2 +- .../compiler/language/lux/phase/synthesis/case.lux | 124 ++-- .../language/lux/phase/synthesis/function.lux | 312 +++++----- .../compiler/language/lux/phase/synthesis/loop.lux | 156 ++--- .../language/lux/phase/synthesis/primitive.lux | 6 +- .../language/lux/phase/synthesis/variable.lux | 146 ++--- .../test/lux/tool/compiler/language/lux/syntax.lux | 2 +- stdlib/source/test/lux/type.lux | 6 +- stdlib/source/test/lux/type/abstract.lux | 2 +- stdlib/source/test/lux/type/check.lux | 60 +- stdlib/source/test/lux/type/resource.lux | 22 +- stdlib/source/test/lux/world/console.lux | 22 +- stdlib/source/test/lux/world/file/watch.lux | 146 ++--- stdlib/source/test/lux/world/input/keyboard.lux | 2 +- stdlib/source/test/lux/world/net/http/client.lux | 2 +- .../test/lux/world/output/video/resolution.lux | 2 +- stdlib/source/test/lux/world/program.lux | 18 +- stdlib/source/test/lux/world/shell.lux | 64 +- 451 files changed, 8789 insertions(+), 8640 deletions(-) (limited to 'stdlib') diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index 4ed6dd7aa..881848963 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -1444,14 +1444,14 @@ (tuple$ (list (tuple$ (list (text$ "") (nat$ 0) (nat$ 0))) content))) -(def:''' (untemplate_list tokens) +(def:''' (untemplated_list tokens) #Nil (-> ($' List Code) Code) ({#Nil (_ann (#Tag ["library/lux" "Nil"])) (#Cons [token tokens']) - (_ann (#Form (list (_ann (#Tag ["library/lux" "Cons"])) token (untemplate_list tokens'))))} + (_ann (#Form (list (_ann (#Tag ["library/lux" "Cons"])) token (untemplated_list tokens'))))} tokens)) (def:''' (list\compose xs ys) @@ -1527,7 +1527,7 @@ ## (interface: (Monad m) ## (: (All [a] (-> a (m a))) -## wrap) +## in) ## (: (All [a b] (-> (-> a (m b)) (m a) (m b))) ## bind)) ("lux def type tagged" Monad @@ -1538,13 +1538,13 @@ ($' m a) ($' m b)))))) (record$ (list)) - ["wrap" "bind"] + ["in" "bind"] #0) (def:''' maybe_monad #Nil ($' Monad Maybe) - {#wrap + {#in (function' [x] (#Some x)) #bind @@ -1556,7 +1556,7 @@ (def:''' meta_monad #Nil ($' Monad Meta) - {#wrap + {#in (function' [x] (function' [state] (#Right state x))) @@ -1573,7 +1573,7 @@ (macro:' (do tokens) ({(#Cons monad (#Cons [_ (#Tuple bindings)] (#Cons body #Nil))) - (let' [g!wrap (local_identifier$ "wrap") + (let' [g!in (local_identifier$ "in") g!bind (local_identifier$ " bind ") body' (list\fold ("lux type check" (-> (& Code Code) Code Code) (function' [binding body'] @@ -1588,7 +1588,7 @@ var)))) body (list\reverse (as_pairs bindings)))] - (return (list (form$ (list (record$ (list [(record$ (list [(tag$ ["library/lux" "wrap"]) g!wrap] [(tag$ ["library/lux" "bind"]) g!bind])) + (return (list (form$ (list (record$ (list [(record$ (list [(tag$ ["library/lux" "in"]) g!in] [(tag$ ["library/lux" "bind"]) g!bind])) body'])) monad))))) @@ -1605,15 +1605,15 @@ (-> a ($' m b)) ($' List a) ($' m ($' List b)))) - (let' [{#wrap wrap #bind _} m] + (let' [{#in in #bind _} m] ({#Nil - (wrap #Nil) + (in #Nil) (#Cons x xs') (do m [y (f x) ys (monad\map m f xs')] - (wrap (#Cons y ys)))} + (in (#Cons y ys)))} xs))) (def:''' (monad\fold m f y xs) @@ -1626,9 +1626,9 @@ b ($' List a) ($' m b))) - (let' [{#wrap wrap #bind _} m] + (let' [{#in in #bind _} m] ({#Nil - (wrap y) + (in y) (#Cons x xs') (do m @@ -1760,13 +1760,13 @@ (#Cons lastI inits) (do meta_monad [lastO ({[_ (#Form (#Cons [[_ (#Identifier ["" "~+"])] (#Cons [spliced #Nil])]))] - (wrap (as_code_list spliced)) + (in (as_code_list spliced)) _ (do meta_monad [lastO (untemplate lastI)] - (wrap (as_code_list (form$ (list (tag$ ["library/lux" "Cons"]) - (tuple$ (list lastO (tag$ ["library/lux" "Nil"]))))))))} + (in (as_code_list (form$ (list (tag$ ["library/lux" "Cons"]) + (tuple$ (list lastO (tag$ ["library/lux" "Nil"]))))))))} lastI)] (monad\fold meta_monad (function' [leftI rightO] @@ -1774,12 +1774,12 @@ (let' [g!in-module (form$ (list (text$ "lux in-module") (text$ "library/lux") (identifier$ ["library/lux" "list\compose"])))] - (wrap (form$ (list g!in-module (as_code_list spliced) rightO)))) + (in (form$ (list g!in-module (as_code_list spliced) rightO)))) _ (do meta_monad [leftO (untemplate leftI)] - (wrap (form$ (list (tag$ ["library/lux" "Cons"]) (tuple$ (list leftO rightO))))))} + (in (form$ (list (tag$ ["library/lux" "Cons"]) (tuple$ (list leftO rightO))))))} leftI)) lastO inits))} @@ -1787,10 +1787,10 @@ #0 (do meta_monad [=elems (monad\map meta_monad untemplate elems)] - (wrap (untemplate_list =elems)))} + (in (untemplated_list =elems)))} replace?)) -(def:''' (untemplate_text value) +(def:''' (untemplated_text value) #Nil (-> Text Code) (wrap_meta (form$ (list (tag$ ["library/lux" "Text"]) (text$ value))))) @@ -1814,7 +1814,7 @@ (return (wrap_meta (form$ (list (tag$ ["library/lux" "Frac"]) (frac$ value))))) [_ [_ (#Text value)]] - (return (untemplate_text value)) + (return (untemplated_text value)) [#0 [_ (#Tag [module name])]] (return (wrap_meta (form$ (list (tag$ ["library/lux" "Tag"]) (tuple$ (list (text$ module) (text$ name))))))) @@ -1832,11 +1832,11 @@ (do meta_monad [real_name ({"" (if (text\= "" subst) - (wrap [module name]) + (in [module name]) (resolve_global_identifier [subst name])) _ - (wrap [module name])} + (in [module name])} module) #let [[module name] real_name]] (return (wrap_meta (form$ (list (tag$ ["library/lux" "Identifier"]) (tuple$ (list (text$ module) (text$ name)))))))) @@ -1852,10 +1852,10 @@ [#1 [_ (#Form (#Cons [[_ (#Identifier ["" "~!"])] (#Cons [dependent #Nil])]))]] (do meta_monad [independent (untemplate replace? subst dependent)] - (wrap (wrap_meta (form$ (list (tag$ ["library/lux" "Form"]) - (untemplate_list (list (untemplate_text "lux in-module") - (untemplate_text subst) - independent))))))) + (in (wrap_meta (form$ (list (tag$ ["library/lux" "Form"]) + (untemplated_list (list (untemplated_text "lux in-module") + (untemplated_text subst) + independent))))))) [#1 [_ (#Form (#Cons [[_ (#Identifier ["" "~'"])] (#Cons [keep_quoted #Nil])]))]] (untemplate #0 subst keep_quoted) @@ -1864,13 +1864,13 @@ (do meta_monad [output (spliced replace? (untemplate replace? subst) elems) #let [[_ output'] (wrap_meta (form$ (list (tag$ ["library/lux" "Form"]) output)))]] - (wrap [meta 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)))]] - (wrap [meta output'])) + (in [meta output'])) [_ [_ (#Record fields)]] (do meta_monad @@ -1881,9 +1881,9 @@ (do meta_monad [=k (untemplate replace? subst k) =v (untemplate replace? subst v)] - (wrap (tuple$ (list =k =v))))))) + (in (tuple$ (list =k =v))))))) fields)] - (wrap (wrap_meta (form$ (list (tag$ ["library/lux" "Record"]) (untemplate_list =fields))))))} + (in (wrap_meta (form$ (list (tag$ ["library/lux" "Record"]) (untemplated_list =fields))))))} [replace? token])) (macro:' #export (primitive tokens) @@ -1896,7 +1896,7 @@ (return (list (form$ (list (tag$ ["library/lux" "Primitive"]) (text$ class_name) (tag$ ["library/lux" "Nil"]))))) (#Cons [_ (#Text class_name)] (#Cons [_ (#Tuple params)] #Nil)) - (return (list (form$ (list (tag$ ["library/lux" "Primitive"]) (text$ class_name) (untemplate_list params))))) + (return (list (form$ (list (tag$ ["library/lux" "Primitive"]) (text$ class_name) (untemplated_list params))))) _ (failure "Wrong syntax for primitive")} @@ -1927,9 +1927,9 @@ (do meta_monad [current_module current_module_name =template (untemplate #1 current_module template)] - (wrap (list (form$ (list (text$ "lux type check") - (identifier$ ["library/lux" "Code"]) - =template))))) + (in (list (form$ (list (text$ "lux type check") + (identifier$ ["library/lux" "Code"]) + =template))))) _ (failure "Wrong syntax for `")} @@ -1943,7 +1943,7 @@ ({(#Cons template #Nil) (do meta_monad [=template (untemplate #1 "" template)] - (wrap (list (form$ (list (text$ "lux type check") (identifier$ ["library/lux" "Code"]) =template))))) + (in (list (form$ (list (text$ "lux type check") (identifier$ ["library/lux" "Code"]) =template))))) _ (failure "Wrong syntax for `")} @@ -1957,7 +1957,7 @@ ({(#Cons template #Nil) (do meta_monad [=template (untemplate #0 "" template)] - (wrap (list (form$ (list (text$ "lux type check") (identifier$ ["library/lux" "Code"]) =template))))) + (in (list (form$ (list (text$ "lux type check") (identifier$ ["library/lux" "Code"]) =template))))) _ (failure "Wrong syntax for '")} @@ -2287,7 +2287,7 @@ #0} type)) -(def:''' (find_macro' modules current_module module name) +(def:''' (macro' modules current_module module name) #Nil (-> ($' List (& Text Module)) Text Text Text @@ -2297,7 +2297,7 @@ gdef (let' [{#module_hash _ #module_aliases _ #definitions bindings #imports _ #tags tags #types types #module_annotations _ #module_state _} ("lux type check" Module $module)] (get name bindings))] ({(#Left [r_module r_name]) - (find_macro' modules current_module r_module r_name) + (macro' modules current_module r_module r_name) (#Right [exported? def_type def_meta def_value]) (if (macro_type? def_type) @@ -2315,13 +2315,13 @@ ({["" name] (do meta_monad [module_name current_module_name] - (wrap [module_name name])) + (in [module_name name])) _ (return name)} name)) -(def:''' (find_macro full_name) +(def:''' (macro full_name) #Nil (-> Name ($' Meta ($' Maybe Macro))) (do meta_monad @@ -2333,7 +2333,7 @@ #seed seed #expected expected #location location #extensions extensions #scope_type_vars scope_type_vars} - (#Right state (find_macro' modules current_module module name))} + (#Right state (macro' modules current_module module name))} state))))) (def:''' (macro? name) @@ -2341,10 +2341,10 @@ (-> Name ($' Meta Bit)) (do meta_monad [name (normalize name) - output (find_macro name)] - (wrap ({(#Some _) #1 - #None #0} - output)))) + output (macro name)] + (in ({(#Some _) #1 + #None #0} + output)))) (def:''' (interpose sep xs) #Nil @@ -2366,7 +2366,7 @@ ({[_ (#Form (#Cons [_ (#Identifier macro_name)] args))] (do meta_monad [macro_name' (normalize macro_name) - ?macro (find_macro macro_name')] + ?macro (macro macro_name')] ({(#Some macro) (("lux type as" Macro' macro) args) @@ -2384,12 +2384,12 @@ ({[_ (#Form (#Cons [_ (#Identifier macro_name)] args))] (do meta_monad [macro_name' (normalize macro_name) - ?macro (find_macro macro_name')] + ?macro (macro macro_name')] ({(#Some macro) (do meta_monad [expansion (("lux type as" Macro' macro) args) expansion' (monad\map meta_monad macro_expand expansion)] - (wrap (list\join expansion'))) + (in (list\join expansion'))) #None (return (list token))} @@ -2405,28 +2405,28 @@ ({[_ (#Form (#Cons [_ (#Identifier macro_name)] args))] (do meta_monad [macro_name' (normalize macro_name) - ?macro (find_macro macro_name')] + ?macro (macro macro_name')] ({(#Some macro) (do meta_monad [expansion (("lux type as" Macro' macro) args) expansion' (monad\map meta_monad macro_expand_all expansion)] - (wrap (list\join expansion'))) + (in (list\join expansion'))) #None (do meta_monad [args' (monad\map meta_monad macro_expand_all args)] - (wrap (list (form$ (#Cons (identifier$ macro_name) (list\join args'))))))} + (in (list (form$ (#Cons (identifier$ macro_name) (list\join args'))))))} ?macro)) [_ (#Form members)] (do meta_monad [members' (monad\map meta_monad macro_expand_all members)] - (wrap (list (form$ (list\join members'))))) + (in (list (form$ (list\join members'))))) [_ (#Tuple members)] (do meta_monad [members' (monad\map meta_monad macro_expand_all members)] - (wrap (list (tuple$ (list\join members'))))) + (in (list (tuple$ (list\join members'))))) [_ (#Record pairs)] (do meta_monad @@ -2442,7 +2442,7 @@ (failure "The value-part of a KV-pair in a record must macro-expand to a single Code.")} val')))) pairs)] - (wrap (list (record$ pairs')))) + (in (list (record$ pairs')))) _ (return (list syntax))} @@ -2485,7 +2485,7 @@ (do meta_monad [type+ (macro_expand_all type)] ({(#Cons type' #Nil) - (wrap (list (walk_type type'))) + (in (list (walk_type type'))) _ (failure "The expansion of the type-syntax had to yield a single element.")} @@ -2762,17 +2762,17 @@ (expander init_expansion)) (do meta_monad [sub_expansion (expander branches')] - (wrap (list& (form$ (list& (identifier$ macro_name) macro_args)) - body - sub_expansion))))) + (in (list& (form$ (list& (identifier$ macro_name) macro_args)) + body + sub_expansion))))) (#Cons pattern (#Cons body branches')) (do meta_monad [sub_expansion (expander branches')] - (wrap (list& pattern body sub_expansion))) + (in (list& pattern body sub_expansion))) #Nil - (do meta_monad [] (wrap (list))) + (do meta_monad [] (in (list))) _ (failure ($_ text\compose "'lux.case' expects an even number of tokens: " (|> branches @@ -2795,7 +2795,7 @@ ({(#Cons value branches) (do meta_monad [expansion (expander branches)] - (wrap (list (` ((~ (record$ (as_pairs expansion))) (~ value)))))) + (in (list (` ((~ (record$ (as_pairs expansion))) (~ value)))))) _ (failure "Wrong syntax for case")} @@ -2818,7 +2818,7 @@ [pattern+ (macro_expand_all pattern)] (case pattern+ (#Cons pattern' #Nil) - (wrap (list& pattern' body branches)) + (in (list& pattern' body branches)) _ (failure "^ can only expand to 1 pattern."))) @@ -2952,7 +2952,7 @@ [_ (#Tuple xs)] (|> xs (list\map process_def_meta_value) - untemplate_list + untemplated_list (meta_code ["library/lux" "Tuple"])) [_ (#Record kvs)] @@ -2961,17 +2961,17 @@ (function (_ [k v]) (` [(~ (process_def_meta_value k)) (~ (process_def_meta_value v))])))) - untemplate_list + untemplated_list (meta_code ["library/lux" "Record"])) )) (def:' (process_def_meta kvs) (-> (List [Code Code]) Code) - (untemplate_list (list\map (: (-> [Code Code] Code) - (function (_ [k v]) - (` [(~ (process_def_meta_value k)) - (~ (process_def_meta_value v))]))) - kvs))) + (untemplated_list (list\map (: (-> [Code Code] Code) + (function (_ [k v]) + (` [(~ (process_def_meta_value k)) + (~ (process_def_meta_value v))]))) + kvs))) (def:' (with_func_args args meta) (-> (List Code) Code Code) @@ -3181,7 +3181,7 @@ (function (_ token) (case token (^ [_ (#Form (list [_ (#Text "lux type check")] type [_ (#Identifier ["" name])]))]) - (wrap [name type]) + (in [name type]) _ (failure "Signatures require typed members!")))) @@ -3414,7 +3414,7 @@ _ (#Some (list type)))) -(def: (find_module name) +(def: (module name) (-> Text (Meta Module)) (function (_ state) (let [{#info info #source source #current_module _ #modules modules @@ -3432,12 +3432,12 @@ (Meta Module) (do meta_monad [module_name current_module_name] - (find_module module_name))) + (module module_name))) (def: (resolve_tag [module name]) (-> Name (Meta [Nat (List Name) Bit Type])) (do meta_monad - [=module (find_module module) + [=module (..module 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) @@ -3460,7 +3460,7 @@ (#Named [module name] unnamed) (do meta_monad - [=module (find_module module) + [=module (..module 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)]) @@ -3514,7 +3514,7 @@ (^ [_ (#Form (list [_ (#Text "lux def")] [_ (#Identifier "" tag_name)] value meta [_ (#Bit #0)]))]) (case (get tag_name tag_mappings) (#Some tag) - (wrap [tag value]) + (in [tag value]) _ (failure (text\compose "Unknown implementation member: " tag_name))) @@ -3522,7 +3522,7 @@ _ (failure "Invalid implementation member.")))) (list\join tokens'))] - (wrap (list (record$ members))))) + (in (list (record$ members))))) (def: (text\join_with separator parts) (-> Text (List Text) Text) @@ -3725,13 +3725,13 @@ (^ (list& [_ (#Form (list& [_ (#Tag ["" "only"])] defs))] tokens'))) (do meta_monad [defs' (extract_defs defs)] - (wrap [(#Only defs') tokens'])) + (in [(#Only defs') tokens'])) (^or (^ (list& [_ (#Form (list& [_ (#Tag ["" "-"])] defs))] tokens')) (^ (list& [_ (#Form (list& [_ (#Tag ["" "exclude"])] defs))] tokens'))) (do meta_monad [defs' (extract_defs defs)] - (wrap [(#Exclude defs') tokens'])) + (in [(#Exclude defs') tokens'])) (^or (^ (list& [_ (#Tag ["" "*"])] tokens')) (^ (list& [_ (#Tag ["" "all"])] tokens'))) @@ -3780,7 +3780,7 @@ [index (..index_of token sample) #let [[pre post'] (text\split! index sample) [_ post] (text\split! ("lux text size" token) post')]] - (wrap [pre post]))) + (in [pre post]))) (def: (replace_all pattern replacement template) (-> Text Text Text Text) @@ -3914,17 +3914,17 @@ [_ (#Identifier ["" m_name])] (do meta_monad [m_name (clean_module nested? relative_root m_name)] - (wrap (list {#import_name m_name - #import_alias #None - #import_refer {#refer_defs #All - #refer_open (list)}}))) + (in (list {#import_name m_name + #import_alias #None + #import_refer {#refer_defs #All + #refer_open (list)}}))) ## Nested (^ [_ (#Tuple (list& [_ (#Identifier ["" m_name])] extra))]) (do meta_monad [import_name (case (normal_parallel_path relative_root m_name) (#.Some parallel_path) - (wrap parallel_path) + (in parallel_path) #.None (clean_module nested? relative_root m_name)) @@ -3933,22 +3933,22 @@ openings+extra (openings_parser extra) #let [[openings extra] openings+extra] sub_imports (imports_parser #1 import_name context_alias extra)] - (wrap (case [referral openings] - [#Nothing #Nil] - sub_imports - - _ - (list& {#import_name import_name - #import_alias #None - #import_refer {#refer_defs referral - #refer_open openings}} - sub_imports)))) + (in (case [referral openings] + [#Nothing #Nil] + sub_imports + + _ + (list& {#import_name import_name + #import_alias #None + #import_refer {#refer_defs referral + #refer_open openings}} + sub_imports)))) (^ [_ (#Tuple (list& [_ (#Text alias)] [_ (#Identifier ["" m_name])] extra))]) (do meta_monad [import_name (case (normal_parallel_path relative_root m_name) (#.Some parallel_path) - (wrap parallel_path) + (in parallel_path) #.None (clean_module nested? relative_root m_name)) @@ -3958,16 +3958,16 @@ #let [[openings extra] openings+extra de_aliased (de_alias context_alias m_name alias)] sub_imports (imports_parser #1 import_name de_aliased extra)] - (wrap (case [referral openings] - [#Ignore #Nil] - sub_imports - - _ - (list& {#import_name import_name - #import_alias (#Some de_aliased) - #import_refer {#refer_defs referral - #refer_open openings}} - sub_imports)))) + (in (case [referral openings] + [#Ignore #Nil] + sub_imports + + _ + (list& {#import_name import_name + #import_alias (#Some de_aliased) + #import_refer {#refer_defs referral + #refer_open openings}} + sub_imports)))) ## Unrecognized syntax. _ @@ -3977,7 +3977,7 @@ "Wrong syntax for import @ " current_module ..\n (code\encode token))))))) imports)] - (wrap (list\join imports')))) + (in (list\join imports')))) (def: (exported_definitions module state) (-> Text (Meta (List Text))) @@ -4047,7 +4047,7 @@ #None (f x2) (#Some y) (#Some y))) -(def: (find_in_env name state) +(def: (in_env name state) (-> Text Lux (Maybe Type)) (case state {#info info #source source #current_module _ #modules modules @@ -4070,7 +4070,7 @@ (: (List [Text [Type Any]]) closure))))) scopes))) -(def: (find_def_type name state) +(def: (definition_type name state) (-> Name Lux (Maybe Type)) (let [[v_prefix v_name] name {#info info #source source #current_module _ #modules modules @@ -4089,12 +4089,12 @@ (#Some definition) (case definition (#Left de_aliased) - (find_def_type de_aliased state) + (definition_type de_aliased state) (#Right [exported? def_type def_meta def_value]) (#Some def_type)))))) -(def: (find_def_value name state) +(def: (definition_value name state) (-> Name (Meta [Type Any])) (let [[v_prefix v_name] name {#info info #source source #current_module _ #modules modules @@ -4113,12 +4113,12 @@ (#Some definition) (case definition (#Left de_aliased) - (find_def_value de_aliased state) + (definition_value de_aliased state) (#Right [exported? def_type def_meta def_value]) (#Right [state [def_type def_value]])))))) -(def: (find_type_var idx bindings) +(def: (type_variable idx bindings) (-> Nat (List [Nat (Maybe Type)]) (Maybe Type)) (case bindings #Nil @@ -4127,27 +4127,27 @@ (#Cons [var bound] bindings') (if ("lux i64 =" idx var) bound - (find_type_var idx bindings')))) + (type_variable idx bindings')))) -(def: (find_type full_name) +(def: (type_definition full_name) (-> Name (Meta Type)) (do meta_monad [#let [[module name] full_name] current_module current_module_name] (function (_ compiler) (let [temp (if (text\= "" module) - (case (find_in_env name compiler) + (case (in_env name compiler) (#Some struct_type) (#Right [compiler struct_type]) _ - (case (find_def_type [current_module name] compiler) + (case (definition_type [current_module name] compiler) (#Some struct_type) (#Right [compiler struct_type]) _ (#Left ($_ text\compose "Unknown var: " (name\encode full_name))))) - (case (find_def_type full_name compiler) + (case (definition_type full_name compiler) (#Some struct_type) (#Right [compiler struct_type]) @@ -4160,7 +4160,7 @@ #seed _ #expected _ #location _ #extensions extensions #scope_type_vars _} compiler {#ex_counter _ #var_counter _ #var_bindings var_bindings} type_context] - (case (find_type_var type_id var_bindings) + (case (type_variable type_id var_bindings) #None temp @@ -4242,11 +4242,11 @@ (^ (list& [_ (#Form (list [_ (#Text alias)]))] body branches)) (do meta_monad [g!temp (gensym "temp")] - (wrap (list& g!temp (` (..^open (~ g!temp) (~ (text$ alias)) (~ body))) branches))) + (in (list& g!temp (` (..^open (~ g!temp) (~ (text$ alias)) (~ body))) branches))) (^ (list [_ (#Identifier name)] [_ (#Text alias)] body)) (do meta_monad - [init_type (find_type name) + [init_type (type_definition name) struct_evidence (resolve_type_tags init_type)] (case struct_evidence #None @@ -4272,12 +4272,12 @@ enhanced_target) #None - (wrap enhanced_target)))) + (in enhanced_target)))) target (zipped/2 locals members))] - (wrap (` ({(~ pattern) (~ enhanced_target)} (~ (identifier$ source))))))))) + (in (` ({(~ pattern) (~ enhanced_target)} (~ (identifier$ source))))))))) name tags&members body)] - (wrap (list full_body))))) + (in (list full_body))))) _ (failure "Wrong syntax for ^open"))) @@ -4361,7 +4361,7 @@ (do meta_monad [g!_ (gensym "_") g!record (gensym "record")] - (wrap (list (` (function ((~ g!_) (~ g!record)) (..get@ (~ selector) (~ g!record))))))) + (in (list (` (function ((~ g!_) (~ g!record)) (..get@ (~ selector) (~ g!record))))))) _ (failure "Wrong syntax for get@"))) @@ -4413,7 +4413,7 @@ (case struct [_ (#Identifier struct_name)] (do meta_monad - [struct_type (find_type struct_name) + [struct_type (type_definition struct_name) output (resolve_type_tags struct_type) #let [source (identifier$ struct_name)]] (case output @@ -4464,9 +4464,9 @@ (def: (imported_by? import_name module_name) (-> Text Text (Meta Bit)) (do meta_monad - [module (find_module module_name) + [module (module module_name) #let [{#module_hash _ #module_aliases _ #definitions _ #imports imports #tags _ #types _ #module_annotations _ #module_state _} module]] - (wrap (is_member? imports import_name)))) + (in (is_member? imports import_name)))) (def: (read_refer module_name options) (-> Text (List Code) (Meta Refer)) @@ -4478,8 +4478,8 @@ current_module current_module_name] (case options #Nil - (wrap {#refer_defs referral - #refer_open openings}) + (in {#refer_defs referral + #refer_open openings}) _ (failure ($_ text\compose "Wrong syntax for refer @ " current_module @@ -4509,19 +4509,19 @@ (do meta_monad [*defs (exported_definitions module_name) _ (test_referrals module_name *defs +defs)] - (wrap +defs)) + (in +defs)) (#Exclude _defs) (do meta_monad [*defs (exported_definitions module_name) _ (test_referrals module_name *defs _defs)] - (wrap (..only (|>> (is_member? _defs) not) *defs))) + (in (..only (|>> (is_member? _defs) not) *defs))) #Ignore - (wrap (list)) + (in (list)) #Nothing - (wrap (list))) + (in (list))) #let [defs (list\map (: (-> Text Code) (function (_ def) (` ("lux def alias" (~ (local_identifier$ def)) (~ (identifier$ [module_name def])))))) @@ -4533,7 +4533,7 @@ (` (open: (~ (text$ alias)) (~ (identifier$ [module_name name]))))) structs)))) list\join)]] - (wrap (list\compose defs openings)) + (in (list\compose defs openings)) )) (macro: #export (refer tokens) @@ -4613,7 +4613,7 @@ =module (` ("lux def module" [(~ location_code) (#.Record (~ (process_def_meta _meta)))] (~ =imports)))]] - (wrap (#Cons =module =refers)))) + (in (#Cons =module =refers)))) (macro: #export (\ tokens) {#.doc (text$ ($_ "lux text concat" @@ -4700,23 +4700,23 @@ [record (: (List (List Code)) #Nil)] pairs) accesses (list\join (list\reverse accesses'))]] - (wrap (list (` (let [(~+ accesses)] - (~ update_expr))))))) + (in (list (` (let [(~+ accesses)] + (~ update_expr))))))) (^ (list selector value)) (do meta_monad [g!_ (gensym "_") g!record (gensym "record")] - (wrap (list (` (function ((~ g!_) (~ g!record)) - (..set@ (~ selector) (~ value) (~ g!record))))))) + (in (list (` (function ((~ g!_) (~ g!record)) + (..set@ (~ selector) (~ value) (~ g!record))))))) (^ (list selector)) (do meta_monad [g!_ (gensym "_") g!value (gensym "value") g!record (gensym "record")] - (wrap (list (` (function ((~ g!_) (~ g!value) (~ g!record)) - (..set@ (~ selector) (~ g!value) (~ g!record))))))) + (in (list (` (function ((~ g!_) (~ g!value) (~ g!record)) + (..set@ (~ selector) (~ g!value) (~ g!record))))))) _ (failure "Wrong syntax for set@"))) @@ -4774,24 +4774,24 @@ (do meta_monad [g!record (gensym "record") g!temp (gensym "temp")] - (wrap (list (` (let [(~ g!record) (~ record) - (~ g!temp) (get@ [(~+ slots)] (~ g!record))] - (set@ [(~+ slots)] ((~ fun) (~ g!temp)) (~ g!record)))))))) + (in (list (` (let [(~ g!record) (~ record) + (~ g!temp) (get@ [(~+ slots)] (~ g!record))] + (set@ [(~+ slots)] ((~ fun) (~ g!temp)) (~ g!record)))))))) (^ (list selector fun)) (do meta_monad [g!_ (gensym "_") g!record (gensym "record")] - (wrap (list (` (function ((~ g!_) (~ g!record)) - (..update@ (~ selector) (~ fun) (~ g!record))))))) + (in (list (` (function ((~ g!_) (~ g!record)) + (..update@ (~ selector) (~ fun) (~ g!record))))))) (^ (list selector)) (do meta_monad [g!_ (gensym "_") g!fun (gensym "fun") g!record (gensym "record")] - (wrap (list (` (function ((~ g!_) (~ g!fun) (~ g!record)) - (..update@ (~ selector) (~ g!fun) (~ g!record))))))) + (in (list (` (function ((~ g!_) (~ g!fun) (~ g!record)) + (..update@ (~ selector) (~ g!fun) (~ g!record))))))) _ (failure "Wrong syntax for update@"))) @@ -4848,7 +4848,7 @@ (|> data' (list\map (compose apply (make_env bindings'))) list\join - wrap)) + in)) #None)))) (#Some output) (return (list\compose output branches)) @@ -4859,7 +4859,7 @@ _ (failure "Wrong syntax for ^template"))) -(def: (find_baseline_column code) +(def: (baseline_column code) (-> Code Nat) (case code (^template [] @@ -4876,14 +4876,14 @@ (^template [] [[[_ _ column] ( parts)] - (list\fold n/min column (list\map find_baseline_column parts))]) + (list\fold n/min column (list\map baseline_column parts))]) ([#Form] [#Tuple]) [[_ _ column] (#Record pairs)] (list\fold n/min column - (list\compose (list\map (|>> first find_baseline_column) pairs) - (list\map (|>> second find_baseline_column) pairs))) + (list\compose (list\map (|>> first baseline_column) pairs) + (list\map (|>> second baseline_column) pairs))) )) (type: Doc_Fragment @@ -4994,7 +4994,7 @@ (text\join_with "")) (#Doc_Example example) - (let [baseline (find_baseline_column example) + (let [baseline (baseline_column example) [location _] example [_ text] (doc_example_to_text (with_baseline baseline location) baseline example)] (text\compose text __paragraph)))) @@ -5035,7 +5035,7 @@ (-> Type Code) (case type (#Primitive name params) - (` (#.Primitive (~ (text$ name)) (~ (untemplate_list (list\map type_to_code params))))) + (` (#.Primitive (~ (text$ name)) (~ (untemplated_list (list\map type_to_code params))))) (^template [] [( left right) @@ -5051,7 +5051,7 @@ (^template [] [( env type) - (let [env' (untemplate_list (list\map type_to_code env))] + (let [env' (untemplated_list (list\map type_to_code env))] (` ( (~ env') (~ (type_to_code type)))))]) ([#.UnivQ] [#.ExQ]) @@ -5098,7 +5098,7 @@ (case (monad\map maybe_monad get_name inits) (#Some inits') (return inits') #None (failure "Wrong syntax for loop"))) - init_types (monad\map meta_monad find_type inits') + init_types (monad\map meta_monad type_definition inits') expected get_expected_type] (return (list (` (("lux type check" (-> (~+ (list\map type_to_code init_types)) @@ -5132,7 +5132,7 @@ (do maybe_monad [hslot (get_tag hslot') tslots (monad\map maybe_monad get_tag tslots')] - (wrap [hslot tslots]))) + (in [hslot tslots]))) (#Some slots) (return slots) @@ -5176,7 +5176,7 @@ [[location ( elems)] (do maybe_monad [placements (monad\map maybe_monad (place_tokens label tokens) elems)] - (wrap (list [location ( (list\join placements))])))]) + (in (list [location ( (list\join placements))])))]) ([#Tuple] [#Form]) @@ -5190,12 +5190,12 @@ value' (place_tokens label tokens value)] (case [slot' value'] (^ [(list =slot) (list =value)]) - (wrap [=slot =value]) + (in [=slot =value]) _ #None)))) pairs)] - (wrap (list [location (#Record =pairs)]))) + (in (list [location (#Record =pairs)]))) )) (macro: #export (with_expansions tokens) @@ -5228,7 +5228,7 @@ [(~+ bindings')] (~+ bodies)))) (#Some output) - (wrap output) + (in output) _ (failure "[with_expansions] Improper macro expansion."))) @@ -5264,12 +5264,12 @@ (def: (anti_quote_def name) (-> Name (Meta Code)) (do meta_monad - [type+value (find_def_value name) + [type+value (definition_value name) #let [[type value] type+value]] (case (flat_alias type) (^template [ ] [(#Named ["library/lux" ] _) - (wrap ( (:as value)))]) + (in ( (:as value)))]) (["Bit" Bit bit$] ["Nat" Nat nat$] ["Int" Int int$] @@ -5294,7 +5294,7 @@ [[meta ( parts)] (do meta_monad [=parts (monad\map meta_monad anti_quote parts)] - (wrap [meta ( =parts)]))]) + (in [meta ( =parts)]))]) ([#Form] [#Tuple]) @@ -5305,14 +5305,14 @@ (function (_ [slot value]) (do meta_monad [=value (anti_quote value)] - (wrap [slot =value])))) + (in [slot =value])))) pairs)] - (wrap [meta (#Record =pairs)])) + (in [meta (#Record =pairs)])) _ (\ meta_monad return token) ## TODO: Figure out why this doesn't work: - ## (\ meta_monad wrap token) + ## (\ meta_monad in token) )) (macro: #export (static tokens) @@ -5320,7 +5320,7 @@ (^ (list pattern)) (do meta_monad [pattern' (anti_quote pattern)] - (wrap (list pattern'))) + (in (list pattern'))) _ (failure "Wrong syntax for 'static'."))) @@ -5347,7 +5347,7 @@ (#Cons init extras) (do meta_monad [extras' (monad\map meta_monad case_level^ extras)] - (wrap [init extras'])))) + (in [init extras'])))) (def: (multi_level_case$ g!_ [[init_pattern levels] body]) (-> Code [Multi_Level_Case Code] (List Code)) @@ -5416,7 +5416,7 @@ (~+ (if initial_bind? (list) (list g!temp (` #.None)))))))))] - (wrap output))) + (in output))) _ (failure "Wrong syntax for ^multi"))) @@ -5468,7 +5468,7 @@ [stvs get_scope_type_vars] (case (..nth idx (list\reverse stvs)) (#Some var_id) - (wrap (list (` (#Ex (~ (nat$ var_id)))))) + (in (list (` (#Ex (~ (nat$ var_id)))))) #None (failure (text\compose "Indexed-type does not exist: " (nat\encode idx))))) @@ -5526,7 +5526,7 @@ (^ (list expr)) (do meta_monad [type get_expected_type] - (wrap (list (` ("lux type as" (~ (type_to_code type)) (~ expr)))))) + (in (list (` ("lux type as" (~ (type_to_code type)) (~ expr)))))) _ (failure (..wrong_syntax_error (name_of ..:assume))))) @@ -5551,7 +5551,7 @@ #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)]] - (wrap (list (` (..error! (~ (text$ message))))))) + (in (list (` (..error! (~ (text$ message))))))) _ (failure (..wrong_syntax_error (name_of ..undefined))))) @@ -5571,14 +5571,14 @@ (case tokens (^ (list [_ (#Identifier var_name)])) (do meta_monad - [var_type (find_type var_name)] - (wrap (list (type_to_code var_type)))) + [var_type (type_definition var_name)] + (in (list (type_to_code var_type)))) (^ (list expression)) (do meta_monad [g!temp (gensym "g!temp")] - (wrap (list (` (let [(~ g!temp) (~ expression)] - (..:of (~ g!temp))))))) + (in (list (` (let [(~ g!temp) (~ expression)] + (..:of (~ g!temp))))))) _ (failure (..wrong_syntax_error (name_of ..:of))))) @@ -5592,12 +5592,12 @@ (function (_ arg') (case arg' [_ (#Identifier ["" arg_name])] - (wrap arg_name) + (in arg_name) _ (failure "Could not parse an argument."))) args')] - (wrap [[name args] tokens'])) + (in [[name args] tokens'])) _ (failure "Could not parse a complex declaration.") @@ -5664,19 +5664,19 @@ [arg (` ((~' ~) (~ (local_identifier$ arg))))]) args)] this_module current_module_name] - (wrap (list (` (macro: (~+ (export export?)) - ((~ (local_identifier$ name)) (~ g!tokens) (~ g!compiler)) - (~ anns) - (case (~ g!tokens) - (^ (list (~+ (list\map local_identifier$ args)))) - (#.Right [(~ g!compiler) - (list (~+ (list\map (function (_ template) - (` (`' (~ (replace_syntax rep_env template))))) - input_templates)))]) - - (~ g!_) - (#.Left (~ (text$ (..wrong_syntax_error [this_module name])))) - ))))) + (in (list (` (macro: (~+ (export export?)) + ((~ (local_identifier$ name)) (~ g!tokens) (~ g!compiler)) + (~ anns) + (case (~ g!tokens) + (^ (list (~+ (list\map local_identifier$ args)))) + (#.Right [(~ g!compiler) + (list (~+ (list\map (function (_ template) + (` (`' (~ (replace_syntax rep_env template))))) + input_templates)))]) + + (~ g!_) + (#.Left (~ (text$ (..wrong_syntax_error [this_module name])))) + ))))) )) (macro: #export (as_is tokens compiler) @@ -5707,12 +5707,12 @@ [_ (#Identifier identifier)] (do meta_monad [identifier (..resolve_global_identifier identifier) - type+value (..find_def_value identifier) + type+value (..definition_value identifier) #let [[type value] type+value]] (case (..flat_alias type) (^or (#Primitive "#Text" #Nil) (#Named ["library/lux" "Text"] (#Primitive "#Text" #Nil))) - (wrap (:as ..Text value)) + (in (:as ..Text value)) _ (failure ($_ text\compose @@ -5770,14 +5770,14 @@ (^ [ann (#Form (list [_ (#Identifier ["" "~~"])] expansion))]) (do meta_monad [g!expansion (gensym "g!expansion")] - (wrap [(list [g!expansion expansion]) g!expansion])) + (in [(list [g!expansion expansion]) g!expansion])) (^template [] [[ann ( parts)] (do meta_monad [=parts (monad\map meta_monad label_code parts)] - (wrap [(list\fold list\compose (list) (list\map left =parts)) - [ann ( (list\map right =parts))]]))]) + (in [(list\fold list\compose (list) (list\map left =parts)) + [ann ( (list\map right =parts))]]))]) ([#Form] [#Tuple]) [ann (#Record kvs)] @@ -5789,10 +5789,10 @@ =val (label_code val) #let [[key_labels key_labelled] =key [val_labels val_labelled] =val]] - (wrap [(list\compose key_labels val_labels) [key_labelled val_labelled]]))) + (in [(list\compose key_labels val_labels) [key_labelled val_labelled]]))) kvs)] - (wrap [(list\fold list\compose (list) (list\map left =kvs)) - [ann (#Record (list\map right =kvs))]])) + (in [(list\fold list\compose (list) (list\map left =kvs)) + [ann (#Record (list\map right =kvs))]])) _ (return [(list) code]))) @@ -5803,10 +5803,10 @@ (do meta_monad [=raw (label_code raw) #let [[labels labelled] =raw]] - (wrap (list (` (with_expansions [(~+ (|> labels - (list\map (function (_ [label expansion]) (list label expansion))) - list\join))] - (~ labelled)))))) + (in (list (` (with_expansions [(~+ (|> labels + (list\map (function (_ [label expansion]) (list label expansion))) + list\join))] + (~ labelled)))))) _ (failure (..wrong_syntax_error (name_of ..``))) @@ -5816,56 +5816,56 @@ (-> Name Code) (` [(~ (text$ module)) (~ (text$ name))])) -(def: (untemplate_list& last inits) +(def: (untemplated_list& last inits) (-> Code (List Code) Code) (case inits #Nil last (#Cons [init inits']) - (` (#.Cons (~ init) (~ (untemplate_list& last inits')))))) + (` (#.Cons (~ init) (~ (untemplated_list& last inits')))))) -(def: (untemplate_record g!meta untemplate_pattern fields) +(def: (untemplated_record g!meta untemplated_pattern fields) (-> Code (-> Code (Meta Code)) (-> (List [Code Code]) (Meta Code))) (do meta_monad [=fields (monad\map meta_monad (function (_ [key value]) (do meta_monad - [=key (untemplate_pattern key) - =value (untemplate_pattern value)] - (wrap (` [(~ =key) (~ =value)])))) + [=key (untemplated_pattern key) + =value (untemplated_pattern value)] + (in (` [(~ =key) (~ =value)])))) fields)] - (wrap (` [(~ g!meta) (#.Record (~ (untemplate_list =fields)))])))) + (in (` [(~ g!meta) (#.Record (~ (untemplated_list =fields)))])))) (template [ ] - [(def: ( g!meta untemplate_pattern elems) + [(def: ( g!meta untemplated_pattern elems) (-> Code (-> Code (Meta Code)) (-> (List Code) (Meta Code))) (case (list\reverse elems) (#Cons [_ (#Form (#Cons [[_ (#Identifier ["" "~+"])] (#Cons [spliced #Nil])]))] inits) (do meta_monad - [=inits (monad\map meta_monad untemplate_pattern (list\reverse inits))] - (wrap (` [(~ g!meta) ( (~ (untemplate_list& spliced =inits)))]))) + [=inits (monad\map meta_monad untemplated_pattern (list\reverse inits))] + (in (` [(~ g!meta) ( (~ (untemplated_list& spliced =inits)))]))) _ (do meta_monad - [=elems (monad\map meta_monad untemplate_pattern elems)] - (wrap (` [(~ g!meta) ( (~ (untemplate_list =elems)))])))))] + [=elems (monad\map meta_monad untemplated_pattern elems)] + (in (` [(~ g!meta) ( (~ (untemplated_list =elems)))])))))] - [#.Tuple untemplate_tuple] - [#.Form untemplate_form] + [#.Tuple untemplated_tuple] + [#.Form untemplated_form] ) -(def: (untemplate_pattern pattern) +(def: (untemplated_pattern pattern) (-> Code (Meta Code)) (do meta_monad [g!meta (gensym "g!meta")] (case pattern (^template [ ] [[_ ( value)] - (wrap (` [(~ g!meta) ( (~ ( value)))]))]) + (in (` [(~ g!meta) ( (~ ( value)))]))]) ([#.Bit bit$] [#.Nat nat$] [#.Int int$] @@ -5883,25 +5883,25 @@ (^template [ ] [[_ ( elems)] - ( g!meta untemplate_pattern elems)]) - ([#.Tuple ..untemplate_tuple] - [#.Form ..untemplate_form]) + ( g!meta untemplated_pattern elems)]) + ([#.Tuple ..untemplated_tuple] + [#.Form ..untemplated_form]) [_ (#Record fields)] - (..untemplate_record g!meta untemplate_pattern fields) + (..untemplated_record g!meta untemplated_pattern fields) ))) (macro: #export (^code tokens) (case tokens (^ (list& [_meta (#Form (list template))] body branches)) (do meta_monad - [pattern (untemplate_pattern template)] - (wrap (list& pattern body branches))) + [pattern (untemplated_pattern template)] + (in (list& pattern body branches))) (^ (list template)) (do meta_monad - [pattern (untemplate_pattern template)] - (wrap (list pattern))) + [pattern (untemplated_pattern template)] + (in (list pattern))) _ (failure (..wrong_syntax_error (name_of ..^code))))) @@ -5940,9 +5940,9 @@ (^ (list expression)) (do meta_monad [g!_ (gensym "g!_")] - (wrap (list (` ("lux try" - (.function ((~ g!_) (~ g!_)) - (~ expression))))))) + (in (list (` ("lux try" + (.function ((~ g!_) (~ g!_)) + (~ expression))))))) _ (..failure (..wrong_syntax_error (name_of ..try))))) diff --git a/stdlib/source/library/lux/abstract/apply.lux b/stdlib/source/library/lux/abstract/apply.lux index da787a54a..38e4772e4 100644 --- a/stdlib/source/library/lux/abstract/apply.lux +++ b/stdlib/source/library/lux/abstract/apply.lux @@ -25,13 +25,13 @@ (def: (apply fgf fgx) ## TODO: Switch from this version to the one below (in comments) ASAP. (let [fgf' (\ f_apply apply - (\ f_monad wrap (\ g_apply apply)) + (\ f_monad in (\ g_apply apply)) fgf)] (\ f_apply apply fgf' fgx)) ## (let [applyF (\ f_apply apply) ## applyG (\ g_apply apply)] ## ($_ applyF - ## (\ f_monad wrap applyG) + ## (\ f_monad in applyG) ## fgf ## fgx)) )) diff --git a/stdlib/source/library/lux/abstract/comonad.lux b/stdlib/source/library/lux/abstract/comonad.lux index 362556f50..205958b26 100644 --- a/stdlib/source/library/lux/abstract/comonad.lux +++ b/stdlib/source/library/lux/abstract/comonad.lux @@ -19,7 +19,7 @@ &functor) (: (All [a] (-> (w a) a)) - unwrap) + out) (: (All [a] (-> (w a) (w (w a)))) split)) @@ -64,13 +64,13 @@ (#.Some name) (let [name [location.dummy (#.Identifier ["" name])]] (` ({(~ name) - ({[(~ g!map) (~' unwrap) (~ g!split)] + ({[(~ g!map) (~' out) (~ g!split)] (~ body')} (~ name))} (~ comonad)))) #.None - (` ({[(~ g!map) (~' unwrap) (~ g!split)] + (` ({[(~ g!map) (~' out) (~ g!split)] (~ body')} (~ comonad)))))])) (#.Left "'be' bindings must have an even number of parts.")) diff --git a/stdlib/source/library/lux/abstract/comonad/cofree.lux b/stdlib/source/library/lux/abstract/comonad/cofree.lux index 88c4ce50a..096a48feb 100644 --- a/stdlib/source/library/lux/abstract/comonad/cofree.lux +++ b/stdlib/source/library/lux/abstract/comonad/cofree.lux @@ -20,7 +20,7 @@ (def: &functor (..functor dsl)) - (def: (unwrap [head tail]) + (def: (out [head tail]) head) (def: (split [head tail]) diff --git a/stdlib/source/library/lux/abstract/monad.lux b/stdlib/source/library/lux/abstract/monad.lux index 567234801..4dc1e1477 100644 --- a/stdlib/source/library/lux/abstract/monad.lux +++ b/stdlib/source/library/lux/abstract/monad.lux @@ -51,7 +51,7 @@ &functor) (: (All [a] (-> a (m a))) - wrap) + in) (: (All [a] (-> (m (m a)) (m a))) join)) @@ -61,7 +61,7 @@ (do monad [y (f1 x) z (f2 z)] - (wrap (f3 z))))} + (in (f3 z))))} (case (: (Maybe [(Maybe Text) Code (List Code) Code]) (case tokens (^ (list [_ (#.Record (list [[_ (#.Identifier ["" name])] monad]))] [_ (#.Tuple bindings)] body)) @@ -96,13 +96,13 @@ (#.Some name) (let [name [location.dummy (#.Identifier ["" name])]] (` ({(~ name) - ({[(~ g!map) (~' wrap) (~ g!join)] + ({[(~ g!map) (~' in) (~ g!join)] (~ body')} (~ name))} (~ monad)))) #.None - (` ({[(~ g!map) (~' wrap) (~ g!join)] + (` ({[(~ g!map) (~' in) (~ g!join)] (~ body')} (~ monad)))))])) (#.Left "'do' bindings must have an even number of parts.")) @@ -127,7 +127,7 @@ (function (recur xs) (case xs #.Nil - (!\wrap #.Nil) + (!\in #.Nil) (#.Cons x xs') (|> x @@ -144,7 +144,7 @@ (function (recur xs) (case xs #.Nil - (!\wrap #.Nil) + (!\in #.Nil) (#.Cons x xs') (|> (f x) @@ -161,7 +161,7 @@ (function (recur xs) (case xs #.Nil - (!\wrap #.Nil) + (!\in #.Nil) (#.Cons head xs') (|> (f head) @@ -180,7 +180,7 @@ (M a))) (case xs #.Nil - (\ monad wrap init) + (\ monad in init) (#.Cons x xs') (do monad diff --git a/stdlib/source/library/lux/abstract/monad/free.lux b/stdlib/source/library/lux/abstract/monad/free.lux index 9648fbc8e..a4f5733df 100644 --- a/stdlib/source/library/lux/abstract/monad/free.lux +++ b/stdlib/source/library/lux/abstract/monad/free.lux @@ -48,7 +48,7 @@ (def: &functor (..functor dsl)) - (def: (wrap a) + (def: (in a) (#Pure a)) (def: (join efefa) diff --git a/stdlib/source/library/lux/abstract/monad/indexed.lux b/stdlib/source/library/lux/abstract/monad/indexed.lux index 5d18ba0ac..8fbd74b1f 100644 --- a/stdlib/source/library/lux/abstract/monad/indexed.lux +++ b/stdlib/source/library/lux/abstract/monad/indexed.lux @@ -15,7 +15,7 @@ (interface: #export (IxMonad m) (: (All [p a] (-> a (m p p a))) - wrap) + in) (: (All [ii it io vi vo] (-> (-> vi (m it io vo)) @@ -71,15 +71,15 @@ (~ value))))) expression (list.reverse context))] - (wrap (list (case ?name - (#.Some name) - (let [name (code.local_identifier name)] - (` (let [(~ name) (~ monad) - {#..wrap (~' wrap) - #..bind (~ g!bind)} (~ name)] - (~ body)))) + (in (list (case ?name + (#.Some name) + (let [name (code.local_identifier name)] + (` (let [(~ name) (~ monad) + {#..in (~' in) + #..bind (~ g!bind)} (~ name)] + (~ body)))) - #.None - (` (let [{#..wrap (~' wrap) - #..bind (~ g!bind)} (~ monad)] - (~ body))))))))) + #.None + (` (let [{#..in (~' in) + #..bind (~ g!bind)} (~ monad)] + (~ body))))))))) diff --git a/stdlib/source/library/lux/abstract/predicate.lux b/stdlib/source/library/lux/abstract/predicate.lux index d53a9a3cb..1d1bfd848 100644 --- a/stdlib/source/library/lux/abstract/predicate.lux +++ b/stdlib/source/library/lux/abstract/predicate.lux @@ -1,6 +1,6 @@ (.module: [library - [lux #* + [lux (#- or and) [control ["." function]]]] [// @@ -26,10 +26,10 @@ ( (left value) (right value))))] - [none #0 unite or + [none #0 or .or (doc "A predicate that always fails.") (doc "A predicate that meets either predecessor.")] - [all #1 intersect and + [all #1 and .and (doc "A predicate that always succeeds.") (doc "A predicate that meets both predecessors.")] ) @@ -41,8 +41,8 @@ (def: identity ) (def: compose ))] - [union ..none ..unite] - [intersection ..all ..intersect] + [union ..none ..or] + [intersection ..all ..and] ) (def: #export (complement predicate) @@ -54,8 +54,8 @@ {#.doc (doc "A predicate that meeds 'base', but not 'sub'.")} (All [a] (-> (Predicate a) (Predicate a) (Predicate a))) (function (_ value) - (and (base value) - (not (sub value))))) + (.and (base value) + (not (sub value))))) (def: #export (rec predicate) {#.doc (doc "Ties the knot for a recursive predicate.")} diff --git a/stdlib/source/library/lux/control/concatenative.lux b/stdlib/source/library/lux/control/concatenative.lux index 0d87210c3..f8426ebb7 100644 --- a/stdlib/source/library/lux/control/concatenative.lux +++ b/stdlib/source/library/lux/control/concatenative.lux @@ -47,7 +47,7 @@ (<>.either (<>.and (<>.maybe bottom^) (.tuple (<>.some .any))) (<>.and (|> bottom^ (<>\map (|>> #.Some))) - (<>\wrap (list))))) + (<>\in (list))))) (def: (stack_fold tops bottom) (-> (List Code) Code Code) @@ -62,7 +62,7 @@ [expansion expander] (case expansion (#.Cons singleton #.Nil) - (wrap singleton) + (in singleton) _ (meta.failure (format "Cannot expand to more than a single AST/Code node:" text.new_line @@ -82,17 +82,17 @@ (monad.do meta.monad [inputC (singleton (macro.expand_all (stack_fold (get@ #top inputs) bottomI))) outputC (singleton (macro.expand_all (stack_fold (get@ #top outputs) bottomO)))] - (wrap (list (` (-> (~ (de_alias inputC)) - (~ (de_alias outputC))))))) + (in (list (` (-> (~ (de_alias inputC)) + (~ (de_alias outputC))))))) [?bottomI ?bottomO] (with_gensyms [g!stack] (monad.do meta.monad [inputC (singleton (macro.expand_all (stack_fold (get@ #top inputs) (maybe.default g!stack ?bottomI)))) outputC (singleton (macro.expand_all (stack_fold (get@ #top outputs) (maybe.default g!stack ?bottomO))))] - (wrap (list (` (All [(~ g!stack)] - (-> (~ (de_alias inputC)) - (~ (de_alias outputC)))))))))))) + (in (list (` (All [(~ g!stack)] + (-> (~ (de_alias inputC)) + (~ (de_alias outputC)))))))))))) (def: begin! Any []) @@ -102,7 +102,7 @@ top)) (syntax: #export (||> {commands (<>.some .any)}) - (wrap (list (` (|> (~! ..begin!) (~+ commands) ((~! ..end!))))))) + (in (list (` (|> (~! ..begin!) (~+ commands) ((~! ..end!))))))) (syntax: #export (word: {export |export|.parser} @@ -110,21 +110,21 @@ {annotations (<>.default |annotations|.empty |annotations|.parser)} type {commands (<>.some .any)}) - (wrap (list (` (def: (~+ (|export|.format export)) (~ (code.local_identifier name)) - (~ (|annotations|.format annotations)) - (~ type) - (|>> (~+ commands))))))) + (in (list (` (def: (~+ (|export|.format export)) (~ (code.local_identifier name)) + (~ (|annotations|.format annotations)) + (~ type) + (|>> (~+ commands))))))) (syntax: #export (apply {arity (|> .nat (<>.only (n.> 0)))}) (with_gensyms [g! g!func g!stack g!output] (monad.do {! meta.monad} [g!inputs (|> (macro.gensym "input") (list.repeat arity) (monad.seq !))] - (wrap (list (` (: (All [(~+ g!inputs) (~ g!output)] - (-> (-> (~+ g!inputs) (~ g!output)) - (=> [(~+ g!inputs)] [(~ g!output)]))) - (function ((~ g!) (~ g!func)) - (function ((~ g!) (~ (stack_fold g!inputs g!stack))) - [(~ g!stack) ((~ g!func) (~+ g!inputs))]))))))))) + (in (list (` (: (All [(~+ g!inputs) (~ g!output)] + (-> (-> (~+ g!inputs) (~ g!output)) + (=> [(~+ g!inputs)] [(~ g!output)]))) + (function ((~ g!) (~ g!func)) + (function ((~ g!) (~ (stack_fold g!inputs g!stack))) + [(~ g!stack) ((~ g!func) (~+ g!inputs))]))))))))) (def: #export apply/1 (apply 1)) (def: #export apply/2 (apply 2)) diff --git a/stdlib/source/library/lux/control/concurrency/actor.lux b/stdlib/source/library/lux/control/concurrency/actor.lux index b2b619735..5b954efcd 100644 --- a/stdlib/source/library/lux/control/concurrency/actor.lux +++ b/stdlib/source/library/lux/control/concurrency/actor.lux @@ -62,7 +62,7 @@ (pending tail)) #.None - (wrap #.Nil)))) + (in #.Nil)))) (abstract: #export (Actor s) {#obituary [(Async ) @@ -107,7 +107,7 @@ (do io.monad [pending (..pending tail)] (resolve [error state (#.Cons head pending)]))) - (wrap []))) + (in []))) (#try.Success state') (recur state' tail))))] @@ -156,12 +156,12 @@ (if resolved? (do ! [_ (atom.write (product.right entry) (get@ #mailbox (:representation actor)))] - (wrap (exception.return []))) + (in (exception.return []))) (recur |mailbox|&resolve))) (#.Some [_ |mailbox|']) (recur |mailbox|')))))) - (wrap (exception.throw ..dead []))))) + (in (exception.except ..dead []))))) (type: #export (Message s o) {#.doc (doc "A two-way message sent to an actor, expecting a reply.")} @@ -200,7 +200,7 @@ async (#try.Failure error) - (wrap (#try.Failure error)))))) + (in (#try.Failure error)))))) ) ) @@ -219,13 +219,13 @@ "but allows the actor to handle previous mail.")} (All [s] (-> (Actor s) (IO (Try Any)))) (..mail! (function (_ state self) - (async.resolved (exception.throw ..poisoned []))) + (async.resolved (exception.except ..poisoned []))) actor)) (def: actor_decl^ (Parser [Text (List Text)]) (<>.either (.form (<>.and .local_identifier (<>.some .local_identifier))) - (<>.and .local_identifier (\ <>.monad wrap (list))))) + (<>.and .local_identifier (\ <>.monad in (list))))) (type: On_MailC [[Text Text Text] Code]) @@ -266,7 +266,7 @@ [#let [_ (debug.log! "BEFORE")] output (mail state self) #let [_ (debug.log! "AFTER")]] - (wrap output))) + (in output))) (message: #export (push {value a} state self) (List a) @@ -298,16 +298,16 @@ [g!type (macro.gensym (format name "_abstract_type")) #let [g!actor (code.local_identifier name) g!vars (list\map code.local_identifier vars)]] - (wrap (list (` ((~! abstract:) (~+ (|export|.format export)) ((~ g!type) (~+ g!vars)) - (~ state_type) + (in (list (` ((~! abstract:) (~+ (|export|.format export)) ((~ g!type) (~+ g!vars)) + (~ state_type) - (def: (~+ (|export|.format export)) (~ g!actor) - (All [(~+ g!vars)] - (..Behavior (~ state_type) ((~ g!type) (~+ g!vars)))) - {#..on_init (|>> ((~! abstract.:abstraction) (~ g!type))) - #..on_mail (~ (..on_mail g!_ ?on_mail))}) + (def: (~+ (|export|.format export)) (~ g!actor) + (All [(~+ g!vars)] + (..Behavior (~ state_type) ((~ g!type) (~+ g!vars)))) + {#..on_init (|>> ((~! abstract.:abstraction) (~ g!type))) + #..on_mail (~ (..on_mail g!_ ?on_mail))}) - (~+ messages)))))))) + (~+ messages)))))))) (syntax: #export (actor {[state_type init] (.record (<>.and .any .any))} {[?on_mail messages] behavior^}) @@ -318,12 +318,12 @@ ((on_mail message state self) (message (inc state) self))))} (with_gensyms [g!_] - (wrap (list (` (: ((~! io.IO) (..Actor (~ state_type))) - (..spawn! (: (..Behavior (~ state_type) (~ state_type)) - {#..on_init (|>>) - #..on_mail (~ (..on_mail g!_ ?on_mail))}) - (: (~ state_type) - (~ init))))))))) + (in (list (` (: ((~! io.IO) (..Actor (~ state_type))) + (..spawn! (: (..Behavior (~ state_type) (~ state_type)) + {#..on_init (|>>) + #..on_mail (~ (..on_mail g!_ ?on_mail))}) + (: (~ state_type) + (~ init))))))))) (type: Signature {#vars (List Text) @@ -344,7 +344,7 @@ (def: reference^ (Parser [Name (List Text)]) (<>.either (.form (<>.and .identifier (<>.some .local_identifier))) - (<>.and .identifier (\ <>.monad wrap (list))))) + (<>.and .identifier (\ <>.monad in (list))))) (syntax: #export (message: {export |export|.parser} @@ -369,21 +369,21 @@ g!inputsT (|> signature (get@ #inputs) (list\map product.right)) g!state (|> signature (get@ #state) code.local_identifier) g!self (|> signature (get@ #self) code.local_identifier)]] - (wrap (list (` (def: (~+ (|export|.format export)) ((~ g!message) (~+ g!inputsC)) - (~ (|annotations|.format annotations)) - (All [(~+ g!all_vars)] - (-> (~+ g!inputsT) - (..Message (~ (get@ #abstract.abstraction actor_scope)) - (~ output_type)))) - (function ((~ g!_) (~ g!state) (~ g!self)) - (let [(~ g!state) (:as (~ (get@ #abstract.representation actor_scope)) - (~ g!state))] - (|> (~ body) - (: ((~! async.Async) ((~! try.Try) [(~ (get@ #abstract.representation actor_scope)) - (~ output_type)]))) - (:as ((~! async.Async) ((~! try.Try) [(~ (get@ #abstract.abstraction actor_scope)) - (~ output_type)])))))))) - )))))) + (in (list (` (def: (~+ (|export|.format export)) ((~ g!message) (~+ g!inputsC)) + (~ (|annotations|.format annotations)) + (All [(~+ g!all_vars)] + (-> (~+ g!inputsT) + (..Message (~ (get@ #abstract.abstraction actor_scope)) + (~ output_type)))) + (function ((~ g!_) (~ g!state) (~ g!self)) + (let [(~ g!state) (:as (~ (get@ #abstract.representation actor_scope)) + (~ g!state))] + (|> (~ body) + (: ((~! async.Async) ((~! try.Try) [(~ (get@ #abstract.representation actor_scope)) + (~ output_type)]))) + (:as ((~! async.Async) ((~! try.Try) [(~ (get@ #abstract.abstraction actor_scope)) + (~ output_type)])))))))) + )))))) (type: #export Stop {#.doc (doc "A signal to stop an actor from observing a channel.")} @@ -408,5 +408,5 @@ (|> actor (..mail! (action event stop)) (\ ! map try.maybe)) - (wrap #.None)))) + (in #.None)))) channel))) diff --git a/stdlib/source/library/lux/control/concurrency/async.lux b/stdlib/source/library/lux/control/concurrency/async.lux index 875602eff..68a586914 100644 --- a/stdlib/source/library/lux/control/concurrency/async.lux +++ b/stdlib/source/library/lux/control/concurrency/async.lux @@ -36,7 +36,7 @@ [(^@ old [_value _observers]) (atom.read async)] (case _value (#.Some _) - (wrap #0) + (in #0) #.None (do ! @@ -46,7 +46,7 @@ (do ! [_ (monad.map ! (function (_ f) (f value)) _observers)] - (wrap #1)) + (in #1)) (resolve value)))))))) (def: #export (resolved value) @@ -82,7 +82,7 @@ (do ! [swapped? (atom.compare_and_swap old new async)] (if swapped? - (wrap []) + (in []) (await f (:abstraction async)))))))) ) @@ -122,7 +122,7 @@ (def: &functor ..functor) - (def: wrap ..resolved) + (def: in ..resolved) (def: (join mma) (let [[ma resolve] (async [])] diff --git a/stdlib/source/library/lux/control/concurrency/atom.lux b/stdlib/source/library/lux/control/concurrency/atom.lux index ba1d2af55..138e03e02 100644 --- a/stdlib/source/library/lux/control/concurrency/atom.lux +++ b/stdlib/source/library/lux/control/concurrency/atom.lux @@ -93,7 +93,7 @@ #let [new (f old)] swapped? (..compare_and_swap old new atom)] (if swapped? - (wrap [old new]) + (in [old new]) (recur []))))) (def: #export (write value atom) diff --git a/stdlib/source/library/lux/control/concurrency/frp.lux b/stdlib/source/library/lux/control/concurrency/frp.lux index fee1a5dda..9bda3c334 100644 --- a/stdlib/source/library/lux/control/concurrency/frp.lux +++ b/stdlib/source/library/lux/control/concurrency/frp.lux @@ -44,13 +44,13 @@ stopped? (current #.None)] (if stopped? ## I closed the sink. - (wrap (exception.return [])) + (in (exception.return [])) ## Someone else interacted with the sink. (do ! [latter (atom.read sink)] (if (is? current latter) ## Someone else closed the sink. - (wrap (exception.throw ..channel_is_already_closed [])) + (in (exception.except ..channel_is_already_closed [])) ## Someone else fed the sink while I was closing it. (recur []))))))) @@ -70,13 +70,13 @@ ## I fed the sink. (do ! [_ (atom.compare_and_swap current resolve_next sink)] - (wrap (exception.return []))) + (in (exception.return []))) ## Someone else interacted with the sink. (do ! [latter (atom.read sink)] (if (is? current latter) ## Someone else closed the sink while I was feeding it. - (wrap (exception.throw ..channel_is_already_closed [])) + (in (exception.except ..channel_is_already_closed [])) ## Someone else fed the sink. (recur [])))))))))) @@ -106,10 +106,10 @@ cons_a fa] (case [cons_f cons_a] [(#.Some [head_f tail_f]) (#.Some [head_a tail_a])] - (wrap (#.Some [(head_f head_a) (apply tail_f tail_a)])) + (in (#.Some [(head_f head_a) (apply tail_f tail_a)])) _ - (wrap #.None))))) + (in #.None))))) (def: empty Channel @@ -120,7 +120,7 @@ (def: &functor ..functor) - (def: (wrap a) + (def: (in a) (async.resolved (#.Some [a ..empty]))) (def: (join mma) @@ -141,11 +141,11 @@ (recur ma')) #.None - (wrap []))))] + (in []))))] (recur mma')) #.None - (wrap (: Any (io.run (\ sink close)))))))) + (in (: Any (io.run (\ sink close)))))))) output)))) (type: #export (Subscriber a) @@ -165,10 +165,10 @@ (recur tail) #.None - (wrap [])) + (in [])) #.None - (wrap []))))) + (in []))))) []))) (def: #export (only pass? channel) @@ -181,11 +181,11 @@ (#.Some [head tail]) (let [tail' (only pass? tail)] (if (pass? head) - (wrap (#.Some [head tail'])) + (in (#.Some [head tail'])) tail')) #.None - (wrap #.None)))) + (in #.None)))) (def: #export (of_async async) {#.doc (doc "A one-element channel containing the output from an async.")} @@ -203,7 +203,7 @@ [cons channel] (case cons #.None - (wrap init) + (in init) (#.Some [head tail]) (do ! @@ -218,12 +218,12 @@ [cons channel] (case cons #.None - (wrap (#.Some [init (wrap #.None)])) + (in (#.Some [init (in #.None)])) (#.Some [head tail]) (do ! [init' (f head init)] - (wrap (#.Some [init (folds f init' tail)])))))) + (in (#.Some [init (folds f init' tail)])))))) (def: #export (poll milli_seconds action) (All [a] @@ -246,10 +246,10 @@ [?next (f init)] (case ?next (#.Some [state output]) - (wrap (#.Some [output (iterate f state)])) + (in (#.Some [output (iterate f state)])) #.None - (wrap #.None)))) + (in #.None)))) (def: (distinct' equivalence previous channel) (All [a] (-> (Equivalence a) a (Channel a) (Channel a))) @@ -259,10 +259,10 @@ (#.Some [head tail]) (if (\ equivalence = previous head) (distinct' equivalence previous tail) - (wrap (#.Some [head (distinct' equivalence head tail)]))) + (in (#.Some [head (distinct' equivalence head tail)]))) #.None - (wrap #.None)))) + (in #.None)))) (def: #export (distinct equivalence channel) (All [a] (-> (Equivalence a) (Channel a) (Channel a))) @@ -270,10 +270,10 @@ [cons channel] (case cons (#.Some [head tail]) - (wrap (#.Some [head (distinct' equivalence head tail)])) + (in (#.Some [head (distinct' equivalence head tail)])) #.None - (wrap #.None)))) + (in #.None)))) (def: #export (consume channel) (All [a] (-> (Channel a) (Async (List a)))) @@ -285,7 +285,7 @@ (consume tail)) #.None - (wrap #.Nil)))) + (in #.Nil)))) (def: #export (sequential milli_seconds values) {#.doc (doc "Transforms the given list into a channel with the same elements.")} diff --git a/stdlib/source/library/lux/control/concurrency/semaphore.lux b/stdlib/source/library/lux/control/concurrency/semaphore.lux index 56b70bbc1..fc6f939c8 100644 --- a/stdlib/source/library/lux/control/concurrency/semaphore.lux +++ b/stdlib/source/library/lux/control/concurrency/semaphore.lux @@ -61,7 +61,7 @@ [(update@ #waiting_list (queue.push sink))])) semaphore)] (with_expansions [ (sink []) - (wrap false)] + (in false)] (if (|> state' ) ))))) @@ -86,15 +86,15 @@ (update@ #waiting_list queue.pop)))) semaphore)] (if (is? pre post) - (wrap (exception.throw ..semaphore_is_maxed_out [(get@ #max_positions pre)])) + (in (exception.except ..semaphore_is_maxed_out [(get@ #max_positions pre)])) (do ! [_ (case (queue.peek (get@ #waiting_list pre)) #.None - (wrap true) + (in true) (#.Some sink) (sink []))] - (wrap (#try.Success (get@ #open_positions post))))))))) + (in (#try.Success (get@ #open_positions post))))))))) ) (abstract: #export Mutex @@ -122,7 +122,7 @@ [_ (..acquire mutex) output (io.run procedure) _ (..release mutex)] - (wrap output))) + (in output))) ) (def: #export limit @@ -155,7 +155,7 @@ (do async.monad [outcome (..signal turnstile)] (recur (inc step))) - (\ async.monad wrap [])))) + (\ async.monad in [])))) (template [ ] [(def: ( (^:representation barrier)) diff --git a/stdlib/source/library/lux/control/concurrency/stm.lux b/stdlib/source/library/lux/control/concurrency/stm.lux index 3f912c3de..da01d2db8 100644 --- a/stdlib/source/library/lux/control/concurrency/stm.lux +++ b/stdlib/source/library/lux/control/concurrency/stm.lux @@ -43,7 +43,7 @@ [_ (atom.update (function (_ [value observers]) [value (list.only (|>> (is? sink) not) observers)]) (:representation var))] - (wrap []))) + (in []))) (def: (write! new_value var) (All [a] (-> a (Var a) (IO Any))) @@ -58,12 +58,12 @@ [result (\ sink feed new_value)] (case result (#try.Success _) - (wrap []) + (in []) (#try.Failure _) (un_follow sink var)))) observers)] - (wrap [])) + (in [])) (write! new_value var)))) (def: #export (follow target) @@ -74,7 +74,7 @@ _ (atom.update (function (_ [value observers]) [value (#.Cons sink observers)]) (:representation target))] - (wrap [channel sink]))) + (in [channel sink]))) ) (type: (Tx_Frame a) @@ -89,7 +89,7 @@ {#.doc "A computation which updates a transaction and produces a value."} (-> Tx [Tx a])) -(def: (find_var_value var tx) +(def: (var_value var tx) (All [a] (-> (Var a) Tx (Maybe a))) (|> tx (list.find (function (_ [_var _original _current]) @@ -103,7 +103,7 @@ (def: #export (read var) (All [a] (-> (Var a) (STM a))) (function (_ tx) - (case (find_var_value var tx) + (case (var_value var tx) (#.Some value) [tx value] @@ -133,7 +133,7 @@ (def: #export (write value var) (All [a] (-> a (Var a) (STM Any))) (function (_ tx) - (case (find_var_value var tx) + (case (var_value var tx) (#.Some _) [(update_tx_value var value tx) []] @@ -166,7 +166,7 @@ (def: &functor ..functor) - (def: (wrap a) + (def: (in a) (function (_ tx) [tx a])) @@ -182,7 +182,7 @@ [a (..read var) #let [a' (f a)] _ (..write a' var)] - (wrap [a a']))) + (in [a a']))) (def: (can_commit? tx) (-> Tx Bit) @@ -247,7 +247,7 @@ (do {! io.monad} [flag (atom.read commit_processor_flag)] (if flag - (wrap []) + (in []) (do ! [was_first? (atom.compare_and_swap flag #1 commit_processor_flag)] (if was_first? @@ -258,7 +258,7 @@ [_ (process_commit head)] (async.await recur tail))) async)) - (wrap []))) + (in []))) ))) (def: #export (commit stm_proc) diff --git a/stdlib/source/library/lux/control/concurrency/thread.lux b/stdlib/source/library/lux/control/concurrency/thread.lux index 3d288f8a6..36f65d0ea 100644 --- a/stdlib/source/library/lux/control/concurrency/thread.lux +++ b/stdlib/source/library/lux/control/concurrency/thread.lux @@ -125,7 +125,7 @@ [(|> milli_seconds n.frac (f./ +1,000.0))] threading/Timer::new (threading/Timer::start []))] - (wrap []))} + (in []))} ## Default (do {! io.monad} @@ -134,7 +134,7 @@ #delay milli_seconds #action action})) ..runner)] - (wrap []))))) + (in []))))) (for {@.old (as_is) @.jvm (as_is) @@ -154,7 +154,7 @@ (case threads ## And... we're done! #.Nil - (wrap []) + (in []) _ (do ! diff --git a/stdlib/source/library/lux/control/continuation.lux b/stdlib/source/library/lux/control/continuation.lux index 8b9b5a24f..e36f3ba69 100644 --- a/stdlib/source/library/lux/control/continuation.lux +++ b/stdlib/source/library/lux/control/continuation.lux @@ -41,7 +41,7 @@ {#.doc (doc "Turns any expression into a function that is pending a continuation." (pending (some_function some_input)))} (with_gensyms [g!_ g!k] - (wrap (list (` (.function ((~ g!_) (~ g!k)) ((~ g!k) (~ expr)))))))) + (in (list (` (.function ((~ g!_) (~ g!k)) ((~ g!k) (~ expr)))))))) (def: #export (reset scope) (All [i o] (-> (Cont i i) (Cont i o))) @@ -79,7 +79,7 @@ (def: &functor ..functor) - (def: (wrap value) + (def: (in value) (function (_ k) (k value))) (def: (join ffa) @@ -97,4 +97,4 @@ [#let [nexus (function (nexus val) (k [nexus val]))] _ (k [nexus init])] - (wrap (undefined)))))) + (in (undefined)))))) diff --git a/stdlib/source/library/lux/control/exception.lux b/stdlib/source/library/lux/control/exception.lux index 6d8b4e5e7..22b882f85 100644 --- a/stdlib/source/library/lux/control/exception.lux +++ b/stdlib/source/library/lux/control/exception.lux @@ -1,4 +1,5 @@ -(.module: {#.doc "Exception-handling functionality."} +(.module: + {#.doc "Pure-Lux exception-handling functionality."} [library [lux #* ["." macro] @@ -76,7 +77,7 @@ (All [e] (-> (Exception e) e Text)) ((get@ #..constructor exception) message)) -(def: #export (throw exception message) +(def: #export (except exception message) {#.doc "Decorate an error message with an Exception and lift it into the error-handling context."} (All [e a] (-> (Exception e) e (Try a))) (#//.Failure (..construct exception message))) @@ -85,11 +86,11 @@ (All [e] (-> (Exception e) e Bit (Try Any))) (if test (#//.Success []) - (..throw exception message))) + (..except exception message))) (syntax: #export (exception: {export |export|.parser} {t_vars (p.default (list) (s.tuple (p.some |type_variable|.parser)))} - {[name inputs] (p.either (p.and s.local_identifier (wrap (list))) + {[name inputs] (p.either (p.and s.local_identifier (in (list))) (s.form (p.and s.local_identifier (p.some |input|.parser))))} {body (p.maybe s.any)}) {#.doc (doc "Define a new exception type." @@ -106,15 +107,15 @@ [current_module meta.current_module_name #let [descriptor ($_ text\compose "{" current_module "." name "}" text.new_line) g!self (code.local_identifier name)]] - (wrap (list (` (def: (~+ (|export|.format export)) - (~ g!self) - (All [(~+ (list\map |type_variable|.format t_vars))] - (..Exception [(~+ (list\map (get@ #|input|.type) inputs))])) - (let [(~ g!descriptor) (~ (code.text descriptor))] - {#..label (~ g!descriptor) - #..constructor (function ((~ g!self) [(~+ (list\map (get@ #|input|.binding) inputs))]) - ((~! text\compose) (~ g!descriptor) - (~ (maybe.default (' "") body))))}))))) + (in (list (` (def: (~+ (|export|.format export)) + (~ g!self) + (All [(~+ (list\map |type_variable|.format t_vars))] + (..Exception [(~+ (list\map (get@ #|input|.type) inputs))])) + (let [(~ g!descriptor) (~ (code.text descriptor))] + {#..label (~ g!descriptor) + #..constructor (function ((~ g!self) [(~+ (list\map (get@ #|input|.binding) inputs))]) + ((~! text\compose) (~ g!descriptor) + (~ (maybe.default (' "") body))))}))))) ))) (def: (report' entries) @@ -149,9 +150,9 @@ tail)))) (syntax: #export (report {entries (p.many (s.tuple (p.and s.any s.any)))}) - (wrap (list (` ((~! report') (list (~+ (|> entries - (list\map (function (_ [header message]) - (` [(~ header) (~ message)]))))))))))) + (in (list (` ((~! report') (list (~+ (|> entries + (list\map (function (_ [header message]) + (` [(~ header) (~ message)]))))))))))) (def: #export (enumerate format entries) (All [a] diff --git a/stdlib/source/library/lux/control/function/contract.lux b/stdlib/source/library/lux/control/function/contract.lux index 414445ac1..00c1bb59c 100644 --- a/stdlib/source/library/lux/control/function/contract.lux +++ b/stdlib/source/library/lux/control/function/contract.lux @@ -34,10 +34,10 @@ "Otherwise, an error is raised." (pre (i.= +4 (i.+ +2 +2)) (foo +123 +456 +789)))} - (wrap (list (` (exec - ((~! ..assert!) (~ (code.text (exception.construct ..pre_condition_failed test))) - (~ test)) - (~ expr)))))) + (in (list (` (exec + ((~! ..assert!) (~ (code.text (exception.construct ..pre_condition_failed test))) + (~ test)) + (~ expr)))))) (syntax: #export (post test expr) {#.doc (doc "Post-conditions." @@ -47,8 +47,8 @@ (post i.even? (i.+ +2 +2)))} (with_gensyms [g!output] - (wrap (list (` (let [(~ g!output) (~ expr)] - (exec - ((~! ..assert!) (~ (code.text (exception.construct ..post_condition_failed test))) - ((~ test) (~ g!output))) - (~ g!output)))))))) + (in (list (` (let [(~ g!output) (~ expr)] + (exec + ((~! ..assert!) (~ (code.text (exception.construct ..post_condition_failed test))) + ((~ test) (~ g!output))) + (~ g!output)))))))) diff --git a/stdlib/source/library/lux/control/function/memo.lux b/stdlib/source/library/lux/control/function/memo.lux index e2b734cae..da293b1f6 100644 --- a/stdlib/source/library/lux/control/function/memo.lux +++ b/stdlib/source/library/lux/control/function/memo.lux @@ -25,13 +25,13 @@ [memory state.get] (case (dictionary.get input memory) (#.Some output) - (wrap output) + (in output) #.None (do ! [output (delegate input) _ (state.update (dictionary.put input output))] - (wrap output))))))) + (in output))))))) (type: #export (Memo i o) (Recursive i (State (Dictionary i o) o))) diff --git a/stdlib/source/library/lux/control/function/mixin.lux b/stdlib/source/library/lux/control/function/mixin.lux index 8248b2055..796c04057 100644 --- a/stdlib/source/library/lux/control/function/mixin.lux +++ b/stdlib/source/library/lux/control/function/mixin.lux @@ -60,7 +60,7 @@ (do monad [output (delegate input) _ (action input output)] - (wrap output)))) + (in output)))) (type: #export (Recursive i o) {#.doc (doc "An indirectly recursive function.")} diff --git a/stdlib/source/library/lux/control/function/mutual.lux b/stdlib/source/library/lux/control/function/mutual.lux index 97d2c3ac1..73407a7f1 100644 --- a/stdlib/source/library/lux/control/function/mutual.lux +++ b/stdlib/source/library/lux/control/function/mutual.lux @@ -51,7 +51,7 @@ (<| (:as Macro) (: Macro') (function (_ parameters) - (\ meta.monad wrap (list (` (((~ g!self) (~ g!context)) (~+ parameters)))))))) + (\ meta.monad in (list (` (((~ g!self) (~ g!context)) (~+ parameters)))))))) (syntax: #export (let {functions (.tuple (<>.some ..mutual))} body) @@ -71,14 +71,14 @@ (odd? 5))))} (case functions #.Nil - (wrap (list body)) + (in (list body)) (#.Cons mutual #.Nil) (.let [g!name (|> mutual (get@ [#declaration #declaration.name]) code.local_identifier)] - (wrap (list (` (.let [(~ g!name) (: (~ (get@ #type mutual)) - (function (~ (declaration.format (get@ #declaration mutual))) - (~ (get@ #body mutual))))] - (~ body)))))) + (in (list (` (.let [(~ g!name) (: (~ (get@ #type mutual)) + (function (~ (declaration.format (get@ #declaration mutual))) + (~ (get@ #body mutual))))] + (~ body)))))) _ (macro.with_gensyms [g!context g!output] @@ -99,16 +99,16 @@ (..macro g!context g!name)]) (list.zipped/2 hidden_names functions)))] - (wrap (list (` (.let [(~ g!context) (: (Rec (~ g!context) - [(~+ context_types)]) - [(~+ definitions)]) - [(~+ user_names)] (.let [[(~+ user_names)] (~ g!context)] - [(~+ (list\map (function (_ g!name) - (` ((~ g!name) (~ g!context)))) - user_names))]) - (~ g!output) (~ body)] - (exec (~ g!pop) - (~ g!output)))))))))) + (in (list (` (.let [(~ g!context) (: (Rec (~ g!context) + [(~+ context_types)]) + [(~+ definitions)]) + [(~+ user_names)] (.let [[(~+ user_names)] (~ g!context)] + [(~+ (list\map (function (_ g!name) + (` ((~ g!name) (~ g!context)))) + user_names))]) + (~ g!output) (~ body)] + (exec (~ g!pop) + (~ g!output)))))))))) (type: Definition {#exported? Bit @@ -135,16 +135,16 @@ _ (even? (dec number)))]))} (case functions #.Nil - (wrap (list)) + (in (list)) (#.Cons definition #.Nil) (.let [(^slots [#exported? #mutual]) definition (^slots [#declaration #type #body]) mutual] - (wrap (list (` (.def: - (~+ (export.format exported?)) - (~ (declaration.format declaration)) - (~ type) - (~ body)))))) + (in (list (` (.def: + (~+ (export.format exported?)) + (~ (declaration.format declaration)) + (~ type) + (~ body)))))) _ (macro.with_gensyms [g!context g!output] @@ -165,22 +165,22 @@ (..macro g!context g!name)]) (list.zipped/2 hidden_names functions)))] - (wrap (list& (` (.def: (~ g!context) - [(~+ (list\map (get@ [#mutual #type]) functions))] - (.let [(~ g!context) (: (Rec (~ g!context) - [(~+ context_types)]) - [(~+ definitions)]) - [(~+ user_names)] (~ g!context)] - [(~+ (list\map (function (_ g!name) - (` ((~ g!name) (~ g!context)))) - user_names))]))) - g!pop - (list\map (function (_ mutual) - (.let [g!name (|> mutual (get@ [#mutual #declaration #declaration.name]) code.local_identifier)] - (` (.def: - (~+ (export.format (get@ #exported? mutual))) - (~ g!name) - (~ (get@ [#mutual #type] mutual)) - (.let [[(~+ user_names)] (~ g!context)] - (~ g!name)))))) - functions))))))) + (in (list& (` (.def: (~ g!context) + [(~+ (list\map (get@ [#mutual #type]) functions))] + (.let [(~ g!context) (: (Rec (~ g!context) + [(~+ context_types)]) + [(~+ definitions)]) + [(~+ user_names)] (~ g!context)] + [(~+ (list\map (function (_ g!name) + (` ((~ g!name) (~ g!context)))) + user_names))]))) + g!pop + (list\map (function (_ mutual) + (.let [g!name (|> mutual (get@ [#mutual #declaration #declaration.name]) code.local_identifier)] + (` (.def: + (~+ (export.format (get@ #exported? mutual))) + (~ g!name) + (~ (get@ [#mutual #type] mutual)) + (.let [[(~+ user_names)] (~ g!context)] + (~ g!name)))))) + functions))))))) diff --git a/stdlib/source/library/lux/control/io.lux b/stdlib/source/library/lux/control/io.lux index a4773cd0d..b3d5893bd 100644 --- a/stdlib/source/library/lux/control/io.lux +++ b/stdlib/source/library/lux/control/io.lux @@ -1,4 +1,5 @@ -(.module: {#.doc "A method for abstracting I/O and effectful computations to make it safe while writing pure functional code."} +(.module: + {#.doc "A method for abstracting I/O and effectful computations to make it safe while writing pure functional code."} [library [lux #* [abstract @@ -39,8 +40,8 @@ (log! msg) "Some value...")))} (with_gensyms [g!func g!arg] - (wrap (list (` ((~! ..label) (function ((~ g!func) (~ g!arg)) - (~ computation)))))))) + (in (list (` ((~! ..label) (function ((~ g!func) (~ g!arg)) + (~ computation)))))))) (def: #export run {#.doc "A way to execute IO computations and perform their side-effects."} @@ -66,7 +67,7 @@ (def: &functor ..functor) - (def: wrap (|>> !io)) + (def: in (|>> !io)) (def: join (|>> !run !run !io))) ) diff --git a/stdlib/source/library/lux/control/parser.lux b/stdlib/source/library/lux/control/parser.lux index d017e9dd4..f473208a9 100644 --- a/stdlib/source/library/lux/control/parser.lux +++ b/stdlib/source/library/lux/control/parser.lux @@ -56,7 +56,7 @@ (def: &functor ..functor) - (def: (wrap x) + (def: (in x) (function (_ input) (#try.Success [input x]))) @@ -157,7 +157,7 @@ {#.doc "Parse exactly N times."} (All [s a] (-> Nat (Parser s a) (Parser s (List a)))) (case amount - 0 (\ ..monad wrap (list)) + 0 (\ ..monad in (list)) _ (do {! ..monad} [x parser] (|> parser @@ -175,7 +175,7 @@ {#.doc "Parse at most N times."} (All [s a] (-> Nat (Parser s a) (Parser s (List a)))) (case amount - 0 (\ ..monad wrap (list)) + 0 (\ ..monad in (list)) _ (function (_ input) (case (parser input) (#try.Failure msg) @@ -194,7 +194,7 @@ (if (n.< to from) (\ ! map (list\compose minimum) (..at_most (n.- from to) parser)) - (wrap minimum)))) + (in minimum)))) (def: #export (separated_by separator parser) {#.doc "Parsers instances of 'parser' that are separated by instances of 'separator'."} @@ -203,7 +203,7 @@ [?x (..maybe parser)] (case ?x #.None - (wrap #.Nil) + (in #.Nil) (#.Some x) (|> parser @@ -269,14 +269,14 @@ (do ..monad [output subject _ param] - (wrap output))) + (in output))) (def: #export (only test parser) (All [s a] (-> (-> a Bit) (Parser s a) (Parser s a))) (do ..monad [output parser _ (..assert "Constraint failed." (test output))] - (wrap output))) + (in output))) (def: #export (parses? parser) (All [s a] (-> (Parser s a) (Parser s Bit))) diff --git a/stdlib/source/library/lux/control/parser/analysis.lux b/stdlib/source/library/lux/control/parser/analysis.lux index df8d140ab..2b585c31e 100644 --- a/stdlib/source/library/lux/control/parser/analysis.lux +++ b/stdlib/source/library/lux/control/parser/analysis.lux @@ -63,7 +63,7 @@ (#try.Success value) (#try.Success [unconsumed _]) - (exception.throw ..unconsumed_input unconsumed))) + (exception.except ..unconsumed_input unconsumed))) (def: #export any {#.doc (doc "Matches any value, without discrimination.")} @@ -71,7 +71,7 @@ (function (_ input) (case input #.Nil - (exception.throw ..cannot_parse input) + (exception.except ..cannot_parse input) (#.Cons [head tail]) (#try.Success [tail head])))) @@ -103,7 +103,7 @@ (#try.Success [input' x]) _ - (exception.throw ..cannot_parse input)))) + (exception.except ..cannot_parse input)))) (def: #export ( expected) {#.doc (doc (~~ (template.text ["Assert a specific " " value."])))} @@ -113,10 +113,10 @@ (^ (list& ( actual) input')) (if (\ = expected actual) (#try.Success [input' []]) - (exception.throw ..cannot_parse input)) + (exception.except ..cannot_parse input)) _ - (exception.throw ..cannot_parse input))))))] + (exception.except ..cannot_parse input))))))] [bit bit! /.bit Bit bit.equivalence] [nat nat! /.nat Nat nat.equivalence] @@ -140,4 +140,4 @@ (#try.Success [tail output])) _ - (exception.throw ..cannot_parse input)))) + (exception.except ..cannot_parse input)))) diff --git a/stdlib/source/library/lux/control/parser/binary.lux b/stdlib/source/library/lux/control/parser/binary.lux index f7a2cb94a..6543cb954 100644 --- a/stdlib/source/library/lux/control/parser/binary.lux +++ b/stdlib/source/library/lux/control/parser/binary.lux @@ -50,7 +50,7 @@ (let [length (/.size input)] (if (n.= end length) (#try.Success output) - (exception.throw ..binary_was_not_fully_read [length end]))))) + (exception.except ..binary_was_not_fully_read [length end]))))) (def: #export end? {#.doc (doc "Checks whether there is no more data to read.")} @@ -121,7 +121,7 @@ (^template [ ] [ (\ ! map (|>> ) )]) ((~~ (template.spliced +))) - _ (//.lift (exception.throw ..invalid_tag [(~~ (template.amount +)) flag])))))) + _ (//.lift (exception.except ..invalid_tag [(~~ (template.amount +)) flag])))))) (def: #export (or left right) (All [l r] (-> (Parser l) (Parser r) (Parser (| l r)))) @@ -138,7 +138,7 @@ (def: #export any {#.doc (doc "Does no parsing, and just returns a dummy value.")} (Parser Any) - (//\wrap [])) + (//\in [])) (exception: #export (not_a_bit {value Nat}) (exception.report @@ -151,9 +151,9 @@ [value (: (Parser Nat) ..bits/8)] (case value - 0 (wrap #0) - 1 (wrap #1) - _ (//.lift (exception.throw ..not_a_bit [value]))))) + 0 (in #0) + 1 (in #1) + _ (//.lift (exception.except ..not_a_bit [value]))))) (def: #export (segment size) {#.doc (doc "Parses a chunk of data of a given size.")} @@ -214,7 +214,7 @@ [value valueP] (recur (.inc index) (row.add value output))) - (//\wrap output)))))] + (//\in output)))))] [08 row/8 ..bits/8] [16 row/16 ..bits/16] @@ -243,7 +243,7 @@ _ (//.assert (exception.construct ..set_elements_are_not_unique []) (n.= (list.size raw) (set.size output)))] - (wrap output))) + (in output))) (def: #export name (Parser Name) diff --git a/stdlib/source/library/lux/control/parser/cli.lux b/stdlib/source/library/lux/control/parser/cli.lux index 5a66208b4..e8796ff1b 100644 --- a/stdlib/source/library/lux/control/parser/cli.lux +++ b/stdlib/source/library/lux/control/parser/cli.lux @@ -47,7 +47,7 @@ (do try.monad [[remaining raw] (any inputs) output (parser raw)] - (wrap [remaining output])))) + (in [remaining output])))) (def: #export (this reference) {#.doc "Checks that a token is in the inputs."} @@ -56,7 +56,7 @@ (do try.monad [[remaining raw] (any inputs)] (if (text\= reference raw) - (wrap [remaining []]) + (in [remaining []]) (#try.Failure (format "Missing token: '" reference "'")))))) (def: #export (somewhere cli) @@ -76,8 +76,8 @@ (#.Cons to_omit immediate') (do try.monad [[remaining output] (recur immediate')] - (wrap [(#.Cons to_omit remaining) - output]))))))) + (in [(#.Cons to_omit remaining) + output]))))))) (def: #export end {#.doc "Ensures there are no more inputs."} diff --git a/stdlib/source/library/lux/control/parser/code.lux b/stdlib/source/library/lux/control/parser/code.lux index bb37c1faf..6f52b23d9 100644 --- a/stdlib/source/library/lux/control/parser/code.lux +++ b/stdlib/source/library/lux/control/parser/code.lux @@ -28,16 +28,16 @@ (#.Cons [[x y] pairs']) (list& x y (join_pairs pairs')))) (type: #export Parser - {#.doc "A Lux syntax parser."} + {#.doc "A Lux code parser."} (//.Parser (List Code))) -(def: (remaining_inputs asts) +(def: (remaining_inputs codes) (-> (List Code) Text) ($_ text\compose text.new_line "Remaining input: " - (|> asts (list\map code.format) (list.interpose " ") (text.join_with "")))) + (|> codes (list\map code.format) (list.interpose " ") (text.join_with "")))) (def: #export any - {#.doc "Just returns the next input without applying any logic."} + {#.doc "Yields the next input without applying any logic."} (Parser Code) (function (_ tokens) (case tokens @@ -61,6 +61,7 @@ ))) (def: #export ( expected) + {#.doc (code.text ($_ text\compose "Checks for a specific " " input."))} (-> (Parser Any)) (function (_ tokens) (case tokens @@ -82,15 +83,15 @@ [tag tag! Name #.Tag name.equivalence "tag"] ) -(def: #export (this! ast) +(def: #export (this! code) {#.doc "Ensures the given Code is the next input."} (-> Code (Parser Any)) (function (_ tokens) (case tokens (#.Cons [token tokens']) - (if (code\= ast token) + (if (code\= code token) (#try.Success [tokens' []]) - (#try.Failure ($_ text\compose "Expected a " (code.format ast) " but instead got " (code.format token) + (#try.Failure ($_ text\compose "Expected a " (code.format code) " but instead got " (code.format token) (remaining_inputs tokens)))) _ @@ -110,6 +111,7 @@ ))) (def: #export ( expected) + {#.doc (code.text ($_ text\compose "Checks for a specific local " " (a " " that has no module prefix)."))} (-> Text (Parser Any)) (function (_ tokens) (case tokens @@ -127,7 +129,7 @@ (template [ ] [(def: #export ( p) - {#.doc (code.text ($_ text\compose "Parse inside the contents of a " " as if they were the input Codes."))} + {#.doc (code.text ($_ text\compose "Parses the contents of a " "."))} (All [a] (-> (Parser a) (Parser a))) (function (_ tokens) @@ -145,7 +147,7 @@ ) (def: #export (record p) - {#.doc (code.text ($_ text\compose "Parse inside the contents of a record as if they were the input Codes."))} + {#.doc "Parses the contents of a record."} (All [a] (-> (Parser a) (Parser a))) (function (_ tokens) @@ -159,7 +161,7 @@ (#try.Failure ($_ text\compose "Cannot parse record" (remaining_inputs tokens)))))) (def: #export end! - {#.doc "Ensures there are no more inputs."} + {#.doc "Verifies there are no more inputs."} (Parser Any) (function (_ tokens) (case tokens @@ -174,9 +176,10 @@ #.Nil true _ false)]))) -(def: #export (run syntax inputs) +(def: #export (run parser inputs) + {#.doc (doc "Executes a parser against a stream of code, and verifies all the inputs are consumed.")} (All [a] (-> (Parser a) (List Code) (Try a))) - (case (syntax inputs) + (case (parser inputs) (#try.Failure error) (#try.Failure error) @@ -190,10 +193,10 @@ (|> (list\map code.format unconsumed) (text.join_with ", "))))))) -(def: #export (local inputs syntax) - {#.doc "Run a syntax parser with the given list of inputs, instead of the real ones."} +(def: #export (local inputs parser) + {#.doc "Runs parser against the given list of inputs."} (All [a] (-> (List Code) (Parser a) (Parser a))) (function (_ real) (do try.monad - [value (..run syntax inputs)] - (wrap [real value])))) + [value (..run parser inputs)] + (in [real value])))) diff --git a/stdlib/source/library/lux/control/parser/environment.lux b/stdlib/source/library/lux/control/parser/environment.lux index c0ced37c2..ea3370c0a 100644 --- a/stdlib/source/library/lux/control/parser/environment.lux +++ b/stdlib/source/library/lux/control/parser/environment.lux @@ -13,32 +13,38 @@ ["." //]) (type: #export Property + {#.doc (doc "A property in the environment.")} Text) (type: #export Environment + {#.doc (doc "An abstraction for environment variables of a program.")} (Dictionary Property Text)) -(exception: #export (unknown {property Property}) +(exception: #export (unknown_property {property Property}) (exception.report ["Property" (%.text property)])) (type: #export (Parser a) + {#.doc (doc "A parser of environment variables of a program.")} (//.Parser Environment a)) (def: #export empty + {#.doc (doc "An empty environment.")} Environment (dictionary.new text.hash)) (def: #export (property name) - (-> Text (Parser Text)) + (-> Property (Parser Text)) (function (_ environment) (case (dictionary.get name environment) (#.Some value) (exception.return [environment value]) #.None - (exception.throw ..unknown name)))) + (exception.except ..unknown_property [name])))) (def: #export (run parser environment) + {#.doc (doc "Executes a parser against the given environment variables." + "Does not check whether all environment variables were parsed, since they're usually an open set.")} (All [a] (-> (Parser a) Environment (Try a))) (\ try.monad map product.right (parser environment))) diff --git a/stdlib/source/library/lux/control/parser/json.lux b/stdlib/source/library/lux/control/parser/json.lux index 2e9935480..cc20f6512 100644 --- a/stdlib/source/library/lux/control/parser/json.lux +++ b/stdlib/source/library/lux/control/parser/json.lux @@ -23,7 +23,7 @@ ["." // ("#\." functor)]) (type: #export (Parser a) - {#.doc "JSON parser."} + {#.doc "A JSON parser."} (//.Parser (List JSON) a)) (exception: #export (unconsumed_input {input (List JSON)}) @@ -33,6 +33,8 @@ (exception: #export empty_input) (def: #export (run parser json) + {#.doc (doc "Executes the parser against a JSON object." + "Verifies that all of the JSON was consumed by the parser.")} (All [a] (-> (Parser a) JSON (Try a))) (case (//.run parser (list json)) (#try.Success [remainder output]) @@ -41,7 +43,7 @@ (#try.Success output) _ - (exception.throw ..unconsumed_input remainder)) + (exception.except ..unconsumed_input remainder)) (#try.Failure error) (#try.Failure error))) @@ -52,7 +54,7 @@ (<| (function (_ inputs)) (case inputs #.Nil - (exception.throw ..empty_input []) + (exception.except ..empty_input []) (#.Cons head tail) (#try.Success [tail head])))) @@ -69,7 +71,7 @@ [head ..any] (case head ( value) - (wrap value) + (in value) _ (//.failure (exception.construct ..unexpected_value [head])))))] @@ -93,7 +95,7 @@ [head ..any] (case head ( value) - (wrap (\ = test value)) + (in (\ = test value)) _ (//.failure (exception.construct ..unexpected_value [head]))))) @@ -106,7 +108,7 @@ (case head ( value) (if (\ = test value) - (wrap []) + (in []) (//.failure (exception.construct ..value_mismatch [( test) ( value)]))) _ @@ -118,12 +120,13 @@ ) (def: #export (nullable parser) + {#.doc (doc "Enhances parser by adding NULL-handling.")} (All [a] (-> (Parser a) (Parser (Maybe a)))) (//.or ..null parser)) (def: #export (array parser) - {#.doc "Parses a JSON array."} + {#.doc "Parses the contents of a JSON array."} (All [a] (-> (Parser a) (Parser a))) (do //.monad [head ..any] @@ -136,7 +139,7 @@ (#try.Success [remainder output]) (case remainder #.Nil - (wrap output) + (in output) _ (//.failure (exception.construct ..unconsumed_input remainder)))) @@ -145,7 +148,8 @@ (//.failure (exception.construct ..unexpected_value [head]))))) (def: #export (object parser) - {#.doc "Parses a JSON object. Use this with the 'field' combinator."} + {#.doc (doc "Parses the contents of a JSON object." + "Use this with the 'field' combinator.")} (All [a] (-> (Parser a) (Parser a))) (do //.monad [head ..any] @@ -163,7 +167,7 @@ (#try.Success [remainder output]) (case remainder #.Nil - (wrap output) + (in output) _ (//.failure (exception.construct ..unconsumed_input remainder)))) @@ -172,7 +176,8 @@ (//.failure (exception.construct ..unexpected_value [head]))))) (def: #export (field field_name parser) - {#.doc "Parses a field inside a JSON object. Use this inside the 'object' combinator."} + {#.doc (doc "Parses a field inside a JSON object." + "Use this inside the 'object' combinator.")} (All [a] (-> Text (Parser a) (Parser a))) (function (recur inputs) (case inputs @@ -183,20 +188,20 @@ (#try.Success [inputs' output]) (#try.Success [inputs'' _]) - (exception.throw ..unconsumed_input inputs'') + (exception.except ..unconsumed_input inputs'') (#try.Failure error) (#try.Failure error)) (do try.monad [[inputs'' output] (recur inputs')] - (wrap [(list& (#/.String key) value inputs'') - output]))) + (in [(list& (#/.String key) value inputs'') + output]))) #.Nil - (exception.throw ..empty_input []) + (exception.except ..empty_input []) _ - (exception.throw ..unconsumed_input inputs)))) + (exception.except ..unconsumed_input inputs)))) (def: #export dictionary {#.doc "Parses a dictionary-like JSON object."} diff --git a/stdlib/source/library/lux/control/parser/synthesis.lux b/stdlib/source/library/lux/control/parser/synthesis.lux index 9c8f76143..3496fde42 100644 --- a/stdlib/source/library/lux/control/parser/synthesis.lux +++ b/stdlib/source/library/lux/control/parser/synthesis.lux @@ -11,6 +11,8 @@ ["." name] ["." text ["%" format (#+ format)]]] + [macro + ["." template]] [math [number ["n" nat] @@ -27,20 +29,15 @@ ["/" synthesis (#+ Synthesis Abstraction)]]]]]]] ["." //]) -## TODO: Use "type:" ASAP. -(def: Input - Type - (type (List Synthesis))) - -(exception: #export (cannot_parse {input ..Input}) +(exception: #export (cannot_parse {input (List Synthesis)}) (exception.report ["Input" (exception.enumerate /.%synthesis input)])) -(exception: #export (unconsumed_input {input ..Input}) +(exception: #export (unconsumed_input {input (List Synthesis)}) (exception.report ["Input" (exception.enumerate /.%synthesis input)])) -(exception: #export (expected_empty_input {input ..Input}) +(exception: #export (expected_empty_input {input (List Synthesis)}) (exception.report ["Input" (exception.enumerate /.%synthesis input)])) @@ -52,10 +49,13 @@ (exception: #export empty_input) (type: #export Parser - (//.Parser ..Input)) + {#.doc (doc "A parser for the Lux compiler's synthesis nodes using during optimization.")} + (//.Parser (List Synthesis))) (def: #export (run parser input) - (All [a] (-> (Parser a) ..Input (Try a))) + {#.doc (doc "Executes the parser against the inputs." + "Ensures all inputs are consumed by the parser.")} + (All [a] (-> (Parser a) (List Synthesis) (Try a))) (case (parser input) (#try.Failure error) (#try.Failure error) @@ -64,14 +64,15 @@ (#try.Success value) (#try.Success [unconsumed _]) - (exception.throw ..unconsumed_input unconsumed))) + (exception.except ..unconsumed_input unconsumed))) (def: #export any + {#.doc (doc "Yields a synthesis node without subjecting it to any analysis.")} (Parser Synthesis) (.function (_ input) (case input #.Nil - (exception.throw ..empty_input []) + (exception.except ..empty_input []) (#.Cons [head tail]) (#try.Success [tail head])))) @@ -82,7 +83,7 @@ (.function (_ tokens) (case tokens #.Nil (#try.Success [tokens []]) - _ (exception.throw ..expected_empty_input [tokens])))) + _ (exception.except ..expected_empty_input [tokens])))) (def: #export end? {#.doc "Checks whether there are no more inputs."} @@ -93,27 +94,29 @@ _ false)]))) (template [ ] - [(def: #export - (Parser ) - (.function (_ input) - (case input - (^ (list& ( x) input')) - (#try.Success [input' x]) - - _ - (exception.throw ..cannot_parse input)))) - - (def: #export ( expected) - (-> (Parser Any)) - (.function (_ input) - (case input - (^ (list& ( actual) input')) - (if (\ = expected actual) - (#try.Success [input' []]) - (exception.throw ..cannot_parse input)) - - _ - (exception.throw ..cannot_parse input))))] + [(`` (def: #export + {#.doc (doc (~~ (template.text ["Queries for a " " synthesis node."])))} + (Parser ) + (.function (_ input) + (case input + (^ (list& ( x) input')) + (#try.Success [input' x]) + + _ + (exception.except ..cannot_parse input))))) + + (`` (def: #export ( expected) + {#.doc (doc (~~ (template.text ["Checks for a specific " " synthesis node."])))} + (-> (Parser Any)) + (.function (_ input) + (case input + (^ (list& ( actual) input')) + (if (\ = expected actual) + (#try.Success [input' []]) + (exception.except ..cannot_parse input)) + + _ + (exception.except ..cannot_parse input)))))] [bit bit! /.bit Bit bit.equivalence] [i64 i64! /.i64 (I64 Any) i64.equivalence] @@ -125,6 +128,7 @@ ) (def: #export (tuple parser) + {#.doc (doc "Parses the contents of a tuple.")} (All [a] (-> (Parser a) (Parser a))) (.function (_ input) (case input @@ -134,9 +138,10 @@ (#try.Success [tail output])) _ - (exception.throw ..cannot_parse input)))) + (exception.except ..cannot_parse input)))) (def: #export (function expected parser) + {#.doc (doc "Parses the body of a function with the 'expected' arity.")} (All [a] (-> Arity (Parser a) (Parser [(Environment Synthesis) a]))) (.function (_ input) (case input @@ -145,12 +150,13 @@ (do try.monad [output (..run parser (list body))] (#try.Success [tail [environment output]])) - (exception.throw ..wrong_arity [expected actual])) + (exception.except ..wrong_arity [expected actual])) _ - (exception.throw ..cannot_parse input)))) + (exception.except ..cannot_parse input)))) (def: #export (loop init_parsers iteration_parser) + {#.doc (doc "Parses the initial values and the body of a loop.")} (All [a b] (-> (Parser a) (Parser b) (Parser [Register a b]))) (.function (_ input) (case input @@ -161,4 +167,4 @@ (#try.Success [tail [start inits iteration]])) _ - (exception.throw ..cannot_parse input)))) + (exception.except ..cannot_parse input)))) diff --git a/stdlib/source/library/lux/control/parser/text.lux b/stdlib/source/library/lux/control/parser/text.lux index 6d4998419..aa4858f66 100644 --- a/stdlib/source/library/lux/control/parser/text.lux +++ b/stdlib/source/library/lux/control/parser/text.lux @@ -13,24 +13,31 @@ [collection ["." list ("#\." fold)]]] [macro - ["." code]] + ["." code] + ["." template]] [math [number ["n" nat ("#\." decimal)]]]]] ["." //]) -(type: #export Offset Nat) +(type: #export Offset + {#.doc (doc "An offset into a block of text.")} + Nat) -(def: start_offset Offset 0) +(def: start_offset + Offset + 0) (type: #export Parser + {#.doc (doc "A parser for text.")} (//.Parser [Offset Text])) (type: #export Slice + {#.doc (doc "A slice of a block of text.")} {#basis Offset #distance Offset}) -(def: (remaining offset tape) +(def: (remaining' offset tape) (-> Offset Text Text) (|> tape (/.split offset) maybe.assume product.right)) @@ -38,17 +45,19 @@ (exception.report ["Offset" (n\encode offset)] ["Input size" (n\encode (/.size tape))] - ["Remaining input" (remaining offset tape)])) + ["Remaining input" (remaining' offset tape)])) (exception: #export (expected_to_fail {offset Offset} {tape Text}) (exception.report ["Offset" (n\encode offset)] - ["Input" (remaining offset tape)])) + ["Input" (remaining' offset tape)])) (exception: #export cannot_parse) (exception: #export cannot_slice) (def: #export (run parser input) + {#.doc (doc "Executes a parser against a block of text." + "Verifies that the entire input has been processed.")} (All [a] (-> (Parser a) Text (Try a))) (case (parser [start_offset input]) (#try.Failure msg) @@ -57,9 +66,10 @@ (#try.Success [[end_offset _] output]) (if (n.= end_offset (/.size input)) (#try.Success output) - (exception.throw ..unconsumed_input [end_offset input])))) + (exception.except ..unconsumed_input [end_offset input])))) (def: #export offset + {#.doc (doc "Yields the current offset into the input.")} (Parser Offset) (function (_ (^@ input [offset tape])) (#try.Success [input offset]))) @@ -69,15 +79,15 @@ (do //.monad [offset ..offset slices parser] - (wrap (list\fold (function (_ [slice::basis slice::distance] - [total::basis total::distance]) - [total::basis ("lux i64 +" slice::distance total::distance)]) - {#basis offset - #distance 0} - slices)))) + (in (list\fold (function (_ [slice::basis slice::distance] + [total::basis total::distance]) + [total::basis ("lux i64 +" slice::distance total::distance)]) + {#basis offset + #distance 0} + slices)))) (def: #export any - {#.doc "Just returns the next character without applying any logic."} + {#.doc "Yields the next character without applying any logic."} (Parser Text) (function (_ [offset tape]) (case (/.nth offset tape) @@ -85,10 +95,10 @@ (#try.Success [[("lux i64 +" 1 offset) tape] (/.of_code output)]) _ - (exception.throw ..cannot_parse [])))) + (exception.except ..cannot_parse [])))) (def: #export any! - {#.doc "Just returns the next character without applying any logic."} + {#.doc "Yields the next character (as a slice) without applying any logic."} (Parser Slice) (function (_ [offset tape]) (case (/.nth offset tape) @@ -98,22 +108,22 @@ #distance 1}]) _ - (exception.throw ..cannot_slice [])))) - -(template [ ] - [(def: #export ( p) - {#.doc "Produce a character if the parser fails."} - (All [a] (-> (Parser a) (Parser ))) - (function (_ input) - (case (p input) - (#try.Failure msg) - ( input) - - _ - (exception.throw ..expected_to_fail input))))] - - [not Text ..any] - [not! Slice ..any!] + (exception.except ..cannot_slice [])))) + +(template [ ] + [(`` (def: #export ( parser) + {#.doc (doc (~~ (template.text ["Produce a character" " if the parser fails."])))} + (All [a] (-> (Parser a) (Parser ))) + (function (_ input) + (case (parser input) + (#try.Failure msg) + ( input) + + _ + (exception.except ..expected_to_fail input)))))] + + [not Text ..any ""] + [not! Slice ..any! " (as a slice)"] ) (exception: #export (cannot_match {reference Text}) @@ -121,7 +131,7 @@ ["Reference" (/.format reference)])) (def: #export (this reference) - {#.doc "Lex a text if it matches the given sample."} + {#.doc (doc "Checks that a specific text shows up in the input.")} (-> Text (Parser Any)) (function (_ [offset tape]) (case (/.index_of' reference offset tape) @@ -129,10 +139,10 @@ (if (n.= offset where) (#try.Success [[("lux i64 +" (/.size reference) offset) tape] []]) - (exception.throw ..cannot_match [reference])) + (exception.except ..cannot_match [reference])) _ - (exception.throw ..cannot_match [reference])))) + (exception.except ..cannot_match [reference])))) (def: #export end! {#.doc "Ensure the parser's input is empty."} @@ -140,10 +150,10 @@ (function (_ (^@ input [offset tape])) (if (n.= offset (/.size tape)) (#try.Success [input []]) - (exception.throw ..unconsumed_input input)))) + (exception.except ..unconsumed_input input)))) (def: #export peek - {#.doc "Lex the next character (without consuming it from the input)."} + {#.doc "Yields the next character (without consuming it from the input)."} (Parser Text) (function (_ (^@ input [offset tape])) (case (/.nth offset tape) @@ -151,16 +161,16 @@ (#try.Success [input (/.of_code output)]) _ - (exception.throw ..cannot_parse [])))) + (exception.except ..cannot_parse [])))) -(def: #export get_input +(def: #export remaining {#.doc "Get all of the remaining input (without consuming it)."} (Parser Text) (function (_ (^@ input [offset tape])) - (#try.Success [input (remaining offset tape)]))) + (#try.Success [input (remaining' offset tape)]))) (def: #export (range bottom top) - {#.doc "Only lex characters within a range."} + {#.doc "Only yields characters within a range."} (-> Nat Nat (Parser Text)) (do //.monad [char any @@ -168,11 +178,11 @@ _ (//.assert ($_ /\compose "Character is not within range: " (/.of_code bottom) "-" (/.of_code top)) (.and (n.>= bottom char') (n.<= top char')))] - (wrap char))) + (in char))) (template [ ] [(def: #export - {#.doc (code.text ($_ /\compose "Only lex " " characters."))} + {#.doc (code.text ($_ /\compose "Only yields " " characters."))} (Parser Text) (..range (char ) (char )))] @@ -183,17 +193,17 @@ ) (def: #export alpha - {#.doc "Only lex alphabetic characters."} + {#.doc "Yields alphabetic characters."} (Parser Text) (//.either lower upper)) (def: #export alpha_num - {#.doc "Only lex alphanumeric characters."} + {#.doc "Yields alphanumeric characters."} (Parser Text) (//.either alpha decimal)) (def: #export hexadecimal - {#.doc "Only lex hexadecimal digits."} + {#.doc "Yields hexadecimal digits."} (Parser Text) ($_ //.either decimal @@ -212,7 +222,7 @@ (template [ ] [(def: #export ( options) - {#.doc (code.text ($_ /\compose "Only lex characters that are" " part of a piece of text."))} + {#.doc (code.text ($_ /\compose "Yields characters that are" " part of a piece of text."))} (-> Text (Parser Text)) (function (_ [offset tape]) (case (/.nth offset tape) @@ -220,10 +230,10 @@ (let [output' (/.of_code output)] (if ( (/.contains? output' options)) (#try.Success [[("lux i64 +" 1 offset) tape] output']) - (exception.throw [options output]))) + (exception.except [options output]))) _ - (exception.throw ..cannot_parse []))))] + (exception.except ..cannot_parse []))))] [one_of |> ..character_should_be ""] [none_of .not ..character_should_not_be " not"] @@ -231,7 +241,7 @@ (template [ ] [(def: #export ( options) - {#.doc (code.text ($_ /\compose "Only lex characters that are" " part of a piece of text."))} + {#.doc (code.text ($_ /\compose "Yields characters (as a slice) that are" " part of a piece of text."))} (-> Text (Parser Slice)) (function (_ [offset tape]) (case (/.nth offset tape) @@ -241,10 +251,10 @@ (#try.Success [[("lux i64 +" 1 offset) tape] {#basis offset #distance 1}]) - (exception.throw [options output]))) + (exception.except [options output]))) _ - (exception.throw ..cannot_slice []))))] + (exception.except ..cannot_slice []))))] [one_of! |> ..character_should_be ""] [none_of! .not ..character_should_not_be " not"] @@ -254,41 +264,43 @@ (exception.report ["Character" (/.format (/.of_code character))])) -(def: #export (satisfies p) - {#.doc "Only lex characters that satisfy a predicate."} +(def: #export (satisfies parser) + {#.doc "Yields characters that satisfy a predicate."} (-> (-> Char Bit) (Parser Text)) (function (_ [offset tape]) (case (/.nth offset tape) (#.Some output) - (if (p output) + (if (parser output) (#try.Success [[("lux i64 +" 1 offset) tape] (/.of_code output)]) - (exception.throw ..character_does_not_satisfy_predicate [output])) + (exception.except ..character_does_not_satisfy_predicate [output])) _ - (exception.throw ..cannot_parse [])))) + (exception.except ..cannot_parse [])))) (def: #export space - {#.doc "Only lex white-space."} + {#.doc "Yields white-space."} (Parser Text) (..satisfies /.space?)) (def: #export (and left right) + {#.doc (doc "Yields the outputs of both parsers composed together.")} (-> (Parser Text) (Parser Text) (Parser Text)) (do //.monad [=left left =right right] - (wrap ($_ /\compose =left =right)))) + (in ($_ /\compose =left =right)))) (def: #export (and! left right) + {#.doc (doc "Yields the outputs of both parsers composed together (as a slice).")} (-> (Parser Slice) (Parser Slice) (Parser Slice)) (do //.monad [[left::basis left::distance] left [right::basis right::distance] right] - (wrap [left::basis ("lux i64 +" left::distance right::distance)]))) + (in [left::basis ("lux i64 +" left::distance right::distance)]))) (template [ ] [(def: #export ( parser) - {#.doc (code.text ($_ /\compose "Lex " " characters as a single continuous text."))} + {#.doc (code.text ($_ /\compose "Yields " " characters as a single continuous text (as a slice)."))} (-> (Parser Text) (Parser Text)) (|> parser (\ //.monad map /.concat)))] @@ -298,7 +310,7 @@ (template [ ] [(def: #export ( parser) - {#.doc (code.text ($_ /\compose "Lex " " characters as a single continuous text."))} + {#.doc (code.text ($_ /\compose "Yields " " characters as a single continuous text (as a slice)."))} (-> (Parser Slice) (Parser Slice)) (with_slices ( parser)))] @@ -308,7 +320,7 @@ (template [ ] [(def: #export ( amount parser) - {#.doc (code.text ($_ /\compose "Lex " " N characters."))} + {#.doc (code.text ($_ /\compose "Yields " " N characters (as a slice)."))} (-> Nat (Parser Text) (Parser Text)) (|> parser ( amount) (\ //.monad map /.concat)))] @@ -319,7 +331,7 @@ (template [ ] [(def: #export ( amount parser) - {#.doc (code.text ($_ /\compose "Lex " " N characters."))} + {#.doc (code.text ($_ /\compose "Yields " " N characters (as a slice)."))} (-> Nat (Parser Slice) (Parser Slice)) (with_slices ( amount parser)))] @@ -329,12 +341,12 @@ ) (def: #export (between from to parser) - {#.doc "Lex between N and M characters."} + {#.doc "Yields between N and M characters."} (-> Nat Nat (Parser Text) (Parser Text)) (|> parser (//.between from to) (\ //.monad map /.concat))) (def: #export (between! from to parser) - {#.doc "Lex between N and M characters."} + {#.doc "Yields between N and M characters (as a slice)."} (-> Nat Nat (Parser Slice) (Parser Slice)) (with_slices (//.between from to parser))) @@ -345,7 +357,7 @@ (//.after (this start)))) (def: #export (local local_input parser) - {#.doc "Run a parser with the given input, instead of the real one."} + {#.doc "Applies a parser against the given input."} (All [a] (-> Text (Parser a) (Parser a))) (function (_ real_input) (case (..run parser local_input) @@ -356,6 +368,7 @@ (#try.Success [real_input value])))) (def: #export (slice parser) + {#.doc (doc "Converts a slice to a block of text.")} (-> (Parser Slice) (Parser Text)) (do //.monad [[basis distance] parser] @@ -365,9 +378,10 @@ (#try.Success [input output]) #.None - (exception.throw ..cannot_slice []))))) + (exception.except ..cannot_slice []))))) -(def: #export (embed structured text) +(def: #export (then structured text) + {#.doc (doc "Embeds a text parser into an arbitrary parser that yields text.")} (All [s a] (-> (Parser a) (//.Parser s Text) diff --git a/stdlib/source/library/lux/control/parser/tree.lux b/stdlib/source/library/lux/control/parser/tree.lux index 6f2080628..11673474c 100644 --- a/stdlib/source/library/lux/control/parser/tree.lux +++ b/stdlib/source/library/lux/control/parser/tree.lux @@ -13,48 +13,63 @@ ["." //]) (type: #export (Parser t a) + {#.doc (doc "A parser of arbitrary trees.")} (//.Parser (Zipper t) a)) (def: #export (run' parser zipper) + {#.doc (doc "Applies the parser against a tree zipper.")} (All [t a] (-> (Parser t a) (Zipper t) (Try a))) (do try.monad [[zipper output] (//.run parser zipper)] - (wrap output))) + (in output))) (def: #export (run parser tree) + {#.doc (doc "Applies the parser against a tree.")} (All [t a] (-> (Parser t a) (Tree t) (Try a))) (run' parser (zipper.zip tree))) (def: #export value + {#.doc (doc "Yields the value inside the current tree node.")} (All [t] (Parser t t)) (function (_ zipper) (#try.Success [zipper (zipper.value zipper)]))) (exception: #export cannot_move_further) -(template [ ] +(template [ ] [(def: #export + {#.doc (doc )} (All [t] (Parser t [])) (function (_ zipper) (case ( zipper) #.None - (exception.throw ..cannot_move_further []) + (exception.except ..cannot_move_further []) (#.Some next) (#try.Success [next []]))))] - [down zipper.down] - [up zipper.up] + [down zipper.down + "Move down."] + [up zipper.up + "Move up."] - [right zipper.right] - [rightmost zipper.rightmost] + [right zipper.right + "Move to the right."] + [rightmost zipper.rightmost + "Move to the rightmost node."] - [left zipper.left] - [leftmost zipper.leftmost] + [left zipper.left + "Move to the left."] + [leftmost zipper.leftmost + "Move to the leftmost node."] - [next zipper.next] - [end zipper.end] + [next zipper.next + "Move to the next node."] + [end zipper.end + "Move to the last node."] - [previous zipper.previous] - [start zipper.start] + [previous zipper.previous + "Move to the previous node."] + [start zipper.start + "Move to the root node."] ) diff --git a/stdlib/source/library/lux/control/parser/type.lux b/stdlib/source/library/lux/control/parser/type.lux index d76254fe8..d8177a553 100644 --- a/stdlib/source/library/lux/control/parser/type.lux +++ b/stdlib/source/library/lux/control/parser/type.lux @@ -1,4 +1,6 @@ (.module: + {#.doc (.doc "Parsing of Lux types." + "Used mostly for polytypic programming.")} [library [lux (#- function) [abstract @@ -14,7 +16,8 @@ ["." list ("#\." functor)] ["." dictionary (#+ Dictionary)]]] [macro - ["." code]] + ["." code] + ["." template]] [math [number ["n" nat ("#\." decimal)]]] @@ -58,12 +61,15 @@ (text.join_with ""))])) (type: #export Env + {#.doc (doc "An environment for type parsing.")} (Dictionary Nat [Type Code])) (type: #export (Parser a) + {#.doc (doc "A parser of Lux types.")} (//.Parser [Env (List Type)] a)) (def: #export fresh + {#.doc (doc "An empty parsing environment.")} Env (dictionary.new n.hash)) @@ -79,13 +85,16 @@ (#try.Success output) _ - (exception.throw ..unconsumed_input remaining)))) + (exception.except ..unconsumed_input remaining)))) (def: #export (run poly type) + {#.doc (doc "Applies a parser against a type." + "Verifies that the parser fully consumes the type's information.")} (All [a] (-> (Parser a) Type (Try a))) (run' ..fresh poly (list type))) (def: #export env + {#.doc (doc "Yields the current parsing environment.")} (Parser Env) (.function (_ [env inputs]) (#try.Success [[env inputs] env]))) @@ -101,26 +110,29 @@ (#try.Success [[env remaining] output])))) (def: #export peek + {#.doc (doc "Inspect a type in the input stream without consuming it.")} (Parser Type) (.function (_ [env inputs]) (case inputs #.Nil - (exception.throw ..empty_input []) + (exception.except ..empty_input []) (#.Cons headT tail) (#try.Success [[env inputs] headT])))) (def: #export any + {#.doc (doc "Yields a type, without examination.")} (Parser Type) (.function (_ [env inputs]) (case inputs #.Nil - (exception.throw ..empty_input []) + (exception.except ..empty_input []) (#.Cons headT tail) (#try.Success [[env tail] headT])))) (def: #export (local types poly) + {#.doc (doc "Apply a parser to the given inputs.")} (All [a] (-> (List Type) (Parser a) (Parser a))) (.function (_ [env pass_through]) (case (run' env poly types) @@ -149,14 +161,15 @@ (#try.Success [[env inputs'] [g!var output]]))))) (template [ ] - [(def: #export ( poly) - (All [a] (-> (Parser a) (Parser a))) - (do //.monad - [headT ..any] - (let [members ( (type.anonymous headT))] - (if (n.> 1 (list.size members)) - (local members poly) - (//.failure (exception.construct headT))))))] + [(`` (def: #export ( poly) + {#.doc (doc (~~ (template.text ["Parses the contents of a " " type."])))} + (All [a] (-> (Parser a) (Parser a))) + (do //.monad + [headT ..any] + (let [members ( (type.anonymous headT))] + (if (n.> 1 (list.size members)) + (local members poly) + (//.failure (exception.construct headT)))))))] [variant type.flat_variant #.Sum ..not_variant] [tuple type.flat_tuple #.Product ..not_tuple] @@ -169,7 +182,7 @@ #let [[num_arg bodyT] (type.flat_univ_q (type.anonymous headT))]] (if (n.= 0 num_arg) (//.failure (exception.construct ..not_polymorphic headT)) - (wrap [num_arg bodyT])))) + (in [num_arg bodyT])))) (def: #export (polymorphic poly) (All [a] (-> (Parser a) (Parser [Code (List Code) a]))) @@ -206,9 +219,10 @@ (local (list non_poly)) (do ! [output poly] - (wrap [funcL all_varsL output]))))) + (in [funcL all_varsL output]))))) (def: #export (function in_poly out_poly) + {#.doc (doc "Parses a function's inputs and output.")} (All [i o] (-> (Parser i) (Parser o) (Parser [i o]))) (do //.monad [headT any @@ -219,6 +233,7 @@ (//.failure (exception.construct ..not_function headT))))) (def: #export (applied poly) + {#.doc (doc "Parses a type application.")} (All [a] (-> (Parser a) (Parser a))) (do //.monad [headT any @@ -227,18 +242,22 @@ (//.failure (exception.construct ..not_application headT)) (..local (#.Cons funcT paramsT) poly)))) -(template [ ] +(template [ ] [(def: #export ( expected) + {#.doc (doc )} (-> Type (Parser Any)) (do //.monad [actual any] (if ( expected actual) - (wrap []) + (in []) (//.failure (exception.construct ..types_do_not_match [expected actual])))))] - [exactly type\=] - [sub check.checks?] - [super (function.flip check.checks?)] + [exactly type\= + "Parses a type exactly."] + [sub check.checks? + "Parses a sub type."] + [super (function.flip check.checks?) + "Parses a super type."] ) (def: #export (adjusted_idx env idx) @@ -257,7 +276,7 @@ (#.Parameter idx) (case (dictionary.get (adjusted_idx env idx) env) (#.Some [poly_type poly_code]) - (wrap poly_code) + (in poly_code) #.None (//.failure (exception.construct ..unknown_parameter headT))) @@ -273,30 +292,32 @@ (case headT (#.Parameter idx) (if (n.= id (adjusted_idx env idx)) - (wrap []) + (in []) (//.failure (exception.construct ..wrong_parameter [(#.Parameter id) headT]))) _ (//.failure (exception.construct ..not_parameter headT))))) (def: #export existential + {#.doc (doc "Yields an existential type.")} (Parser Nat) (do //.monad [headT any] (case headT (#.Ex ex_id) - (wrap ex_id) + (in ex_id) _ (//.failure (exception.construct ..not_existential headT))))) (def: #export named + {#.doc (doc "Yields a named type.")} (Parser [Name Type]) (do //.monad [inputT any] (case inputT (#.Named name anonymousT) - (wrap [name anonymousT]) + (in [name anonymousT]) _ (//.failure (exception.construct ..not_named inputT))))) @@ -317,7 +338,7 @@ (with_extension .Nothing) (with_extension headT) (local (list headT')))] - (wrap [recT output])) + (in [recT output])) _ (//.failure (exception.construct ..not_recursive headT))))) @@ -331,7 +352,7 @@ (^multi (^ (#.Apply (|nothing|) (#.Parameter funcT_idx))) (n.= 0 (adjusted_idx env funcT_idx)) {(dictionary.get 0 env) (#.Some [self_type self_call])}) - (wrap self_call) + (in self_call) _ (//.failure (exception.construct ..not_recursive headT))))) @@ -346,4 +367,4 @@ (|> allT (monad.map ! (function.constant ..parameter)) (local allT)))] - (wrap (` ((~+ allC)))))) + (in (` ((~+ allC)))))) diff --git a/stdlib/source/library/lux/control/parser/xml.lux b/stdlib/source/library/lux/control/parser/xml.lux index 3fed4030e..eb11fb3fd 100644 --- a/stdlib/source/library/lux/control/parser/xml.lux +++ b/stdlib/source/library/lux/control/parser/xml.lux @@ -18,6 +18,7 @@ ["." //]) (type: #export (Parser a) + {#.doc (doc "A parser of XML-encoded data.")} (//.Parser [Attrs (List XML)] a)) (exception: #export empty_input) @@ -43,21 +44,24 @@ (#try.Success [[attrs' remaining] output]) (if (list.empty? remaining) (#try.Success output) - (exception.throw ..unconsumed_inputs remaining)) + (exception.except ..unconsumed_inputs remaining)) (#try.Failure error) (#try.Failure error))) (def: #export (run parser documents) + {#.doc (doc "Applies a parser against a stream of XML documents." + "Verifies that all of the inputs are consumed by the parser.")} (All [a] (-> (Parser a) (List XML) (Try a))) (..run' parser /.attributes documents)) (def: #export text + {#.doc (doc "Yields text from a text node.")} (Parser Text) (function (_ [attrs documents]) (case documents #.Nil - (exception.throw ..empty_input []) + (exception.except ..empty_input []) (#.Cons head tail) (case head @@ -65,58 +69,62 @@ (#try.Success [[attrs tail] value]) (#/.Node _) - (exception.throw ..unexpected_input []))))) + (exception.except ..unexpected_input []))))) (def: #export tag + {#.doc (doc "Yields the tag from the next node.")} (Parser Tag) (function (_ [attrs documents]) (case documents #.Nil - (exception.throw ..empty_input []) + (exception.except ..empty_input []) (#.Cons head _) (case head (#/.Text _) - (exception.throw ..unexpected_input []) + (exception.except ..unexpected_input []) (#/.Node tag _ _) (#try.Success [[attrs documents] tag]))))) (def: #export (attribute name) + {#.doc (doc "Yields the value of an attribute in the current node.")} (-> Attribute (Parser Text)) (function (_ [attrs documents]) (case (dictionary.get name attrs) #.None - (exception.throw ..unknown_attribute [name (dictionary.keys attrs)]) + (exception.except ..unknown_attribute [name (dictionary.keys attrs)]) (#.Some value) (#try.Success [[attrs documents] value])))) (def: #export (node expected parser) + {#.doc (doc "Parses the contents of the next node if the tag matches.")} (All [a] (-> Tag (Parser a) (Parser a))) (function (_ [attrs documents]) (case documents #.Nil - (exception.throw ..empty_input []) + (exception.except ..empty_input []) (#.Cons head tail) (case head (#/.Text _) - (exception.throw ..unexpected_input []) + (exception.except ..unexpected_input []) (#/.Node actual attrs' children) (if (name\= expected actual) (|> children (..run' parser attrs') (try\map (|>> [[attrs tail]]))) - (exception.throw ..wrong_tag [expected actual])))))) + (exception.except ..wrong_tag [expected actual])))))) (def: #export ignore + {#.doc (doc "Skips the next node.")} (Parser Any) (function (_ [attrs documents]) (case documents #.Nil - (exception.throw ..empty_input []) + (exception.except ..empty_input []) (#.Cons head tail) (#try.Success [[attrs tail] []])))) @@ -124,6 +132,7 @@ (exception: #export nowhere) (def: #export (somewhere parser) + {#.doc (doc "Applies the parser somewhere among the remaining inputs; instead of demanding that the parser succeeds against the immediate inputs.")} (All [a] (-> (Parser a) (Parser a))) (function (recur [attrs input]) (case (//.run parser [attrs input]) @@ -133,10 +142,10 @@ (#try.Failure error) (case input #.Nil - (exception.throw ..nowhere []) + (exception.except ..nowhere []) (#.Cons head tail) (do try.monad [[[attrs tail'] output] (recur [attrs tail])] - (wrap [[attrs (#.Cons head tail')] - output])))))) + (in [[attrs (#.Cons head tail')] + output])))))) diff --git a/stdlib/source/library/lux/control/pipe.lux b/stdlib/source/library/lux/control/pipe.lux index cac70fe6b..1945eec59 100644 --- a/stdlib/source/library/lux/control/pipe.lux +++ b/stdlib/source/library/lux/control/pipe.lux @@ -1,4 +1,5 @@ -(.module: {#.doc "Composable extensions to the piping macros (|> and <|) that enhance them with various abilities."} +(.module: + {#.doc "Composable extensions to the piping macros (|> and <|) that enhance them with various abilities."} [library [lux #* [abstract @@ -32,15 +33,15 @@ (n.* 3) (n.+ 4) (new> 0 [inc]))))} - (wrap (list (` (|> (~ start) (~+ body)))))) + (in (list (` (|> (~ start) (~+ body)))))) (syntax: #export (let> binding body prev) {#.doc (doc "Gives a name to the piped-argument, within the given expression." (n.= 10 (|> 5 (let> x (n.+ x x)))))} - (wrap (list (` (let [(~ binding) (~ prev)] - (~ body)))))) + (in (list (` (let [(~ binding) (~ prev)] + (~ body)))))) (def: _reverse_ (Parser Any) @@ -59,22 +60,22 @@ [i.odd?] [(i.* +3)] [(new> -1 [])])))} (with_gensyms [g!temp] - (wrap (list (` (let [(~ g!temp) (~ prev)] - (cond (~+ (do list.monad - [[test then] branches] - (list (` (|> (~ g!temp) (~+ test))) - (` (|> (~ g!temp) (~+ then)))))) - (|> (~ g!temp) (~+ else))))))))) + (in (list (` (let [(~ g!temp) (~ prev)] + (cond (~+ (do list.monad + [[test then] branches] + (list (` (|> (~ g!temp) (~+ test))) + (` (|> (~ g!temp) (~+ then)))))) + (|> (~ g!temp) (~+ else))))))))) (syntax: #export (if> {test body^} {then body^} {else body^} prev) - (wrap (list (` (cond> [(~+ test)] [(~+ then)] - [(~+ else)] - (~ prev)))))) + (in (list (` (cond> [(~+ test)] [(~+ then)] + [(~+ else)] + (~ prev)))))) (syntax: #export (when> {test body^} {then body^} prev) - (wrap (list (` (cond> [(~+ test)] [(~+ then)] - [] - (~ prev)))))) + (in (list (` (cond> [(~+ test)] [(~+ then)] + [] + (~ prev)))))) (syntax: #export (loop> {test body^} {then body^} @@ -85,10 +86,10 @@ (loop> [(i.< +10)] [inc])))} (with_gensyms [g!temp] - (wrap (list (` (loop [(~ g!temp) (~ prev)] - (if (|> (~ g!temp) (~+ test)) - ((~' recur) (|> (~ g!temp) (~+ then))) - (~ g!temp)))))))) + (in (list (` (loop [(~ g!temp) (~ prev)] + (if (|> (~ g!temp) (~+ test)) + ((~' recur) (|> (~ g!temp) (~+ then))) + (~ g!temp)))))))) (syntax: #export (do> monad {steps (p.some body^)} @@ -106,13 +107,13 @@ (let [step_bindings (do list.monad [step (list.reverse prev_steps)] (list g!temp (` (|> (~ g!temp) (~+ step)))))] - (wrap (list (` ((~! do) (~ monad) - [(~' #let) [(~ g!temp) (~ prev)] - (~+ step_bindings)] - (|> (~ g!temp) (~+ last_step))))))) + (in (list (` ((~! do) (~ monad) + [(~' #let) [(~ g!temp) (~ prev)] + (~+ step_bindings)] + (|> (~ g!temp) (~+ last_step))))))) _ - (wrap (list prev))))) + (in (list prev))))) (syntax: #export (exec> {body body^} prev) @@ -122,9 +123,9 @@ (exec> [.nat %n log!]) (i.* +10)))} (with_gensyms [g!temp] - (wrap (list (` (let [(~ g!temp) (~ prev)] - (exec (|> (~ g!temp) (~+ body)) - (~ g!temp)))))))) + (in (list (` (let [(~ g!temp) (~ prev)] + (exec (|> (~ g!temp) (~+ body)) + (~ g!temp)))))))) (syntax: #export (tuple> {paths (p.many body^)} prev) @@ -136,9 +137,9 @@ [Int/encode])) "Will become: [+50 +2 '+5']")} (with_gensyms [g!temp] - (wrap (list (` (let [(~ g!temp) (~ prev)] - [(~+ (list\map (function (_ body) (` (|> (~ g!temp) (~+ body)))) - paths))])))))) + (in (list (` (let [(~ g!temp) (~ prev)] + [(~+ (list\map (function (_ body) (` (|> (~ g!temp) (~+ body)))) + paths))])))))) (syntax: #export (case> {branches (p.many (p.and s.any s.any))} prev) @@ -156,6 +157,6 @@ +8 "eight" +9 "nine" _ "???")))} - (wrap (list (` (case (~ prev) - (~+ (list\join (list\map (function (_ [pattern body]) (list pattern body)) - branches)))))))) + (in (list (` (case (~ prev) + (~+ (list\join (list\map (function (_ [pattern body]) (list pattern body)) + branches)))))))) diff --git a/stdlib/source/library/lux/control/reader.lux b/stdlib/source/library/lux/control/reader.lux index 95662b8ba..cf565cd22 100644 --- a/stdlib/source/library/lux/control/reader.lux +++ b/stdlib/source/library/lux/control/reader.lux @@ -45,7 +45,7 @@ (def: &functor ..functor) - (def: (wrap x) + (def: (in x) (function (_ env) x)) (def: (join mma) @@ -58,7 +58,7 @@ (def: &functor (functor.compose ..functor (get@ #monad.&functor monad))) - (def: wrap (|>> (\ monad wrap) (\ ..monad wrap))) + (def: in (|>> (\ monad in) (\ ..monad in))) (def: (join eMeMa) (function (_ env) @@ -69,4 +69,4 @@ (def: #export lift {#.doc "Lift monadic values to the Reader wrapper."} (All [M e a] (-> (M a) (Reader e (M a)))) - (\ ..monad wrap)) + (\ ..monad in)) diff --git a/stdlib/source/library/lux/control/region.lux b/stdlib/source/library/lux/control/region.lux index 83a0fe84d..98250983a 100644 --- a/stdlib/source/library/lux/control/region.lux +++ b/stdlib/source/library/lux/control/region.lux @@ -49,7 +49,7 @@ output (#try.Failure error) - (exception.throw ..clean_up_error [error output]))) + (exception.except ..clean_up_error [error output]))) (def: #export (run monad computation) (All [! a] @@ -59,15 +59,15 @@ [[cleaners output] (computation [[] (list)]) results (monad.map ! (function (_ cleaner) (cleaner [])) cleaners)] - (wrap (list\fold combine_outcomes output results)))) + (in (list\fold combine_outcomes output results)))) (def: #export (acquire monad cleaner value) (All [! a] (-> (Monad !) (-> a (! (Try Any))) a (All [r] (Region r ! a)))) (function (_ [region cleaners]) - (\ monad wrap [(#.Cons (function (_ region) (cleaner value)) - cleaners) - (#try.Success value)]))) + (\ monad in [(#.Cons (function (_ region) (cleaner value)) + cleaners) + (#try.Success value)]))) (implementation: #export (functor super) (All [!] @@ -104,13 +104,13 @@ (#try.Success f) (case ea (#try.Success a) - (wrap [cleaners (#try.Success (f a))]) + (in [cleaners (#try.Success (f a))]) (#try.Failure error) - (wrap [cleaners (#try.Failure error)])) + (in [cleaners (#try.Failure error)])) (#try.Failure error) - (wrap [cleaners (#try.Failure error)])))))) + (in [cleaners (#try.Failure error)])))))) (implementation: #export (monad super) (All [!] @@ -120,9 +120,9 @@ (def: &functor (..functor (get@ #monad.&functor super))) - (def: (wrap value) + (def: (in value) (function (_ [region cleaners]) - (\ super wrap [cleaners (#try.Success value)]))) + (\ super in [cleaners (#try.Success value)]))) (def: (join ffa) (function (_ [region cleaners]) @@ -133,16 +133,16 @@ (fa [region cleaners]) (#try.Failure error) - (wrap [cleaners (#try.Failure error)])))))) + (in [cleaners (#try.Failure error)])))))) (def: #export (failure monad error) (All [! a] (-> (Monad !) Text (All [r] (Region r ! a)))) (function (_ [region cleaners]) - (\ monad wrap [cleaners (#try.Failure error)]))) + (\ monad in [cleaners (#try.Failure error)]))) -(def: #export (throw monad exception message) +(def: #export (except monad exception message) (All [! e a] (-> (Monad !) (Exception e) e (All [r] (Region r ! a)))) @@ -155,4 +155,4 @@ (function (_ [region cleaners]) (do monad [output operation] - (wrap [cleaners (#try.Success output)])))) + (in [cleaners (#try.Success output)])))) diff --git a/stdlib/source/library/lux/control/remember.lux b/stdlib/source/library/lux/control/remember.lux index c2cc446ed..d8a6dc8a7 100644 --- a/stdlib/source/library/lux/control/remember.lux +++ b/stdlib/source/library/lux/control/remember.lux @@ -41,7 +41,7 @@ [raw .text] (case (\ date.codec decode raw) (#try.Success date) - (wrap date) + (in date) (#try.Failure message) (<>.failure message))))) @@ -50,24 +50,24 @@ (let [now (io.run instant.now) today (instant.date now)] (if (date\< deadline today) - (wrap (case focus - (#.Some focus) - (list focus) + (in (case focus + (#.Some focus) + (list focus) - #.None - (list))) + #.None + (list))) (meta.failure (exception.construct ..must_remember [deadline today message focus]))))) (template [ ] [(syntax: #export ( {deadline ..deadline} {message .text} {focus (<>.maybe .any)}) - (wrap (list (` (..remember (~ (code.text (%.date deadline))) - (~ (code.text (format " " message))) - (~+ (case focus - (#.Some focus) - (list focus) + (in (list (` (..remember (~ (code.text (%.date deadline))) + (~ (code.text (format " " message))) + (~+ (case focus + (#.Some focus) + (list focus) - #.None - (list))))))))] + #.None + (list))))))))] [to_do "TODO"] [fix_me "FIXME"] diff --git a/stdlib/source/library/lux/control/security/capability.lux b/stdlib/source/library/lux/control/security/capability.lux index 100eea37e..14461791f 100644 --- a/stdlib/source/library/lux/control/security/capability.lux +++ b/stdlib/source/library/lux/control/security/capability.lux @@ -37,6 +37,7 @@ (|>> :abstraction)) (def: #export (use capability input) + {#.doc (doc "Applies a capability against its required input.")} (All [brand input output] (-> (Capability brand input output) input @@ -47,23 +48,34 @@ {declaration |declaration|.parser} {annotations (<>.maybe |annotations|.parser)} {[forge input output] (.form ($_ <>.and .local_identifier .any .any))}) + {#.doc (doc "Defines a capability as a unique type, and a constructor for instances." + + (capability: (Can_Duplicate a) + (can_duplicate a [a a])) + + (let [capability (can_duplicate + (function (_ value) + [value value])) + [left right] (..use capability 123)] + (is? left right)))} (do {! meta.monad} [this_module meta.current_module_name #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)))]] - (wrap (list (` (type: (~+ (|export|.format export)) - (~ (|declaration|.format declaration)) - (~ capability))) - (` (def: (~ (code.local_identifier forge)) - (All [(~+ (list\map code.local_identifier vars))] - (-> (-> (~ input) (~ output)) - (~ capability))) - (~! ..forge))) - )))) + (in (list (` (type: (~+ (|export|.format export)) + (~ (|declaration|.format declaration)) + (~ capability))) + (` (def: (~ (code.local_identifier forge)) + (All [(~+ (list\map code.local_identifier vars))] + (-> (-> (~ input) (~ output)) + (~ capability))) + (~! ..forge))) + )))) (def: #export (async capability) + {#.doc (doc "Converts a synchronous I/O-based capability into an asynchronous capability.")} (All [brand input output] (-> (Capability brand input (IO output)) (Capability brand input (Async output)))) diff --git a/stdlib/source/library/lux/control/security/policy.lux b/stdlib/source/library/lux/control/security/policy.lux index 3c1eb579e..05b05cf5f 100644 --- a/stdlib/source/library/lux/control/security/policy.lux +++ b/stdlib/source/library/lux/control/security/policy.lux @@ -11,6 +11,8 @@ (abstract: #export (Policy brand value label) value + {#.doc (doc "A security policy encoded as the means to 'upgrade' or 'downgrade' in a secure context.")} + (type: #export (Can_Upgrade brand label value) {#.doc (doc "Represents the capacity to 'upgrade' a value.")} (-> value (Policy brand value label))) @@ -24,11 +26,6 @@ {#can_upgrade (Can_Upgrade brand label) #can_downgrade (Can_Downgrade brand label)}) - (def: privilege - Privilege - {#can_upgrade (|>> :abstraction) - #can_downgrade (|>> :representation)}) - (type: #export (Delegation brand from to) {#.doc (doc "Represents the act of delegating policy capacities.")} (All [value] @@ -47,7 +44,33 @@ (-> (Privilege brand label) (scope label))) + (def: privilege + Privilege + {#can_upgrade (|>> :abstraction) + #can_downgrade (|>> :representation)}) + (def: #export (with_policy context) + {#.doc (doc "Activates a security context with the priviledge to enforce it's policy." + + (type: Password + (Private Text)) + + (interface: (Policy %) + (: (-> Text (Password %)) + password) + (: (-> (Password %) Text) + unsafe)) + + (def: (policy _) + (Ex [%] (-> Any (Policy %))) + (with_policy + (: (Context Privacy Policy) + (function (_ (^open "%::.")) + (implementation + (def: (password value) + (%::can_upgrade value)) + (def: (unsafe password) + (%::can_downgrade password))))))))} (All [brand scope] (Ex [label] (-> (Context brand scope label) @@ -56,38 +79,51 @@ (def: (decorate constructor) (-> Type Type) - (type (All [brand label] (constructor (All [value] (Policy brand value label)))))) + (type (All [brand label] + (constructor (All [value] (Policy brand value label)))))) (implementation: #export functor - (:~ (decorate Functor)) + (:~ (..decorate Functor)) (def: (map f fa) (|> fa :representation f :abstraction))) (implementation: #export apply - (:~ (decorate Apply)) + (:~ (..decorate Apply)) (def: &functor ..functor) + (def: (apply ff fa) (:abstraction ((:representation ff) (:representation fa))))) (implementation: #export monad - (:~ (decorate Monad)) + (:~ (..decorate Monad)) (def: &functor ..functor) - (def: wrap (|>> :abstraction)) + (def: in (|>> :abstraction)) (def: join (|>> :representation))) ) -(template [ ] +(template [ ] [(abstract: #export Any + + {#.doc } + + (type: #export + (Policy )) + + (type: #export + (Can_Upgrade )) - (type: #export (Policy )) - (type: #export (Can_Upgrade )) - (type: #export (Can_Downgrade )) + (type: #export + (Can_Downgrade )) )] - [Privacy Private Can_Conceal Can_Reveal] - [Safety Safe Can_Trust Can_Distrust] + [Privacy Private Can_Conceal Can_Reveal + (doc "A security context for privacy." + "Private data is data which cannot be allowed to leak outside of the programmed.")] + [Safety Safe Can_Trust Can_Distrust + (doc "A security context for safety." + "Safe data is data coming from outside the program which can be trusted to be properly formatted and lacking injections.")] ) diff --git a/stdlib/source/library/lux/control/state.lux b/stdlib/source/library/lux/control/state.lux index b39690469..661c081d8 100644 --- a/stdlib/source/library/lux/control/state.lux +++ b/stdlib/source/library/lux/control/state.lux @@ -70,7 +70,7 @@ (def: &functor ..functor) - (def: (wrap a) + (def: (in a) (function (_ state) [state a])) @@ -87,7 +87,7 @@ (do ! [_ body] (while condition body)) - (wrap [])))) + (in [])))) (def: #export (do_while condition body) (All [s] (-> (State s Bit) (State s Any) (State s Any))) @@ -113,7 +113,7 @@ (do monad [[state f] (sFf state) [state a] (sFa state)] - (wrap [state (f a)]))))) + (in [state (f a)]))))) (type: #export (State' M s a) {#.doc "Stateful computations decorated by a monad."} @@ -130,9 +130,9 @@ (def: &functor (with//functor (\ monad &functor))) - (def: (wrap a) + (def: (in a) (function (_ state) - (\ monad wrap [state a]))) + (\ monad in [state a]))) (def: (join sMsMa) (function (_ state) @@ -146,4 +146,4 @@ (function (_ state) (do monad [a ma] - (wrap [state a])))) + (in [state a])))) diff --git a/stdlib/source/library/lux/control/thread.lux b/stdlib/source/library/lux/control/thread.lux index 818c38298..ec2e48153 100644 --- a/stdlib/source/library/lux/control/thread.lux +++ b/stdlib/source/library/lux/control/thread.lux @@ -90,7 +90,7 @@ (def: &functor ..functor) - (def: (wrap value) + (def: (in value) (function (_ !) value)) @@ -103,4 +103,4 @@ (do ..monad [old (read box) _ (write (f old) box)] - (wrap old))) + (in old))) diff --git a/stdlib/source/library/lux/control/try.lux b/stdlib/source/library/lux/control/try.lux index 77adf79f0..52f58495a 100644 --- a/stdlib/source/library/lux/control/try.lux +++ b/stdlib/source/library/lux/control/try.lux @@ -47,7 +47,7 @@ (def: &functor ..functor) - (def: (wrap a) + (def: (in a) (#Success a)) (def: (join mma) @@ -64,21 +64,21 @@ (def: &functor (functor.compose (get@ #monad.&functor monad) ..functor)) - (def: wrap (|>> (\ ..monad wrap) (\ monad wrap))) + (def: in (|>> (\ ..monad in) (\ monad in))) (def: (join MeMea) (do monad [eMea MeMea] (case eMea (#Failure try) - (wrap (#Failure try)) + (in (#Failure try)) (#Success Mea) Mea)))) (def: #export (lifted monad) (All [M a] (-> (Monad M) (-> (M a) (M (Try a))))) - (\ monad map (\ ..monad wrap))) + (\ monad map (\ ..monad in))) (implementation: #export (equivalence (^open "_\.")) (All [a] (-> (Equivalence a) (Equivalence (Try a)))) diff --git a/stdlib/source/library/lux/control/writer.lux b/stdlib/source/library/lux/control/writer.lux index 2ddf343df..8fd8e9492 100644 --- a/stdlib/source/library/lux/control/writer.lux +++ b/stdlib/source/library/lux/control/writer.lux @@ -43,7 +43,7 @@ (def: &functor ..functor) - (def: wrap + (def: in (|>> [(\ monoid identity)])) (def: (join mma) @@ -57,9 +57,9 @@ (functor.compose (get@ #monad.&functor monad) ..functor)) - (def: wrap + (def: in (let [writer (..monad monoid)] - (|>> (\ writer wrap) (\ monad wrap)))) + (|>> (\ writer in) (\ monad in)))) (def: (join MlMla) (do monad @@ -69,7 +69,7 @@ ## On new compiler MlMla) [l2 a] Mla] - (wrap [(\ monoid compose l1 l2) a])))) + (in [(\ monoid compose l1 l2) a])))) (def: #export (lift monoid monad) (All [l M a] diff --git a/stdlib/source/library/lux/data/binary.lux b/stdlib/source/library/lux/data/binary.lux index 11bc86754..185a142bf 100644 --- a/stdlib/source/library/lux/data/binary.lux +++ b/stdlib/source/library/lux/data/binary.lux @@ -194,7 +194,7 @@ (-> Nat Binary (Try I64)) (if (n.< (..!size binary) idx) (#try.Success (!read idx binary)) - (exception.throw ..index_out_of_bounds [(..!size binary) idx]))) + (exception.except ..index_out_of_bounds [(..!size binary) idx]))) (def: #export (read/16 idx binary) (-> Nat Binary (Try I64)) @@ -202,7 +202,7 @@ (#try.Success ($_ i64.or (i64.left_shift 8 (!read idx binary)) (!read (n.+ 1 idx) binary))) - (exception.throw ..index_out_of_bounds [(..!size binary) idx]))) + (exception.except ..index_out_of_bounds [(..!size binary) idx]))) (def: #export (read/32 idx binary) (-> Nat Binary (Try I64)) @@ -212,7 +212,7 @@ (i64.left_shift 16 (!read (n.+ 1 idx) binary)) (i64.left_shift 8 (!read (n.+ 2 idx) binary)) (!read (n.+ 3 idx) binary))) - (exception.throw ..index_out_of_bounds [(..!size binary) idx]))) + (exception.except ..index_out_of_bounds [(..!size binary) idx]))) (def: #export (read/64 idx binary) (-> Nat Binary (Try I64)) @@ -226,14 +226,14 @@ (i64.left_shift 16 (!read (n.+ 5 idx) binary)) (i64.left_shift 8 (!read (n.+ 6 idx) binary)) (!read (n.+ 7 idx) binary))) - (exception.throw ..index_out_of_bounds [(..!size binary) idx]))) + (exception.except ..index_out_of_bounds [(..!size binary) idx]))) (def: #export (write/8 idx value binary) (-> Nat (I64 Any) Binary (Try Binary)) (if (n.< (..!size binary) idx) (#try.Success (|> binary (!write idx value))) - (exception.throw ..index_out_of_bounds [(..!size binary) idx]))) + (exception.except ..index_out_of_bounds [(..!size binary) idx]))) (def: #export (write/16 idx value binary) (-> Nat (I64 Any) Binary (Try Binary)) @@ -241,7 +241,7 @@ (#try.Success (|> binary (!write idx (i64.right_shift 8 value)) (!write (n.+ 1 idx) value))) - (exception.throw ..index_out_of_bounds [(..!size binary) idx]))) + (exception.except ..index_out_of_bounds [(..!size binary) idx]))) (def: #export (write/32 idx value binary) (-> Nat (I64 Any) Binary (Try Binary)) @@ -251,7 +251,7 @@ (!write (n.+ 1 idx) (i64.right_shift 16 value)) (!write (n.+ 2 idx) (i64.right_shift 8 value)) (!write (n.+ 3 idx) value))) - (exception.throw ..index_out_of_bounds [(..!size binary) idx]))) + (exception.except ..index_out_of_bounds [(..!size binary) idx]))) (def: #export (write/64 idx value binary) (-> Nat (I64 Any) Binary (Try Binary)) @@ -274,7 +274,7 @@ (!write (n.+ 5 idx) (i64.right_shift 16 value)) (!write (n.+ 6 idx) (i64.right_shift 8 value)) (!write (n.+ 7 idx) value)))) - (exception.throw ..index_out_of_bounds [(..!size binary) idx]))) + (exception.except ..index_out_of_bounds [(..!size binary) idx]))) (implementation: #export equivalence (Equivalence Binary) @@ -309,7 +309,7 @@ (-> Nat Nat Binary Nat Binary (Try Binary)) (with_expansions [ (as_is (do try.monad [_ (java/lang/System::arraycopy source (.int source_offset) target (.int target_offset) (.int bytes))] - (wrap target)))] + (in target)))] (for {@.old @.jvm } @@ -324,7 +324,7 @@ target) (recur (inc idx))) (#try.Success target))) - (exception.throw ..cannot_copy_bytes [bytes source_input target_output])))))) + (exception.except ..cannot_copy_bytes [bytes source_input target_output])))))) (def: #export (slice offset length binary) (-> Nat Nat Binary (Try Binary)) @@ -337,7 +337,7 @@ ## Default (..copy length offset binary 0 (..create length)))) - (exception.throw ..slice_out_of_bounds [size offset length])))) + (exception.except ..slice_out_of_bounds [size offset length])))) (def: #export (drop offset binary) (-> Nat Binary Binary) diff --git a/stdlib/source/library/lux/data/collection/dictionary.lux b/stdlib/source/library/lux/data/collection/dictionary.lux index 5c740b072..490f3f3e0 100644 --- a/stdlib/source/library/lux/data/collection/dictionary.lux +++ b/stdlib/source/library/lux/data/collection/dictionary.lux @@ -594,7 +594,7 @@ (All [k v] (-> k v (Dictionary k v) (Try (Dictionary k v)))) (case (get key dict) #.None (#try.Success (put key val dict)) - (#.Some _) (exception.throw ..key_already_exists []))) + (#.Some _) (exception.except ..key_already_exists []))) (def: #export (update key f dict) {#.doc "Transforms the value located at key (if available), using the given function."} diff --git a/stdlib/source/library/lux/data/collection/dictionary/ordered.lux b/stdlib/source/library/lux/data/collection/dictionary/ordered.lux index 15d7f8077..cb187b477 100644 --- a/stdlib/source/library/lux/data/collection/dictionary/ordered.lux +++ b/stdlib/source/library/lux/data/collection/dictionary/ordered.lux @@ -410,25 +410,25 @@ [fused (prepend (get@ #right left) (get@ #right right))] (case (get@ #color fused) #Red - (wrap (red (get@ #key fused) - (get@ #value fused) - (#.Some (red (get@ #key left) - (get@ #value left) - (get@ #left left) - (get@ #left fused))) - (#.Some (red (get@ #key right) - (get@ #value right) - (get@ #right fused) - (get@ #right right))))) + (in (red (get@ #key fused) + (get@ #value fused) + (#.Some (red (get@ #key left) + (get@ #value left) + (get@ #left left) + (get@ #left fused))) + (#.Some (red (get@ #key right) + (get@ #value right) + (get@ #right fused) + (get@ #right right))))) #Black - (wrap (red (get@ #key left) - (get@ #value left) - (get@ #left left) - (#.Some (red (get@ #key right) - (get@ #value right) - (#.Some fused) - (get@ #right right))))))) + (in (red (get@ #key left) + (get@ #value left) + (get@ #left left) + (#.Some (red (get@ #key right) + (get@ #value right) + (#.Some fused) + (get@ #right right))))))) [#Red #Black] (#.Some (red (get@ #key left) @@ -449,25 +449,25 @@ [fused (prepend (get@ #right left) (get@ #left right))] (case (get@ #color fused) #Red - (wrap (red (get@ #key fused) - (get@ #value fused) - (#.Some (black (get@ #key left) - (get@ #value left) - (get@ #left left) - (get@ #left fused))) - (#.Some (black (get@ #key right) - (get@ #value right) - (get@ #right fused) - (get@ #right right))))) + (in (red (get@ #key fused) + (get@ #value fused) + (#.Some (black (get@ #key left) + (get@ #value left) + (get@ #left left) + (get@ #left fused))) + (#.Some (black (get@ #key right) + (get@ #value right) + (get@ #right fused) + (get@ #right right))))) #Black - (wrap (balance_left_remove (get@ #key left) - (get@ #value left) - (get@ #left left) - (#.Some (black (get@ #key right) - (get@ #value right) - (#.Some fused) - (get@ #right right))))) + (in (balance_left_remove (get@ #key left) + (get@ #value left) + (get@ #left left) + (#.Some (black (get@ #key right) + (get@ #value right) + (#.Some fused) + (get@ #right right))))) )) ) diff --git a/stdlib/source/library/lux/data/collection/list.lux b/stdlib/source/library/lux/data/collection/list.lux index 92b77bdf4..e1661f1a4 100644 --- a/stdlib/source/library/lux/data/collection/list.lux +++ b/stdlib/source/library/lux/data/collection/list.lux @@ -368,7 +368,7 @@ (def: &functor ..functor) - (def: (wrap a) + (def: (in a) (#.Cons a #.Nil)) (def: join (|>> reverse (fold compose identity)))) @@ -587,7 +587,7 @@ (def: &functor (functor.compose (get@ #monad.&functor monad) ..functor)) - (def: wrap (|>> (\ ..monad wrap) (\ monad wrap))) + (def: in (|>> (\ ..monad in) (\ monad in))) (def: (join MlMla) (do {! monad} @@ -597,11 +597,11 @@ (: (($ 0) (List (List ($ 1)))) (monad.seq ! lMla))} (monad.seq ! lMla))] - (wrap (concat lla))))) + (in (concat lla))))) (def: #export (lift monad) (All [M a] (-> (Monad M) (-> (M a) (M (List a))))) - (\ monad map (\ ..monad wrap))) + (\ monad map (\ ..monad in))) (def: #export (enumeration xs) {#.doc "Pairs every element in the list with its index, starting at 0."} diff --git a/stdlib/source/library/lux/data/collection/row.lux b/stdlib/source/library/lux/data/collection/row.lux index 69be85a21..6447d96fe 100644 --- a/stdlib/source/library/lux/data/collection/row.lux +++ b/stdlib/source/library/lux/data/collection/row.lux @@ -260,11 +260,11 @@ (#try.Success base) [_ #.None] - (exception.throw ..base_was_not_found []) + (exception.except ..base_was_not_found []) _ - (exception.throw ..incorrect_row_structure [])))) - (exception.throw ..index_out_of_bounds [row idx]))) + (exception.except ..incorrect_row_structure [])))) + (exception.except ..index_out_of_bounds [row idx]))) (def: #export (nth idx row) (All [a] (-> Nat (Row a) (Try a))) @@ -275,7 +275,7 @@ (#try.Success value) #.None - (exception.throw ..incorrect_row_structure [])))) + (exception.except ..incorrect_row_structure [])))) (def: #export (put idx val row) (All [a] (-> Nat a (Row a) (Try (Row a)))) @@ -289,7 +289,7 @@ row) (update@ #root (put' (get@ #level row) idx val) row))) - (exception.throw ..index_out_of_bounds [row idx])))) + (exception.except ..index_out_of_bounds [row idx])))) (def: #export (update idx f row) (All [a] (-> Nat (-> a a) (Row a) (Try (Row a)))) @@ -332,11 +332,11 @@ _ [level root]) [level root])))]] - (wrap (|> row - (update@ #size dec) - (set@ #level level') - (set@ #root root') - (set@ #tail new_tail)))))) + (in (|> row + (update@ #size dec) + (set@ #level level') + (set@ #root root') + (set@ #tail new_tail)))))) )) (def: #export (to_list row) @@ -359,7 +359,7 @@ (syntax: #export (row {elems (p.some s.any)}) {#.doc (doc "Row literals." (row +10 +20 +30 +40))} - (wrap (list (` (..of_list (list (~+ elems))))))) + (in (list (` (..of_list (list (~+ elems))))))) (implementation: (node_equivalence Equivalence) (All [a] (-> (Equivalence a) (Equivalence (Node a)))) @@ -456,7 +456,7 @@ (def: &functor ..functor) - (def: wrap (|>> row)) + (def: in (|>> row)) (def: join (let [(^open ".") ..fold diff --git a/stdlib/source/library/lux/data/collection/sequence.lux b/stdlib/source/library/lux/data/collection/sequence.lux index 10bbfa9d0..3fe88a087 100644 --- a/stdlib/source/library/lux/data/collection/sequence.lux +++ b/stdlib/source/library/lux/data/collection/sequence.lux @@ -130,7 +130,7 @@ (def: &functor ..functor) - (def: unwrap head) + (def: out head) (def: (split wa) (let [[head tail] (//.run wa)] @@ -149,4 +149,4 @@ (` ((~! //.run) (~ g!sequence))))) patterns)))] (~ body)))] - (wrap (list& g!sequence body+ branches))))) + (in (list& g!sequence body+ branches))))) diff --git a/stdlib/source/library/lux/data/collection/tree.lux b/stdlib/source/library/lux/data/collection/tree.lux index 045b176c6..444ab32e2 100644 --- a/stdlib/source/library/lux/data/collection/tree.lux +++ b/stdlib/source/library/lux/data/collection/tree.lux @@ -56,9 +56,9 @@ {20 {} 30 {} 40 {}})))} - (wrap (list (` (~ (loop [[value children] root] - (` {#value (~ value) - #children (list (~+ (list\map recur children)))}))))))) + (in (list (` (~ (loop [[value children] root] + (` {#value (~ value) + #children (list (~+ (list\map recur children)))}))))))) (implementation: #export (equivalence super) (All [a] (-> (Equivalence a) (Equivalence (Tree a)))) diff --git a/stdlib/source/library/lux/data/collection/tree/zipper.lux b/stdlib/source/library/lux/data/collection/tree/zipper.lux index 942ca5c09..9803124a4 100644 --- a/stdlib/source/library/lux/data/collection/tree/zipper.lux +++ b/stdlib/source/library/lux/data/collection/tree/zipper.lux @@ -99,18 +99,18 @@ (All [a] (-> (Zipper a) (Maybe (Zipper a)))) (do maybe.monad [family (get@ #family zipper)] - (wrap (let [(^slots [#parent #lefts #rights]) family] - (for {@.old - (update@ #node (: (-> (Tree ($ 0)) (Tree ($ 0))) - (set@ #//.children (list\compose (list.reverse lefts) - (#.Cons (get@ #node zipper) - rights)))) - parent)} - (set@ [#node #//.children] - (list\compose (list.reverse lefts) - (#.Cons (get@ #node zipper) - rights)) - parent)))))) + (in (let [(^slots [#parent #lefts #rights]) family] + (for {@.old + (update@ #node (: (-> (Tree ($ 0)) (Tree ($ 0))) + (set@ #//.children (list\compose (list.reverse lefts) + (#.Cons (get@ #node zipper) + rights)))) + parent)} + (set@ [#node #//.children] + (list\compose (list.reverse lefts) + (#.Cons (get@ #node zipper) + rights)) + parent)))))) (template [ ] [(def: #export ( zipper) @@ -258,16 +258,16 @@ [family (get@ #family zipper)] (case (get@ #lefts family) #.Nil - (wrap (set@ [#node #//.children] - (get@ #rights family) - (get@ #parent family))) + (in (set@ [#node #//.children] + (get@ #rights family) + (get@ #parent family))) (#.Cons next side) - (wrap (|> zipper - (set@ #family (|> family - (set@ #lefts side) - #.Some)) - (set@ #node next)))))) + (in (|> zipper + (set@ #family (|> family + (set@ #lefts side) + #.Some)) + (set@ #node next)))))) (template [ ] [(def: #export ( value zipper) @@ -301,7 +301,7 @@ (def: &functor ..functor) - (def: unwrap (get@ [#node #//.value])) + (def: out (get@ [#node #//.value])) (def: (split (^slots [#family #node])) (let [tree_splitter (: (All [a] (-> (Tree a) (Tree (Zipper a)))) diff --git a/stdlib/source/library/lux/data/format/binary.lux b/stdlib/source/library/lux/data/format/binary.lux index c7bd7da94..b12e9f2e1 100644 --- a/stdlib/source/library/lux/data/format/binary.lux +++ b/stdlib/source/library/lux/data/format/binary.lux @@ -197,7 +197,7 @@ (try.assumed (do try.monad [_ ( offset capped_count binary)] - (wrap (mutation [(n.+ offset) binary])))))])))] + (in (mutation [(n.+ offset) binary])))))])))] [row/8 /.size/8 binary.write/8] [row/16 /.size/16 binary.write/16] diff --git a/stdlib/source/library/lux/data/format/css.lux b/stdlib/source/library/lux/data/format/css.lux index 041feace9..d94f97cd9 100644 --- a/stdlib/source/library/lux/data/format/css.lux +++ b/stdlib/source/library/lux/data/format/css.lux @@ -27,15 +27,19 @@ (abstract: #export (CSS brand) Text - (def: #export css (-> (CSS Any) Text) (|>> :representation)) + (def: #export css + (-> (CSS Any) Text) + (|>> :representation)) - (def: #export empty (CSS Common) (:abstraction "")) + (def: #export empty + (CSS Common) + (:abstraction "")) (def: #export (rule selector style) (-> (Selector Any) Style (CSS Common)) (:abstraction (format (/selector.selector selector) "{" (/style.inline style) "}"))) - (def: #export char-set + (def: #export char_set (-> Encoding (CSS Special)) (|>> encoding.name %.text @@ -44,23 +48,23 @@ (def: #export (font font) (-> Font (CSS Special)) - (let [with-unicode (case (get@ #/font.unicode-range font) - (#.Some unicode-range) - (let [unicode-range' (format "U+" (\ nat.hex encode (get@ #/font.start unicode-range)) - "-" (\ nat.hex encode (get@ #/font.end unicode-range)))] - (list ["unicode-range" unicode-range'])) + (let [with_unicode (case (get@ #/font.unicode_range font) + (#.Some unicode_range) + (let [unicode_range' (format "U+" (\ nat.hex encode (get@ #/font.start unicode_range)) + "-" (\ nat.hex encode (get@ #/font.end unicode_range)))] + (list ["unicode-range" unicode_range'])) #.None (list))] (|> (list& ["font-family" (get@ #/font.family font)] ["src" (format "url(" (get@ #/font.source font) ")")] - ["font-stretch" (|> font (get@ #/font.stretch) (maybe.default /value.normal-stretch) /value.value)] - ["font-style" (|> font (get@ #/font.style) (maybe.default /value.normal-style) /value.value)] - ["font-weight" (|> font (get@ #/font.weight) (maybe.default /value.normal-weight) /value.value)] - with-unicode) + ["font-stretch" (|> font (get@ #/font.stretch) (maybe.default /value.normal_stretch) /value.value)] + ["font-style" (|> font (get@ #/font.style) (maybe.default /value.normal_style) /value.value)] + ["font-weight" (|> font (get@ #/font.weight) (maybe.default /value.normal_weight) /value.value)] + with_unicode) (list\map (function (_ [property value]) (format property ": " value ";"))) - (text.join-with /style.separator) + (text.join_with /style.separator) (text.enclose ["{" "}"]) (format "@font-face") :abstraction))) @@ -76,13 +80,14 @@ "") ";"))) - (def: css-separator text.new-line) + (def: css_separator + text.new_line) (type: #export Frame {#when Percentage #what Style}) - (def: #export (key-frames animation frames) + (def: #export (key_frames animation frames) (-> (Value Animation) (List Frame) (CSS Special)) (:abstraction (format "@keyframes " (/value.value animation) " {" (|> frames @@ -90,11 +95,11 @@ (format (/value.percentage (get@ #when frame)) " {" (/style.inline (get@ #what frame)) "}"))) - (text.join-with ..css-separator)) + (text.join_with ..css_separator)) "}"))) (template: (!compose
 )
-    (:abstraction (format (:representation 
) ..css-separator
+    (:abstraction (format (:representation 
) ..css_separator
                           (:representation ))))
   
   (def: #export (and pre post)
@@ -105,9 +110,9 @@
     (-> Combinator (Selector Any) (CSS Common) (CSS Common))
     (|> css
         :representation
-        (text.split-all-with ..css-separator)
+        (text.split_all_with ..css_separator)
         (list\map (|>> (format (/selector.selector (|> selector (combinator (/selector.tag "")))))))
-        (text.join-with ..css-separator)
+        (text.join_with ..css_separator)
         :abstraction))
 
   (def: #export (dependent combinator selector style inner)
@@ -120,7 +125,7 @@
        (-> (Selector Any) Style (CSS Common) (CSS Common))
        (..dependent ))]
 
-    [with-descendants /selector.in]
-    [with-children /selector.sub]
+    [with_descendants /selector.in]
+    [with_children /selector.sub]
     )
   )
diff --git a/stdlib/source/library/lux/data/format/css/property.lux b/stdlib/source/library/lux/data/format/css/property.lux
index 73544c26a..29f3681f9 100644
--- a/stdlib/source/library/lux/data/format/css/property.lux
+++ b/stdlib/source/library/lux/data/format/css/property.lux
@@ -53,7 +53,7 @@
               Z_Index)]])
 
 (syntax: (text_identifier {identifier s.text})
-  (wrap (list (code.local_identifier (text.replace_all "-" "_" identifier)))))
+  (in (list (code.local_identifier (text.replace_all "-" "_" identifier)))))
 
 (abstract: #export (Property brand)
   Text
diff --git a/stdlib/source/library/lux/data/format/css/query.lux b/stdlib/source/library/lux/data/format/css/query.lux
index 3e40701eb..115aeaf97 100644
--- a/stdlib/source/library/lux/data/format/css/query.lux
+++ b/stdlib/source/library/lux/data/format/css/query.lux
@@ -16,13 +16,13 @@
   ["." // #_
    ["#." value (#+ Value Length Count Resolution Ratio
                    Orientation Scan Boolean Update
-                   Block-Overflow Inline-Overflow
-                   Display-Mode Color-Gamut Inverted-Colors
+                   Block_Overflow Inline_Overflow
+                   Display_Mode Color_Gamut Inverted_Colors
                    Pointer Hover
-                   Light Scripting Motion Color-Scheme)]])
+                   Light Scripting Motion Color_Scheme)]])
 
-(syntax: (text-identifier {identifier s.text})
-  (wrap (list (code.local-identifier identifier))))
+(syntax: (text_identifier {identifier s.text})
+  (in (list (code.local_identifier (text.replace_all "-" "_" identifier)))))
 
 (abstract: #export Media
   Text
@@ -32,7 +32,7 @@
     (|>> :representation))
 
   (template []
-    [(`` (def: #export (~~ (text-identifier ))
+    [(`` (def: #export (~~ (text_identifier ))
            Media
            (:abstraction )))]
 
@@ -50,7 +50,7 @@
     (|>> :representation))
 
   (template [ ]
-    [(`` (def: #export ((~~ (text-identifier )) input)
+    [(`` (def: #export ((~~ (text_identifier )) input)
            (-> (Value ) Feature)
            (:abstraction (format "("  ": " (//value.value input) ")"))))]
 
@@ -82,15 +82,15 @@
     ["max-aspect-ratio" Ratio]
     ["min-aspect-ratio" Ratio]
 
-    ["display-mode" Display-Mode]
-    ["color-gamut" Color-Gamut]
+    ["display-mode" Display_Mode]
+    ["color-gamut" Color_Gamut]
     ["grid" Boolean]
     ["orientation" Orientation]
-    ["overflow-block" Block-Overflow]
-    ["overflow-inline" Inline-Overflow]
+    ["overflow-block" Block_Overflow]
+    ["overflow-inline" Inline_Overflow]
     ["scan" Scan]
     ["update" Update]
-    ["inverted-colors" Inverted-Colors]
+    ["inverted-colors" Inverted_Colors]
     ["pointer" Pointer]
     ["any-pointer" Pointer]
     ["hover" Hover]
@@ -98,7 +98,7 @@
     ["light-level" Light]
     ["scripting" Scripting]
     ["prefers-reduced-motion" Motion]
-    ["prefers-color-scheme" Color-Scheme]
+    ["prefers-color-scheme" Color_Scheme]
     )
   )
 
diff --git a/stdlib/source/library/lux/data/format/css/value.lux b/stdlib/source/library/lux/data/format/css/value.lux
index 5c6e575ed..85a775440 100644
--- a/stdlib/source/library/lux/data/format/css/value.lux
+++ b/stdlib/source/library/lux/data/format/css/value.lux
@@ -29,7 +29,7 @@
    [selector (#+ Label)]])
 
 (syntax: (text_identifier {identifier s.text})
-  (wrap (list (code.local_identifier (text.replace_all "-" "_" identifier)))))
+  (in (list (code.local_identifier (text.replace_all "-" "_" identifier)))))
 
 (template: (enumeration:    + +)
   (abstract: #export 
diff --git a/stdlib/source/library/lux/data/format/json.lux b/stdlib/source/library/lux/data/format/json.lux
index 30903df3c..417e7791d 100644
--- a/stdlib/source/library/lux/data/format/json.lux
+++ b/stdlib/source/library/lux/data/format/json.lux
@@ -1,5 +1,6 @@
-(.module: {#.doc (.doc "Functionality for reading and writing values in the JSON format."
-                       "For more information, please see: http://www.json.org/")}
+(.module:
+  {#.doc (.doc "Functionality for reading and writing values in the JSON format."
+               "For more information, please see: http://www.json.org/")}
   [library
    [lux #*
     ["." meta (#+ monad)]
@@ -79,16 +80,16 @@
     (case token
       (^template [  ]
         [[_ ( value)]
-         (wrap (list (` (: JSON ( (~ ( value)))))))])
+         (in (list (` (: JSON ( (~ ( value)))))))])
       ([#.Bit  code.bit  #..Boolean]
        [#.Frac code.frac #..Number]
        [#.Text code.text #..String])
 
       [_ (#.Tag ["" "null"])]
-      (wrap (list (` (: JSON #..Null))))
+      (in (list (` (: JSON #..Null))))
 
       [_ (#.Tuple members)]
-      (wrap (list (` (: JSON (#..Array ((~! row) (~+ (list\map wrapper members))))))))
+      (in (list (` (: JSON (#..Array ((~! row) (~+ (list\map wrapper members))))))))
 
       [_ (#.Record pairs)]
       (do {! ..monad}
@@ -96,17 +97,17 @@
                            (function (_ [slot value])
                              (case slot
                                [_ (#.Text key_name)]
-                               (wrap (` [(~ (code.text key_name)) (~ (wrapper value))]))
+                               (in (` [(~ (code.text key_name)) (~ (wrapper value))]))
 
                                _
                                (meta.failure "Wrong syntax for JSON object.")))
                            pairs)]
-        (wrap (list (` (: JSON (#..Object ((~! dictionary.of_list)
-                                           (~! text.hash)
-                                           (list (~+ pairs')))))))))
+        (in (list (` (: JSON (#..Object ((~! dictionary.of_list)
+                                         (~! text.hash)
+                                         (list (~+ pairs')))))))))
       
       _
-      (wrap (list token)))))
+      (in (list token)))))
 
 (def: #export (fields json)
   {#.doc "Get all the fields in a JSON object."}
@@ -187,7 +188,7 @@
                                             (do maybe.monad
                                               [x' (row.nth idx xs)
                                                y' (row.nth idx ys)]
-                                              (wrap (= x' y'))))))
+                                              (in (= x' y'))))))
                       #1
                       (list.indices (row.size xs))))
       
@@ -305,14 +306,14 @@
   (Parser Null)
   (do <>.monad
     [_ (.this "null")]
-    (wrap [])))
+    (in [])))
 
 (template [  ]
   [(def: 
      (Parser Boolean)
      (do <>.monad
        [_ (.this )]
-       (wrap )))]
+       (in )))]
 
   [true_parser  "true"  #1]
   [false_parser "false" #0]
@@ -338,31 +339,31 @@
                        [mark (.one_of "eE")
                         signed?' (<>.parses? (.this "-"))
                         offset (.many .decimal)]
-                       (wrap ($_ text\compose mark (if signed?' "-" "") offset))))]
+                       (in ($_ text\compose mark (if signed?' "-" "") offset))))]
     (case (f\decode ($_ text\compose (if signed? "-" "") digits "." decimals exp))
       (#try.Failure message)
       (<>.failure message)
       
       (#try.Success value)
-      (wrap value))))
+      (in value))))
 
 (def: escaped_parser
   (Parser Text)
   ($_ <>.either
       (<>.after (.this "\t")
-                (<>\wrap text.tab))
+                (<>\in text.tab))
       (<>.after (.this "\b")
-                (<>\wrap text.back_space))
+                (<>\in text.back_space))
       (<>.after (.this "\n")
-                (<>\wrap text.new_line))
+                (<>\in text.new_line))
       (<>.after (.this "\r")
-                (<>\wrap text.carriage_return))
+                (<>\in text.carriage_return))
       (<>.after (.this "\f")
-                (<>\wrap text.form_feed))
+                (<>\in text.form_feed))
       (<>.after (.this (text\compose "\" text.double_quote))
-                (<>\wrap text.double_quote))
+                (<>\in text.double_quote))
       (<>.after (.this "\\")
-                (<>\wrap "\"))))
+                (<>\in "\"))))
 
 (def: string_parser
   (Parser String)
@@ -375,8 +376,8 @@
         (do !
           [escaped escaped_parser
            next_chars (recur [])]
-          (wrap ($_ text\compose chars escaped next_chars)))
-        (wrap chars))))
+          (in ($_ text\compose chars escaped next_chars)))
+        (in chars))))
 
 (def: (kv_parser json_parser)
   (-> (Parser JSON) (Parser [String JSON]))
@@ -386,7 +387,7 @@
      _ (.this ..entry_separator)
      _ ..space_parser
      value json_parser]
-    (wrap [key value])))
+    (in [key value])))
 
 (template [     ]
   [(def: ( json_parser)
@@ -397,7 +398,7 @@
         elems (<>.separated_by ..separator_parser )
         _ space_parser
         _ (.this )]
-       (wrap ( elems))))]
+       (in ( elems))))]
 
   [array_parser  Array  ..open_array ..close_array json_parser row.of_list]
   [object_parser Object ..open_object ..close_object (kv_parser json_parser) (dictionary.of_list text.hash)]
diff --git a/stdlib/source/library/lux/data/format/tar.lux b/stdlib/source/library/lux/data/format/tar.lux
index b4ae34e8a..d216a1ef8 100644
--- a/stdlib/source/library/lux/data/format/tar.lux
+++ b/stdlib/source/library/lux/data/format/tar.lux
@@ -74,7 +74,7 @@
        (-> Nat (Try ))
        (if (n.<  value)
          (#try.Success (:abstraction value))
-         (exception.throw  [value])))
+         (exception.except  [value])))
 
      (def: #export 
        (->  Nat)
@@ -123,7 +123,7 @@
      _ (let [expected (`` (char (~~ (static ..null))))]
          (<>.assert (exception.construct ..wrong_character [expected end])
                     (n.= expected end)))]
-    (wrap [])))
+    (in [])))
 
 (def: small_parser
   (Parser Small)
@@ -200,8 +200,8 @@
        _ ..verify_small_suffix
        value (<>.lift
               (\ n.octal decode digits))]
-      (wrap [value
-             (:abstraction (format digits ..checksum_suffix))])))
+      (in [value
+           (:abstraction (format digits ..checksum_suffix))])))
   )
 
 (def: last_ascii
@@ -254,8 +254,8 @@
        (if (..ascii? value)
          (if (|> value (\ utf8.codec encode) binary.size (n.<= ))
            (#try.Success (:abstraction value))
-           (exception.throw  [value]))
-         (exception.throw ..not_ascii [value])))
+           (exception.except  [value]))
+         (exception.except ..not_ascii [value])))
 
      (def: #export 
        (->  )
@@ -421,12 +421,12 @@
         (case (.nat linkflag)
           (^template [ ]
             [(^ )
-             (wrap )])
+             (in )])
           ()
 
           _
           (<>.lift
-           (exception.throw ..invalid_link_flag [(.nat linkflag)]))))))
+           (exception.except ..invalid_link_flag [(.nat linkflag)]))))))
   )
 
 (abstract: #export Mode
@@ -506,9 +506,9 @@
         [value (\ ! map ..from_small ..small_parser)]
         (if (n.<= (:representation ..maximum_mode)
                   value)
-          (wrap (:abstraction value))
+          (in (:abstraction value))
           (<>.lift
-           (exception.throw ..invalid_mode [value]))))))
+           (exception.except ..invalid_mode [value]))))))
   )
 
 (def: maximum_content_size
@@ -524,7 +524,7 @@
     (-> Binary (Try Content))
     (do try.monad
       [size (..big (binary.size content))]
-      (wrap (:abstraction [size content]))))
+      (in (:abstraction [size content]))))
 
   (def: from_content
     (-> Content [Big Binary])
@@ -773,20 +773,20 @@
      major_device ..small_parser
      minor_device ..small_parser
      _ (.segment ..header_padding_size)]
-    (wrap {#path path
-           #mode mode
-           #user_id user_id
-           #group_id group_id
-           #size size
-           #modification_time modification_time
-           #checksum checksum_code
-           #link_flag link_flag
-           #link_name link_name
-           #magic magic
-           #user_name user_name
-           #group_name group_name
-           #major_device major_device
-           #minor_device minor_device})))
+    (in {#path path
+         #mode mode
+         #user_id user_id
+         #group_id group_id
+         #size size
+         #modification_time modification_time
+         #checksum checksum_code
+         #link_flag link_flag
+         #link_name link_name
+         #magic magic
+         #user_name user_name
+         #group_name group_name
+         #major_device major_device
+         #minor_device minor_device})))
 
 (exception: #export (wrong_link_flag {expected Link_Flag} {actual Link_Flag})
   (exception.report
@@ -804,20 +804,20 @@
      content (.segment (..from_big size))
      content (<>.lift (..content content))
      _ (.segment (n.- (..from_big size) rounded_size))]
-    (wrap [(get@ #path header)
-           (|> header
-               (get@ #modification_time)
-               ..from_big
-               .int
-               duration.of_millis
-               (duration.up (|> duration.second duration.to_millis .nat))
-               instant.absolute)
-           (get@ #mode header)
-           {#user {#name (get@ #user_name header)
-                   #id (get@ #user_id header)}
-            #group {#name (get@ #group_name header)
-                    #id (get@ #group_id header)}}
-           content])))
+    (in [(get@ #path header)
+         (|> header
+             (get@ #modification_time)
+             ..from_big
+             .int
+             duration.of_millis
+             (duration.up (|> duration.second duration.to_millis .nat))
+             instant.absolute)
+         (get@ #mode header)
+         {#user {#name (get@ #user_name header)
+                 #id (get@ #user_id header)}
+          #group {#name (get@ #group_name header)
+                  #id (get@ #group_id header)}}
+         content])))
 
 (def: (file_name_parser expected extractor)
   (-> Link_Flag (-> Header Path) (Parser Path))
@@ -827,7 +827,7 @@
         (exception.assert ..wrong_link_flag [expected (get@ #link_flag header)]
                           (n.= (..link_flag expected)
                                (..link_flag (get@ #link_flag header)))))]
-    (wrap (extractor header))))
+    (in (extractor header))))
 
 (def: entry_parser
   (Parser Entry)
diff --git a/stdlib/source/library/lux/data/format/xml.lux b/stdlib/source/library/lux/data/format/xml.lux
index 7dd861762..468100e5b 100644
--- a/stdlib/source/library/lux/data/format/xml.lux
+++ b/stdlib/source/library/lux/data/format/xml.lux
@@ -44,11 +44,11 @@
 (def: xml_standard_escape_char^
   (Parser Text)
   ($_ <>.either
-      (<>.after (.this "<") (<>\wrap "<"))
-      (<>.after (.this ">") (<>\wrap ">"))
-      (<>.after (.this "&") (<>\wrap "&"))
-      (<>.after (.this "'") (<>\wrap "'"))
-      (<>.after (.this """) (<>\wrap text.double_quote))
+      (<>.after (.this "<") (<>\in "<"))
+      (<>.after (.this ">") (<>\in ">"))
+      (<>.after (.this "&") (<>\in "&"))
+      (<>.after (.this "'") (<>\in "'"))
+      (<>.after (.this """) (<>\in text.double_quote))
       ))
 
 (def: xml_unicode_escape_char^
@@ -61,7 +61,7 @@
 
                 (#.Some _)
                 (<>.codec int.decimal (.many .hexadecimal)))]
-        (wrap (|> code .nat text.of_code)))
+        (in (|> code .nat text.of_code)))
       (<>.before (.this ";"))
       (<>.after (.this "&#"))))
 
@@ -82,7 +82,7 @@
                      .alpha)
      tail (.some (<>.either (.one_of "_.-")
                                   .alpha_num))]
-    (wrap ($_ text\compose head tail))))
+    (in ($_ text\compose head tail))))
 
 (def: namespaced_symbol^
   (Parser Name)
@@ -91,10 +91,10 @@
      ?second_part (<| <>.maybe (<>.after (.this ..namespace_separator)) xml_identifier)]
     (case ?second_part
       #.None
-      (wrap ["" first_part])
+      (in ["" first_part])
 
       (#.Some second_part)
-      (wrap [first_part second_part]))))
+      (in [first_part second_part]))))
 
 (def: tag^ namespaced_symbol^)
 (def: attr_name^ namespaced_symbol^)
@@ -174,18 +174,18 @@
                 #let [no_children^ ($_ <>.either
                                        (do <>.monad
                                          [_ (.this "/>")]
-                                         (wrap (#Node tag attrs (list))))
+                                         (in (#Node tag attrs (list))))
                                        (do <>.monad
                                          [_ (.this ">")
                                           _ (<>.some (<>.either .space
                                                                 ..comment^))
                                           _ (..close_tag^ tag)]
-                                         (wrap (#Node tag attrs (list)))))
+                                         (in (#Node tag attrs (list)))))
                       with_children^ (do <>.monad
                                        [_ (.this ">")
                                         children (<>.many node^)
                                         _ (..close_tag^ tag)]
-                                       (wrap (#Node tag attrs children)))]]
+                                       (in (#Node tag attrs children)))]]
                ($_ <>.either
                    no_children^
                    with_children^))
diff --git a/stdlib/source/library/lux/data/identity.lux b/stdlib/source/library/lux/data/identity.lux
index c0a39ab5e..521f66e3e 100644
--- a/stdlib/source/library/lux/data/identity.lux
+++ b/stdlib/source/library/lux/data/identity.lux
@@ -27,12 +27,12 @@
   (Monad Identity)
   
   (def: &functor ..functor)
-  (def: wrap function.identity)
+  (def: in function.identity)
   (def: join function.identity))
 
 (implementation: #export comonad
   (CoMonad Identity)
   
   (def: &functor ..functor)
-  (def: unwrap function.identity)
+  (def: out function.identity)
   (def: split function.identity))
diff --git a/stdlib/source/library/lux/data/lazy.lux b/stdlib/source/library/lux/data/lazy.lux
index c9a6ae18c..016a5a18a 100644
--- a/stdlib/source/library/lux/data/lazy.lux
+++ b/stdlib/source/library/lux/data/lazy.lux
@@ -39,7 +39,7 @@
 
 (syntax: #export (freeze expr)
   (with_gensyms [g!_]
-    (wrap (list (` ((~! freeze') (function ((~ g!_) (~ g!_)) (~ expr))))))))
+    (in (list (` ((~! freeze') (function ((~ g!_) (~ g!_)) (~ expr))))))))
 
 (implementation: #export (equivalence (^open "_\."))
   (All [a] (-> (Equivalence a) (Equivalence (Lazy a))))
@@ -64,5 +64,5 @@
   (Monad Lazy)
   
   (def: &functor ..functor)
-  (def: wrap (|>> freeze))
+  (def: in (|>> freeze))
   (def: join thaw))
diff --git a/stdlib/source/library/lux/data/maybe.lux b/stdlib/source/library/lux/data/maybe.lux
index ed6a875ce..d51bfed90 100644
--- a/stdlib/source/library/lux/data/maybe.lux
+++ b/stdlib/source/library/lux/data/maybe.lux
@@ -54,7 +54,7 @@
   
   (def: &functor ..functor)
 
-  (def: (wrap x)
+  (def: (in x)
     (#.Some x))
 
   (def: (join mma)
@@ -98,21 +98,21 @@
 
   (def: &functor (functor.compose (get@ #monad.&functor monad) ..functor))
 
-  (def: wrap (|>> (\ ..monad wrap) (\ monad wrap)))
+  (def: in (|>> (\ ..monad in) (\ monad in)))
   
   (def: (join MmMma)
     (do monad
       [mMma MmMma]
       (case mMma
         #.None
-        (wrap #.None)
+        (in #.None)
 
         (#.Some Mma)
         Mma))))
 
 (def: #export (lift monad)
   (All [M a] (-> (Monad M) (-> (M a) (M (Maybe a)))))
-  (\ monad map (\ ..monad wrap)))
+  (\ monad map (\ ..monad in)))
 
 (macro: #export (default tokens state)
   {#.doc (doc "Allows you to provide a default value that will be used"
diff --git a/stdlib/source/library/lux/data/store.lux b/stdlib/source/library/lux/data/store.lux
index 3a6d73386..ecc34fde5 100644
--- a/stdlib/source/library/lux/data/store.lux
+++ b/stdlib/source/library/lux/data/store.lux
@@ -29,7 +29,7 @@
   
   (def: &functor ..functor)
 
-  (def: (unwrap wa) (\\ peek (\\ cursor)))
+  (def: (out wa) (\\ peek (\\ cursor)))
 
   (def: split (extend id)))
 
diff --git a/stdlib/source/library/lux/data/text.lux b/stdlib/source/library/lux/data/text.lux
index 7dfebd734..15dd8ec04 100644
--- a/stdlib/source/library/lux/data/text.lux
+++ b/stdlib/source/library/lux/data/text.lux
@@ -172,7 +172,7 @@
     [index (index_of token sample)
      [pre post'] (split index sample)
      [_ post] (split (size token) post')]
-    (wrap [pre post])))
+    (in [pre post])))
 
 (def: #export (split_all_with token sample)
   (-> Text Text (List Text))
@@ -194,7 +194,7 @@
   (<| (maybe.default template)
       (do maybe.monad
         [[pre post] (..split_with pattern template)]
-        (wrap ($_ "lux text concat" pre replacement post)))))
+        (in ($_ "lux text concat" pre replacement post)))))
 
 (def: #export (replace_all pattern replacement template)
   (-> Text Text Text Text)
diff --git a/stdlib/source/library/lux/data/text/escape.lux b/stdlib/source/library/lux/data/text/escape.lux
index 08724a881..9ca9ecfe1 100644
--- a/stdlib/source/library/lux/data/text/escape.lux
+++ b/stdlib/source/library/lux/data/text/escape.lux
@@ -188,7 +188,7 @@
                      limit']))
     
     (#try.Failure error)
-    (exception.throw ..invalid_unicode_escape [current offset])))
+    (exception.except ..invalid_unicode_escape [current offset])))
 
 (def: #export (un_escape text)
   (-> Text (Try Text))
@@ -223,11 +223,11 @@
                   (do try.monad
                     [[previous' current' limit'] (..unicode_un_escape offset previous current limit)]
                     (recur 0 previous' current' limit'))
-                  (exception.throw ..invalid_unicode_escape [text offset])))
+                  (exception.except ..invalid_unicode_escape [text offset])))
 
               invalid_sigil
-              (exception.throw ..invalid_escape [text offset invalid_sigil]))
-            (exception.throw ..dangling_escape [text])))
+              (exception.except ..invalid_escape [text offset invalid_sigil]))
+            (exception.except ..dangling_escape [text])))
 
         _
         (recur (inc offset) previous current limit))
@@ -238,7 +238,7 @@
 (syntax: #export (escaped {literal .text})
   (case (..un_escape literal)
     (#try.Success un_escaped)
-    (wrap (list (code.text un_escaped)))
+    (in (list (code.text un_escaped)))
     
     (#try.Failure error)
     (meta.failure error)))
diff --git a/stdlib/source/library/lux/data/text/format.lux b/stdlib/source/library/lux/data/text/format.lux
index c1a1478b6..5b59cf98a 100644
--- a/stdlib/source/library/lux/data/text/format.lux
+++ b/stdlib/source/library/lux/data/text/format.lux
@@ -52,7 +52,7 @@
 (syntax: #export (format {fragments (<>.many .any)})
   {#.doc (doc "Text interpolation."
               (format "Static part " (text static) " does not match URI: " uri))}
-  (wrap (.list (` ($_ "lux text concat" (~+ fragments))))))
+  (in (.list (` ($_ "lux text concat" (~+ fragments))))))
 
 (template [  ]
   [(def: #export 
diff --git a/stdlib/source/library/lux/data/text/regex.lux b/stdlib/source/library/lux/data/text/regex.lux
index c390e1c08..63aca69fb 100644
--- a/stdlib/source/library/lux/data/text/regex.lux
+++ b/stdlib/source/library/lux/data/text/regex.lux
@@ -40,7 +40,7 @@
   (do <>.monad
     [output base^
      _ (.local output refinement^)]
-    (wrap output)))
+    (in output)))
 
 (def: word^
   (Parser Text)
@@ -49,13 +49,13 @@
 
 (def: (copy reference)
   (-> Text (Parser Text))
-  (<>.after (.this reference) (<>\wrap reference)))
+  (<>.after (.this reference) (<>\in reference)))
 
 (def: (join_text^ part^)
   (-> (Parser (List Text)) (Parser Text))
   (do <>.monad
     [parts part^]
-    (wrap (//.join_with "" parts))))
+    (in (//.join_with "" parts))))
 
 (def: name_char^
   (Parser Text)
@@ -67,21 +67,21 @@
     [head (refine^ (.not .decimal)
                    name_char^)
      tail (.some name_char^)]
-    (wrap (format head tail))))
+    (in (format head tail))))
 
 (def: (name^ current_module)
   (-> Text (Parser Name))
   ($_ <>.either
-      (<>.and (<>\wrap current_module) (<>.after (.this "..") name_part^))
+      (<>.and (<>\in current_module) (<>.after (.this "..") name_part^))
       (<>.and name_part^ (<>.after (.this ".") name_part^))
-      (<>.and (<>\wrap .prelude_module) (<>.after (.this ".") name_part^))
-      (<>.and (<>\wrap "") name_part^)))
+      (<>.and (<>\in .prelude_module) (<>.after (.this ".") name_part^))
+      (<>.and (<>\in "") name_part^)))
 
 (def: (re_var^ current_module)
   (-> Text (Parser Code))
   (do <>.monad
     [name (.enclosed ["\@<" ">"] (name^ current_module))]
-    (wrap (` (: (Parser Text) (~ (code.identifier name)))))))
+    (in (` (: (Parser Text) (~ (code.identifier name)))))))
 
 (def: re_range^
   (Parser Code)
@@ -89,19 +89,19 @@
     [from (|> regex_char^ (\ ! map (|>> (//.nth 0) maybe.assume)))
      _ (.this "-")
      to (|> regex_char^ (\ ! map (|>> (//.nth 0) maybe.assume)))]
-    (wrap (` (.range (~ (code.nat from)) (~ (code.nat to)))))))
+    (in (` (.range (~ (code.nat from)) (~ (code.nat to)))))))
 
 (def: re_char^
   (Parser Code)
   (do <>.monad
     [char escaped_char^]
-    (wrap (` ((~! ..copy) (~ (code.text char)))))))
+    (in (` ((~! ..copy) (~ (code.text char)))))))
 
 (def: re_options^
   (Parser Code)
   (do <>.monad
     [options (.many escaped_char^)]
-    (wrap (` (.one_of (~ (code.text options)))))))
+    (in (` (.one_of (~ (code.text options)))))))
 
 (def: re_user_class^'
   (Parser Code)
@@ -110,20 +110,20 @@
      parts (<>.many ($_ <>.either
                         re_range^
                         re_options^))]
-    (wrap (case negate?
-            (#.Some _) (` (.not ($_ <>.either (~+ parts))))
-            #.None     (` ($_ <>.either (~+ parts)))))))
+    (in (case negate?
+          (#.Some _) (` (.not ($_ <>.either (~+ parts))))
+          #.None     (` ($_ <>.either (~+ parts)))))))
 
 (def: re_user_class^
   (Parser Code)
   (do <>.monad
-    [_ (wrap [])
+    [_ (in [])
      init re_user_class^'
      rest (<>.some (<>.after (.this "&&") (.enclosed ["[" "]"] re_user_class^')))]
-    (wrap (list\fold (function (_ refinement base)
-                       (` ((~! refine^) (~ refinement) (~ base))))
-                     init
-                     rest))))
+    (in (list\fold (function (_ refinement base)
+                     (` ((~! refine^) (~ refinement) (~ base))))
+                   init
+                   rest))))
 
 (def: blank^
   (Parser Text)
@@ -157,28 +157,28 @@
   (do <>.monad
     []
     ($_ <>.either
-        (<>.after (.this ".") (wrap (` .any)))
-        (<>.after (.this "\d") (wrap (` .decimal)))
-        (<>.after (.this "\D") (wrap (` (.not .decimal))))
-        (<>.after (.this "\s") (wrap (` .space)))
-        (<>.after (.this "\S") (wrap (` (.not .space))))
-        (<>.after (.this "\w") (wrap (` (~! word^))))
-        (<>.after (.this "\W") (wrap (` (.not (~! word^)))))
-
-        (<>.after (.this "\p{Lower}") (wrap (` .lower)))
-        (<>.after (.this "\p{Upper}") (wrap (` .upper)))
-        (<>.after (.this "\p{Alpha}") (wrap (` .alpha)))
-        (<>.after (.this "\p{Digit}") (wrap (` .decimal)))
-        (<>.after (.this "\p{Alnum}") (wrap (` .alpha_num)))
-        (<>.after (.this "\p{Space}") (wrap (` .space)))
-        (<>.after (.this "\p{HexDigit}") (wrap (` .hexadecimal)))
-        (<>.after (.this "\p{OctDigit}") (wrap (` .octal)))
-        (<>.after (.this "\p{Blank}") (wrap (` (~! blank^))))
-        (<>.after (.this "\p{ASCII}") (wrap (` (~! ascii^))))
-        (<>.after (.this "\p{Contrl}") (wrap (` (~! control^))))
-        (<>.after (.this "\p{Punct}") (wrap (` (~! punct^))))
-        (<>.after (.this "\p{Graph}") (wrap (` (~! graph^))))
-        (<>.after (.this "\p{Print}") (wrap (` (~! print^))))
+        (<>.after (.this ".") (in (` .any)))
+        (<>.after (.this "\d") (in (` .decimal)))
+        (<>.after (.this "\D") (in (` (.not .decimal))))
+        (<>.after (.this "\s") (in (` .space)))
+        (<>.after (.this "\S") (in (` (.not .space))))
+        (<>.after (.this "\w") (in (` (~! word^))))
+        (<>.after (.this "\W") (in (` (.not (~! word^)))))
+
+        (<>.after (.this "\p{Lower}") (in (` .lower)))
+        (<>.after (.this "\p{Upper}") (in (` .upper)))
+        (<>.after (.this "\p{Alpha}") (in (` .alpha)))
+        (<>.after (.this "\p{Digit}") (in (` .decimal)))
+        (<>.after (.this "\p{Alnum}") (in (` .alpha_num)))
+        (<>.after (.this "\p{Space}") (in (` .space)))
+        (<>.after (.this "\p{HexDigit}") (in (` .hexadecimal)))
+        (<>.after (.this "\p{OctDigit}") (in (` .octal)))
+        (<>.after (.this "\p{Blank}") (in (` (~! blank^))))
+        (<>.after (.this "\p{ASCII}") (in (` (~! ascii^))))
+        (<>.after (.this "\p{Contrl}") (in (` (~! control^))))
+        (<>.after (.this "\p{Punct}") (in (` (~! punct^))))
+        (<>.after (.this "\p{Graph}") (in (` (~! graph^))))
+        (<>.after (.this "\p{Print}") (in (` (~! print^))))
         )))
 
 (def: re_class^
@@ -196,12 +196,12 @@
   (<>.either (do <>.monad
                [_ (.this "\")
                 id number^]
-               (wrap (` ((~! ..copy) (~ (code.identifier ["" (n\encode id)]))))))
+               (in (` ((~! ..copy) (~ (code.identifier ["" (n\encode id)]))))))
              (do <>.monad
                [_ (.this "\k<")
                 captured_name name_part^
                 _ (.this ">")]
-               (wrap (` ((~! ..copy) (~ (code.identifier ["" captured_name]))))))))
+               (in (` ((~! ..copy) (~ (code.identifier ["" captured_name]))))))))
 
 (def: (re_simple^ current_module)
   (-> Text (Parser Code))
@@ -219,14 +219,14 @@
      quantifier (.one_of "?*+")]
     (case quantifier
       "?"
-      (wrap (` (<>.default "" (~ base))))
+      (in (` (<>.default "" (~ base))))
       
       "*"
-      (wrap (` ((~! join_text^) (<>.some (~ base)))))
+      (in (` ((~! join_text^) (<>.some (~ base)))))
       
       ## "+"
       _
-      (wrap (` ((~! join_text^) (<>.many (~ base)))))
+      (in (` ((~! join_text^) (<>.many (~ base)))))
       )))
 
 (def: (re_counted_quantified^ current_module)
@@ -237,18 +237,18 @@
                   ($_ <>.either
                       (do !
                         [[from to] (<>.and number^ (<>.after (.this ",") number^))]
-                        (wrap (` ((~! join_text^) (<>.between (~ (code.nat from))
-                                                              (~ (code.nat to))
-                                                              (~ base))))))
+                        (in (` ((~! join_text^) (<>.between (~ (code.nat from))
+                                                            (~ (code.nat to))
+                                                            (~ base))))))
                       (do !
                         [limit (<>.after (.this ",") number^)]
-                        (wrap (` ((~! join_text^) (<>.at_most (~ (code.nat limit)) (~ base))))))
+                        (in (` ((~! join_text^) (<>.at_most (~ (code.nat limit)) (~ base))))))
                       (do !
                         [limit (<>.before (.this ",") number^)]
-                        (wrap (` ((~! join_text^) (<>.at_least (~ (code.nat limit)) (~ base))))))
+                        (in (` ((~! join_text^) (<>.at_least (~ (code.nat limit)) (~ base))))))
                       (do !
                         [limit number^]
-                        (wrap (` ((~! join_text^) (<>.exactly (~ (code.nat limit)) (~ base))))))))))
+                        (in (` ((~! join_text^) (<>.exactly (~ (code.nat limit)) (~ base))))))))))
 
 (def: (re_quantified^ current_module)
   (-> Text (Parser Code))
@@ -307,18 +307,18 @@
                                        (: (List Code) (list))
                                        (: (List (List Code)) (list))]
                                       parts)]]
-    (wrap [(if capturing?
-             (list.size names)
-             0)
-           (` (do <>.monad
-                [(~ (' #let)) [(~ g!total) ""]
-                 (~+ (|> steps list.reverse list\join))]
-                ((~ (' wrap)) [(~ g!total) (~+ (list.reverse names))])))])
+    (in [(if capturing?
+           (list.size names)
+           0)
+         (` (do <>.monad
+              [(~ (' #let)) [(~ g!total) ""]
+               (~+ (|> steps list.reverse list\join))]
+              ((~ (' in)) [(~ g!total) (~+ (list.reverse names))])))])
     ))
 
 (def: (unflatten^ lexer)
   (-> (Parser Text) (Parser [Text Any]))
-  (<>.and lexer (\ <>.monad wrap [])))
+  (<>.and lexer (\ <>.monad in [])))
 
 (def: (|||^ left right)
   (All [l r] (-> (Parser [Text l]) (Parser [Text r]) (Parser [Text (| l r)])))
@@ -366,13 +366,13 @@
      head sub^
      tail (<>.some (<>.after (.this "|") sub^))]
     (if (list.empty? tail)
-      (wrap head)
-      (wrap [(list\fold n.max (product.left head) (list\map product.left tail))
-             (` ($_ ((~ (if capturing?
-                          (` (~! |||^))
-                          (` (~! |||_^)))))
-                    (~ (prep_alternative head))
-                    (~+ (list\map prep_alternative tail))))]))))
+      (in head)
+      (in [(list\fold n.max (product.left head) (list\map product.left tail))
+           (` ($_ ((~ (if capturing?
+                        (` (~! |||^))
+                        (` (~! |||_^)))))
+                  (~ (prep_alternative head))
+                  (~+ (list\map prep_alternative tail))))]))))
 
 (def: (re_scoped^ current_module)
   (-> Text (Parser [Re_Group Code]))
@@ -381,22 +381,22 @@
         [_ (.this "(?:")
          [_ scoped] (re_alternative^ #0 re_scoped^ current_module)
          _ (.this ")")]
-        (wrap [#Non_Capturing scoped]))
+        (in [#Non_Capturing scoped]))
       (do <>.monad
         [complex (re_complex^ current_module)]
-        (wrap [#Non_Capturing complex]))
+        (in [#Non_Capturing complex]))
       (do <>.monad
         [_ (.this "(?<")
          captured_name name_part^
          _ (.this ">")
          [num_captures pattern] (re_alternative^ #1 re_scoped^ current_module)
          _ (.this ")")]
-        (wrap [(#Capturing [(#.Some captured_name) num_captures]) pattern]))
+        (in [(#Capturing [(#.Some captured_name) num_captures]) pattern]))
       (do <>.monad
         [_ (.this "(")
          [num_captures pattern] (re_alternative^ #1 re_scoped^ current_module)
          _ (.this ")")]
-        (wrap [(#Capturing [#.None num_captures]) pattern]))))
+        (in [(#Capturing [#.None num_captures]) pattern]))))
 
 (def: (regex^ current_module)
   (-> Text (Parser Code))
@@ -470,7 +470,7 @@
                             error))
 
       (#try.Success regex)
-      (wrap (list regex))
+      (in (list regex))
       )))
 
 (syntax: #export (^regex {[pattern bindings] (.form (<>.and .text (<>.maybe .any)))}
@@ -488,8 +488,8 @@
                 _
                 do_something_else))}
   (with_gensyms [g!temp]
-    (wrap (list& (` (^multi (~ g!temp)
-                            {((~! .run) (..regex (~ (code.text pattern))) (~ g!temp))
-                             (#try.Success (~ (maybe.default g!temp bindings)))}))
-                 body
-                 branches))))
+    (in (list& (` (^multi (~ g!temp)
+                          {((~! .run) (..regex (~ (code.text pattern))) (~ g!temp))
+                           (#try.Success (~ (maybe.default g!temp bindings)))}))
+               body
+               branches))))
diff --git a/stdlib/source/library/lux/data/trace.lux b/stdlib/source/library/lux/data/trace.lux
index 0edcff430..9646fa0f3 100644
--- a/stdlib/source/library/lux/data/trace.lux
+++ b/stdlib/source/library/lux/data/trace.lux
@@ -18,7 +18,7 @@
 (implementation: #export comonad (All [t] (CoMonad (Trace t)))
   (def: &functor ..functor)
 
-  (def: (unwrap wa)
+  (def: (out wa)
     ((get@ #trace wa)
      (get@ [#monoid #monoid.identity] wa)))
 
diff --git a/stdlib/source/library/lux/debug.lux b/stdlib/source/library/lux/debug.lux
index 4ca51d344..c57394dd3 100644
--- a/stdlib/source/library/lux/debug.lux
+++ b/stdlib/source/library/lux/debug.lux
@@ -390,12 +390,12 @@
   (`` ($_ <>.either
           (do <>.monad
             [_ (.exactly Any)]
-            (wrap (function.constant "[]")))
+            (in (function.constant "[]")))
           
           (~~ (template [ ]
                 [(do <>.monad
                    [_ (.sub )]
-                   (wrap (|>> (:as ) )))]
+                   (in (|>> (:as ) )))]
 
                 [Bit %.bit]
                 [Nat %.nat]
@@ -411,7 +411,7 @@
           (~~ (template [ ]
                 [(do <>.monad
                    [_ (.sub )]
-                   (wrap (|>> (:as ) )))]
+                   (in (|>> (:as ) )))]
 
                 [Ratio %.ratio]
                 [Name %.name]
@@ -432,58 +432,58 @@
           (do <>.monad
             [[_ elemT] (.applied (<>.and (.exactly List) .any))
              elemR (.local (list elemT) representation)]
-            (wrap (|>> (:as (List Any)) (%.list elemR))))
+            (in (|>> (:as (List Any)) (%.list elemR))))
 
           (do <>.monad
             [[_ elemT] (.applied (<>.and (.exactly Maybe) .any))
              elemR (.local (list elemT) representation)]
-            (wrap (|>> (:as (Maybe Any))
-                       (%.maybe elemR)))))))
+            (in (|>> (:as (Maybe Any))
+                     (%.maybe elemR)))))))
 
 (def: (variant_representation representation)
   (-> (Parser Representation) (Parser Representation))
   (do <>.monad
     [membersR+ (.variant (<>.many representation))]
-    (wrap (function (_ variantV)
-            (let [[lefts right? sub_repr] (loop [lefts 0
-                                                 representations membersR+
-                                                 variantV variantV]
-                                            (case representations
-                                              (#.Cons leftR (#.Cons rightR extraR+))
-                                              (case (:as (| Any Any) variantV)
-                                                (#.Left left)
-                                                [lefts #0 (leftR left)]
-
-                                                (#.Right right)
-                                                (case extraR+
-                                                  #.Nil
-                                                  [lefts #1 (rightR right)]
-
-                                                  _
-                                                  (recur (inc lefts) (#.Cons rightR extraR+) right)))
-
-                                              _
-                                              (undefined)))]
-              (%.format "(" (%.nat lefts) " " (%.bit right?) " " sub_repr ")"))))))
+    (in (function (_ variantV)
+          (let [[lefts right? sub_repr] (loop [lefts 0
+                                               representations membersR+
+                                               variantV variantV]
+                                          (case representations
+                                            (#.Cons leftR (#.Cons rightR extraR+))
+                                            (case (:as (| Any Any) variantV)
+                                              (#.Left left)
+                                              [lefts #0 (leftR left)]
+
+                                              (#.Right right)
+                                              (case extraR+
+                                                #.Nil
+                                                [lefts #1 (rightR right)]
+
+                                                _
+                                                (recur (inc lefts) (#.Cons rightR extraR+) right)))
+
+                                            _
+                                            (undefined)))]
+            (%.format "(" (%.nat lefts) " " (%.bit right?) " " sub_repr ")"))))))
 
 (def: (tuple_representation representation)
   (-> (Parser Representation) (Parser Representation))
   (do <>.monad
     [membersR+ (.tuple (<>.many representation))]
-    (wrap (function (_ tupleV)
-            (let [tuple_body (loop [representations membersR+
-                                    tupleV tupleV]
-                               (case representations
-                                 #.Nil
-                                 ""
-                                 
-                                 (#.Cons lastR #.Nil)
-                                 (lastR tupleV)
-                                 
-                                 (#.Cons headR tailR)
-                                 (let [[leftV rightV] (:as [Any Any] tupleV)]
-                                   (%.format (headR leftV) " " (recur tailR rightV)))))]
-              (%.format "[" tuple_body "]"))))))
+    (in (function (_ tupleV)
+          (let [tuple_body (loop [representations membersR+
+                                  tupleV tupleV]
+                             (case representations
+                               #.Nil
+                               ""
+                               
+                               (#.Cons lastR #.Nil)
+                               (lastR tupleV)
+                               
+                               (#.Cons headR tailR)
+                               (let [[leftV rightV] (:as [Any Any] tupleV)]
+                                 (%.format (headR leftV) " " (recur tailR rightV)))))]
+            (%.format "[" tuple_body "]"))))))
 
 (def: representation_parser
   (Parser Representation)
@@ -518,13 +518,13 @@
     (#try.Success (representation value))
 
     (#try.Failure _)
-    (exception.throw ..cannot_represent_value type)))
+    (exception.except ..cannot_represent_value type)))
 
 (syntax: #export (private {definition .identifier})
   (let [[module _] definition]
-    (wrap (list (` ("lux in-module"
-                    (~ (code.text module))
-                    (~ (code.identifier definition))))))))
+    (in (list (` ("lux in-module"
+                  (~ (code.text module))
+                  (~ (code.identifier definition))))))))
 
 (def: #export (log! message)
   {#.doc "Logs message to standard output."}
@@ -540,7 +540,7 @@
   (do meta.monad
     [location meta.location
      expectedT meta.expected_type]
-    (function.constant (exception.throw ..type_hole [location expectedT]))))
+    (function.constant (exception.except ..type_hole [location expectedT]))))
 
 (type: Target
   [Text (Maybe Code)])
@@ -548,7 +548,7 @@
 (def: target
   (.Parser Target)
   (<>.either (<>.and .local_identifier
-                     (\ <>.monad wrap #.None))
+                     (\ <>.monad in #.None))
              (.record (<>.and .local_identifier
                                     (\ <>.monad map (|>> #.Some) .any)))))
 
@@ -575,24 +575,24 @@
                   (|> environment
                       dictionary.keys
                       (list\map (function (_ local) [local #.None]))
-                      wrap)
+                      in)
 
                   _
                   (monad.map ! (function (_ [name format])
                                  (if (dictionary.key? environment name)
-                                   (wrap [name format])
-                                   (function.constant (exception.throw ..unknown_local_binding [name]))))
+                                   (in [name format])
+                                   (function.constant (exception.except ..unknown_local_binding [name]))))
                              targets)))]
-    (wrap (list (` (..log! ("lux text concat"
-                            (~ (code.text (%.format (%.location location) text.new_line)))
-                            ((~! exception.report)
-                             (~+ (list\map (function (_ [name format])
-                                             (let [format (case format
-                                                            #.None
-                                                            (` (~! ..inspection))
-                                                            
-                                                            (#.Some format)
-                                                            format)]
-                                               (` [(~ (code.text name))
-                                                   ((~ format) (~ (code.local_identifier name)))])))
-                                           targets))))))))))
+    (in (list (` (..log! ("lux text concat"
+                          (~ (code.text (%.format (%.location location) text.new_line)))
+                          ((~! exception.report)
+                           (~+ (list\map (function (_ [name format])
+                                           (let [format (case format
+                                                          #.None
+                                                          (` (~! ..inspection))
+                                                          
+                                                          (#.Some format)
+                                                          format)]
+                                             (` [(~ (code.text name))
+                                                 ((~ format) (~ (code.local_identifier name)))])))
+                                         targets))))))))))
diff --git a/stdlib/source/library/lux/extension.lux b/stdlib/source/library/lux/extension.lux
index 23be093ac..add1ec871 100644
--- a/stdlib/source/library/lux/extension.lux
+++ b/stdlib/source/library/lux/extension.lux
@@ -27,7 +27,7 @@
   (-> Code (Parser Input))
   ($_ <>.and
       .local_identifier
-      (<>\wrap default)))
+      (<>\in default)))
 
 (def: complex
   (Parser Input)
@@ -70,17 +70,17 @@
            g!phase (code.local_identifier phase)
            g!archive (code.local_identifier archive)]
        (with_gensyms [g!handler g!inputs g!error]
-         (wrap (list (` ( (~ name)
-                                     (.function ((~ g!handler) (~ g!name) (~ g!phase) (~ g!archive) (~ g!inputs))
-                                       (.case ((~! ) (~ g!parser) (~ g!inputs))
-                                         (#.Right [(~+ (list\map (|>> product.left
-                                                                      code.local_identifier)
-                                                                 inputs))])
-                                         (~ body)
+         (in (list (` ( (~ name)
+                                   (.function ((~ g!handler) (~ g!name) (~ g!phase) (~ g!archive) (~ g!inputs))
+                                     (.case ((~! ) (~ g!parser) (~ g!inputs))
+                                       (#.Right [(~+ (list\map (|>> product.left
+                                                                    code.local_identifier)
+                                                               inputs))])
+                                       (~ body)
 
-                                         (#.Left (~ g!error))
-                                         ((~! phase.failure) (~ g!error)))
-                                       ))))))))]
+                                       (#.Left (~ g!error))
+                                       ((~! phase.failure) (~ g!error)))
+                                     ))))))))]
 
   [.any .end! .and .run "lux def analysis" analysis:]
   [.any .end! .and .run "lux def synthesis" synthesis:]
diff --git a/stdlib/source/library/lux/ffi.js.lux b/stdlib/source/library/lux/ffi.js.lux
index 852ed2b11..629d2f4f5 100644
--- a/stdlib/source/library/lux/ffi.js.lux
+++ b/stdlib/source/library/lux/ffi.js.lux
@@ -179,7 +179,7 @@
 (def: class_declaration
   (Parser Class_Declaration)
   (<>.either (<>.and .local_identifier
-                     (<>\wrap (list)))
+                     (<>\in (list)))
              (.form (<>.and .local_identifier
                                   (<>.some .local_identifier)))))
 
@@ -247,76 +247,76 @@
               declaration (` ((~ (code.local_identifier class_name))
                               (~+ class_parameters)))
               real_class (text.replace_all "/" "." class_name)]
-          (wrap (list& (` (type: (~ declaration)
-                            (..Object (primitive (~ (code.text real_class))))))
-                       (list\map (function (_ member)
-                                   (case member
-                                     (#Constructor inputsT)
-                                     (let [g!inputs (input_variables inputsT)]
-                                       (` (def: ((~ (qualify "new"))
-                                                 [(~+ (list\map product.right g!inputs))])
-                                            (All [(~+ class_parameters)]
-                                              (-> [(~+ (list\map nullable_type inputsT))]
-                                                  (~ declaration)))
-                                            (:assume
-                                             ("js object new"
-                                              ("js constant" (~ (code.text real_class)))
-                                              [(~+ (list\map (with_null g!temp) g!inputs))])))))
+          (in (list& (` (type: (~ declaration)
+                          (..Object (primitive (~ (code.text real_class))))))
+                     (list\map (function (_ member)
+                                 (case member
+                                   (#Constructor inputsT)
+                                   (let [g!inputs (input_variables inputsT)]
+                                     (` (def: ((~ (qualify "new"))
+                                               [(~+ (list\map product.right g!inputs))])
+                                          (All [(~+ class_parameters)]
+                                            (-> [(~+ (list\map nullable_type inputsT))]
+                                                (~ declaration)))
+                                          (:assume
+                                           ("js object new"
+                                            ("js constant" (~ (code.text real_class)))
+                                            [(~+ (list\map (with_null g!temp) g!inputs))])))))
+                                   
+                                   (#Field [static? field fieldT])
+                                   (if static?
+                                     (` ((~! syntax:) ((~ (qualify field)))
+                                         (\ (~! meta.monad) (~' in)
+                                            (list (` (.:as (~ (nullable_type fieldT))
+                                                           ("js constant" (~ (code.text (%.format real_class "." field))))))))))
+                                     (` (def: ((~ (qualify field))
+                                               (~ g!object))
+                                          (All [(~+ class_parameters)]
+                                            (-> (~ declaration)
+                                                (~ (nullable_type fieldT))))
+                                          (:assume
+                                           (~ (without_null g!temp fieldT (` ("js object get" (~ (code.text field)) (~ g!object)))))))))
+                                   
+                                   (#Method method)
+                                   (case method
+                                     (#Static [method alias inputsT io? try? outputT])
+                                     (..make_function (qualify (maybe.default method alias))
+                                                      g!temp
+                                                      (%.format real_class "." method)
+                                                      inputsT
+                                                      io?
+                                                      try?
+                                                      outputT)
                                      
-                                     (#Field [static? field fieldT])
-                                     (if static?
-                                       (` ((~! syntax:) ((~ (qualify field)))
-                                           (\ (~! meta.monad) (~' wrap)
-                                              (list (` (.:as (~ (nullable_type fieldT))
-                                                             ("js constant" (~ (code.text (%.format real_class "." field))))))))))
-                                       (` (def: ((~ (qualify field))
+                                     (#Virtual [method alias inputsT io? try? outputT])
+                                     (let [g!inputs (input_variables inputsT)]
+                                       (` (def: ((~ (qualify (maybe.default method alias)))
+                                                 [(~+ (list\map product.right g!inputs))]
                                                  (~ g!object))
                                             (All [(~+ class_parameters)]
-                                              (-> (~ declaration)
-                                                  (~ (nullable_type fieldT))))
+                                              (-> [(~+ (list\map nullable_type inputsT))]
+                                                  (~ declaration)
+                                                  (~ (|> (nullable_type outputT)
+                                                         (try_type try?)
+                                                         (io_type io?)))))
                                             (:assume
-                                             (~ (without_null g!temp fieldT (` ("js object get" (~ (code.text field)) (~ g!object)))))))))
-                                     
-                                     (#Method method)
-                                     (case method
-                                       (#Static [method alias inputsT io? try? outputT])
-                                       (..make_function (qualify (maybe.default method alias))
-                                                        g!temp
-                                                        (%.format real_class "." method)
-                                                        inputsT
-                                                        io?
-                                                        try?
-                                                        outputT)
-                                       
-                                       (#Virtual [method alias inputsT io? try? outputT])
-                                       (let [g!inputs (input_variables inputsT)]
-                                         (` (def: ((~ (qualify (maybe.default method alias)))
-                                                   [(~+ (list\map product.right g!inputs))]
-                                                   (~ g!object))
-                                              (All [(~+ class_parameters)]
-                                                (-> [(~+ (list\map nullable_type inputsT))]
-                                                    (~ declaration)
-                                                    (~ (|> (nullable_type outputT)
-                                                           (try_type try?)
-                                                           (io_type io?)))))
-                                              (:assume
-                                               (~ (<| (with_io io?)
-                                                      (with_try try?)
-                                                      (without_null g!temp outputT)
-                                                      (` ("js object do"
-                                                          (~ (code.text method))
-                                                          (~ g!object)
-                                                          [(~+ (list\map (with_null g!temp) g!inputs))])))))))))))
-                                 members)))))
+                                             (~ (<| (with_io io?)
+                                                    (with_try try?)
+                                                    (without_null g!temp outputT)
+                                                    (` ("js object do"
+                                                        (~ (code.text method))
+                                                        (~ g!object)
+                                                        [(~+ (list\map (with_null g!temp) g!inputs))])))))))))))
+                               members)))))
       
       (#Function [name alias inputsT io? try? outputT])
-      (wrap (list (..make_function (code.local_identifier (maybe.default name alias))
-                                   g!temp
-                                   name
-                                   inputsT
-                                   io?
-                                   try?
-                                   outputT)))
+      (in (list (..make_function (code.local_identifier (maybe.default name alias))
+                                 g!temp
+                                 name
+                                 inputsT
+                                 io?
+                                 try?
+                                 outputT)))
       )))
 
 (template: #export (type_of object)
@@ -328,24 +328,24 @@
     (let [constant (` ("js constant" (~ (code.text head))))]
       (case tail
         #.Nil
-        (wrap (list (` (: (.Maybe (~ type))
+        (in (list (` (: (.Maybe (~ type))
+                        (case (..type_of (~ constant))
+                          "undefined"
+                          #.None
+
+                          (~ g!_)
+                          (#.Some (:as (~ type) (~ constant))))))))
+        
+        (#.Cons [next tail])
+        (let [separator "."]
+          (in (list (` (: (.Maybe (~ type))
                           (case (..type_of (~ constant))
                             "undefined"
                             #.None
 
                             (~ g!_)
-                            (#.Some (:as (~ type) (~ constant))))))))
-        
-        (#.Cons [next tail])
-        (let [separator "."]
-          (wrap (list (` (: (.Maybe (~ type))
-                            (case (..type_of (~ constant))
-                              "undefined"
-                              #.None
-
-                              (~ g!_)
-                              (..constant (~ type) [(~ (code.local_identifier (%.format head "." next)))
-                                                    (~+ (list\map code.local_identifier tail))])))))))))))
+                            (..constant (~ type) [(~ (code.local_identifier (%.format head "." next)))
+                                                  (~+ (list\map code.local_identifier tail))])))))))))))
 
 (template: (!defined? )
   (.case (..constant Any )
diff --git a/stdlib/source/library/lux/ffi.jvm.lux b/stdlib/source/library/lux/ffi.jvm.lux
index 76983acd5..ff3215f6a 100644
--- a/stdlib/source/library/lux/ffi.jvm.lux
+++ b/stdlib/source/library/lux/ffi.jvm.lux
@@ -395,14 +395,14 @@
   (do <>.monad
     [#let [dotted_name (format "::" field_name)]
      _ (.this! (code.identifier ["" dotted_name]))]
-    (wrap (get_static_field class_name field_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)]
      _ (.this! (code.identifier ["" dotted_name]))]
-    (wrap (get_virtual_field class_name field_name (code.local_identifier self_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))
@@ -410,11 +410,11 @@
     [#let [dotted_name (format "::" field_name)]
      [_ _ value] (: (Parser [Any Any Code])
                     (.form ($_ <>.and (.this! (' :=)) (.this! (code.identifier ["" dotted_name])) .any)))]
-    (wrap (`' ("jvm member put virtual"
-               (~ (code.text class_name))
-               (~ (code.text field_name))
-               (~ value)
-               (~ (code.local_identifier self_name)))))))
+    (in (`' ("jvm member put virtual"
+             (~ (code.text class_name))
+             (~ (code.text field_name))
+             (~ value)
+             (~ (code.local_identifier self_name)))))))
 
 (def: (pre_walk_replace f input)
   (-> (-> Code Code) Code Code)
@@ -464,10 +464,10 @@
     [args (: (Parser (List Code))
              (.form (<>.after (.this! (' ::new!))
                                     (.tuple (<>.exactly (list.size arguments) .any)))))]
-    (wrap (` ("jvm member invoke constructor" (~ (code.text class_name))
-              (~+ (|> args
-                      (list.zipped/2 (list\map product.right arguments))
-                      (list\map ..decorate_input))))))))
+    (in (` ("jvm member invoke constructor" (~ (code.text class_name))
+            (~+ (|> args
+                    (list.zipped/2 (list\map product.right arguments))
+                    (list\map ..decorate_input))))))))
 
 (def: (make_static_method_parser class_name method_name arguments)
   (-> Text Text (List Argument) (Parser Code))
@@ -476,10 +476,10 @@
      args (: (Parser (List Code))
              (.form (<>.after (.this! (code.identifier ["" dotted_name]))
                                     (.tuple (<>.exactly (list.size arguments) .any)))))]
-    (wrap (` ("jvm member invoke static" (~ (code.text class_name)) (~ (code.text method_name))
-              (~+ (|> args
-                      (list.zipped/2 (list\map product.right arguments))
-                      (list\map ..decorate_input))))))))
+    (in (` ("jvm member invoke static" (~ (code.text class_name)) (~ (code.text method_name))
+            (~+ (|> args
+                    (list.zipped/2 (list\map product.right arguments))
+                    (list\map ..decorate_input))))))))
 
 (template [ ]
   [(def: ( class_name method_name arguments self_name)
@@ -489,11 +489,11 @@
         args (: (Parser (List Code))
                 (.form (<>.after (.this! (code.identifier ["" dotted_name]))
                                        (.tuple (<>.exactly (list.size arguments) .any)))))]
-       (wrap (` ( (~ (code.text class_name)) (~ (code.text method_name))
-                          (~ (code.local_identifier self_name))
-                          (~+ (|> args
-                                  (list.zipped/2 (list\map product.right arguments))
-                                  (list\map ..decorate_input))))))))]
+       (in (` ( (~ (code.text class_name)) (~ (code.text method_name))
+                        (~ (code.local_identifier self_name))
+                        (~+ (|> args
+                                (list.zipped/2 (list\map product.right arguments))
+                                (list\map ..decorate_input))))))))]
 
   [make_special_method_parser "jvm member invoke special"]
   [make_virtual_method_parser "jvm member invoke virtual"]
@@ -527,7 +527,7 @@
         (.this! (' #public))
         (.this! (' #private))
         (.this! (' #protected))
-        (wrap []))))
+        (in []))))
 
 (def: inheritance_modifier^
   (Parser Inheritance)
@@ -535,7 +535,7 @@
     ($_ <>.or
         (.this! (' #final))
         (.this! (' #abstract))
-        (wrap []))))
+        (in []))))
 
 (exception: #export (class_names_cannot_contain_periods {name Text})
   (exception.report
@@ -562,7 +562,7 @@
                  (not (list.member? text.equivalence
                                     (list\map parser.name type_vars)
                                     name)))]
-    (wrap name)))
+    (in name)))
 
 (def: (class^' parameter^ type_vars)
   (-> (-> (List (Type Var)) (Parser (Type Parameter)))
@@ -571,10 +571,10 @@
     [[name parameters] (: (Parser [External (List (Type Parameter))])
                           ($_ <>.either
                               (<>.and (valid_class_name type_vars)
-                                      (<>\wrap (list)))
+                                      (<>\in (list)))
                               (.form (<>.and .local_identifier
                                                    (<>.some (parameter^ type_vars))))))]
-    (wrap (type.class (name.safe name) parameters))))
+    (in (type.class (name.safe name) parameters))))
 
 (exception: #export (unexpected_type_variable {name Text}
                                               {type_vars (List (Type Var))})
@@ -588,13 +588,13 @@
     [name .local_identifier
      _ (..assert ..unexpected_type_variable [name type_vars]
                  (list.member? text.equivalence (list\map parser.name type_vars) name))]
-    (wrap (type.var name))))
+    (in (type.var name))))
 
 (def: wildcard^
   (Parser (Type Parameter))
   (do <>.monad
     [_ (.this! (' ?))]
-    (wrap type.wildcard)))
+    (in type.wildcard)))
 
 (template [  ]
   [(def: 
@@ -627,7 +627,7 @@
         (Parser (Type (<| Return' Value' category)))))
   (do <>.monad
     [_ (.identifier! ["" (..reflection type)])]
-    (wrap type)))
+    (in type)))
 
 (def: primitive^
   (Parser (Type Primitive))
@@ -661,7 +661,7 @@
   (Parser (Type Void))
   (do <>.monad
     [_ (.identifier! ["" (reflection.reflection reflection.void)])]
-    (wrap type.void)))
+    (in type.void)))
 
 (def: (return^ type_vars)
   (-> (List (Type Var)) (Parser (Type Return)))
@@ -681,11 +681,11 @@
   (do <>.monad
     [[name variables] (: (Parser [External (List (Type Var))])
                          (<>.either (<>.and (..valid_class_name (list))
-                                            (<>\wrap (list)))
+                                            (<>\in (list)))
                                     (.form (<>.and (..valid_class_name (list))
                                                          (<>.some var^)))
                                     ))]
-    (wrap (type.declaration name variables))))
+    (in (type.declaration name variables))))
 
 (def: (class^ type_vars)
   (-> (List (Type Var)) (Parser (Type Class)))
@@ -699,7 +699,7 @@
   (Parser Annotation)
   (<>.either (do <>.monad
                [ann_name .local_identifier]
-               (wrap [ann_name (list)]))
+               (in [ann_name (list)]))
              (.form (<>.and .local_identifier
                                   annotation_parameters^))))
 
@@ -713,7 +713,7 @@
   (Parser (List Annotation))
   (do <>.monad
     [anns?? (<>.maybe ..annotations^')]
-    (wrap (maybe.default (list) anns??))))
+    (in (maybe.default (list) anns??))))
 
 (def: (throws_decl^ type_vars)
   (-> (List (Type Var)) (Parser (List (Type Class))))
@@ -732,17 +732,17 @@
                   inputs (.tuple (<>.some (..type^ total_vars)))
                   output (..return^ total_vars)
                   exs (..throws_decl^ total_vars)]
-                 (wrap [[name #PublicP anns] {#method_tvars tvars
-                                              #method_inputs inputs
-                                              #method_output output
-                                              #method_exs exs}]))))
+                 (in [[name #PublicP anns] {#method_tvars tvars
+                                            #method_inputs inputs
+                                            #method_output output
+                                            #method_exs exs}]))))
 
 (def: state_modifier^
   (Parser State)
   ($_ <>.or
       (.this! (' #volatile))
       (.this! (' #final))
-      (\ <>.monad wrap [])))
+      (\ <>.monad in [])))
 
 (def: (field_decl^ type_vars)
   (-> (List (Type Var)) (Parser [Member_Declaration FieldDecl]))
@@ -752,14 +752,14 @@
                              anns ..annotations^
                              type (..type^ type_vars)
                              body .any]
-                            (wrap [[name #PublicP anns] (#ConstantField [type body])])))
+                            (in [[name #PublicP anns] (#ConstantField [type body])])))
              (.form (do <>.monad
                             [pm privacy_modifier^
                              sm state_modifier^
                              name .local_identifier
                              anns ..annotations^
                              type (..type^ type_vars)]
-                            (wrap [[name pm anns] (#VariableField [sm type])])))))
+                            (in [[name pm anns] (#VariableField [sm type])])))))
 
 (def: (argument^ type_vars)
   (-> (List (Type Var)) (Parser Argument))
@@ -793,10 +793,10 @@
                   exs (throws_decl^ total_vars)
                   annotations ..annotations^
                   body .any]
-                 (wrap [{#member_name constructor_method_name
-                         #member_privacy pm
-                         #member_anns annotations}
-                        (#ConstructorMethod strict_fp? method_vars self_name arguments constructor_args body exs)]))))
+                 (in [{#member_name constructor_method_name
+                       #member_privacy pm
+                       #member_anns annotations}
+                      (#ConstructorMethod strict_fp? method_vars self_name arguments constructor_args body exs)]))))
 
 (def: (virtual_method_def^ class_vars)
   (-> (List (Type Var)) (Parser [Member_Declaration Method_Definition]))
@@ -814,10 +814,10 @@
                   exs (throws_decl^ total_vars)
                   annotations ..annotations^
                   body .any]
-                 (wrap [{#member_name name
-                         #member_privacy pm
-                         #member_anns annotations}
-                        (#VirtualMethod final? strict_fp? method_vars self_name arguments return_type body exs)]))))
+                 (in [{#member_name name
+                       #member_privacy pm
+                       #member_anns annotations}
+                      (#VirtualMethod final? strict_fp? method_vars self_name arguments return_type body exs)]))))
 
 (def: overriden_method_def^
   (Parser [Member_Declaration Method_Definition])
@@ -835,10 +835,10 @@
                   exs (throws_decl^ total_vars)
                   annotations ..annotations^
                   body .any]
-                 (wrap [{#member_name name
-                         #member_privacy #PublicP
-                         #member_anns annotations}
-                        (#OverridenMethod strict_fp? owner_class method_vars self_name arguments return_type body exs)]))))
+                 (in [{#member_name name
+                       #member_privacy #PublicP
+                       #member_anns annotations}
+                      (#OverridenMethod strict_fp? owner_class method_vars self_name arguments return_type body exs)]))))
 
 (def: static_method_def^
   (Parser [Member_Declaration Method_Definition])
@@ -854,10 +854,10 @@
                   exs (throws_decl^ total_vars)
                   annotations ..annotations^
                   body .any]
-                 (wrap [{#member_name name
-                         #member_privacy pm
-                         #member_anns annotations}
-                        (#StaticMethod strict_fp? method_vars arguments return_type body exs)]))))
+                 (in [{#member_name name
+                       #member_privacy pm
+                       #member_anns annotations}
+                      (#StaticMethod strict_fp? method_vars arguments return_type body exs)]))))
 
 (def: abstract_method_def^
   (Parser [Member_Declaration Method_Definition])
@@ -871,10 +871,10 @@
                   return_type (..return^ total_vars)
                   exs (throws_decl^ total_vars)
                   annotations ..annotations^]
-                 (wrap [{#member_name name
-                         #member_privacy pm
-                         #member_anns annotations}
-                        (#AbstractMethod method_vars arguments return_type exs)]))))
+                 (in [{#member_name name
+                       #member_privacy pm
+                       #member_anns annotations}
+                      (#AbstractMethod method_vars arguments return_type exs)]))))
 
 (def: native_method_def^
   (Parser [Member_Declaration Method_Definition])
@@ -888,10 +888,10 @@
                   return_type (..return^ total_vars)
                   exs (throws_decl^ total_vars)
                   annotations ..annotations^]
-                 (wrap [{#member_name name
-                         #member_privacy pm
-                         #member_anns annotations}
-                        (#NativeMethod method_vars arguments return_type exs)]))))
+                 (in [{#member_name name
+                       #member_privacy pm
+                       #member_anns annotations}
+                      (#NativeMethod method_vars arguments return_type exs)]))))
 
 (def: (method_def^ class_vars)
   (-> (List (Type Var)) (Parser [Member_Declaration Method_Definition]))
@@ -911,10 +911,10 @@
   (Parser Class_Kind)
   (<>.either (do <>.monad
                [_ (.this! (' #class))]
-               (wrap #Class))
+               (in #Class))
              (do <>.monad
                [_ (.this! (' #interface))]
-               (wrap #Interface))
+               (in #Interface))
              ))
 
 (def: import_member_alias^
@@ -946,7 +946,7 @@
       (.form (do <>.monad
                      [_ (.this! (' #enum))
                       enum_members (<>.some .local_identifier)]
-                     (wrap (#EnumDecl enum_members))))
+                     (in (#EnumDecl enum_members))))
       (.form (do <>.monad
                      [tvars (<>.default (list) ..vars^)
                       _ (.identifier! ["" "new"])
@@ -955,20 +955,20 @@
                       ?prim_mode (<>.maybe primitive_mode^)
                       args (..import_member_args^ total_vars)
                       [io? try? maybe?] import_member_return_flags^]
-                     (wrap (#ConstructorDecl [{#import_member_mode    (maybe.default #AutoPrM ?prim_mode)
-                                               #import_member_alias   (maybe.default "new" ?alias)
-                                               #import_member_kind    #VirtualIMK
-                                               #import_member_tvars   tvars
-                                               #import_member_args    args
-                                               #import_member_maybe?  maybe?
-                                               #import_member_try?    try?
-                                               #import_member_io?     io?}
-                                              {}]))
+                     (in (#ConstructorDecl [{#import_member_mode    (maybe.default #AutoPrM ?prim_mode)
+                                             #import_member_alias   (maybe.default "new" ?alias)
+                                             #import_member_kind    #VirtualIMK
+                                             #import_member_tvars   tvars
+                                             #import_member_args    args
+                                             #import_member_maybe?  maybe?
+                                             #import_member_try?    try?
+                                             #import_member_io?     io?}
+                                            {}]))
                      ))
       (.form (do <>.monad
                      [kind (: (Parser ImportMethodKind)
                               (<>.or (.tag! ["" "static"])
-                                     (wrap [])))
+                                     (in [])))
                       tvars (<>.default (list) ..vars^)
                       name .local_identifier
                       ?alias import_member_alias^
@@ -977,16 +977,16 @@
                       args (..import_member_args^ total_vars)
                       [io? try? maybe?] import_member_return_flags^
                       return (..return^ total_vars)]
-                     (wrap (#MethodDecl [{#import_member_mode    (maybe.default #AutoPrM ?prim_mode)
-                                          #import_member_alias   (maybe.default name ?alias)
-                                          #import_member_kind    kind
-                                          #import_member_tvars   tvars
-                                          #import_member_args    args
-                                          #import_member_maybe?  maybe?
-                                          #import_member_try?    try?
-                                          #import_member_io?     io?}
-                                         {#import_method_name    name
-                                          #import_method_return  return}]))))
+                     (in (#MethodDecl [{#import_member_mode    (maybe.default #AutoPrM ?prim_mode)
+                                        #import_member_alias   (maybe.default name ?alias)
+                                        #import_member_kind    kind
+                                        #import_member_tvars   tvars
+                                        #import_member_args    args
+                                        #import_member_maybe?  maybe?
+                                        #import_member_try?    try?
+                                        #import_member_io?     io?}
+                                       {#import_method_name    name
+                                        #import_method_return  return}]))))
       (.form (do <>.monad
                      [static? (<>.parses? (.this! (' #static)))
                       name .local_identifier
@@ -994,12 +994,12 @@
                       gtype (..type^ owner_vars)
                       maybe? (<>.parses? (.this! (' #?)))
                       setter? (<>.parses? (.this! (' #!)))]
-                     (wrap (#FieldAccessDecl {#import_field_mode    (maybe.default #AutoPrM ?prim_mode)
-                                              #import_field_name    name
-                                              #import_field_static? static?
-                                              #import_field_maybe?  maybe?
-                                              #import_field_setter? setter?
-                                              #import_field_type    gtype}))))
+                     (in (#FieldAccessDecl {#import_field_mode    (maybe.default #AutoPrM ?prim_mode)
+                                            #import_field_name    name
+                                            #import_field_static? static?
+                                            #import_field_maybe?  maybe?
+                                            #import_field_setter? setter?
+                                            #import_field_type    gtype}))))
       ))
 
 (def: bundle
@@ -1136,13 +1136,13 @@
           super_replacer (parser->replacer (.form (do <>.monad
                                                           [_ (.this! (' ::super!))
                                                            args (.tuple (<>.exactly (list.size arguments) .any))]
-                                                          (wrap (` ("jvm member invoke special"
-                                                                    (~ (code.text (product.left (parser.read_class super_class))))
-                                                                    (~ (code.text name))
-                                                                    (~ (code.local_identifier self_name))
-                                                                    (~+ (|> args
-                                                                            (list.zipped/2 (list\map product.right arguments))
-                                                                            (list\map ..decorate_input)))))))))]
+                                                          (in (` ("jvm member invoke special"
+                                                                  (~ (code.text (product.left (parser.read_class super_class))))
+                                                                  (~ (code.text name))
+                                                                  (~ (code.local_identifier self_name))
+                                                                  (~+ (|> args
+                                                                          (list.zipped/2 (list\map product.right arguments))
+                                                                          (list\map ..decorate_input)))))))))]
       (` ("override"
           (~ (declaration$ declaration))
           (~ (code.text name))
@@ -1248,14 +1248,14 @@
                             (|> methods
                                 (list\map (method->parser fully_qualified_class_name))
                                 (list\fold <>.either (<>.failure ""))))]]
-    (wrap (list (` ("jvm class"
-                    (~ (declaration$ (type.declaration full_class_name class_vars)))
-                    (~ (class$ super))
-                    [(~+ (list\map class$ interfaces))]
-                    (~ (inheritance_modifier$ im))
-                    [(~+ (list\map annotation$ annotations))]
-                    [(~+ (list\map field_decl$ fields))]
-                    [(~+ (list\map (method_def$ fully_qualified_class_name method_parser super fields) methods))]))))))
+    (in (list (` ("jvm class"
+                  (~ (declaration$ (type.declaration full_class_name class_vars)))
+                  (~ (class$ super))
+                  [(~+ (list\map class$ interfaces))]
+                  (~ (inheritance_modifier$ im))
+                  [(~+ (list\map annotation$ annotations))]
+                  [(~+ (list\map field_decl$ fields))]
+                  [(~+ (list\map (method_def$ fully_qualified_class_name method_parser super fields) methods))]))))))
 
 (syntax: #export (interface:
                    {#let [! <>.monad]}
@@ -1267,11 +1267,11 @@
   {#.doc (doc "Allows defining JVM interfaces."
               (interface: TestInterface
                 ([] foo [boolean String] void #throws [Exception])))}
-  (wrap (list (` ("jvm class interface"
-                  (~ (declaration$ (type.declaration full_class_name class_vars)))
-                  [(~+ (list\map class$ supers))]
-                  [(~+ (list\map annotation$ annotations))]
-                  (~+ (list\map method_decl$ members)))))))
+  (in (list (` ("jvm class interface"
+                (~ (declaration$ (type.declaration full_class_name class_vars)))
+                [(~+ (list\map class$ supers))]
+                [(~+ (list\map annotation$ annotations))]
+                (~+ (list\map method_decl$ members)))))))
 
 (syntax: #export (object
                    {class_vars ..vars^}
@@ -1292,17 +1292,17 @@
                           (exec (do_something some_value)
                             [])))
               )}
-  (wrap (list (` ("jvm class anonymous"
-                  [(~+ (list\map var$ class_vars))]
-                  (~ (class$ super))
-                  [(~+ (list\map class$ interfaces))]
-                  [(~+ (list\map constructor_arg$ constructor_args))]
-                  [(~+ (list\map (method_def$ "" (<>.failure "") super (list)) methods))])))))
+  (in (list (` ("jvm class anonymous"
+                [(~+ (list\map var$ class_vars))]
+                (~ (class$ super))
+                [(~+ (list\map class$ interfaces))]
+                [(~+ (list\map constructor_arg$ constructor_args))]
+                [(~+ (list\map (method_def$ "" (<>.failure "") super (list)) methods))])))))
 
 (syntax: #export (null)
   {#.doc (doc "Null object reference."
               (null))}
-  (wrap (list (` ("jvm object null")))))
+  (in (list (` ("jvm object null")))))
 
 (def: #export (null? obj)
   {#.doc (doc "Test for null object reference."
@@ -1320,10 +1320,10 @@
               (= (??? "YOLO")
                  (#.Some "YOLO")))}
   (with_gensyms [g!temp]
-    (wrap (list (` (let [(~ g!temp) (~ expr)]
-                     (if ("jvm object null?" (~ g!temp))
-                       #.None
-                       (#.Some (~ g!temp)))))))))
+    (in (list (` (let [(~ g!temp) (~ expr)]
+                   (if ("jvm object null?" (~ g!temp))
+                     #.None
+                     (#.Some (~ g!temp)))))))))
 
 (syntax: #export (!!! expr)
   {#.doc (doc "Takes a (Maybe ObjectType) and returns a ObjectType."
@@ -1333,12 +1333,12 @@
               (= "foo"
                  (!!! (??? "foo"))))}
   (with_gensyms [g!value]
-    (wrap (list (` ({(#.Some (~ g!value))
-                     (~ g!value)
+    (in (list (` ({(#.Some (~ g!value))
+                   (~ g!value)
 
-                     #.None
-                     ("jvm object null")}
-                    (~ expr)))))))
+                   #.None
+                   ("jvm object null")}
+                  (~ expr)))))))
 
 (syntax: #export (check {class (..type^ (list))}
                         {unchecked (<>.maybe .any)})
@@ -1357,14 +1357,14 @@
                           #.None))]
       (case unchecked
         (#.Some unchecked)
-        (wrap (list (` (: (~ check_type)
-                          (let [(~ g!unchecked) (~ unchecked)]
-                            (~ check_code))))))
+        (in (list (` (: (~ check_type)
+                        (let [(~ g!unchecked) (~ unchecked)]
+                          (~ check_code))))))
 
         #.None
-        (wrap (list (` (: (-> (primitive "java.lang.Object") (~ check_type))
-                          (function ((~ g!_) (~ g!unchecked))
-                            (~ check_code))))))
+        (in (list (` (: (-> (primitive "java.lang.Object") (~ check_type))
+                        (function ((~ g!_) (~ g!unchecked))
+                          (~ check_code))))))
         ))))
 
 (syntax: #export (synchronized lock body)
@@ -1373,7 +1373,7 @@
                 (exec (do_something ___)
                   (do_something_else ___)
                   (finish_the_computation ___))))}
-  (wrap (list (` ("jvm object synchronized" (~ lock) (~ body))))))
+  (in (list (` ("jvm object synchronized" (~ lock) (~ body))))))
 
 (syntax: #export (do_to obj {methods (<>.some partial_call^)})
   {#.doc (doc "Call a variety of methods on an object. Then, return the object."
@@ -1381,9 +1381,9 @@
                 (ClassName::method1 arg0 arg1 arg2)
                 (ClassName::method2 arg3 arg4 arg5)))}
   (with_gensyms [g!obj]
-    (wrap (list (` (let [(~ g!obj) (~ obj)]
-                     (exec (~+ (list\map (complete_call$ g!obj) methods))
-                       (~ g!obj))))))))
+    (in (list (` (let [(~ g!obj) (~ obj)]
+                   (exec (~+ (list\map (complete_call$ g!obj) methods))
+                     (~ g!obj))))))))
 
 (def: (class_import$ declaration)
   (-> (Type Declaration) Code)
@@ -1424,7 +1424,7 @@
                                (: (-> [Bit (Type Value)] (Meta [Bit Code]))
                                   (function (_ [maybe? _])
                                     (with_gensyms [arg_name]
-                                      (wrap [maybe? arg_name]))))
+                                      (in [maybe? arg_name]))))
                                import_member_args)
          #let [input_jvm_types (list\map product.right import_member_args)
                arg_types (list\map (: (-> [Bit (Type Value)] Code)
@@ -1434,12 +1434,12 @@
                                             (` (Maybe (~ arg_type)))
                                             arg_type))))
                                    import_member_args)]]
-        (wrap [arg_inputs input_jvm_types arg_types])))
+        (in [arg_inputs input_jvm_types arg_types])))
 
     _
-    (\ meta.monad wrap [(list) (list) (list)])))
+    (\ meta.monad in [(list) (list) (list)])))
 
-(def: (decorate_return_maybe member never_null? unboxed return_term)
+(def: (with_return_maybe member never_null? unboxed return_term)
   (-> Import_Member_Declaration Bit (Type Value) Code Code)
   (case member
     (^or (#ConstructorDecl [commons _]) (#MethodDecl [commons _]))
@@ -1473,8 +1473,8 @@
        _
        return_term))]
 
-  [decorate_return_try #import_member_try? (` (.try (~ return_term)))]
-  [decorate_return_io  #import_member_io?  (` ((~! io.io) (~ return_term)))]
+  [with_return_try #import_member_try? (` (.try (~ return_term)))]
+  [with_return_io  #import_member_io?  (` ((~! io.io) (~ return_term)))]
   )
 
 (def: $String
@@ -1518,7 +1518,7 @@
          _
          (` (.|> (~ unboxed/boxed) (~+ post))))))]
 
-  [#1 auto_convert_input ..unbox
+  [#1 with_automatic_input_conversion ..unbox
    [[type.boolean type.boolean (list (` (.: .Bit)) (` (.:as (.primitive (~ (code.text box.boolean)))))) []]
     [type.byte type.byte (list (` (.: .Int)) (` (.:as (.primitive (~ (code.text box.long))))) (` ..long_to_byte)) []]
     [type.short type.short (list (` (.: .Int)) (` (.:as (.primitive (~ (code.text box.long))))) (` ..long_to_short)) []]
@@ -1530,7 +1530,7 @@
     [(type.class box.boolean (list)) (type.class box.boolean (list)) (list (` (.: .Bit)) (` (.:as (.primitive (~ (code.text box.boolean)))))) []]
     [(type.class box.long (list)) (type.class box.long (list)) (list (` (.: .Int)) (` (.:as (.primitive (~ (code.text box.long)))))) []]
     [(type.class box.double (list)) (type.class box.double (list)) (list (` (.: .Frac)) (` (.:as (.primitive (~ (code.text box.double)))))) []]]]
-  [#0 auto_convert_output ..box
+  [#0 with_automatic_output_conversion ..box
    [[type.boolean type.boolean (list) [(` (.: (.primitive (~ (code.text box.boolean))))) (` (.:as .Bit))]]
     [type.byte type.long (list (` "jvm conversion byte-to-long")) [(` (.: (.primitive (~ (code.text box.long))))) (` (.:as .Int))]]
     [type.short type.long (list (` "jvm conversion short-to-long")) [(` (.: (.primitive (~ (code.text box.long))))) (` (.:as .Int))]]
@@ -1558,7 +1558,7 @@
                               ((~! !!!) (~ (un_quote input)))))
                         (un_quote input))
                       [class]
-                      (auto_convert_input mode))))))
+                      (with_automatic_input_conversion mode))))))
 
 (def: (import_name format class member)
   (-> Text Text Text Text)
@@ -1586,7 +1586,7 @@
                                      (` (def: (~ getter_name)
                                           (~ enum_type)
                                           (~ (get_static_field full_name name)))))))]]
-        (wrap (list\map getter_interop enum_members)))
+        (in (list\map getter_interop enum_members)))
       
       (#ConstructorDecl [commons _])
       (do meta.monad
@@ -1600,12 +1600,12 @@
                                     (~+ (|> (jvm_invoke_inputs (get@ #import_member_mode commons) input_jvm_types arg_function_inputs)
                                             (list.zipped/2 input_jvm_types)
                                             (list\map ..decorate_input)))))]
-                               (auto_convert_output (get@ #import_member_mode commons))
-                               (decorate_return_maybe member true classT)
-                               (decorate_return_try member)
-                               (decorate_return_io member))]]
-        (wrap (list (` ((~! syntax:) ((~ def_name) (~+ (list\map product.right arg_function_inputs)))
-                        ((~' wrap) (.list (.` (~ jvm_interop)))))))))
+                               (with_automatic_output_conversion (get@ #import_member_mode commons))
+                               (with_return_maybe member true classT)
+                               (with_return_try member)
+                               (with_return_io member))]]
+        (in (list (` ((~! syntax:) ((~ def_name) (~+ (list\map product.right arg_function_inputs)))
+                      ((~' in) (.list (.` (~ jvm_interop)))))))))
 
       (#MethodDecl [commons method])
       (with_gensyms [g!obj]
@@ -1639,7 +1639,7 @@
                               (~+ (|> object_ast
                                       (list\map ..un_quote)
                                       (list.zipped/2 (list (type.class full_name (list))))
-                                      (list\map (auto_convert_input (get@ #import_member_mode commons)))))
+                                      (list\map (with_automatic_input_conversion (get@ #import_member_mode commons)))))
                               (~+ (|> (jvm_invoke_inputs (get@ #import_member_mode commons) input_jvm_types arg_function_inputs)
                                       (list.zipped/2 input_jvm_types)
                                       (list\map ..decorate_input))))))
@@ -1648,18 +1648,18 @@
                                   (#.Left method_return)
                                   (|> [method_return
                                        callC]
-                                      (auto_convert_output (get@ #import_member_mode commons))
-                                      (decorate_return_maybe member false method_return)
-                                      (decorate_return_try member)
-                                      (decorate_return_io member))
+                                      (with_automatic_output_conversion (get@ #import_member_mode commons))
+                                      (with_return_maybe member false method_return)
+                                      (with_return_try member)
+                                      (with_return_io member))
                                   
                                   
                                   (#.Right method_return)
                                   (|> callC
-                                      (decorate_return_try member)
-                                      (decorate_return_io member))))]]
-          (wrap (list (` ((~! syntax:) ((~ def_name) (~+ (list\map product.right arg_function_inputs)) (~+ object_ast))
-                          ((~' wrap) (.list (.` (~ jvm_interop))))))))))
+                                      (with_return_try member)
+                                      (with_return_io member))))]]
+          (in (list (` ((~! syntax:) ((~ def_name) (~+ (list\map product.right arg_function_inputs)) (~+ object_ast))
+                        ((~' in) (.list (.` (~ jvm_interop))))))))))
 
       (#FieldAccessDecl fad)
       (do meta.monad
@@ -1670,7 +1670,7 @@
                           (let [getter_call (if import_field_static?
                                               (` ((~ getter_name)))
                                               (` ((~ getter_name) (~ g!obj))))
-                                getter_body (<| (auto_convert_output import_field_mode)
+                                getter_body (<| (with_automatic_output_conversion import_field_mode)
                                                 [import_field_type
                                                  (if import_field_static?
                                                    (get_static_field full_name import_field_name)
@@ -1681,8 +1681,8 @@
                                 getter_body (if import_field_setter?
                                               (` ((~! io.io) (~ getter_body)))
                                               getter_body)]
-                            (wrap (` ((~! syntax:) (~ getter_call)
-                                      ((~' wrap) (.list (.` (~ getter_body)))))))))
+                            (in (` ((~! syntax:) (~ getter_call)
+                                    ((~' in) (.list (.` (~ getter_body)))))))))
          setter_interop (: (Meta (List Code))
                            (if import_field_setter?
                              (with_gensyms [g!obj g!value]
@@ -1690,7 +1690,7 @@
                                                    (` ((~ setter_name) (~ g!value)))
                                                    (` ((~ setter_name) (~ g!value) (~ g!obj))))
                                      setter_value (|> [import_field_type (un_quote g!value)]
-                                                      (auto_convert_input import_field_mode))
+                                                      (with_automatic_input_conversion import_field_mode))
                                      setter_value (if import_field_maybe?
                                                     (` ((~! !!!) (~ setter_value)))
                                                     setter_value)
@@ -1700,10 +1700,10 @@
                                                (if import_field_static?
                                                  (list)
                                                  (list (un_quote g!obj))))]
-                                 (wrap (list (` ((~! syntax:) (~ setter_call)
-                                                 ((~' wrap) (.list (.` ((~! io.io) ((~ (code.text setter_command)) (~+ g!obj+) (~ setter_value))))))))))))
-                             (wrap (list))))]
-        (wrap (list& getter_interop setter_interop)))
+                                 (in (list (` ((~! syntax:) (~ setter_call)
+                                               ((~' in) (.list (.` ((~! io.io) ((~ (code.text setter_command)) (~+ g!obj+) (~ setter_value))))))))))))
+                             (in (list))))]
+        (in (list& getter_interop setter_interop)))
       )))
 
 (def: (member_import$ vars kind class [import_format member])
@@ -1733,9 +1733,9 @@
   (let [[class_name _] (parser.declaration declaration)]
     (case (load_class class_name)
       (#.Right class)
-      (\ meta.monad wrap (if (interface? class)
-                           #Interface
-                           #Class))
+      (\ meta.monad in (if (interface? class)
+                         #Interface
+                         #Class))
 
       (#.Left _)
       (meta.failure (format "Unknown class: " class_name)))))
@@ -1802,7 +1802,7 @@
                               (list\map (|>> [import_format]) members)))
                   list.concat
                   (monad.map ! (member_import$ class_type_vars kind declaration)))]
-    (wrap (list& (class_import$ declaration) (list\join =members)))))
+    (in (list& (class_import$ declaration) (list\join =members)))))
 
 (syntax: #export (array {type (..type^ (list))}
                         size)
@@ -1815,7 +1815,7 @@
                        "jvm conversion long-to-int"))]
     (`` (cond (~~ (template [ ]
                     [(\ type.equivalence =  type)
-                     (wrap (list (` ( (~ g!size)))))]
+                     (in (list (` ( (~ g!size)))))]
 
                     [type.boolean "jvm array new boolean"]
                     [type.byte    "jvm array new byte"]
@@ -1826,8 +1826,8 @@
                     [type.double  "jvm array new double"]
                     [type.char    "jvm array new char"]))
               ## else
-              (wrap (list (` (: (~ (value_type #ManualPrM (type.array type)))
-                                ("jvm array new object" (~ g!size))))))))))
+              (in (list (` (: (~ (value_type #ManualPrM (type.array type)))
+                              ("jvm array new object" (~ g!size))))))))))
 
 (exception: #export (cannot_convert_to_jvm_type {type .Type})
   (exception.report
@@ -1837,14 +1837,14 @@
   (def: (lux_type->jvm_type type)
     (-> .Type (Meta (Type Value)))
     (if (lux_type\= .Any type)
-      (\ meta.monad wrap $Object)
+      (\ meta.monad in $Object)
       (case type
         (#.Primitive name params)
         (`` (cond (~~ (template []
                         [(text\= (..reflection ) name)
                          (case params
                            #.Nil
-                           (\ meta.monad wrap )
+                           (\ meta.monad in )
 
                            _
                            )]
@@ -1862,7 +1862,7 @@
                         [(text\= (..reflection (type.array )) name)
                          (case params
                            #.Nil
-                           (\ meta.monad wrap (type.array ))
+                           (\ meta.monad in (type.array ))
 
                            _
                            )]
@@ -1904,7 +1904,7 @@
                                        [paramJT (lux_type->jvm_type paramLT)]
                                        (case (parser.parameter? paramJT)
                                          (#.Some paramJT)
-                                         (wrap paramJT)
+                                         (in paramJT)
 
                                          #.None
                                          )))
@@ -1930,7 +1930,7 @@
   (case array
     [_ (#.Identifier array_name)]
     (do meta.monad
-      [array_type (meta.find_type array_name)
+      [array_type (meta.type array_name)
        array_jvm_type (lux_type->jvm_type array_type)
        #let [g!extension (code.text (`` (cond (~~ (template [ ]
                                                     [(\ type.equivalence =
@@ -1949,16 +1949,16 @@
                                               
                                               ## else
                                               "jvm array length object")))]]
-      (wrap (list (` (.|> ((~ g!extension) (~ array))
-                          "jvm conversion int-to-long"
-                          "jvm object cast"
-                          (.: (.primitive (~ (code.text box.long))))
-                          (.:as .Nat))))))
+      (in (list (` (.|> ((~ g!extension) (~ array))
+                        "jvm conversion int-to-long"
+                        "jvm object cast"
+                        (.: (.primitive (~ (code.text box.long))))
+                        (.:as .Nat))))))
 
     _
     (with_gensyms [g!array]
-      (wrap (list (` (let [(~ g!array) (~ array)]
-                       (..array_length (~ g!array)))))))))
+      (in (list (` (let [(~ g!array) (~ array)]
+                     (..array_length (~ g!array)))))))))
 
 (syntax: #export (array_read idx array)
   {#.doc (doc "Loads an element from an array."
@@ -1966,7 +1966,7 @@
   (case array
     [_ (#.Identifier array_name)]
     (do meta.monad
-      [array_type (meta.find_type array_name)
+      [array_type (meta.type array_name)
        array_jvm_type (lux_type->jvm_type array_type)
        #let [g!idx (` (.|> (~ idx)
                            (.: .Nat)
@@ -1977,9 +1977,9 @@
                       [(\ type.equivalence =
                           (type.array )
                           array_jvm_type)
-                       (wrap (list (` (.|> ( (~ g!idx) (~ array))
-                                           "jvm object cast"
-                                           (.: (.primitive (~ (code.text ))))))))]
+                       (in (list (` (.|> ( (~ g!idx) (~ array))
+                                         "jvm object cast"
+                                         (.: (.primitive (~ (code.text ))))))))]
 
                       [type.boolean "jvm array read boolean" box.boolean]
                       [type.byte "jvm array read byte" box.byte]
@@ -1991,12 +1991,12 @@
                       [type.char "jvm array read char" box.char]))
                 
                 ## else
-                (wrap (list (` ("jvm array read object" (~ g!idx) (~ array))))))))
+                (in (list (` ("jvm array read object" (~ g!idx) (~ array))))))))
 
     _
     (with_gensyms [g!array]
-      (wrap (list (` (let [(~ g!array) (~ array)]
-                       (..array_read (~ idx) (~ g!array)))))))))
+      (in (list (` (let [(~ g!array) (~ array)]
+                     (..array_read (~ idx) (~ g!array)))))))))
 
 (syntax: #export (array_write idx value array)
   {#.doc (doc "Stores an element into an array."
@@ -2004,7 +2004,7 @@
   (case array
     [_ (#.Identifier array_name)]
     (do meta.monad
-      [array_type (meta.find_type array_name)
+      [array_type (meta.type array_name)
        array_jvm_type (lux_type->jvm_type array_type)
        #let [g!idx (` (.|> (~ idx)
                            (.: .Nat)
@@ -2018,7 +2018,7 @@
                        (let [g!value (` (.|> (~ value)
                                              (.:as (.primitive (~ (code.text ))))
                                              "jvm object cast"))]
-                         (wrap (list (` ( (~ g!idx) (~ g!value) (~ array))))))]
+                         (in (list (` ( (~ g!idx) (~ g!value) (~ array))))))]
 
                       [type.boolean "jvm array write boolean" box.boolean]
                       [type.byte "jvm array write byte" box.byte]
@@ -2030,20 +2030,20 @@
                       [type.char "jvm array write char" box.char]))
                 
                 ## else
-                (wrap (list (` ("jvm array write object" (~ g!idx) (~ value) (~ array))))))))
+                (in (list (` ("jvm array write object" (~ g!idx) (~ value) (~ array))))))))
 
     _
     (with_gensyms [g!array]
-      (wrap (list (` (let [(~ g!array) (~ array)]
-                       (..array_write (~ idx) (~ value) (~ g!array)))))))))
+      (in (list (` (let [(~ g!array) (~ array)]
+                     (..array_write (~ idx) (~ value) (~ g!array)))))))))
 
 (syntax: #export (class_for {type (..type^ (list))})
   {#.doc (doc "Loads the class as a java.lang.Class object."
               (class_for java/lang/String))}
-  (wrap (list (` ("jvm object class" (~ (code.text (..reflection type))))))))
+  (in (list (` ("jvm object class" (~ (code.text (..reflection type))))))))
 
 (syntax: #export (type {type (..type^ (list))})
-  (wrap (list (..value_type #ManualPrM type))))
+  (in (list (..value_type #ManualPrM type))))
 
 (exception: #export (cannot_cast_to_non_object {type (Type Value)})
   (exception.report
@@ -2055,8 +2055,8 @@
   (case [(parser.array? type)
          (parser.class? type)]
     (^or [(#.Some _) _] [_ (#.Some _)])
-    (wrap (list (` (.: (~ (..value_type #ManualPrM type))
-                       ("jvm object cast" (~ object))))))
+    (in (list (` (.: (~ (..value_type #ManualPrM type))
+                     ("jvm object cast" (~ object))))))
 
     _
     (meta.failure (exception.construct ..cannot_cast_to_non_object [type]))))
diff --git a/stdlib/source/library/lux/ffi.lua.lux b/stdlib/source/library/lux/ffi.lua.lux
index 1eb32b3bf..a1481fa45 100644
--- a/stdlib/source/library/lux/ffi.lua.lux
+++ b/stdlib/source/library/lux/ffi.lua.lux
@@ -73,7 +73,7 @@
 (def: constant
   (Parser Field)
   (.form ($_ <>.and
-                   (<>\wrap true)
+                   (<>\in true)
                    .local_identifier
                    ..nilable)))
 
@@ -235,71 +235,71 @@
                          
                          #.Nil
                          (` ("lua import" (~ (code.text class)))))]
-          (wrap (list& (` (type: (~ g!type)
-                            (..Object (primitive (~ (code.text real_class))))))
-                       (list\map (function (_ member)
-                                   (case member
-                                     (#Field [static? field fieldT])
-                                     (if static?
-                                       (` ((~! syntax:) ((~ (qualify field)))
-                                           (\ (~! meta.monad) (~' wrap)
-                                              (list (` (.:as (~ (nilable_type fieldT))
-                                                             ("lua object get" (~ (code.text field))
-                                                              (:as (..Object .Any) (~ imported)))))))))
-                                       (` (def: ((~ (qualify field))
+          (in (list& (` (type: (~ g!type)
+                          (..Object (primitive (~ (code.text real_class))))))
+                     (list\map (function (_ member)
+                                 (case member
+                                   (#Field [static? field fieldT])
+                                   (if static?
+                                     (` ((~! syntax:) ((~ (qualify field)))
+                                         (\ (~! meta.monad) (~' in)
+                                            (list (` (.:as (~ (nilable_type fieldT))
+                                                           ("lua object get" (~ (code.text field))
+                                                            (:as (..Object .Any) (~ imported)))))))))
+                                     (` (def: ((~ (qualify field))
+                                               (~ g!object))
+                                          (-> (~ g!type)
+                                              (~ (nilable_type fieldT)))
+                                          (:assume
+                                           (~ (without_nil g!temp fieldT (` ("lua object get" (~ (code.text field))
+                                                                             (:as (..Object .Any) (~ g!object))))))))))
+                                   
+                                   (#Method method)
+                                   (case method
+                                     (#Static [method alias inputsT io? try? outputT])
+                                     (..make_function (qualify (maybe.default method alias))
+                                                      g!temp
+                                                      (` ("lua object get" (~ (code.text method))
+                                                          (:as (..Object .Any) (~ imported))))
+                                                      inputsT
+                                                      io?
+                                                      try?
+                                                      outputT)
+                                     
+                                     (#Virtual [method alias inputsT io? try? outputT])
+                                     (let [g!inputs (input_variables inputsT)]
+                                       (` (def: ((~ (qualify (maybe.default method alias)))
+                                                 [(~+ (list\map product.right g!inputs))]
                                                  (~ g!object))
-                                            (-> (~ g!type)
-                                                (~ (nilable_type fieldT)))
+                                            (-> [(~+ (list\map nilable_type inputsT))]
+                                                (~ g!type)
+                                                (~ (|> (nilable_type outputT)
+                                                       (try_type try?)
+                                                       (io_type io?))))
                                             (:assume
-                                             (~ (without_nil g!temp fieldT (` ("lua object get" (~ (code.text field))
-                                                                               (:as (..Object .Any) (~ g!object))))))))))
-                                     
-                                     (#Method method)
-                                     (case method
-                                       (#Static [method alias inputsT io? try? outputT])
-                                       (..make_function (qualify (maybe.default method alias))
-                                                        g!temp
-                                                        (` ("lua object get" (~ (code.text method))
-                                                            (:as (..Object .Any) (~ imported))))
-                                                        inputsT
-                                                        io?
-                                                        try?
-                                                        outputT)
-                                       
-                                       (#Virtual [method alias inputsT io? try? outputT])
-                                       (let [g!inputs (input_variables inputsT)]
-                                         (` (def: ((~ (qualify (maybe.default method alias)))
-                                                   [(~+ (list\map product.right g!inputs))]
-                                                   (~ g!object))
-                                              (-> [(~+ (list\map nilable_type inputsT))]
-                                                  (~ g!type)
-                                                  (~ (|> (nilable_type outputT)
-                                                         (try_type try?)
-                                                         (io_type io?))))
-                                              (:assume
-                                               (~ (<| (with_io io?)
-                                                      (with_try try?)
-                                                      (without_nil g!temp outputT)
-                                                      (` ("lua object do"
-                                                          (~ (code.text method))
-                                                          (~ g!object)
-                                                          (~+ (list\map (with_nil g!temp) g!inputs)))))))))))))
-                                 members)))))
+                                             (~ (<| (with_io io?)
+                                                    (with_try try?)
+                                                    (without_nil g!temp outputT)
+                                                    (` ("lua object do"
+                                                        (~ (code.text method))
+                                                        (~ g!object)
+                                                        (~+ (list\map (with_nil g!temp) g!inputs)))))))))))))
+                               members)))))
       
       (#Function [name alias inputsT io? try? outputT])
-      (wrap (list (..make_function (code.local_identifier (maybe.default name alias))
-                                   g!temp
-                                   (` ("lua constant" (~ (code.text (text.replace_all "/" "." name)))))
-                                   inputsT
-                                   io?
-                                   try?
-                                   outputT)))
+      (in (list (..make_function (code.local_identifier (maybe.default name alias))
+                                 g!temp
+                                 (` ("lua constant" (~ (code.text (text.replace_all "/" "." name)))))
+                                 inputsT
+                                 io?
+                                 try?
+                                 outputT)))
 
       (#Constant [_ name fieldT])
-      (wrap (list (` ((~! syntax:) ((~ (code.local_identifier name)))
-                      (\ (~! meta.monad) (~' wrap)
-                         (list (` (.:as (~ (nilable_type fieldT))
-                                        ("lua constant" (~ (code.text (text.replace_all "/" "." name))))))))))))
+      (in (list (` ((~! syntax:) ((~ (code.local_identifier name)))
+                    (\ (~! meta.monad) (~' in)
+                       (list (` (.:as (~ (nilable_type fieldT))
+                                      ("lua constant" (~ (code.text (text.replace_all "/" "." name))))))))))))
       )))
 
 (template: #export (closure  )
diff --git a/stdlib/source/library/lux/ffi.old.lux b/stdlib/source/library/lux/ffi.old.lux
index a023d3afe..ff9ef9f31 100644
--- a/stdlib/source/library/lux/ffi.old.lux
+++ b/stdlib/source/library/lux/ffi.old.lux
@@ -389,14 +389,14 @@
   (do <>.monad
     [#let [dotted_name (format "::" field_name)]
      _ (.this! (code.identifier ["" dotted_name]))]
-    (wrap (`' ((~ (code.text (format "jvm getstatic" ":" class_name ":" field_name))))))))
+    (in (`' ((~ (code.text (format "jvm getstatic" ":" class_name ":" field_name))))))))
 
 (def: (make_get_var_parser class_name field_name)
   (-> Text Text (Parser Code))
   (do <>.monad
     [#let [dotted_name (format "::" field_name)]
      _ (.this! (code.identifier ["" dotted_name]))]
-    (wrap (`' ((~ (code.text (format "jvm getfield" ":" class_name ":" field_name))) _jvm_this)))))
+    (in (`' ((~ (code.text (format "jvm getfield" ":" class_name ":" field_name))) _jvm_this)))))
 
 (def: (make_put_var_parser class_name field_name)
   (-> Text Text (Parser Code))
@@ -404,7 +404,7 @@
     [#let [dotted_name (format "::" field_name)]
      [_ _ value] (: (Parser [Any Any Code])
                     (.form ($_ <>.and (.this! (' :=)) (.this! (code.identifier ["" dotted_name])) .any)))]
-    (wrap (`' ((~ (code.text (format "jvm putfield" ":" class_name ":" field_name))) _jvm_this (~ value))))))
+    (in (`' ((~ (code.text (format "jvm putfield" ":" class_name ":" field_name))) _jvm_this (~ value))))))
 
 (def: (pre_walk_replace f input)
   (-> (-> Code Code) Code Code)
@@ -451,8 +451,8 @@
              (.form (<>.after (.this! (' ::new!))
                                     (.tuple (<>.exactly (list.size arg_decls) .any)))))
      #let [arg_decls' (: (List Text) (list\map (|>> product.right (simple_class$ params)) arg_decls))]]
-    (wrap (` ((~ (code.text (format "jvm new" ":" class_name ":" (text.join_with "," arg_decls'))))
-              (~+ args))))))
+    (in (` ((~ (code.text (format "jvm new" ":" class_name ":" (text.join_with "," arg_decls'))))
+            (~+ args))))))
 
 (def: (make_static_method_parser params class_name method_name arg_decls)
   (-> (List Type_Parameter) Text Text (List ArgDecl) (Parser Code))
@@ -462,8 +462,8 @@
              (.form (<>.after (.this! (code.identifier ["" dotted_name]))
                                     (.tuple (<>.exactly (list.size arg_decls) .any)))))
      #let [arg_decls' (: (List Text) (list\map (|>> product.right (simple_class$ params)) arg_decls))]]
-    (wrap (`' ((~ (code.text (format "jvm invokestatic" ":" class_name ":" method_name ":" (text.join_with "," arg_decls'))))
-               (~+ args))))))
+    (in (`' ((~ (code.text (format "jvm invokestatic" ":" class_name ":" method_name ":" (text.join_with "," arg_decls'))))
+             (~+ args))))))
 
 (template [ ]
   [(def: ( params class_name method_name arg_decls)
@@ -474,8 +474,8 @@
                 (.form (<>.after (.this! (code.identifier ["" dotted_name]))
                                        (.tuple (<>.exactly (list.size arg_decls) .any)))))
         #let [arg_decls' (: (List Text) (list\map (|>> product.right (simple_class$ params)) arg_decls))]]
-       (wrap (`' ((~ (code.text (format  ":" class_name ":" method_name ":" (text.join_with "," arg_decls'))))
-                  (~' _jvm_this) (~+ args))))))]
+       (in (`' ((~ (code.text (format  ":" class_name ":" method_name ":" (text.join_with "," arg_decls'))))
+                (~' _jvm_this) (~+ args))))))]
 
   [make_special_method_parser "jvm invokespecial"]
   [make_virtual_method_parser "jvm invokevirtual"]
@@ -508,7 +508,7 @@
         (.this! (' #public))
         (.this! (' #private))
         (.this! (' #protected))
-        (wrap []))))
+        (in []))))
 
 (def: inheritance_modifier^
   (Parser Inheritance)
@@ -516,7 +516,7 @@
     ($_ <>.or
         (.this! (' #final))
         (.this! (' #abstract))
-        (wrap []))))
+        (in []))))
 
 (def: bound_kind^
   (Parser BoundKind)
@@ -535,24 +535,24 @@
      ($_ <>.either
          (do <>.monad
            [_ (.this! (' ?))]
-           (wrap (#GenericWildcard #.None)))
+           (in (#GenericWildcard #.None)))
          (.tuple (do <>.monad
                          [_ (.this! (' ?))
                           bound_kind bound_kind^
                           bound recur^]
-                         (wrap (#GenericWildcard (#.Some [bound_kind bound])))))
+                         (in (#GenericWildcard (#.Some [bound_kind bound])))))
          (do <>.monad
            [name .local_identifier
             _ (assert_no_periods name)]
            (if (list.member? text.equivalence (list\map product.left type_vars) name)
-             (wrap (#GenericTypeVar name))
-             (wrap (#GenericClass name (list)))))
+             (in (#GenericTypeVar name))
+             (in (#GenericClass name (list)))))
          (.tuple (do <>.monad
                          [component recur^]
                          (case component
                            (^template [ ]
                              [(#GenericClass  #.Nil)
-                              (wrap (#GenericClass  (list)))])
+                              (in (#GenericClass  (list)))])
                            (["[Z" "boolean"]
                             ["[B" "byte"]
                             ["[S" "short"]
@@ -563,26 +563,26 @@
                             ["[C" "char"])
 
                            _
-                           (wrap (#GenericArray component)))))
+                           (in (#GenericArray component)))))
          (.form (do <>.monad
                         [name .local_identifier
                          _ (assert_no_periods name)
                          params (<>.some recur^)
                          _ (<>.assert (format name " cannot be a type-parameter!")
                                       (not (list.member? text.equivalence (list\map product.left type_vars) name)))]
-                        (wrap (#GenericClass name params))))
+                        (in (#GenericClass name params))))
          ))))
 
 (def: type_param^
   (Parser Type_Parameter)
   (<>.either (do <>.monad
                [param_name .local_identifier]
-               (wrap [param_name (list)]))
+               (in [param_name (list)]))
              (.tuple (do <>.monad
                              [param_name .local_identifier
                               _ (.this! (' <))
                               bounds (<>.many (..generic_type^ (list)))]
-                             (wrap [param_name bounds])))))
+                             (in [param_name bounds])))))
 
 (def: type_params^
   (Parser (List Type_Parameter))
@@ -596,12 +596,12 @@
   (<>.either (do <>.monad
                [name .local_identifier
                 _ (assert_no_periods name)]
-               (wrap [name (list)]))
+               (in [name (list)]))
              (.form (do <>.monad
                             [name .local_identifier
                              _ (assert_no_periods name)
                              params (<>.some ..type_param^)]
-                            (wrap [name params])))
+                            (in [name params])))
              ))
 
 (def: (super_class_decl^ type_vars)
@@ -609,12 +609,12 @@
   (<>.either (do <>.monad
                [name .local_identifier
                 _ (assert_no_periods name)]
-               (wrap [name (list)]))
+               (in [name (list)]))
              (.form (do <>.monad
                             [name .local_identifier
                              _ (assert_no_periods name)
                              params (<>.some (..generic_type^ type_vars))]
-                            (wrap [name params])))))
+                            (in [name params])))))
 
 (def: annotation_params^
   (Parser (List AnnotationParam))
@@ -624,7 +624,7 @@
   (Parser Annotation)
   (<>.either (do <>.monad
                [ann_name .local_identifier]
-               (wrap [ann_name (list)]))
+               (in [ann_name (list)]))
              (.form (<>.and .local_identifier
                                   annotation_params^))))
 
@@ -638,7 +638,7 @@
   (Parser (List Annotation))
   (do <>.monad
     [anns?? (<>.maybe ..annotations^')]
-    (wrap (maybe.default (list) anns??))))
+    (in (maybe.default (list) anns??))))
 
 (def: (throws_decl'^ type_vars)
   (-> (List Type_Parameter) (Parser (List GenericType)))
@@ -650,7 +650,7 @@
   (-> (List Type_Parameter) (Parser (List GenericType)))
   (do <>.monad
     [exs? (<>.maybe (throws_decl'^ type_vars))]
-    (wrap (maybe.default (list) exs?))))
+    (in (maybe.default (list) exs?))))
 
 (def: (method_decl^ type_vars)
   (-> (List Type_Parameter) (Parser [Member_Declaration MethodDecl]))
@@ -661,17 +661,17 @@
                   inputs (.tuple (<>.some (..generic_type^ type_vars)))
                   output (..generic_type^ type_vars)
                   exs (..throws_decl^ type_vars)]
-                 (wrap [[name #PublicP anns] {#method_tvars tvars
-                                              #method_inputs inputs
-                                              #method_output output
-                                              #method_exs    exs}]))))
+                 (in [[name #PublicP anns] {#method_tvars tvars
+                                            #method_inputs inputs
+                                            #method_output output
+                                            #method_exs    exs}]))))
 
 (def: state_modifier^
   (Parser State)
   ($_ <>.or
       (.this! (' #volatile))
       (.this! (' #final))
-      (\ <>.monad wrap [])))
+      (\ <>.monad in [])))
 
 (def: (field_decl^ type_vars)
   (-> (List Type_Parameter) (Parser [Member_Declaration FieldDecl]))
@@ -681,14 +681,14 @@
                              anns ..annotations^
                              type (..generic_type^ type_vars)
                              body .any]
-                            (wrap [[name #PublicP anns] (#ConstantField [type body])])))
+                            (in [[name #PublicP anns] (#ConstantField [type body])])))
              (.form (do <>.monad
                             [pm privacy_modifier^
                              sm state_modifier^
                              name .local_identifier
                              anns ..annotations^
                              type (..generic_type^ type_vars)]
-                            (wrap [[name pm anns] (#VariableField [sm type])])))))
+                            (in [[name pm anns] (#VariableField [sm type])])))))
 
 (def: (arg_decl^ type_vars)
   (-> (List Type_Parameter) (Parser ArgDecl))
@@ -720,10 +720,10 @@
                   exs (..throws_decl^ total_vars)
                   annotations ..annotations^
                   body .any]
-                 (wrap [{#member_name constructor_method_name
-                         #member_privacy pm
-                         #member_anns annotations}
-                        (#ConstructorMethod strict_fp? method_vars arg_decls constructor_args body exs)]))))
+                 (in [{#member_name constructor_method_name
+                       #member_privacy pm
+                       #member_anns annotations}
+                      (#ConstructorMethod strict_fp? method_vars arg_decls constructor_args body exs)]))))
 
 (def: (virtual_method_def^ class_vars)
   (-> (List Type_Parameter) (Parser [Member_Declaration Method_Definition]))
@@ -741,13 +741,13 @@
                   exs (..throws_decl^ total_vars)
                   annotations ..annotations^
                   body .any]
-                 (wrap [{#member_name name
-                         #member_privacy pm
-                         #member_anns annotations}
-                        (#VirtualMethod final? strict_fp?
-                                        method_vars
-                                        this_name arg_decls return_type
-                                        body exs)]))))
+                 (in [{#member_name name
+                       #member_privacy pm
+                       #member_anns annotations}
+                      (#VirtualMethod final? strict_fp?
+                                      method_vars
+                                      this_name arg_decls return_type
+                                      body exs)]))))
 
 (def: overriden_method_def^
   (Parser [Member_Declaration Method_Definition])
@@ -764,13 +764,13 @@
                   exs (..throws_decl^ total_vars)
                   annotations ..annotations^
                   body .any]
-                 (wrap [{#member_name name
-                         #member_privacy #PublicP
-                         #member_anns annotations}
-                        (#OverridenMethod strict_fp?
-                                          owner_class method_vars
-                                          this_name arg_decls return_type
-                                          body exs)]))))
+                 (in [{#member_name name
+                       #member_privacy #PublicP
+                       #member_anns annotations}
+                      (#OverridenMethod strict_fp?
+                                        owner_class method_vars
+                                        this_name arg_decls return_type
+                                        body exs)]))))
 
 (def: static_method_def^
   (Parser [Member_Declaration Method_Definition])
@@ -786,10 +786,10 @@
                   exs (..throws_decl^ total_vars)
                   annotations ..annotations^
                   body .any]
-                 (wrap [{#member_name name
-                         #member_privacy pm
-                         #member_anns annotations}
-                        (#StaticMethod strict_fp? method_vars arg_decls return_type body exs)]))))
+                 (in [{#member_name name
+                       #member_privacy pm
+                       #member_anns annotations}
+                      (#StaticMethod strict_fp? method_vars arg_decls return_type body exs)]))))
 
 (def: abstract_method_def^
   (Parser [Member_Declaration Method_Definition])
@@ -803,10 +803,10 @@
                   return_type (..generic_type^ total_vars)
                   exs (..throws_decl^ total_vars)
                   annotations ..annotations^]
-                 (wrap [{#member_name name
-                         #member_privacy pm
-                         #member_anns annotations}
-                        (#AbstractMethod method_vars arg_decls return_type exs)]))))
+                 (in [{#member_name name
+                       #member_privacy pm
+                       #member_anns annotations}
+                      (#AbstractMethod method_vars arg_decls return_type exs)]))))
 
 (def: native_method_def^
   (Parser [Member_Declaration Method_Definition])
@@ -820,10 +820,10 @@
                   return_type (..generic_type^ total_vars)
                   exs (..throws_decl^ total_vars)
                   annotations ..annotations^]
-                 (wrap [{#member_name name
-                         #member_privacy pm
-                         #member_anns annotations}
-                        (#NativeMethod method_vars arg_decls return_type exs)]))))
+                 (in [{#member_name name
+                       #member_privacy pm
+                       #member_anns annotations}
+                      (#NativeMethod method_vars arg_decls return_type exs)]))))
 
 (def: (method_def^ class_vars)
   (-> (List Type_Parameter) (Parser [Member_Declaration Method_Definition]))
@@ -843,10 +843,10 @@
   (Parser Class_Kind)
   (<>.either (do <>.monad
                [_ (.this! (' #class))]
-               (wrap #Class))
+               (in #Class))
              (do <>.monad
                [_ (.this! (' #interface))]
-               (wrap #Interface))
+               (in #Interface))
              ))
 
 (def: import_member_alias^
@@ -874,7 +874,7 @@
       (.form (do <>.monad
                      [_ (.this! (' #enum))
                       enum_members (<>.some .local_identifier)]
-                     (wrap (#EnumDecl enum_members))))
+                     (in (#EnumDecl enum_members))))
       (.form (do <>.monad
                      [tvars ..type_params^
                       _ (.this! (' new))
@@ -883,20 +883,20 @@
                       ?prim_mode (<>.maybe primitive_mode^)
                       args (..import_member_args^ total_vars)
                       [io? try? maybe?] import_member_return_flags^]
-                     (wrap (#ConstructorDecl [{#import_member_mode    (maybe.default #AutoPrM ?prim_mode)
-                                               #import_member_alias   (maybe.default "new" ?alias)
-                                               #import_member_kind    #VirtualIMK
-                                               #import_member_tvars   tvars
-                                               #import_member_args    args
-                                               #import_member_maybe?  maybe?
-                                               #import_member_try?    try?
-                                               #import_member_io?     io?}
-                                              {}]))
+                     (in (#ConstructorDecl [{#import_member_mode    (maybe.default #AutoPrM ?prim_mode)
+                                             #import_member_alias   (maybe.default "new" ?alias)
+                                             #import_member_kind    #VirtualIMK
+                                             #import_member_tvars   tvars
+                                             #import_member_args    args
+                                             #import_member_maybe?  maybe?
+                                             #import_member_try?    try?
+                                             #import_member_io?     io?}
+                                            {}]))
                      ))
       (.form (do <>.monad
                      [kind (: (Parser ImportMethodKind)
                               (<>.or (.this! (' #static))
-                                     (wrap [])))
+                                     (in [])))
                       tvars ..type_params^
                       name .local_identifier
                       ?alias import_member_alias^
@@ -905,17 +905,17 @@
                       args (..import_member_args^ total_vars)
                       [io? try? maybe?] import_member_return_flags^
                       return (..generic_type^ total_vars)]
-                     (wrap (#MethodDecl [{#import_member_mode    (maybe.default #AutoPrM ?prim_mode)
-                                          #import_member_alias   (maybe.default name ?alias)
-                                          #import_member_kind    kind
-                                          #import_member_tvars   tvars
-                                          #import_member_args    args
-                                          #import_member_maybe?  maybe?
-                                          #import_member_try?    try?
-                                          #import_member_io?     io?}
-                                         {#import_method_name    name
-                                          #import_method_return  return
-                                          }]))))
+                     (in (#MethodDecl [{#import_member_mode    (maybe.default #AutoPrM ?prim_mode)
+                                        #import_member_alias   (maybe.default name ?alias)
+                                        #import_member_kind    kind
+                                        #import_member_tvars   tvars
+                                        #import_member_args    args
+                                        #import_member_maybe?  maybe?
+                                        #import_member_try?    try?
+                                        #import_member_io?     io?}
+                                       {#import_method_name    name
+                                        #import_method_return  return
+                                        }]))))
       (.form (do <>.monad
                      [static? (<>.parses? (.this! (' #static)))
                       name .local_identifier
@@ -923,12 +923,12 @@
                       gtype (..generic_type^ owner_vars)
                       maybe? (<>.parses? (.this! (' #?)))
                       setter? (<>.parses? (.this! (' #!)))]
-                     (wrap (#FieldAccessDecl {#import_field_mode    (maybe.default #AutoPrM ?prim_mode)
-                                              #import_field_name    name
-                                              #import_field_static? static?
-                                              #import_field_maybe?  maybe?
-                                              #import_field_setter? setter?
-                                              #import_field_type    gtype}))))
+                     (in (#FieldAccessDecl {#import_field_mode    (maybe.default #AutoPrM ?prim_mode)
+                                            #import_field_name    name
+                                            #import_field_static? static?
+                                            #import_field_maybe?  maybe?
+                                            #import_field_setter? setter?
+                                            #import_field_type    gtype}))))
       ))
 
 (def: bundle
@@ -1097,11 +1097,11 @@
                                                              args (.tuple (<>.exactly (list.size arg_decls) .any))
                                                              #let [arg_decls' (: (List Text) (list\map (|>> product.right (simple_class$ (list)))
                                                                                                        arg_decls))]]
-                                                            (wrap (`' ((~ (code.text (format "jvm invokespecial"
-                                                                                             ":" (get@ #super_class_name super_class)
-                                                                                             ":" name
-                                                                                             ":" (text.join_with "," arg_decls'))))
-                                                                       (~' _jvm_this) (~+ args)))))))]
+                                                            (in (`' ((~ (code.text (format "jvm invokespecial"
+                                                                                           ":" (get@ #super_class_name super_class)
+                                                                                           ":" name
+                                                                                           ":" (text.join_with "," arg_decls'))))
+                                                                     (~' _jvm_this) (~+ args)))))))]
       (with_parens
         (spaced (list "override"
                       (class_decl$ class_decl)
@@ -1223,7 +1223,7 @@
                                           (with_brackets (spaced (list\map annotation$ annotations)))
                                           (with_brackets (spaced (list\map field_decl$ fields)))
                                           (with_brackets (spaced (list\map (method_def$ replacer super) methods))))))]]
-    (wrap (list (` ((~ (code.text def_code))))))))
+    (in (list (` ((~ (code.text def_code))))))))
 
 (syntax: #export (interface:
                    {class_decl ..class_decl^}
@@ -1240,7 +1240,7 @@
                                        (with_brackets (spaced (list\map super_class_decl$ supers)))
                                        (with_brackets (spaced (list\map annotation$ annotations)))
                                        (spaced (list\map method_decl$ members)))))]
-    (wrap (list (` ((~ (code.text def_code))))))
+    (in (list (` ((~ (code.text def_code))))))
     ))
 
 (syntax: #export (object
@@ -1267,12 +1267,12 @@
                                        (with_brackets (spaced (list\map super_class_decl$ interfaces)))
                                        (with_brackets (spaced (list\map constructor_arg$ constructor_args)))
                                        (with_brackets (spaced (list\map (method_def$ function.identity super) methods))))))]
-    (wrap (list (` ((~ (code.text def_code))))))))
+    (in (list (` ((~ (code.text def_code))))))))
 
 (syntax: #export (null)
   {#.doc (doc "Null object reference."
               (null))}
-  (wrap (list (` ("jvm object null")))))
+  (in (list (` ("jvm object null")))))
 
 (def: #export (null? obj)
   {#.doc (doc "Test for null object reference."
@@ -1290,10 +1290,10 @@
               (= (??? "YOLO")
                  (#.Some "YOLO")))}
   (with_gensyms [g!temp]
-    (wrap (list (` (let [(~ g!temp) (~ expr)]
-                     (if ("jvm object null?" (~ g!temp))
-                       #.None
-                       (#.Some (~ g!temp)))))))))
+    (in (list (` (let [(~ g!temp) (~ expr)]
+                   (if ("jvm object null?" (~ g!temp))
+                     #.None
+                     (#.Some (~ g!temp)))))))))
 
 (syntax: #export (!!! expr)
   {#.doc (doc "Takes a (Maybe ObjectType) and returns a ObjectType."
@@ -1303,12 +1303,12 @@
               (= "foo"
                  (!!! (??? "foo"))))}
   (with_gensyms [g!value]
-    (wrap (list (` ({(#.Some (~ g!value))
-                     (~ g!value)
+    (in (list (` ({(#.Some (~ g!value))
+                   (~ g!value)
 
-                     #.None
-                     ("jvm object null")}
-                    (~ expr)))))))
+                   #.None
+                   ("jvm object null")}
+                  (~ expr)))))))
 
 (syntax: #export (check {class (..generic_type^ (list))}
                         {unchecked (<>.maybe .any)})
@@ -1327,14 +1327,14 @@
                           #.None))]
       (case unchecked
         (#.Some unchecked)
-        (wrap (list (` (: (~ check_type)
-                          (let [(~ g!unchecked) (~ unchecked)]
-                            (~ check_code))))))
+        (in (list (` (: (~ check_type)
+                        (let [(~ g!unchecked) (~ unchecked)]
+                          (~ check_code))))))
 
         #.None
-        (wrap (list (` (: (-> (primitive "java.lang.Object") (~ check_type))
-                          (function ((~ g!_) (~ g!unchecked))
-                            (~ check_code))))))
+        (in (list (` (: (-> (primitive "java.lang.Object") (~ check_type))
+                        (function ((~ g!_) (~ g!unchecked))
+                          (~ check_code))))))
         ))))
 
 (syntax: #export (synchronized lock body)
@@ -1343,7 +1343,7 @@
                 (exec (do_something ___)
                   (do_something_else ___)
                   (finish_the_computation ___))))}
-  (wrap (list (` ("jvm object synchronized" (~ lock) (~ body))))))
+  (in (list (` ("jvm object synchronized" (~ lock) (~ body))))))
 
 (syntax: #export (do_to obj {methods (<>.some partial_call^)})
   {#.doc (doc "Call a variety of methods on an object. Then, return the object."
@@ -1351,9 +1351,9 @@
                 (ClassName::method1 arg0 arg1 arg2)
                 (ClassName::method2 arg3 arg4 arg5)))}
   (with_gensyms [g!obj]
-    (wrap (list (` (let [(~ g!obj) (~ obj)]
-                     (exec (~+ (list\map (complete_call$ g!obj) methods))
-                       (~ g!obj))))))))
+    (in (list (` (let [(~ g!obj) (~ obj)]
+                   (exec (~+ (list\map (complete_call$ g!obj) methods))
+                     (~ g!obj))))))))
 
 (def: (class_import$ [full_name params])
   (-> Class_Declaration Code)
@@ -1392,7 +1392,7 @@
                                (: (-> [Bit GenericType] (Meta [Bit Code]))
                                   (function (_ [maybe? _])
                                     (with_gensyms [arg_name]
-                                      (wrap [maybe? arg_name]))))
+                                      (in [maybe? arg_name]))))
                                import_member_args)
          #let [arg_classes (: (List Text)
                               (list\map (|>> product.right (simple_class$ (list\compose type_params import_member_tvars)))
@@ -1404,10 +1404,10 @@
                                             (` (Maybe (~ arg_type)))
                                             arg_type))))
                                    import_member_args)]]
-        (wrap [arg_inputs arg_classes arg_types])))
+        (in [arg_inputs arg_classes arg_types])))
 
     _
-    (\ meta.monad wrap [(list) (list) (list)])))
+    (\ meta.monad in [(list) (list) (list)])))
 
 (def: (decorate_return_maybe class member return_term)
   (-> Class_Declaration Import_Member_Declaration Code Code)
@@ -1518,7 +1518,7 @@
                                      (` (def: (~ getter_name)
                                           (~ enum_type)
                                           ((~ (code.text (format "jvm getstatic" ":" full_name ":" name)))))))))]]
-        (wrap (list\map getter_interop enum_members)))
+        (in (list\map getter_interop enum_members)))
       
       (#ConstructorDecl [commons _])
       (do meta.monad
@@ -1529,8 +1529,8 @@
                                (decorate_return_maybe class member)
                                (decorate_return_try member)
                                (decorate_return_io member))]]
-        (wrap (list (` ((~! syntax:) ((~ def_name) (~+ (list\map product.right arg_function_inputs)))
-                        ((~' wrap) (.list (.` (~ jvm_interop)))))))))
+        (in (list (` ((~! syntax:) ((~ def_name) (~+ (list\map product.right arg_function_inputs)))
+                      ((~' in) (.list (.` (~ jvm_interop)))))))))
 
       (#MethodDecl [commons method])
       (with_gensyms [g!obj]
@@ -1562,8 +1562,8 @@
                                  (decorate_return_maybe class member)
                                  (decorate_return_try member)
                                  (decorate_return_io member))]]
-          (wrap (list (` ((~! syntax:) ((~ def_name) (~+ (list\map product.right arg_function_inputs)) (~+ object_ast))
-                          ((~' wrap) (.list (.` (~ jvm_interop))))))))))
+          (in (list (` ((~! syntax:) ((~ def_name) (~+ (list\map product.right arg_function_inputs)) (~+ object_ast))
+                        ((~' in) (.list (.` (~ jvm_interop))))))))))
 
       (#FieldAccessDecl fad)
       (do meta.monad
@@ -1596,8 +1596,8 @@
                                 getter_body (if import_field_setter?
                                               (` ((~! io.io) (~ getter_body)))
                                               getter_body)]
-                            (wrap (` ((~! syntax:) (~ getter_call)
-                                      ((~' wrap) (.list (.` (~ getter_body)))))))))
+                            (in (` ((~! syntax:) (~ getter_call)
+                                    ((~' in) (.list (.` (~ getter_body)))))))))
          setter_interop (: (Meta (List Code))
                            (if import_field_setter?
                              (with_gensyms [g!obj g!value]
@@ -1615,10 +1615,10 @@
                                                (if import_field_static?
                                                  (list)
                                                  (list (un_quote g!obj))))]
-                                 (wrap (list (` ((~! syntax:) (~ setter_call)
-                                                 ((~' wrap) (.list (.` ((~! io.io) ((~ (code.text setter_command)) (~+ g!obj+) (~ setter_value))))))))))))
-                             (wrap (list))))]
-        (wrap (list& getter_interop setter_interop)))
+                                 (in (list (` ((~! syntax:) (~ setter_call)
+                                               ((~' in) (.list (.` ((~! io.io) ((~ (code.text setter_command)) (~+ g!obj+) (~ setter_value))))))))))))
+                             (in (list))))]
+        (in (list& getter_interop setter_interop)))
       )))
 
 (def: (member_import$ type_params kind class [import_format member])
@@ -1644,9 +1644,9 @@
   (let [class_name (..safe class_name)]
     (case (..load_class class_name)
       (#try.Success class)
-      (\ meta.monad wrap (if (interface? class)
-                           #Interface
-                           #Class))
+      (\ meta.monad in (if (interface? class)
+                         #Interface
+                         #Class))
 
       (#try.Failure error)
       (meta.failure (format "Cannot load class: " class_name text.new_line
@@ -1713,7 +1713,7 @@
                               (list\map (|>> [import_format]) members)))
                   list.concat
                   (monad.map ! (member_import$ (product.right class_decl) kind class_decl)))]
-    (wrap (list& (class_import$ class_decl) (list\join =members)))))
+    (in (list& (class_import$ class_decl) (list\join =members)))))
 
 (syntax: #export (array {type (..generic_type^ (list))}
                         size)
@@ -1722,7 +1722,7 @@
   (case type
     (^template [ ]
       [(^ (#GenericClass  (list)))
-       (wrap (list (` ( (~ size)))))])
+       (in (list (` ( (~ size)))))])
     (["boolean" "jvm znewarray"]
      ["byte"    "jvm bnewarray"]
      ["short"   "jvm snewarray"]
@@ -1733,20 +1733,20 @@
      ["char"    "jvm cnewarray"])
 
     _
-    (wrap (list (` ("jvm anewarray" (~ (code.text (generic_type$ type))) (~ size)))))))
+    (in (list (` ("jvm anewarray" (~ (code.text (generic_type$ type))) (~ size)))))))
 
 (syntax: #export (array_length array)
   {#.doc (doc "Gives the length of an array."
               (array_length my_array))}
-  (wrap (list (` ("jvm arraylength" (~ array))))))
+  (in (list (` ("jvm arraylength" (~ array))))))
 
 (def: (type_to_class_name type)
   (-> Type (Meta Text))
   (if (type\= Any type)
-    (\ meta.monad wrap "java.lang.Object")
+    (\ meta.monad in "java.lang.Object")
     (case type
       (#.Primitive name params)
-      (\ meta.monad wrap name)
+      (\ meta.monad in name)
 
       (#.Apply A F)
       (case (type.applied (list A) F)
@@ -1768,12 +1768,12 @@
   (case array
     [_ (#.Identifier array_name)]
     (do meta.monad
-      [array_type (meta.find_type array_name)
+      [array_type (meta.type array_name)
        array_jvm_type (type_to_class_name array_type)]
       (case array_jvm_type
         (^template [ ]
           [
-           (wrap (list (` ( (~ array) (~ idx)))))])
+           (in (list (` ( (~ array) (~ idx)))))])
         (["[Z" "jvm zaload"]
          ["[B" "jvm baload"]
          ["[S" "jvm saload"]
@@ -1784,12 +1784,12 @@
          ["[C" "jvm caload"])
 
         _
-        (wrap (list (` ("jvm aaload" (~ array) (~ idx)))))))
+        (in (list (` ("jvm aaload" (~ array) (~ idx)))))))
 
     _
     (with_gensyms [g!array]
-      (wrap (list (` (let [(~ g!array) (~ array)]
-                       (..array_read (~ idx) (~ g!array)))))))))
+      (in (list (` (let [(~ g!array) (~ array)]
+                     (..array_read (~ idx) (~ g!array)))))))))
 
 (syntax: #export (array_write idx value array)
   {#.doc (doc "Stores an element into an array."
@@ -1797,12 +1797,12 @@
   (case array
     [_ (#.Identifier array_name)]
     (do meta.monad
-      [array_type (meta.find_type array_name)
+      [array_type (meta.type array_name)
        array_jvm_type (type_to_class_name array_type)]
       (case array_jvm_type
         (^template [ ]
           [
-           (wrap (list (` ( (~ array) (~ idx) (~ value)))))])
+           (in (list (` ( (~ array) (~ idx) (~ value)))))])
         (["[Z" "jvm zastore"]
          ["[B" "jvm bastore"]
          ["[S" "jvm sastore"]
@@ -1813,17 +1813,17 @@
          ["[C" "jvm castore"])
 
         _
-        (wrap (list (` ("jvm aastore" (~ array) (~ idx) (~ value)))))))
+        (in (list (` ("jvm aastore" (~ array) (~ idx) (~ value)))))))
 
     _
     (with_gensyms [g!array]
-      (wrap (list (` (let [(~ g!array) (~ array)]
-                       (..array_write (~ idx) (~ value) (~ g!array)))))))))
+      (in (list (` (let [(~ g!array) (~ array)]
+                     (..array_write (~ idx) (~ value) (~ g!array)))))))))
 
 (syntax: #export (class_for {type (..generic_type^ (list))})
   {#.doc (doc "Loads the class as a java.lang.Class object."
               (class_for java/lang/String))}
-  (wrap (list (` ("jvm object class" (~ (code.text (simple_class$ (list) type))))))))
+  (in (list (` ("jvm object class" (~ (code.text (simple_class$ (list) type))))))))
 
 (syntax: #export (type {type (..generic_type^ (list))})
-  (wrap (list (..class_to_type #ManualPrM (list) type))))
+  (in (list (..class_to_type #ManualPrM (list) type))))
diff --git a/stdlib/source/library/lux/ffi.php.lux b/stdlib/source/library/lux/ffi.php.lux
index eb9b5fbed..c9a0a584c 100644
--- a/stdlib/source/library/lux/ffi.php.lux
+++ b/stdlib/source/library/lux/ffi.php.lux
@@ -80,7 +80,7 @@
 (def: constant
   (Parser Field)
   (.form ($_ <>.and
-                   (<>\wrap true)
+                   (<>\in true)
                    .local_identifier
                    (<>.maybe ..alias)
                    ..nullable)))
@@ -189,7 +189,7 @@
 
                 (#.Left error)
                 (recover_from_failure error)))}
-  (wrap (list (` ("lux try" ((~! io.io) (~ expression)))))))
+  (in (list (` ("lux try" ((~! io.io) (~ expression)))))))
 
 (def: (with_io with? without)
   (-> Bit Code Code)
@@ -245,70 +245,70 @@
                                code.local_identifier)))
               g!type (code.local_identifier (maybe.default class alias))
               class_import (` ("php constant" (~ (code.text class))))]
-          (wrap (list& (` (type: (~ g!type)
-                            (..Object (primitive (~ (code.text class))))))
-                       (list\map (function (_ member)
-                                   (case member
-                                     (#Field [static? field alias fieldT])
-                                     (if static?
-                                       (` ((~! syntax:) ((~ (qualify (maybe.default field alias))))
-                                           (\ (~! meta.monad) (~' wrap)
-                                              (list (` (.:as (~ (nullable_type fieldT))
-                                                             ("php constant" (~ (code.text (%.format class "::" field))))))))))
-                                       (` (def: ((~ (qualify field))
+          (in (list& (` (type: (~ g!type)
+                          (..Object (primitive (~ (code.text class))))))
+                     (list\map (function (_ member)
+                                 (case member
+                                   (#Field [static? field alias fieldT])
+                                   (if static?
+                                     (` ((~! syntax:) ((~ (qualify (maybe.default field alias))))
+                                         (\ (~! meta.monad) (~' in)
+                                            (list (` (.:as (~ (nullable_type fieldT))
+                                                           ("php constant" (~ (code.text (%.format class "::" field))))))))))
+                                     (` (def: ((~ (qualify field))
+                                               (~ g!object))
+                                          (-> (~ g!type)
+                                              (~ (nullable_type fieldT)))
+                                          (:assume
+                                           (~ (without_null g!temp fieldT (` ("php object get" (~ (code.text field))
+                                                                              (:as (..Object .Any) (~ g!object))))))))))
+                                   
+                                   (#Method method)
+                                   (case method
+                                     (#Static [method alias inputsT io? try? outputT])
+                                     (..make_function (qualify (maybe.default method alias))
+                                                      g!temp
+                                                      (` ("php object get" (~ (code.text method))
+                                                          (:as (..Object .Any)
+                                                               ("php constant" (~ (code.text (%.format class "::" method)))))))
+                                                      inputsT
+                                                      io?
+                                                      try?
+                                                      outputT)
+                                     
+                                     (#Virtual [method alias inputsT io? try? outputT])
+                                     (let [g!inputs (input_variables inputsT)]
+                                       (` (def: ((~ (qualify (maybe.default method alias)))
+                                                 [(~+ (list\map product.right g!inputs))]
                                                  (~ g!object))
-                                            (-> (~ g!type)
-                                                (~ (nullable_type fieldT)))
+                                            (-> [(~+ (list\map nullable_type inputsT))]
+                                                (~ g!type)
+                                                (~ (|> (nullable_type outputT)
+                                                       (try_type try?)
+                                                       (io_type io?))))
                                             (:assume
-                                             (~ (without_null g!temp fieldT (` ("php object get" (~ (code.text field))
-                                                                                (:as (..Object .Any) (~ g!object))))))))))
-                                     
-                                     (#Method method)
-                                     (case method
-                                       (#Static [method alias inputsT io? try? outputT])
-                                       (..make_function (qualify (maybe.default method alias))
-                                                        g!temp
-                                                        (` ("php object get" (~ (code.text method))
-                                                            (:as (..Object .Any)
-                                                                 ("php constant" (~ (code.text (%.format class "::" method)))))))
-                                                        inputsT
-                                                        io?
-                                                        try?
-                                                        outputT)
-                                       
-                                       (#Virtual [method alias inputsT io? try? outputT])
-                                       (let [g!inputs (input_variables inputsT)]
-                                         (` (def: ((~ (qualify (maybe.default method alias)))
-                                                   [(~+ (list\map product.right g!inputs))]
-                                                   (~ g!object))
-                                              (-> [(~+ (list\map nullable_type inputsT))]
-                                                  (~ g!type)
-                                                  (~ (|> (nullable_type outputT)
-                                                         (try_type try?)
-                                                         (io_type io?))))
-                                              (:assume
-                                               (~ (<| (with_io io?)
-                                                      (with_try try?)
-                                                      (without_null g!temp outputT)
-                                                      (` ("php object do"
-                                                          (~ (code.text method))
-                                                          (~ g!object)
-                                                          (~+ (list\map (with_null g!temp) g!inputs)))))))))))))
-                                 members)))))
+                                             (~ (<| (with_io io?)
+                                                    (with_try try?)
+                                                    (without_null g!temp outputT)
+                                                    (` ("php object do"
+                                                        (~ (code.text method))
+                                                        (~ g!object)
+                                                        (~+ (list\map (with_null g!temp) g!inputs)))))))))))))
+                               members)))))
       
       (#Function [name alias inputsT io? try? outputT])
       (let [imported (` ("php constant" (~ (code.text name))))]
-        (wrap (list (..make_function (code.local_identifier (maybe.default name alias))
-                                     g!temp
-                                     imported
-                                     inputsT
-                                     io?
-                                     try?
-                                     outputT))))
+        (in (list (..make_function (code.local_identifier (maybe.default name alias))
+                                   g!temp
+                                   imported
+                                   inputsT
+                                   io?
+                                   try?
+                                   outputT))))
 
       (#Constant [_ name alias fieldT])
       (let [imported (` ("php constant" (~ (code.text name))))]
-        (wrap (list (` ((~! syntax:) ((~ (code.local_identifier (maybe.default name alias))))
-                        (\ (~! meta.monad) (~' wrap)
-                           (list (` (.:as (~ (nullable_type fieldT)) (~ imported))))))))))
+        (in (list (` ((~! syntax:) ((~ (code.local_identifier (maybe.default name alias))))
+                      (\ (~! meta.monad) (~' in)
+                         (list (` (.:as (~ (nullable_type fieldT)) (~ imported))))))))))
       )))
diff --git a/stdlib/source/library/lux/ffi.py.lux b/stdlib/source/library/lux/ffi.py.lux
index 36196c8dc..150cbf578 100644
--- a/stdlib/source/library/lux/ffi.py.lux
+++ b/stdlib/source/library/lux/ffi.py.lux
@@ -235,76 +235,76 @@
                          
                          #.Nil
                          (` ("python import" (~ (code.text class)))))]
-          (wrap (list& (` (type: (~ g!type)
-                            (..Object (primitive (~ (code.text real_class))))))
-                       (list\map (function (_ member)
-                                   (case member
-                                     (#Constructor inputsT)
-                                     (let [g!inputs (input_variables inputsT)]
-                                       (` (def: ((~ (qualify "new"))
-                                                 [(~+ (list\map product.right g!inputs))])
-                                            (-> [(~+ (list\map noneable_type inputsT))]
-                                                (~ g!type))
-                                            (:assume
-                                             ("python apply"
-                                              (:as ..Function (~ imported))
-                                              (~+ (list\map (with_none g!temp) g!inputs)))))))
+          (in (list& (` (type: (~ g!type)
+                          (..Object (primitive (~ (code.text real_class))))))
+                     (list\map (function (_ member)
+                                 (case member
+                                   (#Constructor inputsT)
+                                   (let [g!inputs (input_variables inputsT)]
+                                     (` (def: ((~ (qualify "new"))
+                                               [(~+ (list\map product.right g!inputs))])
+                                          (-> [(~+ (list\map noneable_type inputsT))]
+                                              (~ g!type))
+                                          (:assume
+                                           ("python apply"
+                                            (:as ..Function (~ imported))
+                                            (~+ (list\map (with_none g!temp) g!inputs)))))))
+                                   
+                                   (#Field [static? field fieldT])
+                                   (if static?
+                                     (` ((~! syntax:) ((~ (qualify field)))
+                                         (\ (~! meta.monad) (~' in)
+                                            (list (` (.:as (~ (noneable_type fieldT))
+                                                           ("python object get" (~ (code.text field))
+                                                            (:as (..Object .Any) (~ imported)))))))))
+                                     (` (def: ((~ (qualify field))
+                                               (~ g!object))
+                                          (-> (~ g!type)
+                                              (~ (noneable_type fieldT)))
+                                          (:assume
+                                           (~ (without_none g!temp fieldT (` ("python object get" (~ (code.text field))
+                                                                              (:as (..Object .Any) (~ g!object))))))))))
+                                   
+                                   (#Method method)
+                                   (case method
+                                     (#Static [method alias inputsT io? try? outputT])
+                                     (..make_function (qualify (maybe.default method alias))
+                                                      g!temp
+                                                      (` ("python object get" (~ (code.text method))
+                                                          (:as (..Object .Any) (~ imported))))
+                                                      inputsT
+                                                      io?
+                                                      try?
+                                                      outputT)
                                      
-                                     (#Field [static? field fieldT])
-                                     (if static?
-                                       (` ((~! syntax:) ((~ (qualify field)))
-                                           (\ (~! meta.monad) (~' wrap)
-                                              (list (` (.:as (~ (noneable_type fieldT))
-                                                             ("python object get" (~ (code.text field))
-                                                              (:as (..Object .Any) (~ imported)))))))))
-                                       (` (def: ((~ (qualify field))
+                                     (#Virtual [method alias inputsT io? try? outputT])
+                                     (let [g!inputs (input_variables inputsT)]
+                                       (` (def: ((~ (qualify (maybe.default method alias)))
+                                                 [(~+ (list\map product.right g!inputs))]
                                                  (~ g!object))
-                                            (-> (~ g!type)
-                                                (~ (noneable_type fieldT)))
+                                            (-> [(~+ (list\map noneable_type inputsT))]
+                                                (~ g!type)
+                                                (~ (|> (noneable_type outputT)
+                                                       (try_type try?)
+                                                       (io_type io?))))
                                             (:assume
-                                             (~ (without_none g!temp fieldT (` ("python object get" (~ (code.text field))
-                                                                                (:as (..Object .Any) (~ g!object))))))))))
-                                     
-                                     (#Method method)
-                                     (case method
-                                       (#Static [method alias inputsT io? try? outputT])
-                                       (..make_function (qualify (maybe.default method alias))
-                                                        g!temp
-                                                        (` ("python object get" (~ (code.text method))
-                                                            (:as (..Object .Any) (~ imported))))
-                                                        inputsT
-                                                        io?
-                                                        try?
-                                                        outputT)
-                                       
-                                       (#Virtual [method alias inputsT io? try? outputT])
-                                       (let [g!inputs (input_variables inputsT)]
-                                         (` (def: ((~ (qualify (maybe.default method alias)))
-                                                   [(~+ (list\map product.right g!inputs))]
-                                                   (~ g!object))
-                                              (-> [(~+ (list\map noneable_type inputsT))]
-                                                  (~ g!type)
-                                                  (~ (|> (noneable_type outputT)
-                                                         (try_type try?)
-                                                         (io_type io?))))
-                                              (:assume
-                                               (~ (<| (with_io io?)
-                                                      (with_try try?)
-                                                      (without_none g!temp outputT)
-                                                      (` ("python object do"
-                                                          (~ (code.text method))
-                                                          (~ g!object)
-                                                          (~+ (list\map (with_none g!temp) g!inputs)))))))))))))
-                                 members)))))
+                                             (~ (<| (with_io io?)
+                                                    (with_try try?)
+                                                    (without_none g!temp outputT)
+                                                    (` ("python object do"
+                                                        (~ (code.text method))
+                                                        (~ g!object)
+                                                        (~+ (list\map (with_none g!temp) g!inputs)))))))))))))
+                               members)))))
       
       (#Function [name alias inputsT io? try? outputT])
-      (wrap (list (..make_function (code.local_identifier (maybe.default name alias))
-                                   g!temp
-                                   (` ("python constant" (~ (code.text name))))
-                                   inputsT
-                                   io?
-                                   try?
-                                   outputT)))
+      (in (list (..make_function (code.local_identifier (maybe.default name alias))
+                                 g!temp
+                                 (` ("python constant" (~ (code.text name))))
+                                 inputsT
+                                 io?
+                                 try?
+                                 outputT)))
       )))
 
 (template: #export (lambda  )
diff --git a/stdlib/source/library/lux/ffi.rb.lux b/stdlib/source/library/lux/ffi.rb.lux
index f3f483e23..ba63ac1b1 100644
--- a/stdlib/source/library/lux/ffi.rb.lux
+++ b/stdlib/source/library/lux/ffi.rb.lux
@@ -80,7 +80,7 @@
 (def: constant
   (Parser Field)
   (.form ($_ <>.and
-                   (<>\wrap true)
+                   (<>\in true)
                    .local_identifier
                    (<>.maybe ..alias)
                    ..nilable)))
@@ -245,60 +245,60 @@
                                  #.None
                                  (list)))
               class_import (` ("ruby constant" (~ (code.text class))))]
-          (wrap (list& (` (type: (~ g!type)
-                            (..Object (primitive (~ (code.text class))))))
-                       (list\map (function (_ member)
-                                   (case member
-                                     (#Field [static? field alias fieldT])
-                                     (if static?
-                                       (` ((~! syntax:) ((~ (qualify (maybe.default field alias))))
-                                           (\ (~! meta.monad) (~' wrap)
-                                              (list (` (.:as (~ (nilable_type fieldT))
-                                                             (.exec
-                                                               (~+ module_import)
-                                                               ("ruby constant" (~ (code.text (%.format class "::" field)))))))))))
-                                       (` (def: ((~ (qualify field))
+          (in (list& (` (type: (~ g!type)
+                          (..Object (primitive (~ (code.text class))))))
+                     (list\map (function (_ member)
+                                 (case member
+                                   (#Field [static? field alias fieldT])
+                                   (if static?
+                                     (` ((~! syntax:) ((~ (qualify (maybe.default field alias))))
+                                         (\ (~! meta.monad) (~' in)
+                                            (list (` (.:as (~ (nilable_type fieldT))
+                                                           (.exec
+                                                             (~+ module_import)
+                                                             ("ruby constant" (~ (code.text (%.format class "::" field)))))))))))
+                                     (` (def: ((~ (qualify field))
+                                               (~ g!object))
+                                          (-> (~ g!type)
+                                              (~ (nilable_type fieldT)))
+                                          (:assume
+                                           (~ (without_nil g!temp fieldT (` ("ruby object get" (~ (code.text field))
+                                                                             (:as (..Object .Any) (~ g!object))))))))))
+                                   
+                                   (#Method method)
+                                   (case method
+                                     (#Static [method alias inputsT io? try? outputT])
+                                     (..make_function (qualify (maybe.default method alias))
+                                                      g!temp
+                                                      (` ("ruby object get" (~ (code.text method))
+                                                          (:as (..Object .Any)
+                                                               (.exec
+                                                                 (~+ module_import)
+                                                                 ("ruby constant" (~ (code.text (%.format class "::" method))))))))
+                                                      inputsT
+                                                      io?
+                                                      try?
+                                                      outputT)
+                                     
+                                     (#Virtual [method alias inputsT io? try? outputT])
+                                     (let [g!inputs (input_variables inputsT)]
+                                       (` (def: ((~ (qualify (maybe.default method alias)))
+                                                 [(~+ (list\map product.right g!inputs))]
                                                  (~ g!object))
-                                            (-> (~ g!type)
-                                                (~ (nilable_type fieldT)))
+                                            (-> [(~+ (list\map nilable_type inputsT))]
+                                                (~ g!type)
+                                                (~ (|> (nilable_type outputT)
+                                                       (try_type try?)
+                                                       (io_type io?))))
                                             (:assume
-                                             (~ (without_nil g!temp fieldT (` ("ruby object get" (~ (code.text field))
-                                                                               (:as (..Object .Any) (~ g!object))))))))))
-                                     
-                                     (#Method method)
-                                     (case method
-                                       (#Static [method alias inputsT io? try? outputT])
-                                       (..make_function (qualify (maybe.default method alias))
-                                                        g!temp
-                                                        (` ("ruby object get" (~ (code.text method))
-                                                            (:as (..Object .Any)
-                                                                 (.exec
-                                                                   (~+ module_import)
-                                                                   ("ruby constant" (~ (code.text (%.format class "::" method))))))))
-                                                        inputsT
-                                                        io?
-                                                        try?
-                                                        outputT)
-                                       
-                                       (#Virtual [method alias inputsT io? try? outputT])
-                                       (let [g!inputs (input_variables inputsT)]
-                                         (` (def: ((~ (qualify (maybe.default method alias)))
-                                                   [(~+ (list\map product.right g!inputs))]
-                                                   (~ g!object))
-                                              (-> [(~+ (list\map nilable_type inputsT))]
-                                                  (~ g!type)
-                                                  (~ (|> (nilable_type outputT)
-                                                         (try_type try?)
-                                                         (io_type io?))))
-                                              (:assume
-                                               (~ (<| (with_io io?)
-                                                      (with_try try?)
-                                                      (without_nil g!temp outputT)
-                                                      (` ("ruby object do"
-                                                          (~ (code.text method))
-                                                          (~ g!object)
-                                                          (~+ (list\map (with_nil g!temp) g!inputs)))))))))))))
-                                 members)))))
+                                             (~ (<| (with_io io?)
+                                                    (with_try try?)
+                                                    (without_nil g!temp outputT)
+                                                    (` ("ruby object do"
+                                                        (~ (code.text method))
+                                                        (~ g!object)
+                                                        (~+ (list\map (with_nil g!temp) g!inputs)))))))))))))
+                               members)))))
       
       (#Function [name alias inputsT io? try? outputT])
       (let [imported (` (.exec
@@ -309,13 +309,13 @@
                                 #.None
                                 (list)))
                           ("ruby constant" (~ (code.text name)))))]
-        (wrap (list (..make_function (code.local_identifier (maybe.default name alias))
-                                     g!temp
-                                     imported
-                                     inputsT
-                                     io?
-                                     try?
-                                     outputT))))
+        (in (list (..make_function (code.local_identifier (maybe.default name alias))
+                                   g!temp
+                                   imported
+                                   inputsT
+                                   io?
+                                   try?
+                                   outputT))))
 
       (#Constant [_ name alias fieldT])
       (let [imported (` (.exec
@@ -326,7 +326,7 @@
                                 #.None
                                 (list)))
                           ("ruby constant" (~ (code.text name)))))]
-        (wrap (list (` ((~! syntax:) ((~ (code.local_identifier (maybe.default name alias))))
-                        (\ (~! meta.monad) (~' wrap)
-                           (list (` (.:as (~ (nilable_type fieldT)) (~ imported))))))))))
+        (in (list (` ((~! syntax:) ((~ (code.local_identifier (maybe.default name alias))))
+                      (\ (~! meta.monad) (~' in)
+                         (list (` (.:as (~ (nilable_type fieldT)) (~ imported))))))))))
       )))
diff --git a/stdlib/source/library/lux/ffi.scm.lux b/stdlib/source/library/lux/ffi.scm.lux
index 85370fcf6..69559353f 100644
--- a/stdlib/source/library/lux/ffi.scm.lux
+++ b/stdlib/source/library/lux/ffi.scm.lux
@@ -80,7 +80,7 @@
 (def: constant
   (Parser Field)
   (.form ($_ <>.and
-                   (<>\wrap true)
+                   (<>\in true)
                    .local_identifier
                    (<>.maybe ..alias)
                    ..nilable)))
@@ -156,7 +156,7 @@
 
                 (#.Left error)
                 (recover_from_failure error)))}
-  (wrap (list (` ("lux try" ((~! io.io) (~ expression)))))))
+  (in (list (` ("lux try" ((~! io.io) (~ expression)))))))
 
 (def: (with_io with? without)
   (-> Bit Code Code)
@@ -204,17 +204,17 @@
     (case import
       (#Function [name alias inputsT io? try? outputT])
       (let [imported (` ("scheme constant" (~ (code.text name))))]
-        (wrap (list (..make_function (code.local_identifier (maybe.default name alias))
-                                     g!temp
-                                     imported
-                                     inputsT
-                                     io?
-                                     try?
-                                     outputT))))
+        (in (list (..make_function (code.local_identifier (maybe.default name alias))
+                                   g!temp
+                                   imported
+                                   inputsT
+                                   io?
+                                   try?
+                                   outputT))))
 
       (#Constant [_ name alias fieldT])
       (let [imported (` ("scheme constant" (~ (code.text name))))]
-        (wrap (list (` ((~! syntax:) ((~ (code.local_identifier (maybe.default name alias))))
-                        (\ (~! meta.monad) (~' wrap)
-                           (list (` (.:as (~ (nilable_type fieldT)) (~ imported))))))))))
+        (in (list (` ((~! syntax:) ((~ (code.local_identifier (maybe.default name alias))))
+                      (\ (~! meta.monad) (~' in)
+                         (list (` (.:as (~ (nilable_type fieldT)) (~ imported))))))))))
       )))
diff --git a/stdlib/source/library/lux/macro.lux b/stdlib/source/library/lux/macro.lux
index 275401a61..242ed8a85 100644
--- a/stdlib/source/library/lux/macro.lux
+++ b/stdlib/source/library/lux/macro.lux
@@ -25,16 +25,16 @@
   (case syntax
     [_ (#.Form (#.Cons [[_ (#.Identifier name)] args]))]
     (do //.monad
-      [?macro (//.find_macro name)]
+      [?macro (//.macro name)]
       (case ?macro
         (#.Some macro)
         ((:as Macro' macro) args)
         
         #.None
-        (\ //.monad wrap (list syntax))))
+        (\ //.monad in (list syntax))))
 
     _
-    (\ //.monad wrap (list syntax))))
+    (\ //.monad in (list syntax))))
 
 (def: #export (expand syntax)
   {#.doc (doc "Given code that requires applying a macro, expands repeatedly until no more direct macro-calls are left."
@@ -43,19 +43,19 @@
   (case syntax
     [_ (#.Form (#.Cons [[_ (#.Identifier name)] args]))]
     (do //.monad
-      [?macro (//.find_macro name)]
+      [?macro (//.macro name)]
       (case ?macro
         (#.Some macro)
         (do //.monad
           [expansion ((:as Macro' macro) args)
            expansion' (monad.map //.monad expand expansion)]
-          (wrap (list\join expansion')))
+          (in (list\join expansion')))
         
         #.None
-        (\ //.monad wrap (list syntax))))
+        (\ //.monad in (list syntax))))
 
     _
-    (\ //.monad wrap (list syntax))))
+    (\ //.monad in (list syntax))))
 
 (def: #export (expand_all syntax)
   {#.doc "Expands all macro-calls everywhere recursively, until only primitive/base code remains."}
@@ -63,29 +63,29 @@
   (case syntax
     [_ (#.Form (#.Cons [[_ (#.Identifier name)] args]))]
     (do //.monad
-      [?macro (//.find_macro name)]
+      [?macro (//.macro name)]
       (case ?macro
         (#.Some macro)
         (do //.monad
           [expansion ((:as Macro' macro) args)
            expansion' (monad.map //.monad expand_all expansion)]
-          (wrap (list\join expansion')))
+          (in (list\join expansion')))
         
         #.None
         (do //.monad
           [parts' (monad.map //.monad expand_all (list& (code.identifier name) args))]
-          (wrap (list (code.form (list\join parts')))))))
+          (in (list (code.form (list\join parts')))))))
 
     [_ (#.Form (#.Cons [harg targs]))]
     (do //.monad
       [harg+ (expand_all harg)
        targs+ (monad.map //.monad expand_all targs)]
-      (wrap (list (code.form (list\compose harg+ (list\join (: (List (List Code)) targs+)))))))
+      (in (list (code.form (list\compose harg+ (list\join (: (List (List Code)) targs+)))))))
 
     [_ (#.Tuple members)]
     (do //.monad
       [members' (monad.map //.monad expand_all members)]
-      (wrap (list (code.tuple (list\join members')))))
+      (in (list (code.tuple (list\join members')))))
 
     [_ (#.Record members)]
     (|> members
@@ -96,14 +96,14 @@
                         right (expand_all right)]
                        (case [left right]
                          [(#.Cons left #.Nil) (#.Cons right #.Nil)]
-                         (wrap [left right])
+                         (in [left right])
 
                          _
                          (//.failure "Record members must expand into singletons.")))))
         (\ //.monad map (|>> code.record list)))
 
     _
-    (\ //.monad wrap (list syntax))))
+    (\ //.monad in (list syntax))))
 
 (def: #export (gensym prefix)
   {#.doc (doc "Generates a unique name as an Code node (ready to be used in code templates)."
@@ -111,16 +111,16 @@
   (-> Text (Meta Code))
   (do //.monad
     [id //.count]
-    (wrap (|> id
-              (\ nat.decimal encode)
-              ($_ text\compose "__gensym__" prefix)
-              [""] code.identifier))))
+    (in (|> id
+            (\ nat.decimal encode)
+            ($_ text\compose "__gensym__" prefix)
+            [""] code.identifier))))
 
 (def: (get_local_identifier ast)
   (-> Code (Meta Text))
   (case ast
     [_ (#.Identifier [_ name])]
-    (\ //.monad wrap name)
+    (\ //.monad in name)
 
     _
     (//.failure (text\compose "Code is not a local identifier: " (code.format ast)))))
@@ -134,11 +134,11 @@
   {#.doc (doc "Creates new identifiers and offers them to the body expression."
               (syntax: #export (synchronized lock body)
                 (with_gensyms [g!lock g!body g!_]
-                  (wrap (list (` (let [(~ g!lock) (~ lock)
-                                       (~ g!_) ("jvm monitorenter" (~ g!lock))
-                                       (~ g!body) (~ body)
-                                       (~ g!_) ("jvm monitorexit" (~ g!lock))]
-                                   (~ g!body)))))
+                  (in (list (` (let [(~ g!lock) (~ lock)
+                                     (~ g!_) ("jvm monitorenter" (~ g!lock))
+                                     (~ g!body) (~ body)
+                                     (~ g!_) ("jvm monitorexit" (~ g!lock))]
+                                 (~ g!body)))))
                   )))}
   (case tokens
     (^ (list [_ (#.Tuple identifiers)] body))
@@ -147,9 +147,9 @@
        #let [identifier_defs (list\join (list\map (: (-> Text (List Code))
                                                      (function (_ name) (list (code.identifier ["" name]) (` (gensym (~ (code.text name)))))))
                                                   identifier_names))]]
-      (wrap (list (` ((~! do) (~! //.monad)
-                      [(~+ identifier_defs)]
-                      (~ body))))))
+      (in (list (` ((~! do) (~! //.monad)
+                    [(~+ identifier_defs)]
+                    (~ body))))))
 
     _
     (//.failure (..wrong_syntax_error (name_of ..with_gensyms)))))
@@ -161,7 +161,7 @@
     [token+ (..expand token)]
     (case token+
       (^ (list token'))
-      (wrap token')
+      (in token')
 
       _
       (//.failure "Macro expanded to more than 1 element."))))
@@ -197,9 +197,9 @@
                   _ (list\map (|>> code.format "lux io log")
                               output)
                   _ ("lux io log" "")]]
-           (wrap (if omit?
-                   (list)
-                   output)))
+           (in (if omit?
+                 (list)
+                 output)))
 
          #.None
          (//.failure (..wrong_syntax_error macro_name)))))]
diff --git a/stdlib/source/library/lux/macro/local.lux b/stdlib/source/library/lux/macro/local.lux
index 1fc16815f..3e37d174f 100644
--- a/stdlib/source/library/lux/macro/local.lux
+++ b/stdlib/source/library/lux/macro/local.lux
@@ -45,7 +45,7 @@
         (#try.Failure error))
 
       #.None
-      (exception.throw ..unknown_module [name]))))
+      (exception.except ..unknown_module [name]))))
 
 (def: (push_one [name macro])
   (-> [Name Macro] (Meta Any))
@@ -62,7 +62,7 @@
                          []])
           
           (#.Some _)
-          (exception.throw ..cannot_shadow_definition [module_name definition_name]))))))
+          (exception.except ..cannot_shadow_definition [module_name definition_name]))))))
 
 (def: (pop_one name)
   (-> Name (Meta Any))
@@ -78,7 +78,7 @@
                          []])
 
           #.None
-          (exception.throw ..unknown_definition [module_name definition_name]))))))
+          (exception.except ..unknown_definition [module_name definition_name]))))))
 
 (def: (pop_all macros self)
   (-> (List Name) Name Macro)
@@ -88,12 +88,12 @@
        [_ (monad.map ! ..pop_one macros)
         _ (..pop_one self)
         compiler meta.get_compiler]
-       (wrap (case (get@ #.expected compiler)
-               (#.Some _)
-               (list (' []))
-               
-               #.None
-               (list)))))))
+       (in (case (get@ #.expected compiler)
+             (#.Some _)
+             (list (' []))
+             
+             #.None
+             (list)))))))
 
 (def: #export (push macros)
   (-> (List [Name Macro]) (Meta Code))
@@ -103,4 +103,4 @@
      g!pop (//.gensym "pop")
      _ (let [g!pop (: Name ["" (//code.format g!pop)])]
          (..push_one [g!pop (..pop_all (list\map product.left macros) g!pop)]))]
-    (wrap (` ((~ g!pop))))))
+    (in (` ((~ g!pop))))))
diff --git a/stdlib/source/library/lux/macro/poly.lux b/stdlib/source/library/lux/macro/poly.lux
index a9f4a5744..892f23284 100644
--- a/stdlib/source/library/lux/macro/poly.lux
+++ b/stdlib/source/library/lux/macro/poly.lux
@@ -29,19 +29,19 @@
                    body)
   (with_gensyms [g!_ g!type g!output]
     (let [g!name (code.identifier ["" name])]
-      (wrap (.list (` ((~! syntax:) (~+ (|export|.format export)) ((~ g!name) {(~ g!type) (~! .identifier)})
-                       ((~! do) (~! meta.monad)
-                        [(~ g!type) ((~! meta.find_type_def) (~ g!type))]
-                        (case (: (.Either .Text .Code)
-                                 ((~! .run) ((~! <>.rec)
-                                                   (function ((~ g!_) (~ g!name))
-                                                     (~ body)))
-                                  (~ g!type)))
-                          (#.Left (~ g!output))
-                          ((~! meta.failure) (~ g!output))
+      (in (.list (` ((~! syntax:) (~+ (|export|.format export)) ((~ g!name) {(~ g!type) (~! .identifier)})
+                     ((~! do) (~! meta.monad)
+                      [(~ g!type) ((~! meta.type_definition) (~ g!type))]
+                      (case (: (.Either .Text .Code)
+                               ((~! .run) ((~! <>.rec)
+                                                 (function ((~ g!_) (~ g!name))
+                                                   (~ body)))
+                                (~ g!type)))
+                        (#.Left (~ g!output))
+                        ((~! meta.failure) (~ g!output))
 
-                          (#.Right (~ g!output))
-                          ((~' wrap) (.list (~ g!output))))))))))))
+                        (#.Right (~ g!output))
+                        ((~' in) (.list (~ g!output))))))))))))
 
 (def: (common_poly_name? poly_func)
   (-> Text Bit)
@@ -61,12 +61,12 @@
     [poly_args (monad.map ! meta.normal poly_args)
      name (case ?name
             (#.Some name)
-            (wrap name)
+            (in name)
 
             (^multi #.None
                     {(derivation_name (product.right poly_func) (list\map product.right poly_args))
                      (#.Some derived_name)})
-            (wrap derived_name)
+            (in derived_name)
 
             _
             (<>.failure "derived: was given no explicit name, and cannot generate one from given information."))
@@ -76,10 +76,10 @@
 
                   #.None
                   (` ((~ (code.identifier poly_func)) (~+ (list\map code.identifier poly_args)))))]]
-    (wrap (.list (` (def: (~+ (|export|.format export))
-                      (~ (code.identifier ["" name]))
-                      {#.implementation? #1}
-                      (~ impl)))))))
+    (in (.list (` (def: (~+ (|export|.format export))
+                    (~ (code.identifier ["" name]))
+                    {#.implementation? #1}
+                    (~ impl)))))))
 
 (def: #export (to_code env type)
   (-> Env Type Code)
diff --git a/stdlib/source/library/lux/macro/syntax.lux b/stdlib/source/library/lux/macro/syntax.lux
index 3ad402530..1ba0c4f9f 100644
--- a/stdlib/source/library/lux/macro/syntax.lux
+++ b/stdlib/source/library/lux/macro/syntax.lux
@@ -57,7 +57,7 @@
                                                  (with_brackets (spaced (list\map super_class_decl$ interfaces)))
                                                  (with_brackets (spaced (list\map constructor_arg$ constructor_args)))
                                                  (with_brackets (spaced (list\map (method_def$ id) methods))))))]
-                  (wrap (list (` ((~ (code.text def_code)))))))))}
+                  (in (list (` ((~ (code.text def_code)))))))))}
   (let [[exported? tokens] (: [Bit (List Code)]
                               (case tokens
                                 (^ (list& [_ (#.Tag ["" "export"])] tokens'))
@@ -89,17 +89,17 @@
                                           (^ [_ (#.Record (list [var parser]))])
                                           (case var
                                             [_ (#.Tag ["" "let"])]
-                                            (wrap [var parser])
+                                            (in [var parser])
 
                                             _
-                                            (wrap [var
-                                                   (` ((~! ..self_documenting) (' (~ var))
-                                                       (~ parser)))]))
+                                            (in [var
+                                                 (` ((~! ..self_documenting) (' (~ var))
+                                                     (~ parser)))]))
 
                                           [_ (#.Identifier var_name)]
-                                          (wrap [arg
-                                                 (` ((~! ..self_documenting) (' (~ arg))
-                                                     (~! .any)))])
+                                          (in [arg
+                                               (` ((~! ..self_documenting) (' (~ arg))
+                                                   (~! .any)))])
 
                                           _
                                           (meta.failure "Syntax pattern expects records or identifiers."))))
@@ -111,19 +111,19 @@
                                (if exported?
                                  (list (' #export))
                                  (list)))]]
-          (wrap (list (` (macro: (~+ export_ast) ((~ (code.identifier ["" name])) (~ g!tokens) (~ g!state))
-                           (~ meta)
-                           ({(#.Right (~ g!body))
-                             ((~ g!body) (~ g!state))
+          (in (list (` (macro: (~+ export_ast) ((~ (code.identifier ["" name])) (~ g!tokens) (~ g!state))
+                         (~ meta)
+                         ({(#.Right (~ g!body))
+                           ((~ g!body) (~ g!state))
 
-                             (#.Left (~ g!error))
-                             (#.Left ((~! text.join_with) (~! text.new_line) (list (~ error_msg) (~ g!error))))}
-                            ((~! .run)
-                             (: ((~! .Parser) (Meta (List Code)))
-                                ((~! do) (~! <>.monad)
-                                 [(~+ (..join_pairs vars+parsers))]
-                                 ((~' wrap) (~ body))))
-                             (~ g!tokens)))))))))
+                           (#.Left (~ g!error))
+                           (#.Left ((~! text.join_with) (~! text.new_line) (list (~ error_msg) (~ g!error))))}
+                          ((~! .run)
+                           (: ((~! .Parser) (Meta (List Code)))
+                              ((~! do) (~! <>.monad)
+                               [(~+ (..join_pairs vars+parsers))]
+                               ((~' in) (~ body))))
+                           (~ g!tokens)))))))))
       
       _
       (meta.failure (macro.wrong_syntax_error (name_of ..syntax:))))))
diff --git a/stdlib/source/library/lux/macro/syntax/declaration.lux b/stdlib/source/library/lux/macro/syntax/declaration.lux
index d1c7d94c6..75098a7b9 100644
--- a/stdlib/source/library/lux/macro/syntax/declaration.lux
+++ b/stdlib/source/library/lux/macro/syntax/declaration.lux
@@ -32,7 +32,7 @@
               (foo bar baz))}
   (Parser Declaration)
   (<>.either (<>.and .local_identifier
-                     (<>\wrap (list)))
+                     (<>\in (list)))
              (.form (<>.and .local_identifier
                                   (<>.some .local_identifier)))))
 
diff --git a/stdlib/source/library/lux/macro/syntax/definition.lux b/stdlib/source/library/lux/macro/syntax/definition.lux
index 7f9e9583f..a97abb278 100644
--- a/stdlib/source/library/lux/macro/syntax/definition.lux
+++ b/stdlib/source/library/lux/macro/syntax/definition.lux
@@ -96,7 +96,7 @@
                         [_ (.tag! (name_of #.Cons))
                          [head tail] (<>.and (.tuple (<>.and tag_parser .any))
                                              recur)]
-                        (wrap [head tail])))
+                        (in [head tail])))
          ))))
 
 (def: #export (parser compiler)
@@ -134,8 +134,8 @@
     [definition (..parser compiler)
      _ (case (get@ #value definition)
          (#.Left _)
-         (wrap [])
+         (in [])
 
          (#.Right _)
-         (<>.lift (exception.throw ..lacks_type! [definition])))]
-    (wrap definition)))
+         (<>.lift (exception.except ..lacks_type! [definition])))]
+    (in definition)))
diff --git a/stdlib/source/library/lux/macro/syntax/export.lux b/stdlib/source/library/lux/macro/syntax/export.lux
index d76aa6fcc..d51b28bcd 100644
--- a/stdlib/source/library/lux/macro/syntax/export.lux
+++ b/stdlib/source/library/lux/macro/syntax/export.lux
@@ -17,5 +17,5 @@
 (def: #export parser
   (Parser Bit)
   (<>.either (<>.after (.this! ..token)
-                       (<>\wrap true))
-             (<>\wrap false)))
+                       (<>\in true))
+             (<>\in false)))
diff --git a/stdlib/source/library/lux/macro/template.lux b/stdlib/source/library/lux/macro/template.lux
index c835b8fd9..09204ce76 100644
--- a/stdlib/source/library/lux/macro/template.lux
+++ b/stdlib/source/library/lux/macro/template.lux
@@ -27,10 +27,10 @@
    ["." local]])
 
 (syntax: #export (spliced {parts (.tuple (<>.some .any))})
-  (wrap parts))
+  (in parts))
 
 (syntax: #export (amount {parts (.tuple (<>.some .any))})
-  (wrap (list (code.nat (list.size parts)))))
+  (in (list (code.nat (list.size parts)))))
 
 (syntax: #export (with_locals {locals (.tuple (<>.some .local_identifier))}
                    body)
@@ -38,21 +38,21 @@
     [g!locals (|> locals
                   (list\map //.gensym)
                   (monad.seq !))]
-    (wrap (list (` (.with_expansions [(~+ (|> (list.zipped/2 locals g!locals)
-                                              (list\map (function (_ [name identifier])
-                                                          (list (code.local_identifier name) (as_is identifier))))
-                                              list\join))]
-                     (~ body)))))))
+    (in (list (` (.with_expansions [(~+ (|> (list.zipped/2 locals g!locals)
+                                            (list\map (function (_ [name identifier])
+                                                        (list (code.local_identifier name) (as_is identifier))))
+                                            list\join))]
+                   (~ body)))))))
 
 (def: (name_side module_side? parser)
   (-> Bit (Parser Name) (Parser Text))
   (do <>.monad
     [[module short] parser]
-    (wrap (if module_side?
-            (case module
-              "" short
-              _ module)
-            short))))
+    (in (if module_side?
+          (case module
+            "" short
+            _ module)
+          short))))
 
 (def: (snippet module_side?)
   (-> Bit (Parser Text))
@@ -80,18 +80,18 @@
   (.tuple (<>.many (..snippet module_side?))))
 
 (syntax: #export (text {simple (..part false)})
-  (wrap (list (|> simple (text.join_with "") code.text))))
+  (in (list (|> simple (text.join_with "") code.text))))
 
 (template [  ]
   [(syntax: #export ( {name (<>.or (<>.and (..part true) (..part false))
                                          (..part false))})
      (case name
        (#.Left [simple complex])
-       (wrap (list ( [(text.join_with "" simple)
-                               (text.join_with "" complex)])))
+       (in (list ( [(text.join_with "" simple)
+                             (text.join_with "" complex)])))
        
        (#.Right simple)
-       (wrap (list (|> simple (text.join_with "") )))))]
+       (in (list (|> simple (text.join_with "") )))))]
 
   [identifier code.local_identifier code.identifier]
   [tag code.local_tag code.tag]
@@ -148,7 +148,7 @@
                                (|> (list.zipped/2 parameters inputs)
                                    (dictionary.of_list text.hash)))]
            (#.Right [compiler (list\map (..applied environment) template)]))
-         (exception.throw ..irregular_arguments [parameters_amount inputs_amount]))))))
+         (exception.except ..irregular_arguments [parameters_amount inputs_amount]))))))
 
 (def: local
   (Parser Local)
@@ -156,9 +156,9 @@
     [[name parameters] (.form (<>.and .local_identifier
                                             (<>.many .local_identifier)))
      template (.tuple (<>.some .any))]
-    (wrap {#name name
-           #parameters parameters
-           #template template})))
+    (in {#name name
+         #parameters parameters
+         #template template})))
 
 (syntax: #export (let {locals (.tuple (<>.some ..local))}
                    body)
@@ -178,8 +178,8 @@
                                  locals))]
     (if expression?
       (//.with_gensyms [g!body]
-        (wrap (list (` (.let [(~ g!body) (~ body)]
-                         (exec (~ g!pop)
-                           (~ g!body)))))))
-      (wrap (list body
-                  g!pop)))))
+        (in (list (` (.let [(~ g!body) (~ body)]
+                       (exec (~ g!pop)
+                         (~ g!body)))))))
+      (in (list body
+                g!pop)))))
diff --git a/stdlib/source/library/lux/math/infix.lux b/stdlib/source/library/lux/math/infix.lux
index a8fd881aa..a0db7975d 100644
--- a/stdlib/source/library/lux/math/infix.lux
+++ b/stdlib/source/library/lux/math/infix.lux
@@ -1,4 +1,5 @@
-(.module: {#.doc "Common mathematical constants and functions."}
+(.module:
+  {#.doc "Common mathematical constants and functions."}
   [library
    [lux #*
     [abstract
@@ -46,21 +47,21 @@
                                init_op .any
                                init_param infix^
                                steps (<>.some (<>.and .any infix^))]
-                              (wrap (product.right (list\fold (function (_ [op param] [subject [_subject _op _param]])
-                                                                [param [(#Binary _subject _op _param)
-                                                                        (` and)
-                                                                        (#Binary subject op param)]])
-                                                              [init_param [init_subject init_op init_param]]
-                                                              steps))))
+                              (in (product.right (list\fold (function (_ [op param] [subject [_subject _op _param]])
+                                                              [param [(#Binary _subject _op _param)
+                                                                      (` and)
+                                                                      (#Binary subject op param)]])
+                                                            [init_param [init_subject init_op init_param]]
+                                                            steps))))
                             (do <>.monad
                               [init_subject infix^
                                init_op .any
                                init_param infix^
                                steps (<>.some (<>.and .any infix^))]
-                              (wrap (list\fold (function (_ [op param] [_subject _op _param])
-                                                 [(#Binary _subject _op _param) op param])
-                                               [init_subject init_op init_param]
-                                               steps)))
+                              (in (list\fold (function (_ [op param] [_subject _op _param])
+                                               [(#Binary _subject _op _param) op param])
+                                             [init_subject init_op init_param]
+                                             steps)))
                             ))
           )))
 
@@ -93,4 +94,4 @@
               "If you want your binary function to work well with it."
               "Then take the argument to the right (y) as your first argument,"
               "and take the argument to the left (x) as your second argument.")}
-  (wrap (list (..to_prefix expr))))
+  (in (list (..to_prefix expr))))
diff --git a/stdlib/source/library/lux/math/modular.lux b/stdlib/source/library/lux/math/modular.lux
index 679666580..0657f48b5 100644
--- a/stdlib/source/library/lux/math/modular.lux
+++ b/stdlib/source/library/lux/math/modular.lux
@@ -77,7 +77,7 @@
          [[value _ actual] ($_ <>.and intL (.this ..separator) intL)
           _ (<>.assert (exception.construct ..incorrect_modulus [expected actual])
                        (i.= (//.divisor expected) actual))]
-         (wrap (..modular expected value))))))
+         (in (..modular expected value))))))
 
   (template [ ]
     [(def: #export ( reference subject)
@@ -154,4 +154,4 @@
   (if (//.= reference subject)
     (#try.Success (|>> ..value
                        (..modular reference)))
-    (exception.throw ..moduli_are_not_equal [reference subject])))
+    (exception.except ..moduli_are_not_equal [reference subject])))
diff --git a/stdlib/source/library/lux/math/modulus.lux b/stdlib/source/library/lux/math/modulus.lux
index b607b6e6a..8f490d236 100644
--- a/stdlib/source/library/lux/math/modulus.lux
+++ b/stdlib/source/library/lux/math/modulus.lux
@@ -29,7 +29,7 @@
   (def: #export (modulus value)
     (Ex [m] (-> Int (Try (Modulus m))))
     (if (i.= +0 value)
-      (exception.throw ..zero_cannot_be_a_modulus [])
+      (exception.except ..zero_cannot_be_a_modulus [])
       (#try.Success (:abstraction value))))
 
   (def: #export divisor
@@ -53,4 +53,4 @@
   (meta.lift
    (do try.monad
      [_ (..modulus divisor)]
-     (wrap (list (` ((~! try.assumed) (..modulus (~ (code.int divisor))))))))))
+     (in (list (` ((~! try.assumed) (..modulus (~ (code.int divisor))))))))))
diff --git a/stdlib/source/library/lux/math/number/complex.lux b/stdlib/source/library/lux/math/number/complex.lux
index cc2c6a4f1..c374519b9 100644
--- a/stdlib/source/library/lux/math/number/complex.lux
+++ b/stdlib/source/library/lux/math/number/complex.lux
@@ -1,4 +1,5 @@
-(.module: {#.doc "Complex arithmetic."}
+(.module:
+  {#.doc "Complex arithmetic."}
   [library
    [lux #*
     ["." math]
@@ -31,9 +32,9 @@
               (complex real imaginary)
               "The imaginary part can be omitted if it's 0."
               (complex real))}
-  (wrap (list (` {#..real (~ real)
-                  #..imaginary (~ (maybe.default (' +0.0)
-                                                 ?imaginary))}))))
+  (in (list (` {#..real (~ real)
+                #..imaginary (~ (maybe.default (' +0.0)
+                                               ?imaginary))}))))
 
 (def: #export i
   (..complex +0.0 +1.0))
diff --git a/stdlib/source/library/lux/math/number/frac.lux b/stdlib/source/library/lux/math/number/frac.lux
index 1b0e1e52a..7b6f4df5d 100644
--- a/stdlib/source/library/lux/math/number/frac.lux
+++ b/stdlib/source/library/lux/math/number/frac.lux
@@ -363,8 +363,8 @@
           exponent (|> representation
                        ("lux text clip" after_offset after_length)
                        (\ codec decode))]
-         (wrap [("lux text clip" 0 split_index representation)
-                (//int.*  (.int exponent))]))])
+         (in [("lux text clip" 0 split_index representation)
+              (//int.*  (.int exponent))]))])
     ([+1 (^or [(#.Some split_index) #.None #.None #.None]
               [#.None (#.Some split_index) #.None #.None])]
      [-1 (^or [#.None #.None (#.Some split_index) #.None]
@@ -405,8 +405,8 @@
                                    decimal (|> mantissa
                                                ("lux text clip" after_offset after_length)
                                                (\  decode))]
-                                  (wrap [("lux text clip" 0 split_index mantissa)
-                                         decimal]))
+                                  (in [("lux text clip" 0 split_index mantissa)
+                                       decimal]))
 
                                 #.None
                                 (#try.Failure ("lux text concat"  representation)))
@@ -415,11 +415,11 @@
                                          0 whole
                                          _ ("lux text concat" whole (\  encode decimal))))
               #let [sign (if negative? 1 0)]]
-             (wrap (..of_bits
-                    ($_ //i64.or
-                        (//i64.left_shift ..sign_offset (.i64 sign))
-                        (//i64.left_shift ..mantissa_size (.i64 (//int.+ (.int ..double_bias) exponent)))
-                        (//i64.clear ..mantissa_size (.i64 mantissa))))))
+             (in (..of_bits
+                  ($_ //i64.or
+                      (//i64.left_shift ..sign_offset (.i64 sign))
+                      (//i64.left_shift ..mantissa_size (.i64 (//int.+ (.int ..double_bias) exponent)))
+                      (//i64.clear ..mantissa_size (.i64 mantissa))))))
            (#try.Failure ("lux text concat"  representation))))))]
 
   [binary //nat.binary //int.binary "Invalid binary syntax: "]
diff --git a/stdlib/source/library/lux/math/number/ratio.lux b/stdlib/source/library/lux/math/number/ratio.lux
index ca122b00d..3ad54b2bd 100644
--- a/stdlib/source/library/lux/math/number/ratio.lux
+++ b/stdlib/source/library/lux/math/number/ratio.lux
@@ -44,9 +44,9 @@
               (ratio numerator denominator)
               "The denominator can be omitted if it is 1."
               (ratio numerator))}
-  (wrap (list (` ((~! ..normal) {#..numerator (~ numerator)
-                                 #..denominator (~ (maybe.default (' 1)
-                                                                  ?denominator))})))))
+  (in (list (` ((~! ..normal) {#..numerator (~ numerator)
+                               #..denominator (~ (maybe.default (' 1)
+                                                                ?denominator))})))))
 
 (def: #export (= parameter subject)
   (-> Ratio Ratio Bit)
@@ -144,8 +144,8 @@
       (do try.monad
         [numerator (n\decode num)
          denominator (n\decode denom)]
-        (wrap (normal {#numerator numerator
-                       #denominator denominator})))
+        (in (normal {#numerator numerator
+                     #denominator denominator})))
       
       #.None
       (#.Left (text\compose "Invalid syntax for ratio: " input)))))
diff --git a/stdlib/source/library/lux/math/random.lux b/stdlib/source/library/lux/math/random.lux
index 3c3cf9448..9df9cbc53 100644
--- a/stdlib/source/library/lux/math/random.lux
+++ b/stdlib/source/library/lux/math/random.lux
@@ -1,4 +1,5 @@
-(.module: {#.doc "Pseudo-random number generation (PRNG) algorithms."}
+(.module:
+  {#.doc "Pseudo-random number generation (PRNG) algorithms."}
   [library
    [lux (#- or and list i64 nat int rev char)
     [abstract
@@ -69,7 +70,7 @@
   
   (def: &functor ..functor)
 
-  (def: (wrap a)
+  (def: (in a)
     (function (_ state)
       [state a]))
 
@@ -84,7 +85,7 @@
   (do ..monad
     [sample gen]
     (if (pred sample)
-      (wrap sample)
+      (in sample)
       (only pred gen))))
 
 (def: #export (one check random)
@@ -94,7 +95,7 @@
     [sample random]
     (case (check sample)
       (#.Some output)
-      (wrap output)
+      (in output)
 
       #.None
       (one check random))))
@@ -106,7 +107,7 @@
     [sample gen]
     (case (refiner sample)
       (#.Some refined)
-      (wrap refined)
+      (in refined)
 
       #.None
       (refine refiner gen))))
@@ -163,11 +164,11 @@
 (def: #export (text char_gen size)
   (-> (Random Char) Nat (Random Text))
   (if (n.= 0 size)
-    (\ ..monad wrap "")
+    (\ ..monad in "")
     (do ..monad
       [x char_gen
        xs (text char_gen (dec size))]
-      (wrap (text\compose (text.of_code x) xs)))))
+      (in (text\compose (text.of_code x) xs)))))
 
 (template [ ]
   [(def: #export 
@@ -189,7 +190,7 @@
      (do ..monad
        [left 
         right ]
-       (wrap ( left right))))]
+       (in ( left right))))]
 
   [ratio   r.Ratio   r.ratio   ..nat]
   [complex c.Complex c.complex ..safe_frac]
@@ -201,7 +202,7 @@
   (do ..monad
     [=left left
      =right right]
-    (wrap [=left =right])))
+    (in [=left =right])))
 
 (def: #export (or left right)
   {#.doc "Heterogeneous alternative combinator."}
@@ -211,10 +212,10 @@
     (if ?
       (do !
         [=left left]
-        (wrap (0 #0 =left)))
+        (in (0 #0 =left)))
       (do !
         [=right right]
-        (wrap (0 #1 =right))))))
+        (in (0 #1 =right))))))
 
 (def: #export (either left right)
   {#.doc "Homogeneous alternative combinator."}
@@ -239,8 +240,8 @@
     (if some?
       (do !
         [value value_gen]
-        (wrap (#.Some value)))
-      (wrap #.None))))
+        (in (#.Some value)))
+      (in #.None))))
 
 (template [   ]
   [(def: #export ( size value_gen)
@@ -249,8 +250,8 @@
        (do ..monad
          [x value_gen
           xs ( (dec size) value_gen)]
-         (wrap ( x xs)))
-       (\ ..monad wrap )))]
+         (in ( x xs)))
+       (\ ..monad in )))]
 
   [list List (.list)   #.Cons]
   [row  Row  row.empty row.add]
@@ -261,7 +262,7 @@
      (All [a] (-> Nat (Random a) (Random ( a))))
      (do ..monad
        [values (list size value_gen)]
-       (wrap (|> values ))))]
+       (in (|> values ))))]
 
   [array Array array.of_list]
   [queue Queue queue.of_list]
@@ -278,9 +279,9 @@
           [x value_gen
            #let [xs+ (set.add x xs)]]
           (if (n.= size (set.size xs+))
-            (wrap xs+)
+            (in xs+)
             (recur [])))))
-    (\ ..monad wrap (set.new Hash))))
+    (\ ..monad in (set.new Hash))))
 
 (def: #export (dictionary Hash size key_gen value_gen)
   (All [k v] (-> (Hash k) Nat (Random k) (Random v) (Random (Dictionary k v))))
@@ -293,9 +294,9 @@
            v value_gen
            #let [kv+ (dictionary.put k v kv)]]
           (if (n.= size (dictionary.size kv+))
-            (wrap kv+)
+            (in kv+)
             (recur [])))))
-    (\ ..monad wrap (dictionary.new Hash))))
+    (\ ..monad in (dictionary.new Hash))))
 
 (def: #export instant
   (Random Instant)
@@ -316,29 +317,29 @@
 (def: #export month
   (Random Month)
   (let [(^open "\.") ..monad]
-    (..either (..either (..either (\wrap #month.January)
-                                  (..either (\wrap #month.February)
-                                            (\wrap #month.March)))
-                        (..either (\wrap #month.April)
-                                  (..either (\wrap #month.May)
-                                            (\wrap #month.June))))
-              (..either (..either (\wrap #month.July)
-                                  (..either (\wrap #month.August)
-                                            (\wrap #month.September)))
-                        (..either (\wrap #month.October)
-                                  (..either (\wrap #month.November)
-                                            (\wrap #month.December)))))))
+    (..either (..either (..either (\in #month.January)
+                                  (..either (\in #month.February)
+                                            (\in #month.March)))
+                        (..either (\in #month.April)
+                                  (..either (\in #month.May)
+                                            (\in #month.June))))
+              (..either (..either (\in #month.July)
+                                  (..either (\in #month.August)
+                                            (\in #month.September)))
+                        (..either (\in #month.October)
+                                  (..either (\in #month.November)
+                                            (\in #month.December)))))))
 
 (def: #export day
   (Random Day)
   (let [(^open "\.") ..monad]
-    (..either (..either (\wrap #day.Sunday)
-                        (..either (\wrap #day.Monday)
-                                  (\wrap #day.Tuesday)))
-              (..either (..either (\wrap #day.Wednesday)
-                                  (\wrap #day.Thursday))
-                        (..either (\wrap #day.Friday)
-                                  (\wrap #day.Saturday))))))
+    (..either (..either (\in #day.Sunday)
+                        (..either (\in #day.Monday)
+                                  (\in #day.Tuesday)))
+              (..either (..either (\in #day.Wednesday)
+                                  (\in #day.Thursday))
+                        (..either (\in #day.Friday)
+                                  (\in #day.Saturday))))))
 
 (def: #export (run prng calc)
   (All [a] (-> PRNG (Random a) [PRNG a]))
diff --git a/stdlib/source/library/lux/meta.lux b/stdlib/source/library/lux/meta.lux
index 97cfe8c9e..ec154caaf 100644
--- a/stdlib/source/library/lux/meta.lux
+++ b/stdlib/source/library/lux/meta.lux
@@ -1,6 +1,7 @@
-(.module: {#.doc "Functions for extracting information from the state of the compiler."}
+(.module:
+  {#.doc "Functions for extracting information from the state of the compiler."}
   [library
-   [lux #*
+   [lux (#- type)
     [abstract
      [functor (#+ Functor)]
      [apply (#+ Apply)]
@@ -64,7 +65,7 @@
   
   (def: &functor ..functor)
 
-  (def: (wrap x)
+  (def: (in x)
     (function (_ compiler)
       (#try.Success [compiler x])))
   
@@ -116,7 +117,7 @@
   (function (_ state)
     (#try.Failure (location.with (get@ #.location state) error))))
 
-(def: #export (find_module name)
+(def: #export (module name)
   (-> Text (Meta Module))
   (function (_ compiler)
     (case (plist.get name (get@ #.modules compiler))
@@ -140,7 +141,7 @@
   (Meta Module)
   (let [(^open "\.") ..monad]
     (|> ..current_module_name
-        (\map ..find_module)
+        (\map ..module)
         \join)))
 
 (def: (macro_type? type)
@@ -160,12 +161,12 @@
     ["" name]
     (do ..monad
       [module_name ..current_module_name]
-      (wrap [module_name name]))
+      (in [module_name name]))
 
     _
-    (\ ..monad wrap name)))
+    (\ ..monad in name)))
 
-(def: (find_macro' modules this_module module name)
+(def: (macro' modules this_module module name)
   (-> (List [Text Module]) Text Text Text
       (Maybe Macro))
   (do maybe.monad
@@ -176,14 +177,14 @@
                        (plist.get name)))]
     (case definition
       (#.Alias [r_module r_name])
-      (find_macro' modules this_module r_module r_name)
+      (macro' modules this_module r_module r_name)
       
       (#.Definition [exported? def_type def_anns def_value])
       (if (macro_type? def_type)
         (#.Some (:as Macro def_value))
         #.None))))
 
-(def: #export (find_macro full_name)
+(def: #export (macro full_name)
   (-> Name (Meta (Maybe Macro)))
   (do ..monad
     [[module name] (..normal full_name)]
@@ -194,7 +195,7 @@
                        #.None
 
                        (#try.Success [_ this_module])
-                       (find_macro' (get@ #.modules compiler) this_module module name))]
+                       (macro' (get@ #.modules compiler) this_module module name))]
            (#try.Success [compiler macro]))))))
 
 (def: #export count
@@ -220,7 +221,7 @@
     #.None     (f x2)
     (#.Some y) (#.Some y)))
 
-(def: (find_type_var idx bindings)
+(def: (type_variable idx bindings)
   (-> Nat (List [Nat (Maybe Type)]) (Maybe Type))
   (case bindings
     #.Nil
@@ -229,7 +230,7 @@
     (#.Cons [var bound] bindings')
     (if (n.= idx var)
       bound
-      (find_type_var idx bindings'))))
+      (type_variable idx bindings'))))
 
 (def: (clean_type type)
   (-> Type (Meta Type))
@@ -238,7 +239,7 @@
     (function (_ compiler)
       (case (|> compiler
                 (get@ [#.type_context #.var_bindings])
-                (find_type_var var))
+                (type_variable var))
         (^or #.None (#.Some (#.Var _)))
         (#try.Success [compiler type])
 
@@ -246,9 +247,9 @@
         (#try.Success [compiler type'])))
 
     _
-    (\ ..monad wrap type)))
+    (\ ..monad in type)))
 
-(def: #export (find_var_type name)
+(def: #export (var_type name)
   {#.doc "Looks-up the type of a local variable somewhere in the environment."}
   (-> Text (Meta Type))
   (function (_ compiler)
@@ -266,14 +267,14 @@
                                          (get@ [#.locals #.mappings] scope))
                                       (: (List [Text [Type Any]])
                                          (get@ [#.captured #.mappings] scope)))]
-              (wrap type))
+              (in type))
         (#.Some var_type)
         ((clean_type var_type) compiler)
 
         #.None
         (#try.Failure ($_ text\compose "Unknown variable: " name))))))
 
-(def: #export (find_def name)
+(def: #export (definition name)
   {#.doc "Looks-up a definition's whole data in the available modules (including the current one)."}
   (-> Name (Meta Global))
   (do ..monad
@@ -330,11 +331,11 @@
                               "")
                             " All known modules: " (|> compiler (get@ #.modules) (list\map product.left) (text.join_with separator)) text.new_line)))))))
 
-(def: #export (find_export name)
+(def: #export (export name)
   {#.doc "Looks-up a definition's type in the available modules (including the current one)."}
   (-> Name (Meta Definition))
   (do ..monad
-    [definition (..find_def name)]
+    [definition (..definition name)]
     (case definition
       (#.Left de_aliased)
       (failure ($_ text\compose
@@ -344,42 +345,42 @@
       (#.Right definition)
       (let [[exported? def_type def_data def_value] definition]
         (if exported?
-          (wrap definition)
+          (in definition)
           (failure ($_ text\compose "Definition is not an export: " (name\encode name))))))))
 
-(def: #export (find_def_type name)
+(def: #export (definition_type name)
   {#.doc "Looks-up a definition's type in the available modules (including the current one)."}
   (-> Name (Meta Type))
   (do ..monad
-    [definition (find_def name)]
+    [definition (definition name)]
     (case definition
       (#.Left de_aliased)
-      (find_def_type de_aliased)
+      (definition_type de_aliased)
       
       (#.Right [exported? def_type def_data def_value])
       (clean_type def_type))))
 
-(def: #export (find_type name)
+(def: #export (type name)
   {#.doc "Looks-up the type of either a local variable or a definition."}
   (-> Name (Meta Type))
   (do ..monad
     [#let [[_ _name] name]]
     (case name
       ["" _name]
-      (either (find_var_type _name)
-              (find_def_type name))
+      (either (var_type _name)
+              (definition_type name))
 
       _
-      (find_def_type name))))
+      (definition_type name))))
 
-(def: #export (find_type_def name)
+(def: #export (type_definition name)
   {#.doc "Finds the value of a type definition (such as Int, Any or Lux)."}
   (-> Name (Meta Type))
   (do ..monad
-    [definition (find_def name)]
+    [definition (definition name)]
     (case definition
       (#.Left de_aliased)
-      (find_type_def de_aliased)
+      (type_definition de_aliased)
       
       (#.Right [exported? def_type def_data def_value])
       (let [type_to_code (`` ("lux in-module" (~~ (static .prelude_module)) .type_to_code))]
@@ -387,7 +388,7 @@
                 (\ code.equivalence =
                    (type_to_code .Type)
                    (type_to_code def_type)))
-          (wrap (:as Type def_value))
+          (in (:as Type def_value))
           (..failure ($_ text\compose "Definition is not a type: " (name\encode name))))))))
 
 (def: #export (globals module)
@@ -419,11 +420,11 @@
   (-> Text (Meta (List [Text Definition])))
   (do ..monad
     [constants (..definitions module_name)]
-    (wrap (do list.monad
-            [[name [exported? def_type def_data def_value]] constants]
-            (if exported?
-              (wrap [name [exported? def_type def_data def_value]])
-              (list))))))
+    (in (do list.monad
+          [[name [exported? def_type def_data def_value]] constants]
+          (if exported?
+            (in [name [exported? def_type def_data def_value]])
+            (list))))))
 
 (def: #export modules
   {#.doc "All the available modules (including the current one)."}
@@ -439,13 +440,13 @@
   (-> Name (Meta (Maybe (List Name))))
   (do ..monad
     [#let [[module name] type_name]
-     module (find_module module)]
+     module (..module module)]
     (case (plist.get name (get@ #.types module))
       (#.Some [tags _])
-      (wrap (#.Some tags))
+      (in (#.Some tags))
 
       _
-      (wrap #.None))))
+      (in #.None))))
 
 (def: #export location
   {#.doc "The location of the current expression being analyzed."}
@@ -468,14 +469,14 @@
   {#.doc "All the modules imported by a specified module."}
   (-> Text (Meta (List Text)))
   (do ..monad
-    [(^slots [#.imports]) (..find_module module_name)]
-    (wrap imports)))
+    [(^slots [#.imports]) (..module module_name)]
+    (in imports)))
 
 (def: #export (imported_by? import module)
   (-> Text Text (Meta Bit))
   (do ..monad
-    [(^slots [#.imports]) (..find_module module)]
-    (wrap (list.any? (text\= import) imports))))
+    [(^slots [#.imports]) (..module module)]
+    (in (list.any? (text\= import) imports))))
 
 (def: #export (imported? import)
   (-> Text (Meta Bit))
@@ -488,14 +489,14 @@
   (-> Name (Meta [Nat (List Name) Type]))
   (do ..monad
     [#let [[module name] tag]
-     =module (..find_module module)
+     =module (..module module)
      this_module_name ..current_module_name
      imported! (..imported? module)]
     (case (plist.get name (get@ #.tags =module))
       (#.Some [idx tag_list exported? type])
       (if (or (text\= this_module_name module)
               (and imported! exported?))
-        (wrap [idx tag_list type])
+        (in [idx tag_list type])
         (..failure ($_ text\compose "Cannot access tag: " (name\encode tag) " from module " this_module_name)))
 
       _
@@ -511,14 +512,14 @@
   {#.doc "All the tag-lists defined in a module, with their associated types."}
   (-> Text (Meta (List [(List Name) Type])))
   (do ..monad
-    [=module (..find_module module)
+    [=module (..module module)
      this_module_name ..current_module_name]
-    (wrap (|> (get@ #.types =module)
-              (list.only (function (_ [type_name [tag_list exported? type]])
-                           (or exported?
-                               (text\= this_module_name module))))
-              (list\map (function (_ [type_name [tag_list exported? type]])
-                          [tag_list type]))))))
+    (in (|> (get@ #.types =module)
+            (list.only (function (_ [type_name [tag_list exported? type]])
+                         (or exported?
+                             (text\= this_module_name module))))
+            (list\map (function (_ [type_name [tag_list exported? type]])
+                        [tag_list type]))))))
 
 (def: #export locals
   {#.doc "All the local variables currently in scope, separated in different scopes."}
@@ -539,13 +540,13 @@
   {#.doc "Given an aliased definition's name, returns the original definition being referenced."}
   (-> Name (Meta Name))
   (do ..monad
-    [constant (..find_def def_name)]
-    (wrap (case constant
-            (#.Left real_def_name)
-            real_def_name
+    [constant (..definition def_name)]
+    (in (case constant
+          (#.Left real_def_name)
+          real_def_name
 
-            (#.Right _)
-            def_name))))
+          (#.Right _)
+          def_name))))
 
 (def: #export get_compiler
   {#.doc "Obtains the current state of the compiler."}
@@ -562,7 +563,7 @@
   (All [a] (-> (Try a) (Meta a)))
   (case result
     (#try.Success output)
-    (\ ..monad wrap output)
+    (\ ..monad in output)
 
     (#try.Failure error)
     (..failure error)))
diff --git a/stdlib/source/library/lux/program.lux b/stdlib/source/library/lux/program.lux
index 51c22c701..f17d42ec1 100644
--- a/stdlib/source/library/lux/program.lux
+++ b/stdlib/source/library/lux/program.lux
@@ -28,7 +28,7 @@
   (<>.or .local_identifier
          (.tuple (<>.some (<>.either (do <>.monad
                                              [name .local_identifier]
-                                             (wrap [(code.identifier ["" name]) (` (~! .any))]))
+                                             (in [(code.identifier ["" name]) (` (~! .any))]))
                                            (.record (<>.and .any .any)))))))
 
 (syntax: #export (program:
@@ -41,7 +41,7 @@
                 (do io.monad
                   [foo init_program
                    bar (do_something all_args)]
-                  (wrap [])))
+                  (in [])))
 
               (program: [name]
                 (io (log! (\ text.monoid compose "Hello, " name))))
@@ -59,26 +59,26 @@
                          @.js (list)
                          @.python (list)}
                         (list g!_ (` (~! thread.run!)))))]
-              ((~' wrap) (~ g!output))))]
-      (wrap (list (` ("lux def program"
-                      (~ (case args
-                           (#Raw args)
-                           (` (.function ((~ g!program) (~ (code.identifier ["" args])))
-                                (~ initialization+event_loop)))
-                           
-                           (#Parsed args)
-                           (` (.function ((~ g!program) (~ g!args))
-                                (case ((~! .run) (: (~! (.Parser (io.IO .Any)))
-                                                         ((~! do) (~! <>.monad)
-                                                          [(~+ (|> args
-                                                                   (list\map (function (_ [binding parser])
-                                                                               (list binding parser)))
-                                                                   list\join))
-                                                           (~ g!_) (~! .end)]
-                                                          ((~' wrap) (~ initialization+event_loop))))
-                                       (~ g!args))
-                                  (#.Right (~ g!output))
-                                  (~ g!output)
+              ((~' in) (~ g!output))))]
+      (in (list (` ("lux def program"
+                    (~ (case args
+                         (#Raw args)
+                         (` (.function ((~ g!program) (~ (code.identifier ["" args])))
+                              (~ initialization+event_loop)))
+                         
+                         (#Parsed args)
+                         (` (.function ((~ g!program) (~ g!args))
+                              (case ((~! .run) (: (~! (.Parser (io.IO .Any)))
+                                                       ((~! do) (~! <>.monad)
+                                                        [(~+ (|> args
+                                                                 (list\map (function (_ [binding parser])
+                                                                             (list binding parser)))
+                                                                 list\join))
+                                                         (~ g!_) (~! .end)]
+                                                        ((~' in) (~ initialization+event_loop))))
+                                     (~ g!args))
+                                (#.Right (~ g!output))
+                                (~ g!output)
 
-                                  (#.Left (~ g!message))
-                                  (.error! (~ g!message))))))))))))))
+                                (#.Left (~ g!message))
+                                (.error! (~ g!message))))))))))))))
diff --git a/stdlib/source/library/lux/target/common_lisp.lux b/stdlib/source/library/lux/target/common_lisp.lux
index a83162d28..9fb5dfaa3 100644
--- a/stdlib/source/library/lux/target/common_lisp.lux
+++ b/stdlib/source/library/lux/target/common_lisp.lux
@@ -192,7 +192,7 @@
                                     definitions))
                   body)))
 
-  (def: #export (destructuring-bind [bindings expression] body)
+  (def: #export (destructuring_bind [bindings expression] body)
     (-> [Var/* (Expression Any)] (List (Expression Any)) (Computation Any))
     (..form (list& (..var "destructuring-bind")
                    (:transmutation bindings) expression
@@ -211,32 +211,32 @@
            (~~ (template.spliced +))))]
 
     [call/0 [] []
-     [[get-universal-time/0 "get-universal-time"]
-      [make-hash-table/0 "make-hash-table"]]]
+     [[get_universal_time/0 "get-universal-time"]
+      [make_hash_table/0 "make-hash-table"]]]
     [call/1 [in0] [(Expression Any)]
      [[length/1 "length"]
       [function/1 "function"]
-      [copy-seq/1 "copy-seq"]
+      [copy_seq/1 "copy-seq"]
       [null/1 "null"]
       [error/1 "error"]
       [not/1 "not"]
       [floor/1 "floor"]
-      [type-of/1 "type-of"]
-      [write-to-string/1 "write-to-string"]
-      [read-from-string/1 "read-from-string"]
+      [type_of/1 "type-of"]
+      [write_to_string/1 "write-to-string"]
+      [read_from_string/1 "read-from-string"]
       [print/1 "print"]
       [reverse/1 "reverse"]
       [sxhash/1 "sxhash"]
-      [string-upcase/1 "string-upcase"]
-      [string-downcase/1 "string-downcase"]
-      [char-int/1 "char-int"]
+      [string_upcase/1 "string-upcase"]
+      [string_downcase/1 "string-downcase"]
+      [char_int/1 "char-int"]
       [text/1 "text"]
-      [hash-table-size/1 "hash-table-size"]
-      [hash-table-rehash-size/1 "hash-table-rehash-size"]
-      [code-char/1 "code-char"]
-      [char-code/1 "char-code"]
+      [hash_table_size/1 "hash-table-size"]
+      [hash_table_rehash_size/1 "hash-table-rehash-size"]
+      [code_char/1 "code-char"]
+      [char_code/1 "char-code"]
       [string/1 "string"]
-      [write-line/1 "write-line"]
+      [write_line/1 "write-line"]
       [pprint/1 "pprint"]
       [identity/1 "identity"]]]
     [call/2 [in0 in1] [(Expression Any) (Expression Any)]
@@ -279,7 +279,7 @@
       [gethash/2 "gethash"]]]
     )
 
-  (def: #export (make-hash-table/with_size size)
+  (def: #export (make_hash_table/with_size size)
     (-> (Expression Any) (Computation Any))
     (..call/* (..var "make-hash-table")
               (list (..keyword "size")
@@ -387,7 +387,7 @@
      #condition Var/1
      #body (Expression Any)})
   
-  (def: #export (handler-case handlers body)
+  (def: #export (handler_case handlers body)
     (-> (List Handler) (Expression Any) (Computation Any))
     (..form (list& (..var "handler-case")
                    body
@@ -426,7 +426,7 @@
     (-> Label (List (Expression Any)) (Computation Any))
     (..form (list& (..var "block") (:transmutation name) body)))
 
-  (def: #export (return-from target value)
+  (def: #export (return_from target value)
     (-> Label (Expression Any) (Computation Any))
     (..form (list (..var "return-from") (:transmutation target) value)))
 
@@ -451,12 +451,12 @@
     (|>> (list (..var "go"))
          ..form))
 
-  (def: #export values-list/1
+  (def: #export values_list/1
     (-> (Expression Any) (Expression Any))
     (|>> (list (..var "values-list"))
          ..form))
 
-  (def: #export (multiple-value-setq bindings values)
+  (def: #export (multiple_value_setq bindings values)
     (-> Var/* (Expression Any) (Expression Any))
     (..form (list (..var "multiple-value-setq")
                   (:transmutation bindings)
diff --git a/stdlib/source/library/lux/target/jvm/attribute.lux b/stdlib/source/library/lux/target/jvm/attribute.lux
index d7d3cd36c..6d94c1b5b 100644
--- a/stdlib/source/library/lux/target/jvm/attribute.lux
+++ b/stdlib/source/library/lux/target/jvm/attribute.lux
@@ -94,7 +94,7 @@
   (-> (Constant Any) (Resource Attribute))
   (do //constant/pool.monad
     [@name (//constant/pool.utf8 "ConstantValue")]
-    (wrap (constant' @name index))))
+    (in (constant' @name index))))
 
 ## TODO: Inline ASAP
 (def: (code' @name specification)
@@ -111,7 +111,7 @@
   (-> Code (Resource Attribute))
   (do //constant/pool.monad
     [@name (//constant/pool.utf8 "Code")]
-    (wrap (code' @name specification))))
+    (in (code' @name specification))))
 
 (def: #export (writer value)
   (Writer Attribute)
diff --git a/stdlib/source/library/lux/target/jvm/bytecode.lux b/stdlib/source/library/lux/target/jvm/bytecode.lux
index ba09af5bb..8571aeece 100644
--- a/stdlib/source/library/lux/target/jvm/bytecode.lux
+++ b/stdlib/source/library/lux/target/jvm/bytecode.lux
@@ -94,8 +94,8 @@
             (do try.monad
               [[left_exceptions left_instruction] (left resolver)
                [right_exceptions right_instruction] (right resolver)]
-              (wrap [(\ row.monoid compose left_exceptions right_exceptions)
-                     (_\compose left_instruction right_instruction)]))))))
+              (in [(\ row.monoid compose left_exceptions right_exceptions)
+                   (_\compose left_instruction right_instruction)]))))))
 
 (type: #export (Bytecode a)
   (State' Try [Pool Environment Tracker] (Writer Relative a)))
@@ -125,20 +125,20 @@
    ["Expected" (/stack.format expected)]
    ["Actual" (/stack.format actual)]))
 
-(with_expansions [ (as_is (wrap [[pool
-                                           environment
-                                           (update@ #known
-                                                    (dictionary.put label [actual (#.Some @here)])
-                                                    tracker)]
-                                          [..relative_identity
-                                           []]]))]
+(with_expansions [ (as_is (in [[pool
+                                         environment
+                                         (update@ #known
+                                                  (dictionary.put label [actual (#.Some @here)])
+                                                  tracker)]
+                                        [..relative_identity
+                                         []]]))]
   (def: #export (set_label label)
     (-> Label (Bytecode Any))
     (function (_ [pool environment tracker])
       (let [@here (get@ #program_counter tracker)]
         (case (dictionary.get label (get@ #known tracker))
           (#.Some [expected (#.Some address)])
-          (exception.throw ..label_has_already_been_set [label])
+          (exception.except ..label_has_already_been_set [label])
           
           (#.Some [expected #.None])
           (do try.monad
@@ -166,7 +166,7 @@
   (-> Text Bytecode)
   (|>> #try.Failure function.constant))
 
-(def: #export (throw exception value)
+(def: #export (except exception value)
   (All [e] (-> (exception.Exception e) e Bytecode))
   (..failure (exception.construct exception value)))
 
@@ -176,7 +176,7 @@
     (do try.monad
       [[[pool environment tracker] [relative output]] (bytecode [pool environment ..fresh])
        [exceptions instruction] (relative (get@ #known tracker))]
-      (wrap [pool [environment exceptions instruction output]]))))
+      (in [pool [environment exceptions instruction output]]))))
 
 (def: (step estimator counter)
   (-> Estimator Address (Try Address))
@@ -191,11 +191,11 @@
                         (monad.bind ! (/environment.produces production))
                         (monad.bind ! (/environment.has registry)))
        program_counter' (step estimator (get@ #program_counter tracker))]
-      (wrap [[pool
-              environment'
-              (set@ #program_counter program_counter' tracker)]
-             [(function.constant (wrap [..no_exceptions (bytecode input)]))
-              []]]))))
+      (in [[pool
+            environment'
+            (set@ #program_counter program_counter' tracker)]
+           [(function.constant (in [..no_exceptions (bytecode input)]))
+            []]]))))
 
 (template [ ]
   [(def:  U2 (|>  //unsigned.u2 try.assumed))]
@@ -409,11 +409,11 @@
   (function (_ [pool environment tracker])
     (do try.monad
       [_ (/environment.stack environment)]
-      (wrap [[pool
-              (/environment.discontinue environment)
-              tracker]
-             [..relative_identity
-              []]]))))
+      (in [[pool
+            (/environment.discontinue environment)
+            tracker]
+           [..relative_identity
+            []]]))))
 
 (template [  ]
   [(def: #export 
@@ -443,9 +443,9 @@
   (function (_ [pool environment tracker])
     (do try.monad
       [[pool' output] (resource pool)]
-      (wrap [[pool' environment tracker]
-             [..relative_identity
-              output]]))))
+      (in [[pool' environment tracker]
+           [..relative_identity
+            output]]))))
 
 (def: #export (string value)
   (-> //constant.UTF8 (Bytecode Any))
@@ -581,10 +581,10 @@
   (-> Nat (Bytecode Register))
   (case (//unsigned.u1 id)
     (#try.Success register)
-    (\ ..monad wrap register)
+    (\ ..monad in register)
     
     (#try.Failure error)
-    (..throw ..invalid_register [id])))
+    (..except ..invalid_register [id])))
 
 (template [    ]
   [(def: #export ( local)
@@ -714,10 +714,10 @@
     (#try.Success [actual address])
 
     (#.Some [actual #.None])
-    (exception.throw ..unset_label [label])
+    (exception.except ..unset_label [label])
     
     #.None
-    (exception.throw ..unknown_label [label])))
+    (exception.except ..unknown_label [label])))
 
 (def: (acknowledge_label stack label tracker)
   (-> Stack Label Tracker Tracker)
@@ -739,25 +739,25 @@
                                (/environment.consumes ))
               actual (/environment.stack environment')
               program_counter' (step estimator @here)]
-             (wrap (let [@from @here]
-                     [[pool
-                       environment'
-                       (|> tracker
-                           (..acknowledge_label actual label)
-                           (set@ #program_counter program_counter'))]
-                      [(function (_ resolver)
-                         (do try.monad
-                           [[expected @to] (..resolve_label label resolver)
-                            _ (exception.assert ..mismatched_environments [(name_of ) label @here expected actual]
-                                                (\ /stack.equivalence = expected actual))
-                            jump (..jump @from @to)]
-                           (case jump
-                             (#.Left jump)
-                             (exception.throw ..cannot_do_a_big_jump [label @from jump])
-
-                             (#.Right jump)
-                             (wrap [..no_exceptions (bytecode jump)]))))
-                       []]])))))))]
+             (in (let [@from @here]
+                   [[pool
+                     environment'
+                     (|> tracker
+                         (..acknowledge_label actual label)
+                         (set@ #program_counter program_counter'))]
+                    [(function (_ resolver)
+                       (do try.monad
+                         [[expected @to] (..resolve_label label resolver)
+                          _ (exception.assert ..mismatched_environments [(name_of ) label @here expected actual]
+                                              (\ /stack.equivalence = expected actual))
+                          jump (..jump @from @to)]
+                         (case jump
+                           (#.Left jump)
+                           (exception.except ..cannot_do_a_big_jump [label @from jump])
+
+                           (#.Right jump)
+                           (in [..no_exceptions (bytecode jump)]))))
+                     []]])))))))]
 
   [$1 ifeq _.ifeq]
   [$1 ifne _.ifne]
@@ -789,39 +789,39 @@
            [actual (/environment.stack environment)
             #let [@here (get@ #program_counter tracker)]
             program_counter' (step estimator @here)]
-           (wrap (let [@from @here]
-                   [[pool
-                     (/environment.discontinue environment)
-                     (|> tracker
-                         (..acknowledge_label actual label)
-                         (set@ #program_counter program_counter'))]
-                    [(function (_ resolver)
-                       (case (dictionary.get label resolver)
-                         (#.Some [expected (#.Some @to)])
-                         (do try.monad
-                           [_ (exception.assert ..mismatched_environments [(name_of ) label @here expected actual]
-                                                (\ /stack.equivalence = expected actual))
-                            jump (..jump @from @to)]
-                           (case jump
-                             (#.Left jump)
-                             
-
-                             (#.Right jump)
-                             ))
-
-                         (#.Some [expected #.None])
-                         (exception.throw ..unset_label [label])
-
-                         #.None
-                         (exception.throw ..unknown_label [label])))
-                     []]]))))))]
+           (in (let [@from @here]
+                 [[pool
+                   (/environment.discontinue environment)
+                   (|> tracker
+                       (..acknowledge_label actual label)
+                       (set@ #program_counter program_counter'))]
+                  [(function (_ resolver)
+                     (case (dictionary.get label resolver)
+                       (#.Some [expected (#.Some @to)])
+                       (do try.monad
+                         [_ (exception.assert ..mismatched_environments [(name_of ) label @here expected actual]
+                                              (\ /stack.equivalence = expected actual))
+                          jump (..jump @from @to)]
+                         (case jump
+                           (#.Left jump)
+                           
+
+                           (#.Right jump)
+                           ))
+
+                       (#.Some [expected #.None])
+                       (exception.except ..unset_label [label])
+
+                       #.None
+                       (exception.except ..unknown_label [label])))
+                   []]]))))))]
 
   [goto _.goto
-   (exception.throw ..cannot_do_a_big_jump [label @from jump])
-   (wrap [..no_exceptions (bytecode jump)])]
+   (exception.except ..cannot_do_a_big_jump [label @from jump])
+   (in [..no_exceptions (bytecode jump)])]
   [goto_w _.goto_w
-   (wrap [..no_exceptions (bytecode jump)])
-   (wrap [..no_exceptions (bytecode (/jump.lift jump))])]
+   (in [..no_exceptions (bytecode jump)])
+   (in [..no_exceptions (bytecode (/jump.lift jump))])]
   )
 
 (def: (big_jump jump)
@@ -844,33 +844,33 @@
                           (/environment.consumes $1))
          actual (/environment.stack environment')
          program_counter' (step (estimator (list.size afterwards)) (get@ #program_counter tracker))]
-        (wrap (let [@from (get@ #program_counter tracker)]
-                [[pool
-                  environment'
-                  (|> (list\fold (..acknowledge_label actual) tracker (list& default at_minimum afterwards))
-                      (set@ #program_counter program_counter'))]
-                 [(function (_ resolver)
-                    (let [get (: (-> Label (Maybe [Stack (Maybe Address)]))
-                                 (function (_ label)
-                                   (dictionary.get label resolver)))]
-                      (case (do {! maybe.monad}
-                              [@default (|> default get (monad.bind ! product.right))
-                               @at_minimum (|> at_minimum get (monad.bind ! product.right))
-                               @afterwards (|> afterwards
-                                               (monad.map ! get)
-                                               (monad.bind ! (monad.map ! product.right)))]
-                              (wrap [@default @at_minimum @afterwards]))
-                        (#.Some [@default @at_minimum @afterwards])
-                        (do {! try.monad}
-                          [>default (\ ! map ..big_jump (..jump @from @default))
-                           >at_minimum (\ ! map ..big_jump (..jump @from @at_minimum))
-                           >afterwards (monad.map ! (|>> (..jump @from) (\ ! map ..big_jump))
-                                                  @afterwards)]
-                          (wrap [..no_exceptions (bytecode minimum >default [>at_minimum >afterwards])]))
-
-                        #.None
-                        (exception.throw ..invalid_tableswitch []))))
-                  []]]))))))
+        (in (let [@from (get@ #program_counter tracker)]
+              [[pool
+                environment'
+                (|> (list\fold (..acknowledge_label actual) tracker (list& default at_minimum afterwards))
+                    (set@ #program_counter program_counter'))]
+               [(function (_ resolver)
+                  (let [get (: (-> Label (Maybe [Stack (Maybe Address)]))
+                               (function (_ label)
+                                 (dictionary.get label resolver)))]
+                    (case (do {! maybe.monad}
+                            [@default (|> default get (monad.bind ! product.right))
+                             @at_minimum (|> at_minimum get (monad.bind ! product.right))
+                             @afterwards (|> afterwards
+                                             (monad.map ! get)
+                                             (monad.bind ! (monad.map ! product.right)))]
+                            (in [@default @at_minimum @afterwards]))
+                      (#.Some [@default @at_minimum @afterwards])
+                      (do {! try.monad}
+                        [>default (\ ! map ..big_jump (..jump @from @default))
+                         >at_minimum (\ ! map ..big_jump (..jump @from @at_minimum))
+                         >afterwards (monad.map ! (|>> (..jump @from) (\ ! map ..big_jump))
+                                                @afterwards)]
+                        (in [..no_exceptions (bytecode minimum >default [>at_minimum >afterwards])]))
+
+                      #.None
+                      (exception.except ..invalid_tableswitch []))))
+                []]]))))))
 
 (exception: #export invalid_lookupswitch)
 
@@ -887,32 +887,32 @@
                           (/environment.consumes $1))
          actual (/environment.stack environment')
          program_counter' (step (estimator (list.size cases)) (get@ #program_counter tracker))]
-        (wrap (let [@from (get@ #program_counter tracker)]
-                [[pool
-                  environment'
-                  (|> (list\fold (..acknowledge_label actual) tracker (list& default (list\map product.right cases)))
-                      (set@ #program_counter program_counter'))]
-                 [(function (_ resolver)
-                    (let [get (: (-> Label (Maybe [Stack (Maybe Address)]))
-                                 (function (_ label)
-                                   (dictionary.get label resolver)))]
-                      (case (do {! maybe.monad}
-                              [@default (|> default get (monad.bind ! product.right))
-                               @cases (|> cases
-                                          (monad.map ! (|>> product.right get))
-                                          (monad.bind ! (monad.map ! product.right)))]
-                              (wrap [@default @cases]))
-                        (#.Some [@default @cases])
-                        (do {! try.monad}
-                          [>default (\ ! map ..big_jump (..jump @from @default))
-                           >cases (|> @cases
-                                      (monad.map ! (|>> (..jump @from) (\ ! map ..big_jump)))
-                                      (\ ! map (|>> (list.zipped/2 (list\map product.left cases)))))]
-                          (wrap [..no_exceptions (bytecode >default >cases)]))
-
-                        #.None
-                        (exception.throw ..invalid_lookupswitch []))))
-                  []]]))))))
+        (in (let [@from (get@ #program_counter tracker)]
+              [[pool
+                environment'
+                (|> (list\fold (..acknowledge_label actual) tracker (list& default (list\map product.right cases)))
+                    (set@ #program_counter program_counter'))]
+               [(function (_ resolver)
+                  (let [get (: (-> Label (Maybe [Stack (Maybe Address)]))
+                               (function (_ label)
+                                 (dictionary.get label resolver)))]
+                    (case (do {! maybe.monad}
+                            [@default (|> default get (monad.bind ! product.right))
+                             @cases (|> cases
+                                        (monad.map ! (|>> product.right get))
+                                        (monad.bind ! (monad.map ! product.right)))]
+                            (in [@default @cases]))
+                      (#.Some [@default @cases])
+                      (do {! try.monad}
+                        [>default (\ ! map ..big_jump (..jump @from @default))
+                         >cases (|> @cases
+                                    (monad.map ! (|>> (..jump @from) (\ ! map ..big_jump)))
+                                    (\ ! map (|>> (list.zipped/2 (list\map product.left cases)))))]
+                        (in [..no_exceptions (bytecode >default >cases)]))
+
+                      #.None
+                      (exception.except ..invalid_lookupswitch []))))
+                []]]))))))
 
 (def: reflection
   (All [category]
@@ -947,8 +947,8 @@
   (do ..monad
     [_ (: (Bytecode Any)
           (case (|> dimensions //unsigned.value)
-            0 (..throw ..multiarray_cannot_be_zero_dimensional [class])
-            _ (wrap [])))
+            0 (..except ..multiarray_cannot_be_zero_dimensional [class])
+            _ (in [])))
      index (..lift (//constant/pool.class (//name.internal (..reflection class))))]
     (..bytecode (//unsigned.lift/2 dimensions) $1 @_ _.multianewarray [index dimensions])))
 
@@ -1028,14 +1028,14 @@
              [[_ @start] (..resolve_label @start resolver)
               [_ @end] (..resolve_label @end resolver)
               _ (if (/address.after? @start @end)
-                  (wrap [])
-                  (exception.throw ..invalid_range_for_try [@start @end]))
+                  (in [])
+                  (exception.except ..invalid_range_for_try [@start @end]))
               [_ @handler] (..resolve_label @handler resolver)]
-             (wrap [(row.row {#//exception.start @start
-                              #//exception.end @end
-                              #//exception.handler @handler
-                              #//exception.catch @catch})
-                    _.empty])))
+             (in [(row.row {#//exception.start @start
+                            #//exception.end @end
+                            #//exception.handler @handler
+                            #//exception.catch @catch})
+                  _.empty])))
          []]]))))
 
 (def: #export (compose pre post)
diff --git a/stdlib/source/library/lux/target/jvm/bytecode/environment.lux b/stdlib/source/library/lux/target/jvm/bytecode/environment.lux
index fdf50d974..289e3bd99 100644
--- a/stdlib/source/library/lux/target/jvm/bytecode/environment.lux
+++ b/stdlib/source/library/lux/target/jvm/bytecode/environment.lux
@@ -26,8 +26,8 @@
      (-> (Type Method) (Try Environment))
      (do try.monad
        [limit ( type)]
-       (wrap {#limit limit
-              #stack (#.Some /stack.empty)})))]
+       (in {#limit limit
+            #stack (#.Some /stack.empty)})))]
 
   [static /limit.static]
   [virtual /limit.virtual]
@@ -56,7 +56,7 @@
     (#try.Success stack)
 
     #.None
-    (exception.throw ..discontinuity [])))
+    (exception.except ..discontinuity [])))
 
 (def: #export discontinue
   (-> Environment Environment)
@@ -74,7 +74,7 @@
     (#.Some actual)
     (if (\ /stack.equivalence = expected actual)
       (#try.Success [actual environment])
-      (exception.throw ..mismatched_stacks [expected actual]))
+      (exception.except ..mismatched_stacks [expected actual]))
 
     #.None
     (#try.Success [expected (set@ #..stack (#.Some expected) environment)])))
@@ -87,7 +87,7 @@
     (do try.monad
       [previous (..stack environment)
        current (/stack.pop amount previous)]
-      (wrap (set@ #..stack (#.Some current) environment)))))
+      (in (set@ #..stack (#.Some current) environment)))))
 
 (def: #export (produces amount)
   (-> U2 Condition)
@@ -98,9 +98,9 @@
        #let [limit (|> environment
                        (get@ [#..limit #/limit.stack])
                        (/stack.max current))]]
-      (wrap (|> environment
-                (set@ #..stack (#.Some current))
-                (set@ [#..limit #/limit.stack] limit))))))
+      (in (|> environment
+              (set@ #..stack (#.Some current))
+              (set@ [#..limit #/limit.stack] limit))))))
 
 (def: #export (has registry)
   (-> Registry Condition)
diff --git a/stdlib/source/library/lux/target/jvm/bytecode/environment/limit.lux b/stdlib/source/library/lux/target/jvm/bytecode/environment/limit.lux
index c7e9a8959..fad7c9dae 100644
--- a/stdlib/source/library/lux/target/jvm/bytecode/environment/limit.lux
+++ b/stdlib/source/library/lux/target/jvm/bytecode/environment/limit.lux
@@ -29,8 +29,8 @@
      (-> (Type Method) (Try Limit))
      (do try.monad
        [registry ( type)]
-       (wrap {#stack /stack.empty
-              #registry registry})))]
+       (in {#stack /stack.empty
+            #registry registry})))]
 
   [static /registry.static]
   [virtual /registry.virtual]
diff --git a/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux b/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux
index d4f4ba688..a77eb88a4 100644
--- a/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux
+++ b/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux
@@ -623,7 +623,7 @@
                                                         (binary.write/16 (inc offset) 0 binary))
                                                     2 (binary.write/16 offset 0 binary)
                                                     1 (binary.write/8 offset 0 binary)
-                                                    _ (wrap binary))
+                                                    _ (in binary))
                                                 #let [offset (n.+ padding offset)]
                                                 _ (binary.write/32 offset (///signed.value default) binary)
                                                 #let [offset (n.+ (///unsigned.value ..big_jump_size) offset)]
@@ -635,7 +635,7 @@
                                                                     (#.Cons at_minimum afterwards))]
                                                  (case afterwards
                                                    #.Nil
-                                                   (wrap binary)
+                                                   (in binary)
                                                    
                                                    (#.Cons head tail)
                                                    (do !
@@ -685,7 +685,7 @@
                                                          (binary.write/16 (inc offset) 0 binary))
                                                      2 (binary.write/16 offset 0 binary)
                                                      1 (binary.write/8 offset 0 binary)
-                                                     _ (wrap binary))
+                                                     _ (in binary))
                                                  #let [offset (n.+ padding offset)]
                                                  _ (binary.write/32 offset (///signed.value default) binary)
                                                  #let [offset (n.+ (///unsigned.value ..big_jump_size) offset)]
@@ -694,7 +694,7 @@
                                                        cases cases]
                                                   (case cases
                                                     #.Nil
-                                                    (wrap binary)
+                                                    (in binary)
                                                     
                                                     (#.Cons [value jump] tail)
                                                     (do !
diff --git a/stdlib/source/library/lux/target/jvm/class.lux b/stdlib/source/library/lux/target/jvm/class.lux
index 165f9a33f..2e4b8eb15 100644
--- a/stdlib/source/library/lux/target/jvm/class.lux
+++ b/stdlib/source/library/lux/target/jvm/class.lux
@@ -1,18 +1,18 @@
- (.module:
-   [library
-    [lux #*
-     [abstract
-      [equivalence (#+ Equivalence)]
-      ["." monad (#+ do)]]
-     [control
-      ["." state]
-      ["." try (#+ Try)]]
-     [data
-      ["." product]
-      [format
-       [".F" binary (#+ Writer) ("#\." monoid)]]
-      [collection
-       ["." row (#+ Row)]]]]]
+(.module:
+  [library
+   [lux #*
+    [abstract
+     [equivalence (#+ Equivalence)]
+     ["." monad (#+ do)]]
+    [control
+     ["." state]
+     ["." try (#+ Try)]]
+    [data
+     ["." product]
+     [format
+      [".F" binary (#+ Writer) ("#\." monoid)]]
+     [collection
+      ["." row (#+ Row)]]]]]
   ["." // #_
    ["#." modifier (#+ Modifier modifiers:)]
    ["#." version (#+ Version Minor Major)]
@@ -76,10 +76,10 @@
                     (monad.fold ! (function (_ interface @interfaces)
                                     (do !
                                       [@interface (//constant/pool.class interface)]
-                                      (wrap (row.add @interface @interfaces))))
+                                      (in (row.add @interface @interfaces))))
                                 row.empty
                                 interfaces))]
-    (wrap [@this @super @interfaces])))
+    (in [@this @super @interfaces])))
 
 (def: #export (class version modifier
                      this super interfaces
@@ -97,18 +97,18 @@
            [classes (install_classes this super interfaces)
             =fields (monad.seq //constant/pool.monad fields)
             =methods (monad.seq //constant/pool.monad methods)]
-           (wrap [classes =fields =methods])))]
-    (wrap {#magic //magic.code
-           #minor_version //version.default_minor
-           #major_version version
-           #constant_pool pool
-           #modifier modifier
-           #this @this
-           #super @super
-           #interfaces @interfaces
-           #fields (row.of_list =fields)
-           #methods (row.of_list =methods)
-           #attributes attributes})))
+           (in [classes =fields =methods])))]
+    (in {#magic //magic.code
+         #minor_version //version.default_minor
+         #major_version version
+         #constant_pool pool
+         #modifier modifier
+         #this @this
+         #super @super
+         #interfaces @interfaces
+         #fields (row.of_list =fields)
+         #methods (row.of_list =methods)
+         #attributes attributes})))
 
 (def: #export (writer class)
   (Writer Class)
diff --git a/stdlib/source/library/lux/target/jvm/constant/pool.lux b/stdlib/source/library/lux/target/jvm/constant/pool.lux
index b4697768a..18b6a9c61 100644
--- a/stdlib/source/library/lux/target/jvm/constant/pool.lux
+++ b/stdlib/source/library/lux/target/jvm/constant/pool.lux
@@ -76,9 +76,9 @@
                              //index.value
                              (//unsigned.+/2 @new)
                              (\ ! map //index.index)))]
-                (wrap [[next
-                        (row.add [current new] pool)]
-                       current])))))))))
+                (in [[next
+                      (row.add [current new] pool)]
+                     current])))))))))
 
 (template: (!index )
   (|>  //index.value //unsigned.value))
diff --git a/stdlib/source/library/lux/target/jvm/encoding/signed.lux b/stdlib/source/library/lux/target/jvm/encoding/signed.lux
index a914dfc3c..1958ea63c 100644
--- a/stdlib/source/library/lux/target/jvm/encoding/signed.lux
+++ b/stdlib/source/library/lux/target/jvm/encoding/signed.lux
@@ -68,7 +68,7 @@
                       (i64.and positive value))
                     value)
              (#try.Success (:abstraction value))
-             (exception.throw ..value_exceeds_the_scope [value ])))))
+             (exception.except ..value_exceeds_the_scope [value ])))))
 
      (template [ ]
        [(def: #export ( parameter subject)
diff --git a/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux b/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux
index d8299fa65..546d4f516 100644
--- a/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux
+++ b/stdlib/source/library/lux/target/jvm/encoding/unsigned.lux
@@ -74,7 +74,7 @@
        (-> Nat (Try ))
        (if (n.<= (:representation ) value)
          (#try.Success (:abstraction value))
-         (exception.throw ..value_exceeds_the_maximum [(name_of ) value ])))
+         (exception.except ..value_exceeds_the_maximum [(name_of ) value ])))
 
      (def: #export (<+> parameter subject)
        (->   (Try ))
@@ -88,7 +88,7 @@
              subject' (:representation subject)]
          (if (n.<= subject' parameter')
            (#try.Success (:abstraction (n.- parameter' subject')))
-           (exception.throw ..subtraction_cannot_yield_negative_value [(name_of ) parameter subject]))))
+           (exception.except ..subtraction_cannot_yield_negative_value [(name_of ) parameter subject]))))
 
      (def: #export ( left right)
        (->   )
diff --git a/stdlib/source/library/lux/target/jvm/field.lux b/stdlib/source/library/lux/target/jvm/field.lux
index aa71794a5..93cda4c5e 100644
--- a/stdlib/source/library/lux/target/jvm/field.lux
+++ b/stdlib/source/library/lux/target/jvm/field.lux
@@ -64,7 +64,7 @@
   (do //constant/pool.monad
     [@name (//constant/pool.utf8 name)
      @descriptor (//constant/pool.descriptor (//type.descriptor type))]
-    (wrap {#modifier modifier
-           #name @name
-           #descriptor @descriptor
-           #attributes attributes})))
+    (in {#modifier modifier
+         #name @name
+         #descriptor @descriptor
+         #attributes attributes})))
diff --git a/stdlib/source/library/lux/target/jvm/loader.lux b/stdlib/source/library/lux/target/jvm/loader.lux
index 5cc5e9310..67d786da5 100644
--- a/stdlib/source/library/lux/target/jvm/loader.lux
+++ b/stdlib/source/library/lux/target/jvm/loader.lux
@@ -131,10 +131,10 @@
   (do {! io.monad}
     [library' (atom.read library)]
     (if (dictionary.key? library' name)
-      (wrap (exception.throw ..already_stored name))
+      (in (exception.except ..already_stored name))
       (do !
         [_ (atom.update (dictionary.put name bytecode) library)]
-        (wrap (#try.Success []))))))
+        (in (#try.Success []))))))
 
 (def: #export (load name loader)
   (-> Text java/lang/ClassLoader
diff --git a/stdlib/source/library/lux/target/jvm/method.lux b/stdlib/source/library/lux/target/jvm/method.lux
index 3dcc4d7a2..6df81d091 100644
--- a/stdlib/source/library/lux/target/jvm/method.lux
+++ b/stdlib/source/library/lux/target/jvm/method.lux
@@ -63,7 +63,7 @@
                                          (//bytecode/environment.static type)
                                          (//bytecode/environment.virtual type))
                                    (#try.Success environment)
-                                   (wrap environment)
+                                   (in environment)
                                    
                                    (#try.Failure error)
                                    (function (_ _) (#try.Failure error)))
@@ -73,14 +73,14 @@
                                               #//attribute/code.code bytecode
                                               #//attribute/code.exception_table exceptions
                                               #//attribute/code.attributes (row.row)})]
-                    (wrap (row.add @code attributes)))
+                    (in (row.add @code attributes)))
                   
                   #.None
-                  (wrap attributes))]
-    (wrap {#modifier modifier
-           #name @name
-           #descriptor @descriptor
-           #attributes attributes})))
+                  (in attributes))]
+    (in {#modifier modifier
+         #name @name
+         #descriptor @descriptor
+         #attributes attributes})))
 
 (def: #export equivalence
   (Equivalence Method)
diff --git a/stdlib/source/library/lux/target/jvm/modifier.lux b/stdlib/source/library/lux/target/jvm/modifier.lux
index 80db613de..d6fae89ed 100644
--- a/stdlib/source/library/lux/target/jvm/modifier.lux
+++ b/stdlib/source/library/lux/target/jvm/modifier.lux
@@ -80,9 +80,9 @@
 
 (syntax: #export (modifiers: ofT {options (<>.many .any)})
   (with_gensyms [g!modifier g!code]
-    (wrap (list (` (template [(~ g!code) (~ g!modifier)]
-                     [(def: (~' #export) (~ g!modifier)
-                        (..Modifier (~ ofT))
-                        ((~! ..modifier) ((~! number.hex) (~ g!code))))]
-                     
-                     (~+ options)))))))
+    (in (list (` (template [(~ g!code) (~ g!modifier)]
+                   [(def: (~' #export) (~ g!modifier)
+                      (..Modifier (~ ofT))
+                      ((~! ..modifier) ((~! number.hex) (~ g!code))))]
+                   
+                   (~+ options)))))))
diff --git a/stdlib/source/library/lux/target/jvm/reflection.lux b/stdlib/source/library/lux/target/jvm/reflection.lux
index 5745ecd89..086a394bb 100644
--- a/stdlib/source/library/lux/target/jvm/reflection.lux
+++ b/stdlib/source/library/lux/target/jvm/reflection.lux
@@ -132,14 +132,14 @@
     (#try.Success class)
 
     (#try.Failure _)
-    (exception.throw ..unknown_class name)))
+    (exception.except ..unknown_class name)))
 
 (def: #export (sub? class_loader super sub)
   (-> java/lang/ClassLoader External External (Try Bit))
   (do try.monad
     [super (..load class_loader super)
      sub (..load class_loader sub)]
-    (wrap (java/lang/Class::isAssignableFrom sub super))))
+    (in (java/lang/Class::isAssignableFrom sub super))))
 
 (def: (class' parameter reflection)
   (-> (-> java/lang/reflect/Type (Try (/.Type Parameter)))
@@ -163,7 +163,7 @@
                             [/reflection.double]
                             [/reflection.char]))
                       (text.starts_with? /descriptor.array_prefix class_name))
-                (exception.throw ..not_a_class reflection)
+                (exception.except ..not_a_class reflection)
                 (#try.Success (/.class class_name (list))))))
         _)
       (case (ffi.check java/lang/reflect/ParameterizedType reflection)
@@ -176,16 +176,16 @@
                            java/lang/reflect/ParameterizedType::getActualTypeArguments
                            array.to_list
                            (monad.map ! parameter))]
-              (wrap (/.class (|> raw
-                                 (:as (java/lang/Class java/lang/Object))
-                                 java/lang/Class::getName)
-                             paramsT)))
+              (in (/.class (|> raw
+                               (:as (java/lang/Class java/lang/Object))
+                               java/lang/Class::getName)
+                           paramsT)))
 
             _
-            (exception.throw ..not_a_class raw)))
+            (exception.except ..not_a_class raw)))
         _)
       ## else
-      (exception.throw ..cannot_convert_to_a_lux_type reflection)))
+      (exception.except ..cannot_convert_to_a_lux_type reflection)))
 
 (def: #export (parameter reflection)
   (-> java/lang/reflect/Type (Try (/.Type Parameter)))
@@ -309,22 +309,22 @@
                            (dictionary.put name paramT mapping))
                          /lux.fresh)
               #try.Success)
-          (exception.throw ..type_parameter_mismatch [num_class_params num_type_params class type]))
-        (exception.throw ..cannot_correspond [class type])))
+          (exception.except ..type_parameter_mismatch [num_class_params num_type_params class type]))
+        (exception.except ..cannot_correspond [class type])))
 
     (#.Named name anonymousT)
     (correspond class anonymousT)
 
     (#.Apply inputT abstractionT)
-    (case (type.apply (list inputT) abstractionT)
+    (case (type.applied (list inputT) abstractionT)
       (#.Some outputT)
       (correspond class outputT)
 
       #.None
-      (exception.throw ..non_jvm_type [type]))
+      (exception.except ..non_jvm_type [type]))
 
     _
-    (exception.throw ..non_jvm_type [type])))
+    (exception.except ..non_jvm_type [type])))
 
 (exception: #export (mistaken_field_owner {field java/lang/reflect/Field}
                                           {owner (java/lang/Class java/lang/Object)}
@@ -353,10 +353,10 @@
     (let [owner (java/lang/reflect/Field::getDeclaringClass field)]
       (if (is? owner target)
         (#try.Success field)
-        (exception.throw ..mistaken_field_owner [field owner target])))
+        (exception.except ..mistaken_field_owner [field owner target])))
 
     (#try.Failure _)
-    (exception.throw ..unknown_field [field target])))
+    (exception.except ..unknown_field [field target])))
 
 (def: #export deprecated?
   (-> (array.Array java/lang/annotation/Annotation) Bit)
@@ -377,7 +377,7 @@
                      ..type
                      (\ ! map (|>> [(java/lang/reflect/Modifier::isFinal modifiers)
                                     (..deprecated? (java/lang/reflect/Field::getDeclaredAnnotations fieldJ))])))
-          (exception.throw  [field class]))))]
+          (exception.except  [field class]))))]
 
   [static_field ..not_a_static_field #1 #0]
   [virtual_field ..not_a_virtual_field #0 #1]
diff --git a/stdlib/source/library/lux/target/jvm/type/alias.lux b/stdlib/source/library/lux/target/jvm/type/alias.lux
index 315dff281..e7cc570c1 100644
--- a/stdlib/source/library/lux/target/jvm/type/alias.lux
+++ b/stdlib/source/library/lux/target/jvm/type/alias.lux
@@ -35,10 +35,10 @@
   (-> Aliasing (Parser (Type Var)))
   (do <>.monad
     [var //parser.var']
-    (wrap (|> aliasing
-              (dictionary.get var)
-              (maybe.default var)
-              //.var))))
+    (in (|> aliasing
+            (dictionary.get var)
+            (maybe.default var)
+            //.var))))
 
 (def: (class parameter)
   (-> (Parser (Type Parameter)) (Parser (Type Class)))
@@ -48,7 +48,7 @@
                         (<>.after (.this //signature.parameters_start))
                         (<>.before (.this //signature.parameters_end))
                         (<>.default (list)))]
-        (wrap (//.class name parameters)))
+        (in (//.class name parameters)))
       (<>.after (.this //descriptor.class_prefix))
       (<>.before (.this //descriptor.class_suffix))))
 
@@ -127,5 +127,5 @@
                       inputs (..inputs aliasing)
                       return (..return aliasing)
                       exceptions (<>.some (..exception aliasing))]
-                     (wrap (//.method [type_variables inputs return exceptions]))))
+                     (in (//.method [type_variables inputs return exceptions]))))
        try.assumed))
diff --git a/stdlib/source/library/lux/target/jvm/type/lux.lux b/stdlib/source/library/lux/target/jvm/type/lux.lux
index ea9df2259..3224c9a24 100644
--- a/stdlib/source/library/lux/target/jvm/type/lux.lux
+++ b/stdlib/source/library/lux/target/jvm/type/lux.lux
@@ -49,13 +49,13 @@
 (def: void
   (Parser (Check Type))
   (<>.after //parser.void
-            (<>\wrap (check\wrap .Any))))
+            (<>\in (check\in .Any))))
 
 (template [  ]
   [(def: 
      (Parser (Check Type))
      (<>.after 
-               (<>\wrap (check\wrap (#.Primitive (//reflection.reflection ) #.Nil)))))]
+               (<>\in (check\in (#.Primitive (//reflection.reflection ) #.Nil)))))]
 
   [boolean //parser.boolean //reflection.boolean]
   [byte //parser.byte //reflection.byte]
@@ -71,7 +71,7 @@
   [(def: 
      (Parser (Check Type))
      (<>.after 
-               (<>\wrap (check\wrap (#.Primitive  #.Nil)))))]
+               (<>\in (check\in (#.Primitive  #.Nil)))))]
 
   [boxed_boolean //parser.boolean //box.boolean]
   [boxed_byte //parser.byte //box.byte]
@@ -112,19 +112,19 @@
 (def: wildcard
   (Parser (Check Type))
   (<>.after //parser.wildcard
-            (<>\wrap (check\map product.right
-                                check.existential))))
+            (<>\in (check\map product.right
+                              check.existential))))
 
 (def: (var mapping)
   (-> Mapping (Parser (Check Type)))
   (do <>.monad
     [var //parser.var']
-    (wrap (case (dictionary.get var mapping)
-            #.None
-            (check.throw ..unknown_var [var])
-            
-            (#.Some type)
-            (check\wrap type)))))
+    (in (case (dictionary.get var mapping)
+          #.None
+          (check.except ..unknown_var [var])
+          
+          (#.Some type)
+          (check\in type)))))
 
 (def: (class' parameter)
   (-> (Parser (Check Type)) (Parser (Check Type)))
@@ -134,9 +134,9 @@
                         (<>.after (.this //signature.parameters_start))
                         (<>.before (.this //signature.parameters_end))
                         (<>.default (list)))]
-        (wrap (do {! check.monad}
-                [parameters (monad.seq ! parameters)]
-                (wrap (#.Primitive name parameters)))))
+        (in (do {! check.monad}
+              [parameters (monad.seq ! parameters)]
+              (in (#.Primitive name parameters)))))
       (<>.after (.this //descriptor.class_prefix))
       (<>.before (.this //descriptor.class_suffix))))
 
diff --git a/stdlib/source/library/lux/target/jvm/type/parser.lux b/stdlib/source/library/lux/target/jvm/type/parser.lux
index 5c8f218b9..b955ce0f7 100644
--- a/stdlib/source/library/lux/target/jvm/type/parser.lux
+++ b/stdlib/source/library/lux/target/jvm/type/parser.lux
@@ -26,7 +26,7 @@
   [(def: #export 
      (Parser (Type ))
      (<>.after (.this (//signature.signature ))
-               (<>\wrap )))]
+               (<>\in )))]
 
   [Void void //signature.void //.void]
   [Primitive boolean //signature.boolean //.boolean]
@@ -118,7 +118,7 @@
                         (<>.after (.this //signature.parameters_start))
                         (<>.before (.this //signature.parameters_end))
                         (<>.default (list)))]
-        (wrap [name parameters]))
+        (in [name parameters]))
       (<>.after (.this //descriptor.class_prefix))
       (<>.before (.this //descriptor.class_suffix))))
 
diff --git a/stdlib/source/library/lux/target/lua.lux b/stdlib/source/library/lux/target/lua.lux
index 3c76ad6c4..74a975754 100644
--- a/stdlib/source/library/lux/target/lua.lux
+++ b/stdlib/source/library/lux/target/lua.lux
@@ -370,14 +370,14 @@
              (list.reverse clauses)))
 
 (syntax: (arity_inputs {arity .nat})
-  (wrap (case arity
-          0 (.list)
-          _ (|> (dec arity)
-                (enum.range n.enum 0)
-                (list\map (|>> %.nat code.local_identifier))))))
+  (in (case arity
+        0 (.list)
+        _ (|> (dec arity)
+              (enum.range n.enum 0)
+              (list\map (|>> %.nat code.local_identifier))))))
 
 (syntax: (arity_types {arity .nat})
-  (wrap (list.repeat arity (` ..Expression))))
+  (in (list.repeat arity (` ..Expression))))
 
 (template [ +]
   [(with_expansions [ (template.identifier ["apply/" ])
diff --git a/stdlib/source/library/lux/target/php.lux b/stdlib/source/library/lux/target/php.lux
index 5ca2e0d58..10ef0dbd3 100644
--- a/stdlib/source/library/lux/target/php.lux
+++ b/stdlib/source/library/lux/target/php.lux
@@ -226,14 +226,14 @@
           :abstraction)))
 
   (syntax: (arity_inputs {arity .nat})
-    (wrap (case arity
-            0 (.list)
-            _ (|> (dec arity)
-                  (enum.range n.enum 0)
-                  (list\map (|>> %.nat code.local_identifier))))))
+    (in (case arity
+          0 (.list)
+          _ (|> (dec arity)
+                (enum.range n.enum 0)
+                (list\map (|>> %.nat code.local_identifier))))))
 
   (syntax: (arity_types {arity .nat})
-    (wrap (list.repeat arity (` ..Expression))))
+    (in (list.repeat arity (` ..Expression))))
 
   (template [ +]
     [(with_expansions [ (template.identifier ["apply/" ])
diff --git a/stdlib/source/library/lux/target/python.lux b/stdlib/source/library/lux/target/python.lux
index 3c8450b31..056426d2a 100644
--- a/stdlib/source/library/lux/target/python.lux
+++ b/stdlib/source/library/lux/target/python.lux
@@ -456,14 +456,14 @@
              (list.reverse clauses)))
 
 (syntax: (arity_inputs {arity .nat})
-  (wrap (case arity
-          0 (.list)
-          _ (|> (dec arity)
-                (enum.range n.enum 0)
-                (list\map (|>> %.nat code.local_identifier))))))
+  (in (case arity
+        0 (.list)
+        _ (|> (dec arity)
+              (enum.range n.enum 0)
+              (list\map (|>> %.nat code.local_identifier))))))
 
 (syntax: (arity_types {arity .nat})
-  (wrap (list.repeat arity (` (Expression Any)))))
+  (in (list.repeat arity (` (Expression Any)))))
 
 (template [ +]
   [(with_expansions [ (template.identifier ["apply/" ])
diff --git a/stdlib/source/library/lux/target/r.lux b/stdlib/source/library/lux/target/r.lux
index f6180c45c..11d080762 100644
--- a/stdlib/source/library/lux/target/r.lux
+++ b/stdlib/source/library/lux/target/r.lux
@@ -204,14 +204,14 @@
                      ")"))))
 
   (syntax: (arity_inputs {arity .nat})
-    (wrap (case arity
-            0 (.list)
-            _ (|> arity
-                  list.indices
-                  (list\map (|>> %.nat code.local_identifier))))))
+    (in (case arity
+          0 (.list)
+          _ (|> arity
+                list.indices
+                (list\map (|>> %.nat code.local_identifier))))))
 
   (syntax: (arity_types {arity .nat})
-    (wrap (list.repeat arity (` ..Expression))))
+    (in (list.repeat arity (` ..Expression))))
 
   (template [ +]
     [(with_expansions [ (template.identifier ["apply/" ])
diff --git a/stdlib/source/library/lux/target/ruby.lux b/stdlib/source/library/lux/target/ruby.lux
index 1d28af979..497cae831 100644
--- a/stdlib/source/library/lux/target/ruby.lux
+++ b/stdlib/source/library/lux/target/ruby.lux
@@ -432,14 +432,14 @@
              (list.reverse clauses)))
 
 (syntax: (arity_inputs {arity .nat})
-  (wrap (case arity
-          0 (.list)
-          _ (|> (dec arity)
-                (enum.range n.enum 0)
-                (list\map (|>> %.nat code.local_identifier))))))
+  (in (case arity
+        0 (.list)
+        _ (|> (dec arity)
+              (enum.range n.enum 0)
+              (list\map (|>> %.nat code.local_identifier))))))
 
 (syntax: (arity_types {arity .nat})
-  (wrap (list.repeat arity (` ..Expression))))
+  (in (list.repeat arity (` ..Expression))))
 
 (template [ +]
   [(with_expansions [ (template.identifier ["apply/" ])
diff --git a/stdlib/source/library/lux/target/scheme.lux b/stdlib/source/library/lux/target/scheme.lux
index 6ebc254db..cb6878cb4 100644
--- a/stdlib/source/library/lux/target/scheme.lux
+++ b/stdlib/source/library/lux/target/scheme.lux
@@ -217,39 +217,39 @@
       [car/1 "car"]
       [cdr/1 "cdr"]
       [raise/1 "raise"]
-      [error-object-message/1 "error-object-message"]
-      [make-vector/1 "make-vector"]
-      [vector-length/1 "vector-length"]
+      [error_object_message/1 "error-object-message"]
+      [make_vector/1 "make-vector"]
+      [vector_length/1 "vector-length"]
       [not/1 "not"]
-      [string-hash/1 "string-hash"]
+      [string_hash/1 "string-hash"]
       [reverse/1 "reverse"]
       [display/1 "display"]
       [exit/1 "exit"]
-      [string-length/1 "string-length"]
-      [load-relative/1 "load-relative"]]]
+      [string_length/1 "string-length"]
+      [load_relative/1 "load-relative"]]]
 
     [apply/2 [_0 _1] [Expression Expression]
      [[append/2 "append"]
       [cons/2 "cons"]
-      [make-vector/2 "make-vector"]
-      ## [vector-ref/2 "vector-ref"]
-      [list-tail/2 "list-tail"]
+      [make_vector/2 "make-vector"]
+      ## [vector_ref/2 "vector-ref"]
+      [list_tail/2 "list-tail"]
       [map/2 "map"]
-      [string-ref/2 "string-ref"]
-      [string-append/2 "string-append"]
-      [make-string/2 "make-string"]]]
+      [string_ref/2 "string-ref"]
+      [string_append/2 "string-append"]
+      [make_string/2 "make-string"]]]
 
     [apply/3 [_0 _1 _2] [Expression Expression Expression]
      [[substring/3 "substring"]
-      [vector-set!/3 "vector-set!"]
-      [string-contains/3 "string-contains"]]]
+      [vector_set!/3 "vector-set!"]
+      [string_contains/3 "string-contains"]]]
 
     [apply/5 [_0 _1 _2 _3 _4] [Expression Expression Expression Expression Expression]
-     [[vector-copy!/5 "vector-copy!"]]]
+     [[vector_copy!/5 "vector-copy!"]]]
     )
 
-  ## TODO: define "vector-ref/2" like a normal apply/2 function.
-  ## "vector-ref/2" as an 'invoke' is problematic, since it only works
+  ## TODO: define "vector_ref/2" like a normal apply/2 function.
+  ## "vector_ref/2" as an 'invoke' is problematic, since it only works
   ## in Kawa.
   ## However, the way Kawa defines "vector-ref" causes trouble,
   ## because it does a runtime type-check which throws an error when
@@ -261,7 +261,7 @@
   ## 1. To carry on, and then, when it's time to compile the compiler
   ## itself into Scheme, switch from 'invoke' to normal 'vector-ref'.
   ## Either way, the 'invoke' needs to go away.
-  (def: #export (vector-ref/2 vector index)
+  (def: #export (vector_ref/2 vector index)
     (-> Expression Expression Computation)
     (..form (list (..var "invoke") vector (..symbol "getRaw") index)))
 
@@ -287,10 +287,10 @@
     [remainder/2 "remainder"]
     [quotient/2 "quotient"]
     [mod/2 "mod"]
-    [arithmetic-shift/2 "arithmetic-shift"]
-    [bitwise-and/2 "bitwise-and"]
-    [bitwise-ior/2 "bitwise-ior"]
-    [bitwise-xor/2 "bitwise-xor"]
+    [arithmetic_shift/2 "arithmetic-shift"]
+    [bitwise_and/2 "bitwise-and"]
+    [bitwise_ior/2 "bitwise-ior"]
+    [bitwise_xor/2 "bitwise-xor"]
     )
 
   (template [ ]
diff --git a/stdlib/source/library/lux/test.lux b/stdlib/source/library/lux/test.lux
index c3c67ff82..2faf51dd2 100644
--- a/stdlib/source/library/lux/test.lux
+++ b/stdlib/source/library/lux/test.lux
@@ -1,4 +1,5 @@
-(.module: {#.doc "Tools for unit & property-based/generative testing."}
+(.module:
+  {#.doc "Tools for unit & property-based/generative testing."}
   [library
    [lux (#- and for)
     ["." meta]
@@ -121,13 +122,13 @@
   (-> Text Test)
   (|>> (format ..failure_prefix)
        [..failure_tally]
-       async\wrap
-       random\wrap))
+       async\in
+       random\in))
 
 (def: #export (assert message condition)
   {#.doc "Check that a condition is #1, and fail with the given message otherwise."}
   (-> Text Bit Assertion)
-  (<| async\wrap
+  (<| async\in
       (if condition
         [..success_tally (format ..success_prefix message)]
         [..failure_tally (format ..failure_prefix message)])))
@@ -135,7 +136,7 @@
 (def: #export (test message condition)
   {#.doc "Check that a condition is #1, and fail with the given message otherwise."}
   (-> Text Bit Test)
-  (random\wrap (..assert message condition)))
+  (random\in (..assert message condition)))
 
 (def: #export (lift message random)
   (-> Text (Random Bit) Test)
@@ -178,7 +179,7 @@
             [prng' (do {! async.monad}
                      [[tally documentation] instance]
                      (if (..failed? tally)
-                       (wrap [tally (times_failure seed documentation)])
+                       (in [tally (times_failure seed documentation)])
                        (case amount
                          1 instance
                          _ (|> test
@@ -270,7 +271,7 @@
 (def: (|cover| coverage condition)
   (-> (List Name) Bit Test)
   (|> (..|cover'| coverage condition)
-      random\wrap))
+      random\in))
 
 (def: (|for| coverage test)
   (-> (List Name) Test Test)
@@ -290,8 +291,8 @@
 
 (syntax: (reference {name .identifier})
   (do meta.monad
-    [_ (meta.find_export name)]
-    (wrap (list (name_code name)))))
+    [_ (meta.export name)]
+    (in (list (name_code name)))))
 
 (def: coverage_separator
   Text
@@ -322,10 +323,10 @@
      (let [coverage (list\map (function (_ definition)
                                 (` ((~! ..reference) (~ definition))))
                               coverage)]
-       (wrap (list (` ((~! )
-                       (: (.List .Name)
-                          (.list (~+ coverage)))
-                       (~ condition)))))))]
+       (in (list (` ((~! )
+                     (: (.List .Name)
+                        (.list (~+ coverage)))
+                     (~ condition)))))))]
 
   [cover' ..|cover'|]
   [cover ..|cover|]
@@ -336,10 +337,10 @@
   (let [coverage (list\map (function (_ definition)
                              (` ((~! ..reference) (~ definition))))
                            coverage)]
-    (wrap (list (` ((~! ..|for|)
-                    (: (.List .Name)
-                       (.list (~+ coverage)))
-                    (~ test)))))))
+    (in (list (` ((~! ..|for|)
+                  (: (.List .Name)
+                     (.list (~+ coverage)))
+                  (~ test)))))))
 
 (def: (covering' module coverage test)
   (-> Text Text Test Test)
@@ -361,10 +362,10 @@
                                        aggregate))
                                    #.Nil)
                         ..encode_coverage)]]
-    (wrap (list (` ((~! ..covering')
-                    (~ (code.text module))
-                    (~ (code.text coverage))
-                    (~ test)))))))
+    (in (list (` ((~! ..covering')
+                  (~ (code.text module))
+                  (~ (code.text coverage))
+                  (~ test)))))))
 
 (exception: #export (error_during_execution {error Text})
   (exception.report
@@ -374,7 +375,7 @@
   (-> (List Test) Test)
   (case (list.size tests)
     0
-    (random\wrap (async\wrap [..start ""]))
+    (random\in (async\in [..start ""]))
     
     expected_tests
     (do random.monad
@@ -413,7 +414,7 @@
                                                                   (|> assertions
                                                                       (list\map product.right)
                                                                       (text.join_with ..separator))]))
-                                                       (wrap []))))
+                                                       (in []))))
                                                  (run! test)))
                                   (list.enumeration tests)))]]
-      (wrap read!))))
+      (in read!))))
diff --git a/stdlib/source/library/lux/time.lux b/stdlib/source/library/lux/time.lux
index cf1f340c0..e726ad968 100644
--- a/stdlib/source/library/lux/time.lux
+++ b/stdlib/source/library/lux/time.lux
@@ -54,7 +54,7 @@
   (<>.either (|> (.at_most 3 .decimal)
                  (<>.codec n.decimal)
                  (<>.after (.this ".")))
-             (\ <>.monad wrap 0)))
+             (\ <>.monad in 0)))
 
 (template [   ]
   [(exception: #export ( {value Nat})
@@ -68,8 +68,8 @@
      (do <>.monad
        [value ]
        (if (n.<  value)
-         (wrap value)
-         (<>.lift (exception.throw  [value])))))]
+         (in value)
+         (<>.lift (exception.except  [value])))))]
 
   [..hours hour_parser invalid_hour ..section_parser]
   [..minutes minute_parser invalid_minute ..section_parser]
@@ -90,7 +90,7 @@
     (-> Nat (Try Time))
     (if (n.< ..limit milli_seconds)
       (#try.Success (:abstraction milli_seconds))
-      (exception.throw ..time_exceeds_a_day [milli_seconds])))
+      (exception.except ..time_exceeds_a_day [milli_seconds])))
 
   (def: #export to_millis
     (-> Time Nat)
@@ -140,12 +140,12 @@
          _ (.this ..separator)
          utc_second ..second_parser
          utc_millis ..millis_parser]
-        (wrap (:abstraction
-               ($_ n.+
-                   (n.* utc_hour hour)
-                   (n.* utc_minute minute)
-                   (n.* utc_second second)
-                   (n.* utc_millis millis)))))))
+        (in (:abstraction
+             ($_ n.+
+                 (n.* utc_hour hour)
+                 (n.* utc_minute minute)
+                 (n.* utc_second second)
+                 (n.* utc_millis millis)))))))
   )
 
 (def: (pad value)
diff --git a/stdlib/source/library/lux/time/date.lux b/stdlib/source/library/lux/time/date.lux
index c2ad8d025..79250a35e 100644
--- a/stdlib/source/library/lux/time/date.lux
+++ b/stdlib/source/library/lux/time/date.lux
@@ -11,7 +11,7 @@
      ["." try (#+ Try)]
      ["." exception (#+ exception:)]
      ["<>" parser
-      ["" text (#+ Parser)]]]
+      ["<.>" text (#+ Parser)]]]
     [data
      ["." maybe]
      ["." text ("#\." monoid)]
@@ -80,7 +80,7 @@
         {#year year
          #month month
          #day day}))
-      (exception.throw ..invalid_day [year month day])))
+      (exception.except ..invalid_day [year month day])))
 
   (def: #export epoch
     Date
@@ -147,7 +147,7 @@
   (<>.either (|> (.at_most 3 .decimal)
                  (<>.codec n.decimal)
                  (<>.after (.this ".")))
-             (\ <>.monad wrap 0)))
+             (\ <>.monad in 0)))
 
 (template [   ]
   [(exception: #export ( {value Nat})
@@ -162,8 +162,8 @@
        [value ..section_parser]
        (if (and (n.>=  value)
                 (n.<=  value))
-         (wrap value)
-         (<>.lift (exception.throw  [value])))))]
+         (in value)
+         (<>.lift (exception.except  [value])))))]
 
   [1 12 month_parser invalid_month]
   )
diff --git a/stdlib/source/library/lux/time/day.lux b/stdlib/source/library/lux/time/day.lux
index 157dd6c1f..d5379cdc1 100644
--- a/stdlib/source/library/lux/time/day.lux
+++ b/stdlib/source/library/lux/time/day.lux
@@ -118,4 +118,4 @@
        [#..Friday]
        [#..Saturday]
        [#..Sunday])
-      _ (exception.throw ..not_a_day_of_the_week [value]))))
+      _ (exception.except ..not_a_day_of_the_week [value]))))
diff --git a/stdlib/source/library/lux/time/duration.lux b/stdlib/source/library/lux/time/duration.lux
index bcc65a0d3..5e0907481 100644
--- a/stdlib/source/library/lux/time/duration.lux
+++ b/stdlib/source/library/lux/time/duration.lux
@@ -179,9 +179,9 @@
                       (..merge (..up minutes ..minute))
                       (..merge (..up seconds ..second))
                       (..merge (..up millis ..milli_second)))]]
-      (wrap (case sign
-              (#.Left _) (..inverse span)
-              (#.Right _) span)))))
+      (in (case sign
+            (#.Left _) (..inverse span)
+            (#.Right _) span)))))
 
 (implementation: #export codec
   (Codec Text Duration)
diff --git a/stdlib/source/library/lux/time/instant.lux b/stdlib/source/library/lux/time/instant.lux
index a73a603ba..8445ed977 100644
--- a/stdlib/source/library/lux/time/instant.lux
+++ b/stdlib/source/library/lux/time/instant.lux
@@ -139,13 +139,13 @@
      _ (.this ..date_suffix)
      time (\ ! map //.to_millis //.parser)
      _ (.this ..time_suffix)]
-    (wrap (|> (if (i.< +0 days)
-                (|> duration.day
-                    (duration.up (.nat (i.* -1 days)))
-                    duration.inverse)
-                (duration.up (.nat days) duration.day))
-              (duration.merge (duration.up time duration.milli_second))
-              ..absolute))))
+    (in (|> (if (i.< +0 days)
+              (|> duration.day
+                  (duration.up (.nat (i.* -1 days)))
+                  duration.inverse)
+              (duration.up (.nat days) duration.day))
+            (duration.merge (duration.up time duration.milli_second))
+            ..absolute))))
 
 (implementation: #export codec
   {#.doc (doc "Based on ISO 8601."
diff --git a/stdlib/source/library/lux/time/month.lux b/stdlib/source/library/lux/time/month.lux
index 381094933..89dc069f2 100644
--- a/stdlib/source/library/lux/time/month.lux
+++ b/stdlib/source/library/lux/time/month.lux
@@ -89,7 +89,7 @@
       (^template [ ]
         [ (#try.Success )])
       ()
-      _ (exception.throw ..invalid_month [number])))
+      _ (exception.except ..invalid_month [number])))
   )
 
 (implementation: #export hash
@@ -222,4 +222,4 @@
        [#..October]
        [#..November]
        [#..December])
-      _ (exception.throw ..not_a_month_of_the_year [value]))))
+      _ (exception.except ..not_a_month_of_the_year [value]))))
diff --git a/stdlib/source/library/lux/time/year.lux b/stdlib/source/library/lux/time/year.lux
index b3f3e7ecf..5388b5ef8 100644
--- a/stdlib/source/library/lux/time/year.lux
+++ b/stdlib/source/library/lux/time/year.lux
@@ -40,7 +40,7 @@
   (def: #export (year value)
     (-> Int (Try Year))
     (case value
-      +0 (exception.throw ..there_is_no_year_0 [])
+      +0 (exception.except ..there_is_no_year_0 [])
       _ (#try.Success (:abstraction (..internal value)))))
 
   (def: #export value
@@ -112,9 +112,9 @@
 (def: #export parser
   (Parser Year)
   (do {! <>.monad}
-    [sign (<>.or (.this "-") (wrap []))
+    [sign (<>.or (.this "-") (in []))
      digits (.many .decimal)
-     raw_year (<>.codec i.decimal (wrap (text\compose "+" digits)))]
+     raw_year (<>.codec i.decimal (in (text\compose "+" digits)))]
     (<>.lift (..year (case sign
                        (#.Left _)  (i.* -1 raw_year)
                        (#.Right _) raw_year)))))
diff --git a/stdlib/source/library/lux/tool/compiler/default/init.lux b/stdlib/source/library/lux/tool/compiler/default/init.lux
index 7fcbb94eb..8b668b60f 100644
--- a/stdlib/source/library/lux/tool/compiler/default/init.lux
+++ b/stdlib/source/library/lux/tool/compiler/default/init.lux
@@ -48,7 +48,8 @@
      ["." archive (#+ Archive)
       ["." descriptor (#+ Module)]
       ["." artifact]
-      ["." document]]]]])
+      ["." document]]]]
+   ])
 
 (def: #export (state target module expander host_analysis host generate generation_bundle)
   (All [anchor expression directive]
@@ -132,8 +133,8 @@
         _ (monad.map ! module.import dependencies)
         #let [source (///analysis.source (get@ #///.module input) (get@ #///.code input))]
         _ (///analysis.set_source_code source)]
-       (wrap [source [///generation.empty_buffer
-                      artifact.empty]])))))
+       (in [source [///generation.empty_buffer
+                    artifact.empty]])))))
 
 (def: (end module)
   (-> Module
@@ -150,8 +151,8 @@
                    ///generation.buffer)
      final_registry (///directive.lift_generation
                      ///generation.get_registry)]
-    (wrap [analysis_module [final_buffer
-                            final_registry]])))
+    (in [analysis_module [final_buffer
+                          final_registry]])))
 
 ## TODO: Inline ASAP
 (def: (get_current_payload _)
@@ -165,7 +166,7 @@
              ///generation.buffer)
      registry (///directive.lift_generation
                ///generation.get_registry)]
-    (wrap [buffer registry])))
+    (in [buffer registry])))
 
 ## TODO: Inline ASAP
 (def: (process_directive archive expander pre_payoad code)
@@ -183,7 +184,7 @@
      requirements (let [execute! (directiveP.phase expander)]
                     (execute! archive code))
      post_payload (..get_current_payload pre_payoad)]
-    (wrap [requirements post_payload])))
+    (in [requirements post_payload])))
 
 (def: (iteration archive expander reader source pre_payload)
   (All [directive]
@@ -195,7 +196,7 @@
     [[source code] (///directive.lift_analysis
                     (..read source reader))
      [requirements post_payload] (process_directive archive expander pre_payload code)]
-    (wrap [source requirements post_payload])))
+    (in [source requirements post_payload])))
 
 (def: (iterate archive expander module source pre_payload aliases)
   (All [directive]
@@ -255,33 +256,33 @@
                                                      #descriptor.references (set.of_list text.hash dependencies)
                                                      #descriptor.state #.Compiled
                                                      #descriptor.registry final_registry}]]
-                                  (wrap [state
-                                         (#.Right [descriptor
-                                                   (document.write key analysis_module)
-                                                   (row\map (function (_ [artifact_id custom directive])
-                                                              [artifact_id custom (write_directive directive)])
-                                                            final_buffer)])]))
+                                  (in [state
+                                       (#.Right [descriptor
+                                                 (document.write key analysis_module)
+                                                 (row\map (function (_ [artifact_id custom directive])
+                                                            [artifact_id custom (write_directive directive)])
+                                                          final_buffer)])]))
 
                                 (#.Some [source requirements temporary_payload])
                                 (let [[temporary_buffer temporary_registry] temporary_payload]
-                                  (wrap [state
-                                         (#.Left {#///.dependencies (|> requirements
-                                                                        (get@ #///directive.imports)
-                                                                        (list\map product.left))
-                                                  #///.process (function (_ state archive)
-                                                                 (recur (<| (///phase.run' state)
-                                                                            (do {! ///phase.monad}
-                                                                              [analysis_module (<| (: (Operation .Module))
-                                                                                                   ///directive.lift_analysis
-                                                                                                   extension.lift
-                                                                                                   meta.current_module)
-                                                                               _ (///directive.lift_generation
-                                                                                  (///generation.set_buffer temporary_buffer))
-                                                                               _ (///directive.lift_generation
-                                                                                  (///generation.set_registry temporary_registry))
-                                                                               _ (|> requirements
-                                                                                     (get@ #///directive.referrals)
-                                                                                     (monad.map ! (execute! archive)))
-                                                                               temporary_payload (..get_current_payload temporary_payload)]
-                                                                              (..iterate archive expander module source temporary_payload (..module_aliases analysis_module))))))})]))
+                                  (in [state
+                                       (#.Left {#///.dependencies (|> requirements
+                                                                      (get@ #///directive.imports)
+                                                                      (list\map product.left))
+                                                #///.process (function (_ state archive)
+                                                               (recur (<| (///phase.run' state)
+                                                                          (do {! ///phase.monad}
+                                                                            [analysis_module (<| (: (Operation .Module))
+                                                                                                 ///directive.lift_analysis
+                                                                                                 extension.lift
+                                                                                                 meta.current_module)
+                                                                             _ (///directive.lift_generation
+                                                                                (///generation.set_buffer temporary_buffer))
+                                                                             _ (///directive.lift_generation
+                                                                                (///generation.set_registry temporary_registry))
+                                                                             _ (|> requirements
+                                                                                   (get@ #///directive.referrals)
+                                                                                   (monad.map ! (execute! archive)))
+                                                                             temporary_payload (..get_current_payload temporary_payload)]
+                                                                            (..iterate archive expander module source temporary_payload (..module_aliases analysis_module))))))})]))
                                 )))))}))))
diff --git a/stdlib/source/library/lux/tool/compiler/default/platform.lux b/stdlib/source/library/lux/tool/compiler/default/platform.lux
index c60700019..8a3d4a1cd 100644
--- a/stdlib/source/library/lux/tool/compiler/default/platform.lux
+++ b/stdlib/source/library/lux/tool/compiler/default/platform.lux
@@ -2,8 +2,8 @@
   [library
    [lux (#- Module)
     [type (#+ :sharing)]
-    ["." debug]
     ["@" target]
+    ["." debug]
     [abstract
      ["." monad (#+ Monad do)]]
     [control
@@ -58,9 +58,9 @@
       ["ioW" archive]]]]]
   [program
    [compositor
-    ["." cli (#+ Compilation Library)]
-    ["." static (#+ Static)]
-    ["." import (#+ Import)]]])
+    [cli (#+ Compilation Library)]
+    [import (#+ Import)]
+    ["." static (#+ Static)]]])
 
 (with_expansions [ (as_is anchor expression directive)
                    (as_is ///generation.Operation )]
@@ -112,7 +112,7 @@
                       row.to_list
                       (monad.map ..monad write_artifact!)
                       (: (Action (List Any)))))
-           document (\ async.monad wrap
+           document (\ async.monad in
                        (document.check $.key document))]
           (ioW.cache system static module_id
                      (_.run ..writer [descriptor document])))))
@@ -158,7 +158,7 @@
                                   (do try.monad
                                     [[_ archive] (archive.reserve archive.runtime_module archive)]
                                     (archive.add archive.runtime_module [descriptor document payload] archive))))]
-        (wrap [archive [descriptor document payload]])))
+        (in [archive [descriptor document payload]])))
 
     (def: (initialize_state extender
                             [analysers
@@ -191,7 +191,7 @@
                        _ (///directive.lift_generation
                           (extension.with extender (:assume generators)))
                        _ (extension.with extender (:assume directives))]
-                      (wrap [])))
+                      (in [])))
           (///phase.run' state)
           (\ try.monad map product.left)))
 
@@ -249,7 +249,7 @@
                (: (All []
                     (->  (Program expression directive)  (Async (Try ))))
                   (function (_ platform program state)
-                    (async\wrap
+                    (async\in
                      (do try.monad
                        [[state phase_wrapper] (..phase_wrapper archive platform state)]
                        (|> state
@@ -260,15 +260,15 @@
         (if (archive.archived? archive archive.runtime_module)
           (do !
             [state (with_missing_extensions platform program state)]
-            (wrap [state archive]))
+            (in [state archive]))
           (do !
             [[state [archive payload]] (|> (..process_runtime archive platform)
                                            (///phase.run' state)
-                                           async\wrap)
+                                           async\in)
              _ (..cache_module static platform 0 payload)
              
              state (with_missing_extensions platform program state)]
-            (wrap [state archive])))))
+            (in [state archive])))))
 
     (def: compilation_log_separator
       (format text.new_line text.tab))
@@ -369,10 +369,10 @@
     (def: (verify_dependencies importer importee dependence)
       (-> Module Module Dependence (Try Any))
       (cond (text\= importer importee)
-            (exception.throw ..module_cannot_import_itself [importer])
+            (exception.except ..module_cannot_import_itself [importer])
 
             (..circular_dependency? importer importee dependence)
-            (exception.throw ..cannot_import_circular_dependency [importer importee])
+            (exception.except ..cannot_import_circular_dependency [importer importee])
 
             ## else
             (#try.Success [])))
@@ -414,30 +414,30 @@
                                                              (stm.read dependence)
                                                              (do !
                                                                [[_ dependence] (stm.update (..depend importer module) dependence)]
-                                                               (wrap dependence)))]
+                                                               (in dependence)))]
                                                (case (..verify_dependencies importer module dependence)
                                                  (#try.Failure error)
-                                                 (wrap [(async.resolved (#try.Failure error))
-                                                        #.None])
+                                                 (in [(async.resolved (#try.Failure error))
+                                                      #.None])
 
                                                  (#try.Success _)
                                                  (do !
                                                    [[archive state] (stm.read current)]
                                                    (if (archive.archived? archive module)
-                                                     (wrap [(async\wrap (#try.Success [archive state]))
-                                                            #.None])
+                                                     (in [(async\in (#try.Success [archive state]))
+                                                          #.None])
                                                      (do !
                                                        [@pending (stm.read pending)]
                                                        (case (dictionary.get module @pending)
                                                          (#.Some [return signal])
-                                                         (wrap [return
-                                                                #.None])
+                                                         (in [return
+                                                              #.None])
                                                          
                                                          #.None
                                                          (case (if (archive.reserved? archive module)
                                                                  (do try.monad
                                                                    [module_id (archive.id module archive)]
-                                                                   (wrap [module_id archive]))
+                                                                   (in [module_id archive]))
                                                                  (archive.reserve module archive))
                                                            (#try.Success [module_id archive])
                                                            (do !
@@ -449,24 +449,24 @@
                                                                                               
                                                                                               (async.async []))]
                                                               _ (stm.update (dictionary.put module [return signal]) pending)]
-                                                             (wrap [return
-                                                                    (#.Some [[archive state]
-                                                                             module_id
-                                                                             signal])]))
+                                                             (in [return
+                                                                  (#.Some [[archive state]
+                                                                           module_id
+                                                                           signal])]))
                                                            
                                                            (#try.Failure error)
-                                                           (wrap [(async\wrap (#try.Failure error))
-                                                                  #.None])))))))))))
+                                                           (in [(async\in (#try.Failure error))
+                                                                #.None])))))))))))
                  _ (case signal
                      #.None
-                     (wrap [])
+                     (in [])
                      
                      (#.Some [context module_id resolver])
                      (do !
                        [result (compile importer import! module_id context module)
                         result (case result
                                  (#try.Failure error)
-                                 (wrap result)
+                                 (in result)
 
                                  (#try.Success [resulting_archive resulting_state])
                                  (stm.commit (do stm.monad
@@ -474,9 +474,9 @@
                                                                                      [(archive.merge resulting_archive archive)
                                                                                       state])
                                                                                    current)]
-                                               (wrap (#try.Success [merged_archive resulting_state])))))
+                                               (in (#try.Success [merged_archive resulting_state])))))
                         _ (async.future (resolver result))]
-                       (wrap [])))]
+                       (in [])))]
                 return)))))
 
       ## TODO: Find a better way, as this only works for the Lux compiler.
@@ -488,26 +488,26 @@
                                   (do !
                                     [[descriptor document output] (archive.find module archive)
                                      lux_module (document.read $.key document)]
-                                    (wrap [module lux_module])))
+                                    (in [module lux_module])))
                               (archive.archived archive))
            #let [additions (|> modules
                                (list\map product.left)
                                (set.of_list text.hash))]]
-          (wrap (update@ [#extension.state
-                          #///directive.analysis
-                          #///directive.state
-                          #extension.state]
-                         (function (_ analysis_state)
-                           (|> analysis_state
-                               (:as .Lux)
-                               (update@ #.modules (function (_ current)
-                                                    (list\compose (list.only (|>> product.left
-                                                                                  (set.member? additions)
-                                                                                  not)
-                                                                             current)
-                                                                  modules)))
-                               :assume))
-                         state))))
+          (in (update@ [#extension.state
+                        #///directive.analysis
+                        #///directive.state
+                        #extension.state]
+                       (function (_ analysis_state)
+                         (|> analysis_state
+                             (:as .Lux)
+                             (update@ #.modules (function (_ current)
+                                                  (list\compose (list.only (|>> product.left
+                                                                                (set.member? additions)
+                                                                                not)
+                                                                           current)
+                                                                modules)))
+                             :assume))
+                       state))))
 
       (def: (set_current_module module state)
         (All []
@@ -556,7 +556,7 @@
                                 (do !
                                   [[archive state] (case new_dependencies
                                                      #.Nil
-                                                     (wrap [archive state])
+                                                     (in [archive state])
 
                                                      (#.Cons _)
                                                      (do !
@@ -566,8 +566,8 @@
                                                         #let [archive (|> archive,document+
                                                                           (list\map product.left)
                                                                           (list\fold archive.merge archive))]]
-                                                       (wrap [archive (try.assumed
-                                                                       (..updated_state archive state))])))]
+                                                       (in [archive (try.assumed
+                                                                     (..updated_state archive state))])))]
                                   (case ((get@ #///.process compilation)
                                          ## TODO: The "///directive.set_current_module" below shouldn't be necessary. Remove it ASAP.
                                          ## TODO: The context shouldn't need to be re-set either.
@@ -588,15 +588,15 @@
                                          _ (..cache_module static platform module_id [descriptor document output])]
                                         (case (archive.add module [descriptor document output] archive)
                                           (#try.Success archive)
-                                          (wrap [archive
-                                                 (..with_reset_log state)])
+                                          (in [archive
+                                               (..with_reset_log state)])
                                           
                                           (#try.Failure error)
-                                          (async\wrap (#try.Failure error)))))
+                                          (async\in (#try.Failure error)))))
 
                                     (#try.Failure error)
                                     (do !
                                       [_ (ioW.freeze (get@ #&file_system platform) static archive)]
-                                      (async\wrap (#try.Failure error))))))))))]
+                                      (async\in (#try.Failure error))))))))))]
           (compiler archive.runtime_module compilation_module)))
       )))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux.lux b/stdlib/source/library/lux/tool/compiler/language/lux.lux
index e6d5816a4..e5c8e654d 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux.lux
@@ -98,7 +98,7 @@
         ## #module_annotations
         (.maybe .code)
         ## #module_state
-        (\ <>.monad wrap #.Cached))))
+        (\ <>.monad in #.Cached))))
 
 (def: #export key
   (Key .Module)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux
index 0fc5d90fc..b2b7b6c18 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux
@@ -469,22 +469,22 @@
   (function (_ [bundle state])
     (#try.Failure (locate_error (get@ #.location state) error))))
 
-(def: #export (throw exception parameters)
+(def: #export (except exception parameters)
   (All [e] (-> (Exception e) e Operation))
   (..failure (exception.construct exception parameters)))
 
 (def: #export (assert exception parameters condition)
   (All [e] (-> (Exception e) e Bit (Operation Any)))
   (if condition
-    (\ phase.monad wrap [])
-    (..throw exception parameters)))
+    (\ phase.monad in [])
+    (..except exception parameters)))
 
 (def: #export (failure' error)
   (-> Text (phase.Operation Lux))
   (function (_ state)
     (#try.Failure (locate_error (get@ #.location state) error))))
 
-(def: #export (throw' exception parameters)
+(def: #export (except' exception parameters)
   (All [e] (-> (Exception e) e (phase.Operation Lux)))
   (..failure' (exception.construct exception parameters)))
 
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/macro.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/macro.lux
index f8f295429..ecc765794 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/macro.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/macro.lux
@@ -46,7 +46,7 @@
     [expansion (expand expander name macro inputs)]
     (case expansion
       (^ (list single))
-      (wrap single)
+      (in single)
 
       _
       (meta.failure (exception.construct ..must_have_single_expansion [name inputs expansion])))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux b/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux
index 29796ead6..bbe6da451 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux
@@ -128,7 +128,7 @@
          (#try.Success [stateE output])
 
          #.None
-         (exception.throw  []))))
+         (exception.except  []))))
 
    (def: #export ( value)
      (All [anchor expression directive]
@@ -171,7 +171,7 @@
   (do phase.monad
     [count (extension.read (get@ #counter))
      _ (extension.update (update@ #counter inc))]
-    (wrap count)))
+    (in count)))
 
 (def: #export (gensym prefix)
   (All [anchor expression directive]
@@ -197,7 +197,7 @@
       (#try.Success [state+ output])
 
       (#try.Failure error)
-      (exception.throw ..cannot_interpret error))))
+      (exception.except ..cannot_interpret error))))
 
 (def: #export (execute! code)
   (All [anchor expression directive]
@@ -208,7 +208,7 @@
       (#try.Success [state+ output])
 
       (#try.Failure error)
-      (exception.throw ..cannot_interpret error))))
+      (exception.except ..cannot_interpret error))))
 
 (def: #export (define! context custom code)
   (All [anchor expression directive]
@@ -219,7 +219,7 @@
       (#try.Success [stateE output])
 
       (#try.Failure error)
-      (exception.throw ..cannot_interpret error))))
+      (exception.except ..cannot_interpret error))))
 
 (def: #export (save! artifact_id custom code)
   (All [anchor expression directive]
@@ -230,11 +230,11 @@
       (#.Some buffer)
       ## TODO: Optimize by no longer checking for overwrites...
       (if (row.any? (|>> product.left (n.= artifact_id)) buffer)
-        (phase.throw ..cannot_overwrite_output [artifact_id])
+        (phase.except ..cannot_overwrite_output [artifact_id])
         (extension.update (set@ #buffer (#.Some (row.add [artifact_id custom code] buffer)))))
       
       #.None
-      (phase.throw ..no_buffer_for_saving_code [artifact_id]))))
+      (phase.except ..no_buffer_for_saving_code [artifact_id]))))
 
 (template [ ]
   [(def: #export ( name)
@@ -274,7 +274,7 @@
                       (#try.Success (get@ #descriptor.registry descriptor))))]
         (case (artifact.remember _name registry)
           #.None
-          (exception.throw ..unknown_definition [name (artifact.definitions registry)])
+          (exception.except ..unknown_definition [name (artifact.definitions registry)])
           
           (#.Some id)
           (#try.Success [stateE [module_id id]]))))))
@@ -287,7 +287,7 @@
   (function (_ (^@ stateE [bundle state]))
     (do try.monad
       [module_id (archive.id module archive)]
-      (wrap [stateE module_id]))))
+      (in [stateE module_id]))))
 
 (def: #export (context archive)
   (All [anchor expression directive]
@@ -295,12 +295,12 @@
   (function (_ (^@ stateE [bundle state]))
     (case (get@ #context state)
       #.None
-      (exception.throw ..no_context [])
+      (exception.except ..no_context [])
       
       (#.Some id)
       (do try.monad
         [module_id (archive.id (get@ #module state) archive)]
-        (wrap [stateE [module_id id]])))))
+        (in [stateE [module_id id]])))))
 
 (def: #export (with_context id body)
   (All [anchor expression directive a]
@@ -310,8 +310,8 @@
   (function (_ [bundle state])
     (do try.monad
       [[[bundle' state'] output] (body [bundle (set@ #context (#.Some id) state)])]
-      (wrap [[bundle' (set@ #context (get@ #context state) state')]
-             output]))))
+      (in [[bundle' (set@ #context (get@ #context state) state')]
+           output]))))
 
 (def: #export (with_new_context archive body)
   (All [anchor expression directive a]
@@ -324,9 +324,9 @@
                                                      (set@ #registry registry')
                                                      (set@ #context (#.Some id)))])
          module_id (archive.id (get@ #module state) archive)]
-        (wrap [[bundle' (set@ #context (get@ #context state) state')]
-               [[module_id id]
-                output]])))))
+        (in [[bundle' (set@ #context (get@ #context state) state')]
+             [[module_id id]
+              output]])))))
 
 (def: #export (log! message)
   (All [anchor expression directive a]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux
index c35404a68..b2a5e9fc6 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis.lux
@@ -116,7 +116,7 @@
       (case functionA
         (#/.Reference (#reference.Constant def_name))
         (do !
-          [?macro (//extension.lift (meta.find_macro def_name))]
+          [?macro (//extension.lift (meta.macro def_name))]
           (case ?macro
             (#.Some macro)
             (do !
@@ -130,7 +130,7 @@
         (/function.apply compile argsC+ functionT functionA archive functionC)))
 
     _
-    (//.throw ..unrecognized_syntax [location.dummy code'])))
+    (//.except ..unrecognized_syntax [location.dummy code'])))
 
 (def: #export (phase expander)
   (-> Expander Phase)
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 54e4e90d6..fb8d67bf5 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
@@ -90,7 +90,7 @@
           (recur envs caseT')
 
           _
-          (/.throw ..cannot_simplify_for_pattern_matching caseT)))
+          (/.except ..cannot_simplify_for_pattern_matching caseT)))
 
       (#.Named name unnamedT)
       (recur envs unnamedT)
@@ -102,7 +102,7 @@
       (do ///.monad
         [[var_id varT] (//type.with_env
                          check.var)]
-        (recur envs (maybe.assume (type.apply (list varT) caseT))))
+        (recur envs (maybe.assume (type.applied (list varT) caseT))))
 
       (#.Apply inputT funcT)
       (.case funcT
@@ -113,29 +113,29 @@
                       [?funct' (check.read funcT_id)]
                       (.case ?funct'
                         (#.Some funct')
-                        (wrap funct')
+                        (in funct')
 
                         _
-                        (check.throw ..cannot_simplify_for_pattern_matching caseT))))]
+                        (check.except ..cannot_simplify_for_pattern_matching caseT))))]
           (recur envs (#.Apply inputT funcT')))
 
         _
-        (.case (type.apply (list inputT) funcT)
+        (.case (type.applied (list inputT) funcT)
           (#.Some outputT)
           (recur envs outputT)
 
           #.None
-          (/.throw ..cannot_simplify_for_pattern_matching caseT)))
+          (/.except ..cannot_simplify_for_pattern_matching caseT)))
 
       (#.Product _)
       (|> caseT
           type.flat_tuple
           (list\map (re_quantify envs))
           type.tuple
-          (\ ///.monad wrap))
+          (\ ///.monad in))
 
       _
-      (\ ///.monad wrap (re_quantify envs caseT)))))
+      (\ ///.monad in (re_quantify envs caseT)))))
 
 (def: (analyse_primitive type inputT location output next)
   (All [a] (-> Type Type Location Pattern (Operation a) (Operation [Pattern a])))
@@ -144,7 +144,7 @@
       [_ (//type.with_env
            (check.check inputT type))
        outputA next]
-      (wrap [output outputA]))))
+      (in [output outputA]))))
 
 ## This function handles several concerns at once, but it must be that
 ## way because those concerns are interleaved when doing
@@ -171,7 +171,7 @@
         [outputA (//scope.with_local [name inputT]
                    next)
          idx //scope.next_local]
-        (wrap [(#/.Bind idx) outputA])))
+        (in [(#/.Bind idx) outputA])))
 
     (^template [  ]
       [[location ]
@@ -216,16 +216,16 @@
                                                   [[memberP [memberP+ thenA]] ((:as (All [a] (-> (Maybe Nat) Type Code (Operation a) (Operation [Pattern a])))
                                                                                     analyse_pattern)
                                                                                #.None memberT memberC then)]
-                                                  (wrap [(list& memberP memberP+) thenA]))))
+                                                  (in [(list& memberP memberP+) thenA]))))
                                            (do !
                                              [nextA next]
-                                             (wrap [(list) nextA]))
+                                             (in [(list) nextA]))
                                            (list.reverse matches))]
-              (wrap [(/.pattern/tuple memberP+)
-                     thenA])))
+              (in [(/.pattern/tuple memberP+)
+                   thenA])))
 
           _
-          (/.throw ..cannot_match_with_pattern [inputT' pattern])
+          (/.except ..cannot_match_with_pattern [inputT' pattern])
           )))
 
     [location (#.Record record)]
@@ -238,7 +238,7 @@
              (check.check inputT recordT))
 
            _
-           (wrap []))]
+           (in []))]
       (analyse_pattern (#.Some (list.size members)) inputT [location (#.Tuple members)] next))
 
     [location (#.Tag tag)]
@@ -266,23 +266,23 @@
                                                   (` [(~+ values)])
                                                   next)
                                  (analyse_pattern #.None caseT (` [(~+ values)]) next))]
-                (wrap [(/.pattern/variant [lefts right? testP])
-                       nextA]))
+                (in [(/.pattern/variant [lefts right? testP])
+                     nextA]))
 
               _
-              (/.throw ..sum_has_no_case [idx inputT])))
+              (/.except ..sum_has_no_case [idx inputT])))
 
           (#.UnivQ _)
           (do ///.monad
             [[ex_id exT] (//type.with_env
                            check.existential)]
             (analyse_pattern num_tags
-                             (maybe.assume (type.apply (list exT) inputT'))
+                             (maybe.assume (type.applied (list exT) inputT'))
                              pattern
                              next))
           
           _
-          (/.throw ..cannot_match_with_pattern [inputT' pattern]))))
+          (/.except ..cannot_match_with_pattern [inputT' pattern]))))
 
     (^ [location (#.Form (list& [_ (#.Tag tag)] values))])
     (/.with_location location
@@ -295,7 +295,7 @@
         (analyse_pattern (#.Some (list.size group)) inputT (` ((~ (code.nat lefts)) (~ (code.bit right?)) (~+ values))) next)))
 
     _
-    (/.throw ..not_a_pattern pattern)
+    (/.except ..not_a_pattern pattern)
     ))
 
 (def: #export (case analyse branches archive inputC)
@@ -319,7 +319,7 @@
 
            (#try.Failure error)
            (/.failure error))]
-      (wrap (#/.Case inputA [outputH outputT])))
+      (in (#/.Case inputA [outputH outputT])))
 
     #.Nil
-    (/.throw ..cannot_have_empty_branches "")))
+    (/.except ..cannot_have_empty_branches "")))
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 2bb0fe957..37177e7ba 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
@@ -99,13 +99,13 @@
   (case pattern
     (^or (#/.Simple #/.Unit)
          (#/.Bind _))
-    (////\wrap #Exhaustive)
+    (////\in #Exhaustive)
 
     ## Primitive patterns always have partial coverage because there
     ## are too many possibilities as far as values go.
     (^template []
       [(#/.Simple ( _))
-       (////\wrap #Partial)])
+       (////\in #Partial)])
     ([#/.Nat]
      [#/.Int]
      [#/.Rev]
@@ -116,14 +116,14 @@
     ## "#0", which means it is possible for bit
     ## pattern-matching to become exhaustive if complementary parts meet.
     (#/.Simple (#/.Bit value))
-    (////\wrap (#Bit value))
+    (////\in (#Bit value))
 
     ## Tuple patterns can be exhaustive if there is exhaustiveness for all of
     ## their sub-patterns.
     (#/.Complex (#/.Tuple membersP+))
     (case (list.reverse membersP+)
       (^or #.Nil (#.Cons _ #.Nil))
-      (/.throw ..invalid_tuple_pattern [])
+      (/.except ..invalid_tuple_pattern [])
       
       (#.Cons lastP prevsP+)
       (do ////.monad
@@ -134,10 +134,10 @@
                         [leftC (determine leftP)]
                         (case rightC
                           #Exhaustive
-                          (wrap leftC)
+                          (in leftC)
 
                           _
-                          (wrap (#Seq leftC rightC)))))
+                          (in (#Seq leftC rightC)))))
                     lastC prevsP+)))
 
     ## Variant patterns can be shown to be exhaustive if all the possible
@@ -148,11 +148,11 @@
        #let [idx (if right?
                    (inc lefts)
                    lefts)]]
-      (wrap (#Variant (if right?
-                        (#.Some idx)
-                        #.None)
-                      (|> (dictionary.new n.hash)
-                          (dictionary.put idx value_coverage)))))))
+      (in (#Variant (if right?
+                      (#.Some idx)
+                      #.None)
+                    (|> (dictionary.new n.hash)
+                        (dictionary.put idx value_coverage)))))))
 
 (def: (xor left right)
   (-> Bit Bit Bit)
@@ -221,12 +221,12 @@
   (-> Coverage Coverage (Try Coverage))
   (case [addition so_far]
     [#Partial #Partial]
-    (try\wrap #Partial)
+    (try\in #Partial)
 
     ## 2 bit coverages are exhaustive if they complement one another.
     (^multi [(#Bit sideA) (#Bit sideSF)]
             (xor sideA sideSF))
-    (try\wrap #Exhaustive)
+    (try\in #Exhaustive)
 
     [(#Variant allA casesA) (#Variant allSF casesSF)]
     (let [addition_cases (cases allSF)
@@ -234,10 +234,10 @@
       (cond (and (known_cases? addition_cases)
                  (known_cases? so_far_cases)
                  (not (n.= addition_cases so_far_cases)))
-            (ex.throw ..variants_do_not_match [addition_cases so_far_cases])
+            (ex.except ..variants_do_not_match [addition_cases so_far_cases])
 
             (\ (dictionary.equivalence ..equivalence) = casesSF casesA)
-            (ex.throw ..redundant_pattern [so_far addition])
+            (ex.except ..redundant_pattern [so_far addition])
 
             ## else
             (do {! try.monad}
@@ -247,24 +247,24 @@
                                       (#.Some coverageSF)
                                       (do !
                                         [coverageM (merge coverageA coverageSF)]
-                                        (wrap (dictionary.put tagA coverageM casesSF')))
+                                        (in (dictionary.put tagA coverageM casesSF')))
 
                                       #.None
-                                      (wrap (dictionary.put tagA coverageA casesSF'))))
+                                      (in (dictionary.put tagA coverageA casesSF'))))
                                   casesSF (dictionary.entries casesA))]
-              (wrap (if (and (or (known_cases? addition_cases)
-                                 (known_cases? so_far_cases))
-                             (n.= (inc (n.max addition_cases so_far_cases))
-                                  (dictionary.size casesM))
-                             (list.every? exhaustive? (dictionary.values casesM)))
-                      #Exhaustive
-                      (#Variant (case allSF
-                                  (#.Some _)
-                                  allSF
-
-                                  _
-                                  allA)
-                                casesM))))))
+              (in (if (and (or (known_cases? addition_cases)
+                               (known_cases? so_far_cases))
+                           (n.= (inc (n.max addition_cases so_far_cases))
+                                (dictionary.size casesM))
+                           (list.every? exhaustive? (dictionary.values casesM)))
+                    #Exhaustive
+                    (#Variant (case allSF
+                                (#.Some _)
+                                allSF
+
+                                _
+                                allA)
+                              casesM))))))
 
     [(#Seq leftA rightA) (#Seq leftSF rightSF)]
     (case [(coverage/= leftSF leftA) (coverage/= rightSF rightA)]
@@ -276,40 +276,40 @@
           ## If all that follows is exhaustive, then it can be safely dropped
           ## (since only the "left" part would influence whether the
           ## merged coverage is exhaustive or not).
-          (wrap leftSF)
-          (wrap (#Seq leftSF rightM))))
+          (in leftSF)
+          (in (#Seq leftSF rightM))))
 
       ## Same suffix
       [#0 #1]
       (do try.monad
         [leftM (merge leftA leftSF)]
-        (wrap (#Seq leftM rightA)))
+        (in (#Seq leftM rightA)))
 
       ## The 2 sequences cannot possibly be merged.
       [#0 #0]
-      (try\wrap (#Alt so_far addition))
+      (try\in (#Alt so_far addition))
 
       ## There is nothing the addition adds to the coverage.
       [#1 #1]
-      (ex.throw ..redundant_pattern [so_far addition]))
+      (ex.except ..redundant_pattern [so_far addition]))
 
     ## The addition cannot possibly improve the coverage.
     [_ #Exhaustive]
-    (ex.throw ..redundant_pattern [so_far addition])
+    (ex.except ..redundant_pattern [so_far addition])
 
     ## The addition completes the coverage.
     [#Exhaustive _]
-    (try\wrap #Exhaustive)
+    (try\in #Exhaustive)
     
     ## The left part will always match, so the addition is redundant.
     (^multi [(#Seq left right) single]
             (coverage/= left single))
-    (ex.throw ..redundant_pattern [so_far addition])
+    (ex.except ..redundant_pattern [so_far addition])
 
     ## The right part is not necessary, since it can always match the left.
     (^multi [single (#Seq left right)]
             (coverage/= left single))
-    (try\wrap single)
+    (try\in single)
 
     ## When merging a new coverage against one based on Alt, it may be
     ## that one of the many coverages in the Alt is complementary to
@@ -329,7 +329,7 @@
                             (loop [altsSF possibilitiesSF]
                               (case altsSF
                                 #.Nil
-                                (wrap [#.None (list coverageA)])
+                                (in [#.None (list coverageA)])
                                 
                                 (#.Cons altSF altsSF')
                                 (case (merge coverageA altSF)
@@ -338,13 +338,13 @@
                                     (#Alt _)
                                     (do !
                                       [[success altsSF+] (recur altsSF')]
-                                      (wrap [success (#.Cons altSF altsSF+)]))
+                                      (in [success (#.Cons altSF altsSF+)]))
 
                                     _
-                                    (wrap [(#.Some altMSF) altsSF']))
+                                    (in [(#.Some altMSF) altsSF']))
                                   
                                   (#try.Failure error)
-                                  (try.failure error))
+                                  (#try.Failure error))
                                 ))))]
        [successA possibilitiesSF] (fuse_once addition (flat_alt so_far))]
       (loop [successA successA
@@ -358,9 +358,9 @@
           #.None
           (case (list.reverse possibilitiesSF)
             (#.Cons last prevs)
-            (wrap (list\fold (function (_ left right) (#Alt left right))
-                             last
-                             prevs))
+            (in (list\fold (function (_ left right) (#Alt left right))
+                           last
+                           prevs))
 
             #.Nil
             (undefined)))))
@@ -368,6 +368,6 @@
     _
     (if (coverage/= so_far addition)
       ## The addition cannot possibly improve the coverage.
-      (ex.throw ..redundant_pattern [so_far addition])
+      (ex.except ..redundant_pattern [so_far addition])
       ## There are now 2 alternative paths.
-      (try\wrap (#Alt so_far addition)))))
+      (try\in (#Alt so_far addition)))))
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 1ef5c88c4..7fb985f4b 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
@@ -53,7 +53,7 @@
           (recur unnamedT)
 
           (#.Apply argT funT)
-          (case (type.apply (list argT) funT)
+          (case (type.applied (list argT) funT)
             (#.Some value)
             (recur value)
 
@@ -64,7 +64,7 @@
             [( _)
              (do !
                [[_ instanceT] (//type.with_env )]
-               (recur (maybe.assume (type.apply (list instanceT) expectedT))))])
+               (recur (maybe.assume (type.applied (list instanceT) expectedT))))])
           ([#.UnivQ check.existential]
            [#.ExQ check.var])
           
@@ -85,7 +85,7 @@
                  functionA (recur functionT)
                  _ (//type.with_env
                      (check.check expectedT functionT))]
-                (wrap functionA))
+                (in functionA))
               ))
 
           (#.Function inputT outputT)
@@ -110,4 +110,4 @@
   (<| (/.with_stack ..cannot_apply [functionT functionC argsC+])
       (do ///.monad
         [[applyT argsA+] (//inference.general archive analyse functionT argsC+)])
-      (wrap (/.apply [functionA argsA+]))))
+      (in (/.apply [functionA argsA+]))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/inference.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/inference.lux
index ace669fbe..abdf5b806 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/inference.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/inference.lux
@@ -98,7 +98,7 @@
   (do ///.monad
     [location (///extension.lift meta.location)
      [ex_id _] (//type.with_env check.existential)]
-    (wrap (named_type location ex_id))))
+    (in (named_type location ex_id))))
 
 ## Type-inference works by applying some (potentially quantified) type
 ## to a sequence of values.
@@ -113,7 +113,7 @@
     #.Nil
     (do ///.monad
       [_ (//type.infer inferT)]
-      (wrap [inferT (list)]))
+      (in [inferT (list)]))
     
     (#.Cons argC args')
     (case inferT
@@ -123,31 +123,31 @@
       (#.UnivQ _)
       (do ///.monad
         [[var_id varT] (//type.with_env check.var)]
-        (general archive analyse (maybe.assume (type.apply (list varT) inferT)) args))
+        (general archive analyse (maybe.assume (type.applied (list varT) inferT)) args))
 
       (#.ExQ _)
       (do {! ///.monad}
         [[var_id varT] (//type.with_env check.var)
          output (general archive analyse
-                         (maybe.assume (type.apply (list varT) inferT))
+                         (maybe.assume (type.applied (list varT) inferT))
                          args)
          bound? (//type.with_env
                   (check.bound? var_id))
          _ (if bound?
-             (wrap [])
+             (in [])
              (do !
                [newT new_named_type]
                (//type.with_env
                  (check.check varT newT))))]
-        (wrap output))
+        (in output))
 
       (#.Apply inputT transT)
-      (case (type.apply (list inputT) transT)
+      (case (type.applied (list inputT) transT)
         (#.Some outputT)
         (general archive analyse outputT args)
 
         #.None
-        (/.throw ..invalid_type_application inferT))
+        (/.except ..invalid_type_application inferT))
 
       ## Arguments are inferred back-to-front because, by convention,
       ## Lux functions take the most important arguments *last*, which
@@ -162,7 +162,7 @@
          argA (<| (/.with_stack ..cannot_infer_argument [inputT argC])
                   (//type.with_type inputT)
                   (analyse archive argC))]
-        (wrap [outputT' (list& argA args'A)]))
+        (in [outputT' (list& argA args'A)]))
 
       (#.Var infer_id)
       (do ///.monad
@@ -172,10 +172,10 @@
           (general archive analyse inferT' args)
 
           _
-          (/.throw ..cannot_infer [inferT args])))
+          (/.except ..cannot_infer [inferT args])))
 
       _
-      (/.throw ..cannot_infer [inferT args]))
+      (/.except ..cannot_infer [inferT args]))
     ))
 
 (def: (substitute_bound target sub)
@@ -214,25 +214,25 @@
       [( env bodyT)
        (do ///.monad
          [bodyT+ (record' (n.+ 2 target) originalT bodyT)]
-         (wrap ( env bodyT+)))])
+         (in ( env bodyT+)))])
     ([#.UnivQ]
      [#.ExQ])
 
     (#.Apply inputT funcT)
-    (case (type.apply (list inputT) funcT)
+    (case (type.applied (list inputT) funcT)
       (#.Some outputT)
       (record' target originalT outputT)
 
       #.None
-      (/.throw ..invalid_type_application inferT))
+      (/.except ..invalid_type_application inferT))
 
     (#.Product _)
-    (///\wrap (|> inferT
-                  (type.function (type.flat_tuple inferT))
-                  (substitute_bound target originalT)))
+    (///\in (|> inferT
+                (type.function (type.flat_tuple inferT))
+                (substitute_bound target originalT)))
 
     _
-    (/.throw ..not_a_record_type inferT)))
+    (/.except ..not_a_record_type inferT)))
 
 (def: #export (record inferT)
   (-> Type (Operation Type))
@@ -247,13 +247,13 @@
       (#.Named name unnamedT)
       (do ///.monad
         [unnamedT+ (recur depth unnamedT)]
-        (wrap unnamedT+))
+        (in unnamedT+))
 
       (^template []
         [( env bodyT)
          (do ///.monad
            [bodyT+ (recur (inc depth) bodyT)]
-           (wrap ( env bodyT+)))])
+           (in ( env bodyT+)))])
       ([#.UnivQ]
        [#.ExQ])
 
@@ -266,36 +266,36 @@
                        (n.< boundary tag)))
               (case (list.nth tag cases)
                 (#.Some caseT)
-                (///\wrap (if (n.= 0 depth)
-                            (type.function (list caseT) currentT)
-                            (let [replace' (replace (|> depth dec (n.* 2)) inferT)]
-                              (type.function (list (replace' caseT))
-                                (replace' currentT)))))
+                (///\in (if (n.= 0 depth)
+                          (type.function (list caseT) currentT)
+                          (let [replace' (replace (|> depth dec (n.* 2)) inferT)]
+                            (type.function (list (replace' caseT))
+                              (replace' currentT)))))
 
                 #.None
-                (/.throw ..variant_tag_out_of_bounds [expected_size tag inferT]))
+                (/.except ..variant_tag_out_of_bounds [expected_size tag inferT]))
               
               (n.< expected_size actual_size)
-              (/.throw ..smaller_variant_than_expected [expected_size actual_size])
+              (/.except ..smaller_variant_than_expected [expected_size actual_size])
 
               (n.= boundary tag)
               (let [caseT (type.variant (list.drop boundary cases))]
-                (///\wrap (if (n.= 0 depth)
-                            (type.function (list caseT) currentT)
-                            (let [replace' (replace (|> depth dec (n.* 2)) inferT)]
-                              (type.function (list (replace' caseT))
-                                (replace' currentT))))))
+                (///\in (if (n.= 0 depth)
+                          (type.function (list caseT) currentT)
+                          (let [replace' (replace (|> depth dec (n.* 2)) inferT)]
+                            (type.function (list (replace' caseT))
+                              (replace' currentT))))))
               
               ## else
-              (/.throw ..variant_tag_out_of_bounds [expected_size tag inferT])))
+              (/.except ..variant_tag_out_of_bounds [expected_size tag inferT])))
 
       (#.Apply inputT funcT)
-      (case (type.apply (list inputT) funcT)
+      (case (type.applied (list inputT) funcT)
         (#.Some outputT)
         (variant tag expected_size outputT)
 
         #.None
-        (/.throw ..invalid_type_application inferT))
+        (/.except ..invalid_type_application inferT))
 
       _
-      (/.throw ..not_a_variant_type inferT))))
+      (/.except ..not_a_variant_type inferT))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux
index 94b289a08..1ae1152bd 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux
@@ -93,7 +93,7 @@
                         []]))
        
        (#.Some old)
-       (/.throw' cannot_set_module_annotations_more_than_once [self_name old annotations])))))
+       (/.except' cannot_set_module_annotations_more_than_once [self_name old annotations])))))
 
 (def: #export (import module)
   (-> Text (Operation Any))
@@ -151,7 +151,7 @@
                         []])
 
          (#.Some already_existing)
-         ((/.throw' ..cannot_define_more_than_once [[self_name name] already_existing]) state))))))
+         ((/.except' ..cannot_define_more_than_once [[self_name name] already_existing]) state))))))
 
 (def: #export (create hash name)
   (-> Nat Text (Operation Any))
@@ -168,8 +168,8 @@
     [_ (create hash name)
      output (/.with_current_module name
               action)
-     module (///extension.lift (meta.find_module name))]
-    (wrap [module output])))
+     module (///extension.lift (meta.module name))]
+    (in [module output])))
 
 (template [  ]
   [(def: #export ( module_name)
@@ -186,11 +186,11 @@
                                       (plist.put module_name (set@ #.module_state  module))
                                       state)
                              []])
-              ((/.throw' can_only_change_state_of_active_module [module_name ])
+              ((/.except' can_only_change_state_of_active_module [module_name ])
                state)))
 
           #.None
-          ((/.throw' unknown_module module_name) state)))))
+          ((/.except' unknown_module module_name) state)))))
    
    (def: #export ( module_name)
      (-> Text (Operation Bit))
@@ -204,7 +204,7 @@
                            _     #0)])
 
           #.None
-          ((/.throw' unknown_module module_name) state)))))]
+          ((/.except' unknown_module module_name) state)))))]
 
   [set_active   active?   #.Active]
   [set_compiled compiled? #.Compiled]
@@ -221,7 +221,7 @@
           (#try.Success [state (get@  module)])
 
           #.None
-          ((/.throw' unknown_module module_name) state)))))]
+          ((/.except' unknown_module module_name) state)))))]
 
   [tags  #.tags        (List [Text [Nat (List Name) Bit Type]])]
   [types #.types       (List [Text [(List Name) Bit Type]])]
@@ -236,12 +236,12 @@
                   (function (_ tag)
                     (case (plist.get tag bindings)
                       #.None
-                      (wrap [])
+                      (in [])
 
                       (#.Some _)
-                      (/.throw ..cannot_declare_tag_twice [module_name tag])))
+                      (/.except ..cannot_declare_tag_twice [module_name tag])))
                   tags)]
-    (wrap [])))
+    (in [])))
 
 (def: #export (declare_tags tags exported? type)
   (-> (List Tag) Bit Type (Operation Any))
@@ -249,10 +249,10 @@
     [self_name (///extension.lift meta.current_module_name)
      [type_module type_name] (case type
                                (#.Named type_name _)
-                               (wrap type_name)
+                               (in type_name)
 
                                _
-                               (/.throw ..cannot_declare_tags_for_unnamed_type [tags type]))
+                               (/.except ..cannot_declare_tags_for_unnamed_type [tags type]))
      _ (ensure_undeclared_tags self_name tags)
      _ (///.assert cannot_declare_tags_for_foreign_type [tags type]
                    (text\= self_name type_module))]
@@ -272,4 +272,4 @@
                                    state)
                           []]))
          #.None
-         ((/.throw' unknown_module self_name) state))))))
+         ((/.except' unknown_module self_name) state))))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/primitive.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/primitive.lux
index 27c4d98f4..4840dca2a 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/primitive.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/primitive.lux
@@ -16,7 +16,7 @@
      (->  (Operation Analysis))
      (do ///.monad
        [_ (//type.infer )]
-       (wrap (#/.Primitive ( value)))))]
+       (in (#/.Primitive ( value)))))]
 
   [bit  .Bit  #/.Bit]
   [nat  .Nat  #/.Nat]
@@ -30,4 +30,4 @@
   (Operation Analysis)
   (do ///.monad
     [_ (//type.infer .Any)]
-    (wrap (#/.Primitive #/.Unit))))
+    (in (#/.Primitive #/.Unit))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/reference.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/reference.lux
index 4e085a6b9..25f478f04 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/reference.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/reference.lux
@@ -31,9 +31,9 @@
 
 (def: (definition def_name)
   (-> Name (Operation Analysis))
-  (with_expansions [ (wrap (|> def_name ///reference.constant #/.Reference))]
+  (with_expansions [ (in (|> def_name ///reference.constant #/.Reference))]
     (do {! ///.monad}
-      [constant (///extension.lift (meta.find_def def_name))]
+      [constant (///extension.lift (meta.definition def_name))]
       (case constant
         (#.Left real_def_name)
         (definition real_def_name)
@@ -50,8 +50,8 @@
                 [imported! (///extension.lift (meta.imported_by? ::module current))]
                 (if imported!
                   
-                  (/.throw foreign_module_has_not_been_imported [current ::module])))
-              (/.throw definition_has_not_been_exported def_name))))))))
+                  (/.except foreign_module_has_not_been_imported [current ::module])))
+              (/.except definition_has_not_been_exported def_name))))))))
 
 (def: (variable var_name)
   (-> Text (Operation (Maybe Analysis)))
@@ -61,10 +61,10 @@
       (#.Some [actualT ref])
       (do !
         [_ (//type.infer actualT)]
-        (wrap (#.Some (|> ref ///reference.variable #/.Reference))))
+        (in (#.Some (|> ref ///reference.variable #/.Reference))))
 
       #.None
-      (wrap #.None))))
+      (in #.None))))
 
 (def: #export (reference reference)
   (-> Name (Operation Analysis))
@@ -74,7 +74,7 @@
       [?var (variable simple_name)]
       (case ?var
         (#.Some varA)
-        (wrap varA)
+        (in varA)
 
         #.None
         (do !
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 c0e598e06..ab202ed61 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
@@ -129,13 +129,13 @@
                              output]))
 
             _
-            (exception.throw ..invalid_scope_alteration []))
+            (exception.except ..invalid_scope_alteration []))
 
           (#try.Failure error)
           (#try.Failure error)))
 
       _
-      (exception.throw ..cannot_create_local_binding_without_a_scope []))
+      (exception.except ..cannot_create_local_binding_without_a_scope []))
     ))
 
 (template [ ]
@@ -188,7 +188,7 @@
        (#try.Success [state (get@ [#.locals #.counter] top)])
 
        #.Nil
-       (exception.throw ..cannot_get_next_reference_when_there_is_no_scope [])))))
+       (exception.except ..cannot_get_next_reference_when_there_is_no_scope [])))))
 
 (def: (ref_to_variable ref)
   (-> Ref Variable)
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 ca42337d5..449ac9606 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
@@ -107,10 +107,10 @@
                 (do !
                   [valueA (//type.with_type variant_type
                             (analyse archive valueC))]
-                  (wrap (/.variant [lefts right? valueA])))
+                  (in (/.variant [lefts right? valueA])))
 
                 #.None
-                (/.throw //inference.variant_tag_out_of_bounds [(list.size flat) tag expectedT])))
+                (/.except //inference.variant_tag_out_of_bounds [(list.size flat) tag expectedT])))
 
             (#.Named name unnamedT)
             (//type.with_type unnamedT
@@ -129,13 +129,13 @@
                 ## This is because there is no way of knowing how many
                 ## cases the inferred sum type would have.
                 _
-                (/.throw ..cannot_infer_numeric_tag [expectedT tag valueC])))
+                (/.except ..cannot_infer_numeric_tag [expectedT tag valueC])))
 
             (^template [ ]
               [( _)
                (do !
                  [[instance_id instanceT] (//type.with_env )]
-                 (//type.with_type (maybe.assume (type.apply (list instanceT) expectedT))
+                 (//type.with_type (maybe.assume (type.applied (list instanceT) expectedT))
                    (recur valueC)))])
             ([#.UnivQ check.existential]
              [#.ExQ check.var])
@@ -151,19 +151,19 @@
                     (recur valueC))
 
                   _
-                  (/.throw ..invalid_variant_type [expectedT tag valueC])))
+                  (/.except ..invalid_variant_type [expectedT tag valueC])))
 
               _
-              (case (type.apply (list inputT) funT)
+              (case (type.applied (list inputT) funT)
                 (#.Some outputT)
                 (//type.with_type outputT
                   (recur valueC))
 
                 #.None
-                (/.throw ..not_a_quantified_type funT)))
+                (/.except ..not_a_quantified_type funT)))
             
             _
-            (/.throw ..invalid_variant_type [expectedT tag valueC])))))))
+            (/.except ..invalid_variant_type [expectedT tag valueC])))))))
 
 (def: (typed_product archive analyse members)
   (-> Archive Phase (List Code) (Operation Analysis))
@@ -186,11 +186,11 @@
                         [memberA (//type.with_type memberT
                                    (analyse archive memberC))
                          memberA+ (recur membersT+' membersC+')]
-                        (wrap (#.Cons memberA memberA+)))
+                        (in (#.Cons memberA memberA+)))
 
                       _
-                      (/.throw ..cannot_analyse_tuple [expectedT members]))))]
-    (wrap (/.tuple membersA+))))
+                      (/.except ..cannot_analyse_tuple [expectedT members]))))]
+    (in (/.tuple membersA+))))
 
 (def: #export (product archive analyse membersC)
   (-> Archive Phase (List Code) (Operation Analysis))
@@ -222,13 +222,13 @@
                _ (//type.with_env
                    (check.check expectedT
                                 (type.tuple (list\map product.left membersTA))))]
-              (wrap (/.tuple (list\map product.right membersTA))))))
+              (in (/.tuple (list\map product.right membersTA))))))
 
         (^template [ ]
           [( _)
            (do !
              [[instance_id instanceT] (//type.with_env )]
-             (//type.with_type (maybe.assume (type.apply (list instanceT) expectedT))
+             (//type.with_type (maybe.assume (type.applied (list instanceT) expectedT))
                (product archive analyse membersC)))])
         ([#.UnivQ check.existential]
          [#.ExQ check.var])
@@ -244,19 +244,19 @@
                 (product archive analyse membersC))
 
               _
-              (/.throw ..invalid_tuple_type [expectedT membersC])))
+              (/.except ..invalid_tuple_type [expectedT membersC])))
 
           _
-          (case (type.apply (list inputT) funT)
+          (case (type.applied (list inputT) funT)
             (#.Some outputT)
             (//type.with_type outputT
               (product archive analyse membersC))
 
             #.None
-            (/.throw ..not_a_quantified_type funT)))
+            (/.except ..not_a_quantified_type funT)))
         
         _
-        (/.throw ..invalid_tuple_type [expectedT membersC])
+        (/.except ..invalid_tuple_type [expectedT membersC])
         ))))
 
 (def: #export (tagged_sum analyse tag archive valueC)
@@ -272,7 +272,7 @@
       (do !
         [inferenceT (//inference.variant idx case_size variantT)
          [inferredT valueA+] (//inference.general archive analyse inferenceT (list valueC))]
-        (wrap (/.variant [lefts right? (|> valueA+ list.head maybe.assume)])))
+        (in (/.variant [lefts right? (|> valueA+ list.head maybe.assume)])))
 
       _
       (..sum analyse lefts right? archive valueC))))
@@ -289,10 +289,10 @@
                  [_ (#.Tag key)]
                  (do ///.monad
                    [key (///extension.lift (meta.normal key))]
-                   (wrap [key val]))
+                   (in [key val]))
 
                  _
-                 (/.throw ..record_keys_must_be_tags [key record])))
+                 (/.except ..record_keys_must_be_tags [key record])))
              record))
 
 ## Lux already possesses the means to analyse tuples, so
@@ -303,7 +303,7 @@
   (case record
     ## empty_record = empty_tuple = unit = []
     #.Nil
-    (\ ///.monad wrap [(list) Any])
+    (\ ///.monad in [(list) Any])
 
     (#.Cons [head_k head_v] _)
     (do {! ///.monad}
@@ -312,8 +312,8 @@
        #let [size_record (list.size record)
              size_ts (list.size tag_set)]
        _ (if (n.= size_ts size_record)
-           (wrap [])
-           (/.throw ..record_size_mismatch [size_ts size_record recordT record]))
+           (in [])
+           (/.except ..record_size_mismatch [size_ts size_record recordT record]))
        #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 !
@@ -323,17 +323,17 @@
                                 (case (dictionary.get key tag->idx)
                                   (#.Some idx)
                                   (if (dictionary.key? idx->val idx)
-                                    (/.throw ..cannot_repeat_tag [key record])
-                                    (wrap (dictionary.put idx val idx->val)))
+                                    (/.except ..cannot_repeat_tag [key record])
+                                    (in (dictionary.put idx val idx->val)))
 
                                   #.None
-                                  (/.throw ..tag_does_not_belong_to_record [key recordT]))))
+                                  (/.except ..tag_does_not_belong_to_record [key recordT]))))
                             (: (Dictionary Nat Code)
                                (dictionary.new n.hash))
                             record)
        #let [ordered_tuple (list\map (function (_ idx) (maybe.assume (dictionary.get idx idx->val)))
                                      tuple_range)]]
-      (wrap [ordered_tuple recordT]))
+      (in [ordered_tuple recordT]))
     ))
 
 (def: #export (record archive analyse members)
@@ -355,7 +355,7 @@
         (do !
           [inferenceT (//inference.record recordT)
            [inferredT membersA] (//inference.general archive analyse inferenceT membersC)]
-          (wrap (/.tuple membersA)))
+          (in (/.tuple membersA)))
 
         _
         (..product archive analyse membersC)))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/type.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/type.lux
index c9227aa31..f530c80ae 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/type.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/type.lux
@@ -53,4 +53,4 @@
               action)
      knownT (..with_env
               (check.clean varT))]
-    (wrap [knownT output])))
+    (in [knownT output])))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/directive.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/directive.lux
index 882ac3a6e..ef7cffba4 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/directive.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/directive.lux
@@ -54,17 +54,17 @@
                           (case macroA
                             (^ (///analysis.constant macro_name))
                             (do !
-                              [?macro (//extension.lift (meta.find_macro macro_name))
+                              [?macro (//extension.lift (meta.macro macro_name))
                                macro (case ?macro
                                        (#.Some macro)
-                                       (wrap macro)
+                                       (in macro)
                                        
                                        #.None
-                                       (//.throw ..macro_was_not_found macro_name))]
+                                       (//.except ..macro_was_not_found macro_name))]
                               (//extension.lift (///analysis/macro.expand expander macro_name macro inputs)))
                             
                             _
-                            (//.throw ..invalid_macro_call code))))]
+                            (//.except ..invalid_macro_call code))))]
             (case expansion
               (^ (list&  referrals))
               (|> (recur archive )
@@ -76,4 +76,4 @@
                   (\ ! map (list\fold /.merge_requirements /.no_requirements)))))
 
           _
-          (//.throw ..not_a_directive code))))))
+          (//.except ..not_a_directive code))))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux
index fd30c45d2..d0f8db7c5 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux
@@ -96,7 +96,7 @@
                      []])
 
       _
-      (exception.throw ..cannot_overwrite name))))
+      (exception.except ..cannot_overwrite name))))
 
 (def: #export (with extender extensions)
   (All [s i o]
@@ -118,7 +118,7 @@
        stateE)
 
       #.None
-      (exception.throw ..unknown [name bundle]))))
+      (exception.except ..unknown [name bundle]))))
 
 (def: #export (localized get set transform)
   (All [s s' i o v]
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 5660a2a85..4f185f810 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
@@ -38,7 +38,7 @@
                    (phase archive lengthC))
          [var_id varT] (analysis/type.with_env check.var)
          _ (analysis/type.infer (type (Array varT)))]
-        (wrap (#analysis.Extension extension (list lengthA)))))]))
+        (in (#analysis.Extension extension (list lengthA)))))]))
 
 (def: array::length
   Handler
@@ -50,7 +50,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer Nat)]
-        (wrap (#analysis.Extension extension (list arrayA)))))]))
+        (in (#analysis.Extension extension (list arrayA)))))]))
 
 (def: array::read
   Handler
@@ -64,7 +64,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer varT)]
-        (wrap (#analysis.Extension extension (list indexA arrayA)))))]))
+        (in (#analysis.Extension extension (list indexA arrayA)))))]))
 
 (def: array::write
   Handler
@@ -80,7 +80,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer (type (Array varT)))]
-        (wrap (#analysis.Extension extension (list indexA valueA arrayA)))))]))
+        (in (#analysis.Extension extension (list indexA valueA arrayA)))))]))
 
 (def: array::delete
   Handler
@@ -94,7 +94,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer (type (Array varT)))]
-        (wrap (#analysis.Extension extension (list indexA arrayA)))))]))
+        (in (#analysis.Extension extension (list indexA arrayA)))))]))
 
 (def: bundle::array
   Bundle
@@ -117,7 +117,7 @@
                         (phase archive constructorC))
          inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
          _ (analysis/type.infer .Any)]
-        (wrap (#analysis.Extension extension (list& constructorA inputsA)))))]))
+        (in (#analysis.Extension extension (list& constructorA inputsA)))))]))
 
 (def: object::get
   Handler
@@ -128,8 +128,8 @@
         [objectA (analysis/type.with_type Any
                    (phase archive objectC))
          _ (analysis/type.infer .Any)]
-        (wrap (#analysis.Extension extension (list (analysis.text fieldC)
-                                                   objectA)))))]))
+        (in (#analysis.Extension extension (list (analysis.text fieldC)
+                                                 objectA)))))]))
 
 (def: object::do
   Handler
@@ -141,9 +141,9 @@
                    (phase archive objectC))
          inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
          _ (analysis/type.infer .Any)]
-        (wrap (#analysis.Extension extension (list& (analysis.text methodC)
-                                                    objectA
-                                                    inputsA)))))]))
+        (in (#analysis.Extension extension (list& (analysis.text methodC)
+                                                  objectA
+                                                  inputsA)))))]))
 
 (def: bundle::object
   Bundle
@@ -165,7 +165,7 @@
     (function (_ extension phase archive name)
       (do phase.monad
         [_ (analysis/type.infer Any)]
-        (wrap (#analysis.Extension extension (list (analysis.text name))))))]))
+        (in (#analysis.Extension extension (list (analysis.text name))))))]))
 
 (def: js::apply
   Handler
@@ -177,7 +177,7 @@
                         (phase archive abstractionC))
          inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
          _ (analysis/type.infer Any)]
-        (wrap (#analysis.Extension extension (list& abstractionA inputsA)))))]))
+        (in (#analysis.Extension extension (list& abstractionA inputsA)))))]))
 
 (def: js::type_of
   Handler
@@ -188,7 +188,7 @@
         [objectA (analysis/type.with_type Any
                    (phase archive objectC))
          _ (analysis/type.infer .Text)]
-        (wrap (#analysis.Extension extension (list objectA)))))]))
+        (in (#analysis.Extension extension (list objectA)))))]))
 
 (def: js::function
   Handler
@@ -201,8 +201,8 @@
                         (phase archive abstractionC))
          _ (analysis/type.infer (for {@.js ffi.Function}
                                      Any))]
-        (wrap (#analysis.Extension extension (list (analysis.nat arity)
-                                                   abstractionA)))))]))
+        (in (#analysis.Extension extension (list (analysis.nat arity)
+                                                 abstractionA)))))]))
 
 (def: #export bundle
   Bundle
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 bd49944a1..6ff584f36 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
@@ -352,12 +352,12 @@
     (jvm_type anonymousT)
     
     (#.Apply inputT abstractionT)
-    (case (type.apply (list inputT) abstractionT)
+    (case (type.applied (list inputT) abstractionT)
       (#.Some outputT)
       (jvm_type outputT)
 
       #.None
-      (/////analysis.throw ..non_jvm_type luxT))
+      (/////analysis.except ..non_jvm_type luxT))
 
     (^ (#.Primitive (static array.type_name) (list elemT)))
     (phase\map jvm.array (jvm_type elemT))
@@ -367,10 +367,10 @@
       (#.Some [_ primitive_type])
       (case parametersT
         #.Nil
-        (phase\wrap primitive_type)
+        (phase\in primitive_type)
 
         _
-        (/////analysis.throw ..primitives_cannot_have_type_parameters class))
+        (/////analysis.except ..primitives_cannot_have_type_parameters class))
 
       #.None
       (do {! phase.monad}
@@ -381,18 +381,18 @@
                                         [parameterJT (jvm_type parameterT)]
                                         (case (jvm_parser.parameter? parameterJT)
                                           (#.Some parameterJT)
-                                          (wrap parameterJT)
+                                          (in parameterJT)
                                           
                                           #.None
-                                          (/////analysis.throw ..non_parameter parameterT))))
+                                          (/////analysis.except ..non_parameter parameterT))))
                                     parametersT))]
-        (wrap (jvm.class class parametersJT))))
+        (in (jvm.class class parametersJT))))
 
     (#.Ex _)
-    (phase\wrap (jvm.class ..object_class (list)))
+    (phase\in (jvm.class ..object_class (list)))
     
     _
-    (/////analysis.throw ..non_jvm_type luxT)))
+    (/////analysis.except ..non_jvm_type luxT)))
 
 (def: (jvm_array_type objectT)
   (-> .Type (Operation (Type Array)))
@@ -414,10 +414,10 @@
                                                   ..reflection)
                                               (list))
                   (analyse archive arrayC))]
-        (wrap (#/////analysis.Extension extension_name (list arrayA))))
+        (in (#/////analysis.Extension extension_name (list arrayA))))
 
       _
-      (/////analysis.throw ///.incorrect_arity [extension_name 1 (list.size args)]))))
+      (/////analysis.except ///.incorrect_arity [extension_name 1 (list.size args)]))))
 
 (def: array::length::object
   Handler
@@ -431,11 +431,11 @@
                   (analyse archive arrayC))
          varT (typeA.with_env (check.clean varT))
          arrayJT (jvm_array_type (.type (array.Array varT)))]
-        (wrap (#/////analysis.Extension extension_name (list (/////analysis.text (..signature arrayJT))
-                                                             arrayA))))
+        (in (#/////analysis.Extension extension_name (list (/////analysis.text (..signature arrayJT))
+                                                           arrayA))))
 
       _
-      (/////analysis.throw ///.incorrect_arity [extension_name 1 (list.size args)]))))
+      (/////analysis.except ///.incorrect_arity [extension_name 1 (list.size args)]))))
 
 (def: (new_primitive_array_handler primitive_type)
   (-> (Type Primitive) Handler)
@@ -447,10 +447,10 @@
                    (analyse archive lengthC))
          _ (typeA.infer (#.Primitive (|> (jvm.array primitive_type) ..reflection)
                                      (list)))]
-        (wrap (#/////analysis.Extension extension_name (list lengthA))))
+        (in (#/////analysis.Extension extension_name (list lengthA))))
 
       _
-      (/////analysis.throw ///.incorrect_arity [extension_name 1 (list.size args)]))))
+      (/////analysis.except ///.incorrect_arity [extension_name 1 (list.size args)]))))
 
 (def: array::new::object
   Handler
@@ -464,22 +464,22 @@
          expectedJT (jvm_array_type expectedT)
          elementJT (case (jvm_parser.array? expectedJT)
                      (#.Some elementJT)
-                     (wrap elementJT)
+                     (in elementJT)
                      
                      #.None
-                     (/////analysis.throw ..non_array expectedT))]
-        (wrap (#/////analysis.Extension extension_name (list (/////analysis.text (..signature elementJT))
-                                                             lengthA))))
+                     (/////analysis.except ..non_array expectedT))]
+        (in (#/////analysis.Extension extension_name (list (/////analysis.text (..signature elementJT))
+                                                           lengthA))))
 
       _
-      (/////analysis.throw ///.incorrect_arity [extension_name 1 (list.size args)]))))
+      (/////analysis.except ///.incorrect_arity [extension_name 1 (list.size args)]))))
 
 (def: (check_parameter objectT)
   (-> .Type (Operation (Type Parameter)))
   (case objectT
     (^ (#.Primitive (static array.type_name)
                     (list elementT)))
-    (/////analysis.throw ..non_parameter objectT)
+    (/////analysis.except ..non_parameter objectT)
     
     (#.Primitive name parameters)
     (`` (cond (or (~~ (template []
@@ -494,17 +494,17 @@
                         [jvm.double]
                         [jvm.char]))
                   (text.starts_with? descriptor.array_prefix name))
-              (/////analysis.throw ..non_parameter objectT)
+              (/////analysis.except ..non_parameter objectT)
 
               ## else
-              (phase\wrap (jvm.class name (list)))))
+              (phase\in (jvm.class name (list)))))
 
     (#.Named name anonymous)
     (check_parameter anonymous)
 
     (^template []
       [( id)
-       (phase\wrap (jvm.class ..object_class (list)))])
+       (phase\in (jvm.class ..object_class (list)))])
     ([#.Var]
      [#.Ex])
 
@@ -515,15 +515,15 @@
      [#.ExQ])
 
     (#.Apply inputT abstractionT)
-    (case (type.apply (list inputT) abstractionT)
+    (case (type.applied (list inputT) abstractionT)
       (#.Some outputT)
       (check_parameter outputT)
 
       #.None
-      (/////analysis.throw ..non_parameter objectT))
+      (/////analysis.except ..non_parameter objectT))
 
     _
-    (/////analysis.throw ..non_parameter objectT)))
+    (/////analysis.except ..non_parameter objectT)))
 
 (def: (check_jvm objectT)
   (-> .Type (Operation (Type Value)))
@@ -531,7 +531,7 @@
     (#.Primitive name #.Nil)
     (`` (cond (~~ (template []
                     [(text\= (..reflection ) name)
-                     (phase\wrap )]
+                     (phase\in )]
 
                     [jvm.boolean]
                     [jvm.byte]
@@ -544,7 +544,7 @@
 
               (~~ (template []
                     [(text\= (..reflection (jvm.array )) name)
-                     (phase\wrap (jvm.array ))]
+                     (phase\in (jvm.array ))]
 
                     [jvm.boolean]
                     [jvm.byte]
@@ -561,7 +561,7 @@
                    (check_jvm (#.Primitive unprefixed (list)))))
 
               ## else
-              (phase\wrap (jvm.class name (list)))))
+              (phase\in (jvm.class name (list)))))
     
     (^ (#.Primitive (static array.type_name)
                     (list elementT)))
@@ -572,7 +572,7 @@
     (#.Primitive name parameters)
     (do {! phase.monad}
       [parameters (monad.map ! check_parameter parameters)]
-      (phase\wrap (jvm.class name parameters)))
+      (phase\in (jvm.class name parameters)))
 
     (#.Named name anonymous)
     (check_jvm anonymous)
@@ -584,12 +584,12 @@
      [#.ExQ])
 
     (#.Apply inputT abstractionT)
-    (case (type.apply (list inputT) abstractionT)
+    (case (type.applied (list inputT) abstractionT)
       (#.Some outputT)
       (check_jvm outputT)
 
       #.None
-      (/////analysis.throw ..non_object objectT))
+      (/////analysis.except ..non_object objectT))
 
     _
     (check_parameter objectT)))
@@ -599,13 +599,13 @@
   (do {! phase.monad}
     [name (\ ! map ..reflection (check_jvm objectT))]
     (if (dictionary.key? ..boxes name)
-      (/////analysis.throw ..primitives_are_not_objects [name])
-      (phase\wrap name))))
+      (/////analysis.except ..primitives_are_not_objects [name])
+      (phase\in name))))
 
 (def: (check_return type)
   (-> .Type (Operation (Type Return)))
   (if (is? .Any type)
-    (phase\wrap jvm.void)
+    (phase\in jvm.void)
     (check_jvm type)))
 
 (def: (read_primitive_array_handler lux_type jvm_type)
@@ -620,10 +620,10 @@
          arrayA (typeA.with_type (#.Primitive (|> (jvm.array jvm_type) ..reflection)
                                               (list))
                   (analyse archive arrayC))]
-        (wrap (#/////analysis.Extension extension_name (list idxA arrayA))))
+        (in (#/////analysis.Extension extension_name (list idxA arrayA))))
 
       _
-      (/////analysis.throw ///.incorrect_arity [extension_name 2 (list.size args)]))))
+      (/////analysis.except ///.incorrect_arity [extension_name 2 (list.size args)]))))
 
 (def: array::read::object
   Handler
@@ -640,12 +640,12 @@
          arrayJT (jvm_array_type (.type (array.Array varT)))
          idxA (typeA.with_type ..int
                 (analyse archive idxC))]
-        (wrap (#/////analysis.Extension extension_name (list (/////analysis.text (..signature arrayJT))
-                                                             idxA
-                                                             arrayA))))
+        (in (#/////analysis.Extension extension_name (list (/////analysis.text (..signature arrayJT))
+                                                           idxA
+                                                           arrayA))))
 
       _
-      (/////analysis.throw ///.incorrect_arity [extension_name 2 (list.size args)]))))
+      (/////analysis.except ///.incorrect_arity [extension_name 2 (list.size args)]))))
 
 (def: (write_primitive_array_handler lux_type jvm_type)
   (-> .Type (Type Primitive) Handler)
@@ -662,12 +662,12 @@
                     (analyse archive valueC))
            arrayA (typeA.with_type array_type
                     (analyse archive arrayC))]
-          (wrap (#/////analysis.Extension extension_name (list idxA
-                                                               valueA
-                                                               arrayA))))
+          (in (#/////analysis.Extension extension_name (list idxA
+                                                             valueA
+                                                             arrayA))))
 
         _
-        (/////analysis.throw ///.incorrect_arity [extension_name 3 (list.size args)])))))
+        (/////analysis.except ///.incorrect_arity [extension_name 3 (list.size args)])))))
 
 (def: array::write::object
   Handler
@@ -686,13 +686,13 @@
                 (analyse archive idxC))
          valueA (typeA.with_type varT
                   (analyse archive valueC))]
-        (wrap (#/////analysis.Extension extension_name (list (/////analysis.text (..signature arrayJT))
-                                                             idxA
-                                                             valueA
-                                                             arrayA))))
+        (in (#/////analysis.Extension extension_name (list (/////analysis.text (..signature arrayJT))
+                                                           idxA
+                                                           valueA
+                                                           arrayA))))
 
       _
-      (/////analysis.throw ///.incorrect_arity [extension_name 3 (list.size args)]))))
+      (/////analysis.except ///.incorrect_arity [extension_name 3 (list.size args)]))))
 
 (def: bundle::array
   Bundle
@@ -752,10 +752,10 @@
       (do phase.monad
         [expectedT (///.lift meta.expected_type)
          _ (check_object expectedT)]
-        (wrap (#/////analysis.Extension extension_name (list))))
+        (in (#/////analysis.Extension extension_name (list))))
 
       _
-      (/////analysis.throw ///.incorrect_arity [extension_name 0 (list.size args)]))))
+      (/////analysis.except ///.incorrect_arity [extension_name 0 (list.size args)]))))
 
 (def: object::null?
   Handler
@@ -767,10 +767,10 @@
          [objectT objectA] (typeA.with_inference
                              (analyse archive objectC))
          _ (check_object objectT)]
-        (wrap (#/////analysis.Extension extension_name (list objectA))))
+        (in (#/////analysis.Extension extension_name (list objectA))))
 
       _
-      (/////analysis.throw ///.incorrect_arity [extension_name 1 (list.size args)]))))
+      (/////analysis.except ///.incorrect_arity [extension_name 1 (list.size args)]))))
 
 (def: object::synchronized
   Handler
@@ -782,10 +782,10 @@
                                (analyse archive monitorC))
          _ (check_object monitorT)
          exprA (analyse archive exprC)]
-        (wrap (#/////analysis.Extension extension_name (list monitorA exprA))))
+        (in (#/////analysis.Extension extension_name (list monitorA exprA))))
 
       _
-      (/////analysis.throw ///.incorrect_arity [extension_name 2 (list.size args)]))))
+      (/////analysis.except ///.incorrect_arity [extension_name 2 (list.size args)]))))
 
 (def: (object::throw class_loader)
   (-> java/lang/ClassLoader Handler)
@@ -800,12 +800,12 @@
          ? (phase.lift (reflection!.sub? class_loader "java.lang.Throwable" exception_class))
          _ (: (Operation Any)
               (if ?
-                (wrap [])
-                (/////analysis.throw non_throwable exception_class)))]
-        (wrap (#/////analysis.Extension extension_name (list exceptionA))))
+                (in [])
+                (/////analysis.except non_throwable exception_class)))]
+        (in (#/////analysis.Extension extension_name (list exceptionA))))
 
       _
-      (/////analysis.throw ///.incorrect_arity [extension_name 1 (list.size args)]))))
+      (/////analysis.except ///.incorrect_arity [extension_name 1 (list.size args)]))))
 
 (def: (object::class class_loader)
   (-> java/lang/ClassLoader Handler)
@@ -818,13 +818,13 @@
           [_ (..ensure_fresh_class! class_loader class)
            _ (typeA.infer (#.Primitive "java.lang.Class" (list (#.Primitive class (list)))))
            _ (phase.lift (reflection!.load class_loader class))]
-          (wrap (#/////analysis.Extension extension_name (list (/////analysis.text class)))))
+          (in (#/////analysis.Extension extension_name (list (/////analysis.text class)))))
 
         _
-        (/////analysis.throw ///.invalid_syntax [extension_name %.code args]))
+        (/////analysis.except ///.invalid_syntax [extension_name %.code args]))
 
       _
-      (/////analysis.throw ///.incorrect_arity [extension_name 1 (list.size args)]))))
+      (/////analysis.except ///.incorrect_arity [extension_name 1 (list.size args)]))))
 
 (def: (object::instance? class_loader)
   (-> java/lang/ClassLoader Handler)
@@ -839,8 +839,8 @@
          object_class (check_object objectT)
          ? (phase.lift (reflection!.sub? class_loader object_class sub_class))]
         (if ?
-          (wrap (#/////analysis.Extension extension_name (list (/////analysis.text sub_class) objectA)))
-          (/////analysis.throw cannot_possibly_be_an_instance (format sub_class " !<= "  object_class)))))]))
+          (in (#/////analysis.Extension extension_name (list (/////analysis.text sub_class) objectA)))
+          (/////analysis.except cannot_possibly_be_an_instance (format sub_class " !<= "  object_class)))))]))
 
 (template [  ]
   [(def: #export ( mapping typeJ)
@@ -871,7 +871,7 @@
                     #let [super_name (|> superJT ..reflection)]
                     super_class (phase.lift (reflection!.load class_loader super_name))
                     superT (reflection_type mapping superJT)]
-                   (wrap [[super_name superT] (java/lang/Class::isAssignableFrom super_class to_class)])))
+                   (in [[super_name superT] (java/lang/Class::isAssignableFrom super_class to_class)])))
                (case (java/lang/Class::getGenericSuperclass from_class)
                  (#.Some super)
                  (list& super (array.to_list (java/lang/Class::getGenericInterfaces from_class)))
@@ -891,12 +891,12 @@
                  (do {! phase.monad}
                    [super_name (\ ! map ..reflection (check_jvm superT))
                     super_class (phase.lift (reflection!.load class_loader super_name))]
-                   (wrap [[super_name superT]
-                          (java/lang/Class::isAssignableFrom super_class to_class)])))
+                   (in [[super_name superT]
+                        (java/lang/Class::isAssignableFrom super_class to_class)])))
                (list& super_classT super_interfacesT+))
 
     _
-    (/////analysis.throw ..cannot_cast [fromT toT fromC])))
+    (/////analysis.except ..cannot_cast [fromT toT fromC])))
 
 (def: (object::cast class_loader)
   (-> java/lang/ClassLoader Handler)
@@ -917,7 +917,7 @@
                                                       (text\= =primitive to_name)))
                                              (and (text\=  from_name)
                                                   (text\= =primitive to_name))))
-                                       (wrap true)]
+                                       (in true)]
 
                                       [reflection.boolean box.boolean]
                                       [reflection.byte    box.byte]
@@ -936,14 +936,14 @@
                                                    (not (dictionary.key? ..boxes to_name)))
                                    to_class (phase.lift (reflection!.load class_loader to_name))
                                    _ (if (text\= ..inheritance_relationship_type_name from_name)
-                                       (wrap [])
+                                       (in [])
                                        (do !
                                          [from_class (phase.lift (reflection!.load class_loader from_name))]
                                          (phase.assert ..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)
-                                      (wrap true)
+                                      (in true)
                                       (do !
                                         [candidate_parents (: (Operation (List [[Text .Type] Bit]))
                                                               (if (text\= ..inheritance_relationship_type_name current_name)
@@ -956,15 +956,15 @@
                                           (recur [next_name nextT])
 
                                           #.Nil
-                                          (wrap false)))))))))]
+                                          (in false)))))))))]
         (if can_cast?
-          (wrap (#/////analysis.Extension extension_name (list (/////analysis.text from_name)
-                                                               (/////analysis.text to_name)
-                                                               fromA)))
-          (/////analysis.throw ..cannot_cast [fromT toT fromC])))
+          (in (#/////analysis.Extension extension_name (list (/////analysis.text from_name)
+                                                             (/////analysis.text to_name)
+                                                             fromA)))
+          (/////analysis.except ..cannot_cast [fromT toT fromC])))
 
       _
-      (/////analysis.throw ///.invalid_syntax [extension_name %.code args]))))
+      (/////analysis.except ///.invalid_syntax [extension_name %.code args]))))
 
 (def: (bundle::object class_loader)
   (-> java/lang/ClassLoader Bundle)
@@ -994,10 +994,10 @@
                          (not deprecated?))
          fieldT (reflection_type luxT.fresh fieldJT)
          _ (typeA.infer fieldT)]
-        (wrap (<| (#/////analysis.Extension extension_name)
-                  (list (/////analysis.text class)
-                        (/////analysis.text field)
-                        (/////analysis.text (|> fieldJT ..reflection)))))))]))
+        (in (<| (#/////analysis.Extension extension_name)
+                (list (/////analysis.text class)
+                      (/////analysis.text field)
+                      (/////analysis.text (|> fieldJT ..reflection)))))))]))
 
 (def: (put::static class_loader)
   (-> java/lang/ClassLoader Handler)
@@ -1018,10 +1018,10 @@
          fieldT (reflection_type luxT.fresh fieldJT)
          valueA (typeA.with_type fieldT
                   (analyse archive valueC))]
-        (wrap (<| (#/////analysis.Extension extension_name)
-                  (list (/////analysis.text class)
-                        (/////analysis.text field)
-                        valueA)))))]))
+        (in (<| (#/////analysis.Extension extension_name)
+                (list (/////analysis.text class)
+                      (/////analysis.text field)
+                      valueA)))))]))
 
 (def: (get::virtual class_loader)
   (-> java/lang/ClassLoader Handler)
@@ -1037,16 +1037,16 @@
                                           [class (reflection!.load class_loader class)
                                            [final? deprecated? fieldJT] (reflection!.virtual_field field class)
                                            mapping (reflection!.correspond class objectT)]
-                                          (wrap [deprecated? mapping fieldJT])))
+                                          (in [deprecated? mapping fieldJT])))
          _ (phase.assert ..deprecated_field [class field]
                          (not deprecated?))
          fieldT (reflection_type mapping fieldJT)
          _ (typeA.infer fieldT)]
-        (wrap (<| (#/////analysis.Extension extension_name)
-                  (list (/////analysis.text class)
-                        (/////analysis.text field)
-                        (/////analysis.text (..reflection fieldJT))
-                        objectA)))))]))
+        (in (<| (#/////analysis.Extension extension_name)
+                (list (/////analysis.text class)
+                      (/////analysis.text field)
+                      (/////analysis.text (..reflection fieldJT))
+                      objectA)))))]))
 
 (def: (put::virtual class_loader)
   (-> java/lang/ClassLoader Handler)
@@ -1063,7 +1063,7 @@
                                                  [class (reflection!.load class_loader class)
                                                   [final? deprecated? fieldJT] (reflection!.virtual_field field class)
                                                   mapping (reflection!.correspond class objectT)]
-                                                 (wrap [final? deprecated? mapping fieldJT])))
+                                                 (in [final? deprecated? mapping fieldJT])))
          _ (phase.assert ..deprecated_field [class field]
                          (not deprecated?))
          _ (phase.assert ..cannot_set_a_final_field [class field]
@@ -1071,12 +1071,12 @@
          fieldT (reflection_type mapping fieldJT)
          valueA (typeA.with_type fieldT
                   (analyse archive valueC))]
-        (wrap (<| (#/////analysis.Extension extension_name)
-                  (list (/////analysis.text class)
-                        (/////analysis.text field)
-                        (/////analysis.text (..reflection fieldJT))
-                        valueA
-                        objectA)))))]))
+        (in (<| (#/////analysis.Extension extension_name)
+                (list (/////analysis.text class)
+                      (/////analysis.text field)
+                      (/////analysis.text (..reflection fieldJT))
+                      valueA
+                      objectA)))))]))
 
 (type: Method_Style
   #Static
@@ -1124,12 +1124,12 @@
                                                                        actualJC)))))
                                          true
                                          (list.zipped/2 parameters inputsJT)))]]
-    (wrap (and correct_class?
-               correct_method?
-               static_matches?
-               special_matches?
-               arity_matches?
-               inputs_match?))))
+    (in (and correct_class?
+             correct_method?
+             static_matches?
+             special_matches?
+             arity_matches?
+             inputs_match?))))
 
 (def: (check_constructor aliasing class inputsJT constructor)
   (-> Aliasing (java/lang/Class java/lang/Object) (List (Type Value)) (java/lang/reflect/Constructor java/lang/Object) (Operation Bit))
@@ -1138,22 +1138,22 @@
                     array.to_list
                     (monad.map try.monad reflection!.type)
                     phase.lift)]
-    (wrap (and (java/lang/Object::equals class (java/lang/reflect/Constructor::getDeclaringClass constructor))
-               (n.= (list.size inputsJT) (list.size parameters))
-               (list\fold (function (_ [expectedJC actualJC] prev)
-                            (and prev
-                                 (jvm\= expectedJC (: (Type Value)
-                                                      (case (jvm_parser.var? actualJC)
-                                                        (#.Some name)
-                                                        (|> aliasing
-                                                            (dictionary.get name)
-                                                            (maybe.default name)
-                                                            jvm.var)
-
-                                                        #.None
-                                                        actualJC)))))
-                          true
-                          (list.zipped/2 parameters inputsJT))))))
+    (in (and (java/lang/Object::equals class (java/lang/reflect/Constructor::getDeclaringClass constructor))
+             (n.= (list.size inputsJT) (list.size parameters))
+             (list\fold (function (_ [expectedJC actualJC] prev)
+                          (and prev
+                               (jvm\= expectedJC (: (Type Value)
+                                                    (case (jvm_parser.var? actualJC)
+                                                      (#.Some name)
+                                                      (|> aliasing
+                                                          (dictionary.get name)
+                                                          (maybe.default name)
+                                                          jvm.var)
+
+                                                      #.None
+                                                      actualJC)))))
+                        true
+                        (list.zipped/2 parameters inputsJT))))))
 
 (def: idx_to_parameter
   (-> Nat .Type)
@@ -1214,9 +1214,9 @@
                                           (list& (#.Primitive (java/lang/Class::getName owner) owner_tvarsT)
                                                  inputsT)))
                          outputT)]]
-      (wrap [methodT
-             (reflection!.deprecated? (java/lang/reflect/Method::getDeclaredAnnotations method))
-             exceptionsT]))))
+      (in [methodT
+           (reflection!.deprecated? (java/lang/reflect/Method::getDeclaredAnnotations method))
+           exceptionsT]))))
 
 (def: (constructor_signature constructor)
   (-> (java/lang/reflect/Constructor java/lang/Object) (Operation Method_Signature))
@@ -1243,9 +1243,9 @@
              constructorT (<| (type.univ_q (dictionary.size mapping))
                               (type.function inputsT)
                               objectT)]]
-      (wrap [constructorT
-             (reflection!.deprecated? (java/lang/reflect/Constructor::getDeclaredAnnotations constructor))
-             exceptionsT]))))
+      (in [constructorT
+           (reflection!.deprecated? (java/lang/reflect/Constructor::getDeclaredAnnotations constructor))
+           exceptionsT]))))
 
 (type: Evaluation
   (#Pass Method_Signature)
@@ -1304,13 +1304,13 @@
                                            (method_signature method_style method)))))))]
     (case (list.all pass! candidates)
       (#.Cons method #.Nil)
-      (wrap method)
+      (in method)
 
       #.Nil
-      (/////analysis.throw ..no_candidates [class_name method_name inputsJT (list.all hint! candidates)])
+      (/////analysis.except ..no_candidates [class_name method_name inputsJT (list.all hint! candidates)])
       
       candidates
-      (/////analysis.throw ..too_many_candidates [class_name method_name inputsJT candidates]))))
+      (/////analysis.except ..too_many_candidates [class_name method_name inputsJT candidates]))))
 
 (def: constructor_method
   "")
@@ -1334,18 +1334,18 @@
                                         (constructor_signature constructor))))))]
     (case (list.all pass! candidates)
       (#.Cons constructor #.Nil)
-      (wrap constructor)
+      (in constructor)
 
       #.Nil
-      (/////analysis.throw ..no_candidates [class_name ..constructor_method inputsJT (list.all hint! candidates)])
+      (/////analysis.except ..no_candidates [class_name ..constructor_method inputsJT (list.all hint! candidates)])
       
       candidates
-      (/////analysis.throw ..too_many_candidates [class_name ..constructor_method inputsJT candidates]))))
+      (/////analysis.except ..too_many_candidates [class_name ..constructor_method inputsJT candidates]))))
 
 (template [  ]
   [(def: #export 
      (Parser (Type ))
-     (.embed  .text))]
+     (.then  .text))]
 
   [var Var jvm_parser.var]
   [class Class jvm_parser.class]
@@ -1380,10 +1380,10 @@
                          (not deprecated?))
          [outputT argsA] (inferenceA.general archive analyse methodT (list\map product.right argsTC))
          outputJT (check_return outputT)]
-        (wrap (#/////analysis.Extension extension_name (list& (/////analysis.text (..signature (jvm.class class (list))))
-                                                              (/////analysis.text method)
-                                                              (/////analysis.text (..signature outputJT))
-                                                              (decorate_inputs argsT argsA))))))]))
+        (in (#/////analysis.Extension extension_name (list& (/////analysis.text (..signature (jvm.class class (list))))
+                                                            (/////analysis.text method)
+                                                            (/////analysis.text (..signature outputJT))
+                                                            (decorate_inputs argsT argsA))))))]))
 
 (def: (invoke::virtual class_loader)
   (-> java/lang/ClassLoader Handler)
@@ -1404,11 +1404,11 @@
                                  _
                                  (undefined))]
          outputJT (check_return outputT)]
-        (wrap (#/////analysis.Extension extension_name (list& (/////analysis.text (..signature (jvm.class class (list))))
-                                                              (/////analysis.text method)
-                                                              (/////analysis.text (..signature outputJT))
-                                                              objectA
-                                                              (decorate_inputs argsT argsA))))))]))
+        (in (#/////analysis.Extension extension_name (list& (/////analysis.text (..signature (jvm.class class (list))))
+                                                            (/////analysis.text method)
+                                                            (/////analysis.text (..signature outputJT))
+                                                            objectA
+                                                            (decorate_inputs argsT argsA))))))]))
 
 (def: (invoke::special class_loader)
   (-> java/lang/ClassLoader Handler)
@@ -1423,10 +1423,10 @@
                          (not deprecated?))
          [outputT argsA] (inferenceA.general archive analyse methodT (list& objectC (list\map product.right argsTC)))
          outputJT (check_return outputT)]
-        (wrap (#/////analysis.Extension extension_name (list& (/////analysis.text (..signature (jvm.class class (list))))
-                                                              (/////analysis.text method)
-                                                              (/////analysis.text (..signature outputJT))
-                                                              (decorate_inputs argsT argsA))))))]))
+        (in (#/////analysis.Extension extension_name (list& (/////analysis.text (..signature (jvm.class class (list))))
+                                                            (/////analysis.text method)
+                                                            (/////analysis.text (..signature outputJT))
+                                                            (decorate_inputs argsT argsA))))))]))
 
 (def: (invoke::interface class_loader)
   (-> java/lang/ClassLoader Handler)
@@ -1450,12 +1450,12 @@
                                  _
                                  (undefined))]
          outputJT (check_return outputT)]
-        (wrap (#/////analysis.Extension extension_name
-                                        (list& (/////analysis.text (..signature (jvm.class class_name (list))))
-                                               (/////analysis.text method)
-                                               (/////analysis.text (..signature outputJT))
-                                               objectA
-                                               (decorate_inputs argsT argsA))))))]))
+        (in (#/////analysis.Extension extension_name
+                                      (list& (/////analysis.text (..signature (jvm.class class_name (list))))
+                                             (/////analysis.text method)
+                                             (/////analysis.text (..signature outputJT))
+                                             objectA
+                                             (decorate_inputs argsT argsA))))))]))
 
 (def: (invoke::constructor class_loader)
   (-> java/lang/ClassLoader Handler)
@@ -1469,8 +1469,8 @@
          _ (phase.assert ..deprecated_method [class ..constructor_method methodT]
                          (not deprecated?))
          [outputT argsA] (inferenceA.general archive analyse methodT (list\map product.right argsTC))]
-        (wrap (#/////analysis.Extension extension_name (list& (/////analysis.text (..signature (jvm.class class (list))))
-                                                              (decorate_inputs argsT argsA))))))]))
+        (in (#/////analysis.Extension extension_name (list& (/////analysis.text (..signature (jvm.class class (list))))
+                                                            (decorate_inputs argsT argsA))))))]))
 
 (def: (bundle::member class_loader)
   (-> java/lang/ClassLoader Bundle)
@@ -1565,8 +1565,8 @@
                           exceptions (|> (java/lang/reflect/Method::getGenericExceptionTypes method)
                                          array.to_list
                                          (monad.map ! reflection!.class))]
-                         (wrap [(java/lang/reflect/Method::getName method)
-                                (jvm.method [type_variables inputs return exceptions])]))))))]
+                         (in [(java/lang/reflect/Method::getName method)
+                              (jvm.method [type_variables inputs return exceptions])]))))))]
 
   [abstract_methods (list.only (|>> java/lang/reflect/Method::getModifiers java/lang/reflect/Modifier::isAbstract))]
   [methods (<|)]
@@ -1667,22 +1667,22 @@
                                      [parametersA (monad.map ! (function (_ [name value])
                                                                  (do !
                                                                    [valueA (analyse archive value)]
-                                                                   (wrap [name valueA])))
+                                                                   (in [name valueA])))
                                                              parameters)]
-                                     (wrap [name parametersA])))
+                                     (in [name parametersA])))
                                annotations)
        super_arguments (monad.map ! (function (_ [jvmT super_argC])
                                       (do !
                                         [luxT (reflection_type mapping jvmT)
                                          super_argA (typeA.with_type luxT
                                                       (analyse archive super_argC))]
-                                        (wrap [jvmT super_argA])))
+                                        (in [jvmT super_argA])))
                                   super_arguments)
        arguments' (monad.map !
                              (function (_ [name jvmT])
                                (do !
                                  [luxT (boxed_reflection_type mapping jvmT)]
-                                 (wrap [name luxT])))
+                                 (in [name luxT])))
                              arguments)
        [scope bodyA] (|> arguments'
                          (#.Cons [self_name selfT])
@@ -1690,20 +1690,20 @@
                          (list\fold scope.with_local (analyse archive body))
                          (typeA.with_type .Any)
                          /////analysis.with_scope)]
-      (wrap (/////analysis.tuple (list (/////analysis.text ..constructor_tag)
-                                       (visibility_analysis visibility)
-                                       (/////analysis.bit strict_fp?)
-                                       (/////analysis.tuple (list\map annotation_analysis annotationsA))
-                                       (/////analysis.tuple (list\map var_analysis vars))
-                                       (/////analysis.text self_name)
-                                       (/////analysis.tuple (list\map ..argument_analysis arguments))
-                                       (/////analysis.tuple (list\map class_analysis exceptions))
-                                       (/////analysis.tuple (list\map typed_analysis super_arguments))
-                                       (#/////analysis.Function
-                                        (list\map (|>> /////analysis.variable)
-                                                  (scope.environment scope))
-                                        (/////analysis.tuple (list bodyA)))
-                                       ))))))
+      (in (/////analysis.tuple (list (/////analysis.text ..constructor_tag)
+                                     (visibility_analysis visibility)
+                                     (/////analysis.bit strict_fp?)
+                                     (/////analysis.tuple (list\map annotation_analysis annotationsA))
+                                     (/////analysis.tuple (list\map var_analysis vars))
+                                     (/////analysis.text self_name)
+                                     (/////analysis.tuple (list\map ..argument_analysis arguments))
+                                     (/////analysis.tuple (list\map class_analysis exceptions))
+                                     (/////analysis.tuple (list\map typed_analysis super_arguments))
+                                     (#/////analysis.Function
+                                      (list\map (|>> /////analysis.variable)
+                                                (scope.environment scope))
+                                      (/////analysis.tuple (list bodyA)))
+                                     ))))))
 
 (type: #export (Virtual_Method a)
   [Text
@@ -1749,16 +1749,16 @@
                                      [parametersA (monad.map ! (function (_ [name value])
                                                                  (do !
                                                                    [valueA (analyse archive value)]
-                                                                   (wrap [name valueA])))
+                                                                   (in [name valueA])))
                                                              parameters)]
-                                     (wrap [name parametersA])))
+                                     (in [name parametersA])))
                                annotations)
        returnT (reflection_return mapping return)
        arguments' (monad.map !
                              (function (_ [name jvmT])
                                (do !
                                  [luxT (boxed_reflection_type mapping jvmT)]
-                                 (wrap [name luxT])))
+                                 (in [name luxT])))
                              arguments)
        [scope bodyA] (|> arguments'
                          (#.Cons [self_name selfT])
@@ -1766,22 +1766,22 @@
                          (list\fold scope.with_local (analyse archive body))
                          (typeA.with_type returnT)
                          /////analysis.with_scope)]
-      (wrap (/////analysis.tuple (list (/////analysis.text ..virtual_tag)
-                                       (/////analysis.text method_name)
-                                       (visibility_analysis visibility)
-                                       (/////analysis.bit final?)
-                                       (/////analysis.bit strict_fp?)
-                                       (/////analysis.tuple (list\map annotation_analysis annotationsA))
-                                       (/////analysis.tuple (list\map var_analysis vars))
-                                       (/////analysis.text self_name)
-                                       (/////analysis.tuple (list\map ..argument_analysis arguments))
-                                       (return_analysis return)
-                                       (/////analysis.tuple (list\map class_analysis exceptions))
-                                       (#/////analysis.Function
-                                        (list\map (|>> /////analysis.variable)
-                                                  (scope.environment scope))
-                                        (/////analysis.tuple (list bodyA)))
-                                       ))))))
+      (in (/////analysis.tuple (list (/////analysis.text ..virtual_tag)
+                                     (/////analysis.text method_name)
+                                     (visibility_analysis visibility)
+                                     (/////analysis.bit final?)
+                                     (/////analysis.bit strict_fp?)
+                                     (/////analysis.tuple (list\map annotation_analysis annotationsA))
+                                     (/////analysis.tuple (list\map var_analysis vars))
+                                     (/////analysis.text self_name)
+                                     (/////analysis.tuple (list\map ..argument_analysis arguments))
+                                     (return_analysis return)
+                                     (/////analysis.tuple (list\map class_analysis exceptions))
+                                     (#/////analysis.Function
+                                      (list\map (|>> /////analysis.variable)
+                                                (scope.environment scope))
+                                      (/////analysis.tuple (list bodyA)))
+                                     ))))))
 
 (type: #export (Static_Method a)
   [Text
@@ -1823,37 +1823,37 @@
                                      [parametersA (monad.map ! (function (_ [name value])
                                                                  (do !
                                                                    [valueA (analyse archive value)]
-                                                                   (wrap [name valueA])))
+                                                                   (in [name valueA])))
                                                              parameters)]
-                                     (wrap [name parametersA])))
+                                     (in [name parametersA])))
                                annotations)
        returnT (reflection_return mapping return)
        arguments' (monad.map !
                              (function (_ [name jvmT])
                                (do !
                                  [luxT (boxed_reflection_type mapping jvmT)]
-                                 (wrap [name luxT])))
+                                 (in [name luxT])))
                              arguments)
        [scope bodyA] (|> arguments'
                          list.reverse
                          (list\fold scope.with_local (analyse archive body))
                          (typeA.with_type returnT)
                          /////analysis.with_scope)]
-      (wrap (/////analysis.tuple (list (/////analysis.text ..static_tag)
-                                       (/////analysis.text method_name)
-                                       (visibility_analysis visibility)
-                                       (/////analysis.bit strict_fp?)
-                                       (/////analysis.tuple (list\map annotation_analysis annotationsA))
-                                       (/////analysis.tuple (list\map var_analysis vars))
-                                       (/////analysis.tuple (list\map ..argument_analysis arguments))
-                                       (return_analysis return)
-                                       (/////analysis.tuple (list\map class_analysis
-                                                                      exceptions))
-                                       (#/////analysis.Function
-                                        (list\map (|>> /////analysis.variable)
-                                                  (scope.environment scope))
-                                        (/////analysis.tuple (list bodyA)))
-                                       ))))))
+      (in (/////analysis.tuple (list (/////analysis.text ..static_tag)
+                                     (/////analysis.text method_name)
+                                     (visibility_analysis visibility)
+                                     (/////analysis.bit strict_fp?)
+                                     (/////analysis.tuple (list\map annotation_analysis annotationsA))
+                                     (/////analysis.tuple (list\map var_analysis vars))
+                                     (/////analysis.tuple (list\map ..argument_analysis arguments))
+                                     (return_analysis return)
+                                     (/////analysis.tuple (list\map class_analysis
+                                                                    exceptions))
+                                     (#/////analysis.Function
+                                      (list\map (|>> /////analysis.variable)
+                                                (scope.environment scope))
+                                      (/////analysis.tuple (list bodyA)))
+                                     ))))))
 
 (type: #export (Overriden_Method a)
   [(Type Class)
@@ -1918,10 +1918,10 @@
             (|> super_parameters
                 (monad.map ! (..reflection_type mapping))
                 (\ ! map (|>> (list.zipped/2 parent_parameters)))))
-          (phase.lift (exception.throw ..mismatched_super_parameters [parent_name expected_count actual_count]))))
+          (phase.lift (exception.except ..mismatched_super_parameters [parent_name expected_count actual_count]))))
       
       #.None
-      (phase.lift (exception.throw ..unknown_super [parent_name supers])))))
+      (phase.lift (exception.except ..unknown_super [parent_name supers])))))
 
 (def: #export (with_fresh_type_vars vars mapping)
   (-> (List (Type Var)) Mapping (Operation Mapping))
@@ -1930,21 +1930,21 @@
                              (do !
                                [[_ exT] (typeA.with_env
                                           check.existential)]
-                               (wrap [var exT])))
+                               (in [var exT])))
                          vars)]
-    (wrap (list\fold (function (_ [varJ varT] mapping)
-                       (dictionary.put (jvm_parser.name varJ) varT mapping))
-                     mapping
-                     pairings))))
+    (in (list\fold (function (_ [varJ varT] mapping)
+                     (dictionary.put (jvm_parser.name varJ) varT mapping))
+                   mapping
+                   pairings))))
 
 (def: #export (with_override_mapping supers parent_type mapping)
   (-> (List (Type Class)) (Type Class) Mapping (Operation Mapping))
   (do phase.monad
     [override_mapping (..override_mapping mapping supers parent_type)]
-    (wrap (list\fold (function (_ [super_var bound_type] mapping)
-                       (dictionary.put super_var bound_type mapping))
-                     mapping
-                     override_mapping))))
+    (in (list\fold (function (_ [super_var bound_type] mapping)
+                     (dictionary.put super_var bound_type mapping))
+                   mapping
+                   override_mapping))))
 
 (def: #export (hide_method_body arity bodyA)
   (-> Nat Analysis Analysis)
@@ -1989,15 +1989,15 @@
                                      [parametersA (monad.map ! (function (_ [name value])
                                                                  (do !
                                                                    [valueA (analyse archive value)]
-                                                                   (wrap [name valueA])))
+                                                                   (in [name valueA])))
                                                              parameters)]
-                                     (wrap [name parametersA])))
+                                     (in [name parametersA])))
                                annotations)
        arguments' (monad.map !
                              (function (_ [name jvmT])
                                (do !
                                  [luxT (boxed_reflection_type mapping jvmT)]
-                                 (wrap [name luxT])))
+                                 (in [name luxT])))
                              arguments)
        returnT (boxed_reflection_return mapping return)
        [scope bodyA] (|> arguments'
@@ -2006,22 +2006,22 @@
                          (list\fold scope.with_local (analyse archive body))
                          (typeA.with_type returnT)
                          /////analysis.with_scope)]
-      (wrap (/////analysis.tuple (list (/////analysis.text ..overriden_tag)
-                                       (class_analysis parent_type)
-                                       (/////analysis.text method_name)
-                                       (/////analysis.bit strict_fp?)
-                                       (/////analysis.tuple (list\map annotation_analysis annotationsA))
-                                       (/////analysis.tuple (list\map var_analysis vars))
-                                       (/////analysis.text self_name)
-                                       (/////analysis.tuple (list\map ..argument_analysis arguments))
-                                       (return_analysis return)
-                                       (/////analysis.tuple (list\map class_analysis
-                                                                      exceptions))
-                                       (#/////analysis.Function
-                                        (list\map (|>> /////analysis.variable)
-                                                  (scope.environment scope))
-                                        (..hide_method_body (list.size arguments) bodyA))
-                                       ))))))
+      (in (/////analysis.tuple (list (/////analysis.text ..overriden_tag)
+                                     (class_analysis parent_type)
+                                     (/////analysis.text method_name)
+                                     (/////analysis.bit strict_fp?)
+                                     (/////analysis.tuple (list\map annotation_analysis annotationsA))
+                                     (/////analysis.tuple (list\map var_analysis vars))
+                                     (/////analysis.text self_name)
+                                     (/////analysis.tuple (list\map ..argument_analysis arguments))
+                                     (return_analysis return)
+                                     (/////analysis.tuple (list\map class_analysis
+                                                                    exceptions))
+                                     (#/////analysis.Function
+                                      (list\map (|>> /////analysis.variable)
+                                                (scope.environment scope))
+                                      (..hide_method_body (list.size arguments) bodyA))
+                                     ))))))
 
 (type: #export (Method_Definition a)
   (#Overriden_Method (Overriden_Method a)))
@@ -2032,7 +2032,7 @@
              (function (_ parameterJ)
                (do check.monad
                  [[_ parameterT] check.existential]
-                 (wrap [parameterJ parameterT])))))
+                 (in [parameterJ parameterT])))))
 
 (def: (mismatched_methods super_set sub_set)
   (-> (List [Text (Type Method)])
@@ -2067,15 +2067,15 @@
      _ (phase.assert ..class_parameter_mismatch [expected_parameters actual_parameters]
                      (n.= (list.size expected_parameters)
                           (list.size actual_parameters)))]
-    (wrap (|> (list.zipped/2 expected_parameters actual_parameters)
-              (list\fold (function (_ [expected actual] mapping)
-                           (case (jvm_parser.var? actual)
-                             (#.Some actual)
-                             (dictionary.put actual expected mapping)
-                             
-                             #.None
-                             mapping))
-                         jvm_alias.fresh)))))
+    (in (|> (list.zipped/2 expected_parameters actual_parameters)
+            (list\fold (function (_ [expected actual] mapping)
+                         (case (jvm_parser.var? actual)
+                           (#.Some actual)
+                           (dictionary.put actual expected mapping)
+                           
+                           #.None
+                           mapping))
+                       jvm_alias.fresh)))))
 
 (def: (anonymous_class_name module id)
   (-> Module Nat Text)
@@ -2094,11 +2094,11 @@
                                                   body])
                                       (do !
                                         [aliasing (super_aliasing class_loader parent_type)]
-                                        (wrap [method_name (|> (jvm.method [type_vars
-                                                                            (list\map product.right arguments)
-                                                                            return
-                                                                            exceptions])
-                                                               (jvm_alias.method aliasing))])))
+                                        (in [method_name (|> (jvm.method [type_vars
+                                                                          (list\map product.right arguments)
+                                                                          return
+                                                                          exceptions])
+                                                             (jvm_alias.method aliasing))])))
                                   methods)
      #let [missing_abstract_methods (mismatched_methods overriden_methods required_abstract_methods)
            invalid_overriden_methods (mismatched_methods available_methods overriden_methods)]
@@ -2106,7 +2106,7 @@
                      (list.empty? missing_abstract_methods))
      _ (phase.assert ..invalid_overriden_methods invalid_overriden_methods
                      (list.empty? invalid_overriden_methods))]
-    (wrap [])))
+    (in [])))
 
 (def: (class::anonymous class_loader)
   (-> java/lang/ClassLoader Handler)
@@ -2142,25 +2142,25 @@
          selfT (///.lift (do meta.monad
                            [where meta.current_module_name
                             id meta.count]
-                           (wrap (inheritance_relationship_type (#.Primitive (..anonymous_class_name where id) (list))
-                                                                super_classT
-                                                                super_interfaceT+))))
+                           (in (inheritance_relationship_type (#.Primitive (..anonymous_class_name where id) (list))
+                                                              super_classT
+                                                              super_interfaceT+))))
          _ (typeA.infer selfT)
          constructor_argsA+ (monad.map ! (function (_ [type term])
                                            (do !
                                              [argT (reflection_type mapping type)
                                               termA (typeA.with_type argT
                                                       (analyse archive term))]
-                                             (wrap [type termA])))
+                                             (in [type termA])))
                                        constructor_args)
          #let [supers (#.Cons super_class super_interfaces)]
          _ (..require_complete_method_concretion class_loader supers methods)
          methodsA (monad.map ! (analyse_overriden_method analyse archive selfT mapping supers) methods)]
-        (wrap (#/////analysis.Extension extension_name
-                                        (list (class_analysis super_class)
-                                              (/////analysis.tuple (list\map class_analysis super_interfaces))
-                                              (/////analysis.tuple (list\map typed_analysis constructor_argsA+))
-                                              (/////analysis.tuple methodsA))))))]))
+        (in (#/////analysis.Extension extension_name
+                                      (list (class_analysis super_class)
+                                            (/////analysis.tuple (list\map class_analysis super_interfaces))
+                                            (/////analysis.tuple (list\map typed_analysis constructor_argsA+))
+                                            (/////analysis.tuple methodsA))))))]))
 
 (def: (bundle::class class_loader)
   (-> java/lang/ClassLoader Bundle)
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 b0bdba0cb..9fc9ce902 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
@@ -50,7 +50,7 @@
                    (phase archive lengthC))
          [var_id varT] (analysis/type.with_env check.var)
          _ (analysis/type.infer (type (Array varT)))]
-        (wrap (#analysis.Extension extension (list lengthA)))))]))
+        (in (#analysis.Extension extension (list lengthA)))))]))
 
 (def: array::length
   Handler
@@ -62,7 +62,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer Nat)]
-        (wrap (#analysis.Extension extension (list arrayA)))))]))
+        (in (#analysis.Extension extension (list arrayA)))))]))
 
 (def: array::read
   Handler
@@ -76,7 +76,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer varT)]
-        (wrap (#analysis.Extension extension (list indexA arrayA)))))]))
+        (in (#analysis.Extension extension (list indexA arrayA)))))]))
 
 (def: array::write
   Handler
@@ -92,7 +92,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer (type (Array varT)))]
-        (wrap (#analysis.Extension extension (list indexA valueA arrayA)))))]))
+        (in (#analysis.Extension extension (list indexA valueA arrayA)))))]))
 
 (def: array::delete
   Handler
@@ -106,7 +106,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer (type (Array varT)))]
-        (wrap (#analysis.Extension extension (list indexA arrayA)))))]))
+        (in (#analysis.Extension extension (list indexA arrayA)))))]))
 
 (def: bundle::array
   Bundle
@@ -128,8 +128,8 @@
         [objectA (analysis/type.with_type ..Object
                    (phase archive objectC))
          _ (analysis/type.infer .Any)]
-        (wrap (#analysis.Extension extension (list (analysis.text fieldC)
-                                                   objectA)))))]))
+        (in (#analysis.Extension extension (list (analysis.text fieldC)
+                                                 objectA)))))]))
 
 (def: object::do
   Handler
@@ -141,9 +141,9 @@
                    (phase archive objectC))
          inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
          _ (analysis/type.infer .Any)]
-        (wrap (#analysis.Extension extension (list& (analysis.text methodC)
-                                                    objectA
-                                                    inputsA)))))]))
+        (in (#analysis.Extension extension (list& (analysis.text methodC)
+                                                  objectA
+                                                  inputsA)))))]))
 
 (def: bundle::object
   Bundle
@@ -165,7 +165,7 @@
            [inputA (analysis/type.with_type (type )
                      (phase archive inputC))
             _ (analysis/type.infer (type ))]
-           (wrap (#analysis.Extension extension (list inputA)))))]))]
+           (in (#analysis.Extension extension (list inputA)))))]))]
 
   [utf8::encode Text (array.Array (I64 Any))]
   [utf8::decode (array.Array (I64 Any)) Text]
@@ -186,7 +186,7 @@
     (function (_ extension phase archive name)
       (do phase.monad
         [_ (analysis/type.infer Any)]
-        (wrap (#analysis.Extension extension (list (analysis.text name))))))]))
+        (in (#analysis.Extension extension (list (analysis.text name))))))]))
 
 (def: lua::apply
   Handler
@@ -198,7 +198,7 @@
                         (phase archive abstractionC))
          inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
          _ (analysis/type.infer Any)]
-        (wrap (#analysis.Extension extension (list& abstractionA inputsA)))))]))
+        (in (#analysis.Extension extension (list& abstractionA inputsA)))))]))
 
 (def: lua::power
   Handler
@@ -211,7 +211,7 @@
          baseA (analysis/type.with_type Frac
                  (phase archive baseC))
          _ (analysis/type.infer Frac)]
-        (wrap (#analysis.Extension extension (list powerA baseA)))))]))
+        (in (#analysis.Extension extension (list powerA baseA)))))]))
 
 (def: lua::import
   Handler
@@ -220,7 +220,7 @@
     (function (_ extension phase archive name)
       (do phase.monad
         [_ (analysis/type.infer ..Object)]
-        (wrap (#analysis.Extension extension (list (analysis.text name))))))]))
+        (in (#analysis.Extension extension (list (analysis.text name))))))]))
 
 (def: lua::function
   Handler
@@ -232,8 +232,8 @@
          abstractionA (analysis/type.with_type (-> inputT Any)
                         (phase archive abstractionC))
          _ (analysis/type.infer ..Function)]
-        (wrap (#analysis.Extension extension (list (analysis.nat arity)
-                                                   abstractionA)))))]))
+        (in (#analysis.Extension extension (list (analysis.nat arity)
+                                                 abstractionA)))))]))
 
 (def: #export bundle
   Bundle
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux
index 2804d568f..78d3b7aac 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux
@@ -45,7 +45,7 @@
       (handler extension_name analyse archive inputs)
 
       (#try.Failure _)
-      (////analysis.throw ///.invalid_syntax [extension_name %.code args]))))
+      (////analysis.except ///.invalid_syntax [extension_name %.code args]))))
 
 (def: (simple inputsT+ outputT)
   (-> (List Type) Type Handler)
@@ -60,8 +60,8 @@
                                 (typeA.with_type argT
                                   (analyse archive argC)))
                               (list.zipped/2 inputsT+ args))]
-            (wrap (#////analysis.Extension extension_name argsA)))
-          (////analysis.throw ///.incorrect_arity [extension_name num_expected num_actual]))))))
+            (in (#////analysis.Extension extension_name argsA)))
+          (////analysis.except ///.incorrect_arity [extension_name num_expected num_actual]))))))
 
 (def: #export (nullary valueT)
   (-> Type Handler)
@@ -90,7 +90,7 @@
    (do <>.monad
      [raw .text]
      (case (text.size raw)
-       1 (wrap (|> raw (text.nth 0) maybe.assume))
+       1 (in (|> raw (text.nth 0) maybe.assume))
        _ (<>.failure (exception.construct ..char_text_must_be_size_1 [raw])))))
 
  (def: lux::syntax_char_case!
@@ -109,17 +109,17 @@
                                       (do !
                                         [branch (typeA.with_type expectedT
                                                   (phase archive branch))]
-                                        (wrap [cases branch])))
+                                        (in [cases branch])))
                                   conditionals)
           else (typeA.with_type expectedT
                  (phase archive else))]
-         (wrap (|> conditionals
-                   (list\map (function (_ [cases branch])
-                               (////analysis.tuple
-                                (list (////analysis.tuple (list\map (|>> ////analysis.nat) cases))
-                                      branch))))
-                   (list& input else)
-                   (#////analysis.Extension extension_name)))))])))
+         (in (|> conditionals
+                 (list\map (function (_ [cases branch])
+                             (////analysis.tuple
+                              (list (////analysis.tuple (list\map (|>> ////analysis.nat) cases))
+                                    branch))))
+                 (list& input else)
+                 (#////analysis.Extension extension_name)))))])))
 
 ## "lux is" represents reference/pointer equality.
 (def: lux::is
@@ -142,10 +142,10 @@
          _ (typeA.infer (type (Either Text varT)))
          opA (typeA.with_type (type (-> .Any varT))
                (analyse archive opC))]
-        (wrap (#////analysis.Extension extension_name (list opA))))
+        (in (#////analysis.Extension extension_name (list opA))))
       
       _
-      (////analysis.throw ///.incorrect_arity [extension_name 1 (list.size args)]))))
+      (////analysis.except ///.incorrect_arity [extension_name 1 (list.size args)]))))
 
 (def: lux::in_module
   Handler
@@ -156,7 +156,7 @@
         (analyse archive exprC))
       
       _
-      (////analysis.throw ///.invalid_syntax [extension_name %.code argsC+]))))
+      (////analysis.except ///.invalid_syntax [extension_name %.code argsC+]))))
 
 (def: (lux::type::check eval)
   (-> Eval Handler)
@@ -172,7 +172,7 @@
           (analyse archive valueC)))
 
       _
-      (////analysis.throw ///.incorrect_arity [extension_name 2 (list.size args)]))))
+      (////analysis.except ///.incorrect_arity [extension_name 2 (list.size args)]))))
 
 (def: (lux::type::as eval)
   (-> Eval Handler)
@@ -186,10 +186,10 @@
          _ (typeA.infer actualT)
          [valueT valueA] (typeA.with_inference
                            (analyse archive valueC))]
-        (wrap valueA))
+        (in valueA))
 
       _
-      (////analysis.throw ///.incorrect_arity [extension_name 2 (list.size args)]))))
+      (////analysis.except ///.incorrect_arity [extension_name 2 (list.size args)]))))
 
 (def: (caster input output)
   (-> Type Type Handler)
@@ -210,10 +210,10 @@
         [_ (typeA.infer .Macro)
          input_type (loop [input_name (name_of .Macro')]
                       (do !
-                        [input_type (///.lift (meta.find_def (name_of .Macro')))]
+                        [input_type (///.lift (meta.definition (name_of .Macro')))]
                         (case input_type
                           (#.Definition [exported? def_type def_data def_value])
-                          (wrap (:as Type def_value))
+                          (in (:as Type def_value))
 
                           (#.Alias real_name)
                           (recur real_name))))]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux
index a30c9e6f0..40cf1f094 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux
@@ -38,7 +38,7 @@
                    (phase archive lengthC))
          [var_id varT] (analysis/type.with_env check.var)
          _ (analysis/type.infer (type (Array varT)))]
-        (wrap (#analysis.Extension extension (list lengthA)))))]))
+        (in (#analysis.Extension extension (list lengthA)))))]))
 
 (def: array::length
   Handler
@@ -50,7 +50,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer Nat)]
-        (wrap (#analysis.Extension extension (list arrayA)))))]))
+        (in (#analysis.Extension extension (list arrayA)))))]))
 
 (def: array::read
   Handler
@@ -64,7 +64,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer varT)]
-        (wrap (#analysis.Extension extension (list indexA arrayA)))))]))
+        (in (#analysis.Extension extension (list indexA arrayA)))))]))
 
 (def: array::write
   Handler
@@ -80,7 +80,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer (type (Array varT)))]
-        (wrap (#analysis.Extension extension (list indexA valueA arrayA)))))]))
+        (in (#analysis.Extension extension (list indexA valueA arrayA)))))]))
 
 (def: array::delete
   Handler
@@ -94,7 +94,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer (type (Array varT)))]
-        (wrap (#analysis.Extension extension (list indexA arrayA)))))]))
+        (in (#analysis.Extension extension (list indexA arrayA)))))]))
 
 (def: bundle::array
   Bundle
@@ -127,7 +127,7 @@
       (do {! phase.monad}
         [inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
          _ (analysis/type.infer .Any)]
-        (wrap (#analysis.Extension extension (list& (analysis.text constructor) inputsA)))))]))
+        (in (#analysis.Extension extension (list& (analysis.text constructor) inputsA)))))]))
 
 (def: object::get
   Handler
@@ -138,8 +138,8 @@
         [objectA (analysis/type.with_type ..Object
                    (phase archive objectC))
          _ (analysis/type.infer .Any)]
-        (wrap (#analysis.Extension extension (list (analysis.text fieldC)
-                                                   objectA)))))]))
+        (in (#analysis.Extension extension (list (analysis.text fieldC)
+                                                 objectA)))))]))
 
 (def: object::do
   Handler
@@ -151,9 +151,9 @@
                    (phase archive objectC))
          inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
          _ (analysis/type.infer .Any)]
-        (wrap (#analysis.Extension extension (list& (analysis.text methodC)
-                                                    objectA
-                                                    inputsA)))))]))
+        (in (#analysis.Extension extension (list& (analysis.text methodC)
+                                                  objectA
+                                                  inputsA)))))]))
 
 (def: bundle::object
   Bundle
@@ -173,7 +173,7 @@
     (function (_ extension phase archive name)
       (do phase.monad
         [_ (analysis/type.infer Any)]
-        (wrap (#analysis.Extension extension (list (analysis.text name))))))]))
+        (in (#analysis.Extension extension (list (analysis.text name))))))]))
 
 (def: php::apply
   Handler
@@ -185,7 +185,7 @@
                         (phase archive abstractionC))
          inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
          _ (analysis/type.infer Any)]
-        (wrap (#analysis.Extension extension (list& abstractionA inputsA)))))]))
+        (in (#analysis.Extension extension (list& abstractionA inputsA)))))]))
 
 (def: php::pack
   Handler
@@ -198,7 +198,7 @@
          dataA (analysis/type.with_type (type (Array (I64 Any)))
                  (phase archive dataC))
          _ (analysis/type.infer Text)]
-        (wrap (#analysis.Extension extension (list formatA dataA)))))]))
+        (in (#analysis.Extension extension (list formatA dataA)))))]))
 
 (def: #export bundle
   Bundle
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 a3635cf96..6d5e3290f 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
@@ -38,7 +38,7 @@
                    (phase archive lengthC))
          [var_id varT] (analysis/type.with_env check.var)
          _ (analysis/type.infer (type (Array varT)))]
-        (wrap (#analysis.Extension extension (list lengthA)))))]))
+        (in (#analysis.Extension extension (list lengthA)))))]))
 
 (def: array::length
   Handler
@@ -50,7 +50,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer Nat)]
-        (wrap (#analysis.Extension extension (list arrayA)))))]))
+        (in (#analysis.Extension extension (list arrayA)))))]))
 
 (def: array::read
   Handler
@@ -64,7 +64,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer varT)]
-        (wrap (#analysis.Extension extension (list indexA arrayA)))))]))
+        (in (#analysis.Extension extension (list indexA arrayA)))))]))
 
 (def: array::write
   Handler
@@ -80,7 +80,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer (type (Array varT)))]
-        (wrap (#analysis.Extension extension (list indexA valueA arrayA)))))]))
+        (in (#analysis.Extension extension (list indexA valueA arrayA)))))]))
 
 (def: array::delete
   Handler
@@ -94,7 +94,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer (type (Array varT)))]
-        (wrap (#analysis.Extension extension (list indexA arrayA)))))]))
+        (in (#analysis.Extension extension (list indexA arrayA)))))]))
 
 (def: bundle::array
   Bundle
@@ -133,8 +133,8 @@
         [objectA (analysis/type.with_type ..Object
                    (phase archive objectC))
          _ (analysis/type.infer .Any)]
-        (wrap (#analysis.Extension extension (list (analysis.text fieldC)
-                                                   objectA)))))]))
+        (in (#analysis.Extension extension (list (analysis.text fieldC)
+                                                 objectA)))))]))
 
 (def: object::do
   Handler
@@ -146,9 +146,9 @@
                    (phase archive objectC))
          inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
          _ (analysis/type.infer .Any)]
-        (wrap (#analysis.Extension extension (list& (analysis.text methodC)
-                                                    objectA
-                                                    inputsA)))))]))
+        (in (#analysis.Extension extension (list& (analysis.text methodC)
+                                                  objectA
+                                                  inputsA)))))]))
 
 (def: bundle::object
   Bundle
@@ -167,7 +167,7 @@
     (function (_ extension phase archive name)
       (do phase.monad
         [_ (analysis/type.infer Any)]
-        (wrap (#analysis.Extension extension (list (analysis.text name))))))]))
+        (in (#analysis.Extension extension (list (analysis.text name))))))]))
 
 (def: python::import
   Handler
@@ -176,7 +176,7 @@
     (function (_ extension phase archive name)
       (do phase.monad
         [_ (analysis/type.infer ..Object)]
-        (wrap (#analysis.Extension extension (list (analysis.text name))))))]))
+        (in (#analysis.Extension extension (list (analysis.text name))))))]))
 
 (def: python::apply
   Handler
@@ -188,7 +188,7 @@
                         (phase archive abstractionC))
          inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
          _ (analysis/type.infer Any)]
-        (wrap (#analysis.Extension extension (list& abstractionA inputsA)))))]))
+        (in (#analysis.Extension extension (list& abstractionA inputsA)))))]))
 
 (def: python::function
   Handler
@@ -200,8 +200,8 @@
          abstractionA (analysis/type.with_type (-> inputT Any)
                         (phase archive abstractionC))
          _ (analysis/type.infer ..Function)]
-        (wrap (#analysis.Extension extension (list (analysis.nat arity)
-                                                   abstractionA)))))]))
+        (in (#analysis.Extension extension (list (analysis.nat arity)
+                                                 abstractionA)))))]))
 
 (def: python::exec
   Handler
@@ -214,7 +214,7 @@
          globalsA (analysis/type.with_type ..Dict
                     (phase archive globalsC))
          _ (analysis/type.infer .Any)]
-        (wrap (#analysis.Extension extension (list codeA globalsA)))))]))
+        (in (#analysis.Extension extension (list codeA globalsA)))))]))
 
 (def: #export bundle
   Bundle
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/ruby.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/ruby.lux
index 1d01b479d..65650c837 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/ruby.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/ruby.lux
@@ -38,7 +38,7 @@
                    (phase archive lengthC))
          [var_id varT] (analysis/type.with_env check.var)
          _ (analysis/type.infer (type (Array varT)))]
-        (wrap (#analysis.Extension extension (list lengthA)))))]))
+        (in (#analysis.Extension extension (list lengthA)))))]))
 
 (def: array::length
   Handler
@@ -50,7 +50,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer Nat)]
-        (wrap (#analysis.Extension extension (list arrayA)))))]))
+        (in (#analysis.Extension extension (list arrayA)))))]))
 
 (def: array::read
   Handler
@@ -64,7 +64,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer varT)]
-        (wrap (#analysis.Extension extension (list indexA arrayA)))))]))
+        (in (#analysis.Extension extension (list indexA arrayA)))))]))
 
 (def: array::write
   Handler
@@ -80,7 +80,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer (type (Array varT)))]
-        (wrap (#analysis.Extension extension (list indexA valueA arrayA)))))]))
+        (in (#analysis.Extension extension (list indexA valueA arrayA)))))]))
 
 (def: array::delete
   Handler
@@ -94,7 +94,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer (type (Array varT)))]
-        (wrap (#analysis.Extension extension (list indexA arrayA)))))]))
+        (in (#analysis.Extension extension (list indexA arrayA)))))]))
 
 (def: bundle::array
   Bundle
@@ -128,8 +128,8 @@
         [objectA (analysis/type.with_type ..Object
                    (phase archive objectC))
          _ (analysis/type.infer .Any)]
-        (wrap (#analysis.Extension extension (list (analysis.text fieldC)
-                                                   objectA)))))]))
+        (in (#analysis.Extension extension (list (analysis.text fieldC)
+                                                 objectA)))))]))
 
 (def: object::do
   Handler
@@ -141,9 +141,9 @@
                    (phase archive objectC))
          inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
          _ (analysis/type.infer .Any)]
-        (wrap (#analysis.Extension extension (list& (analysis.text methodC)
-                                                    objectA
-                                                    inputsA)))))]))
+        (in (#analysis.Extension extension (list& (analysis.text methodC)
+                                                  objectA
+                                                  inputsA)))))]))
 
 (def: bundle::object
   Bundle
@@ -162,7 +162,7 @@
     (function (_ extension phase archive name)
       (do phase.monad
         [_ (analysis/type.infer Any)]
-        (wrap (#analysis.Extension extension (list (analysis.text name))))))]))
+        (in (#analysis.Extension extension (list (analysis.text name))))))]))
 
 (def: ruby::apply
   Handler
@@ -174,7 +174,7 @@
                         (phase archive abstractionC))
          inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
          _ (analysis/type.infer Any)]
-        (wrap (#analysis.Extension extension (list& abstractionA inputsA)))))]))
+        (in (#analysis.Extension extension (list& abstractionA inputsA)))))]))
 
 (def: ruby::import
   Handler
@@ -183,7 +183,7 @@
     (function (_ extension phase archive name)
       (do phase.monad
         [_ (analysis/type.infer Bit)]
-        (wrap (#analysis.Extension extension (list (analysis.text name))))))]))
+        (in (#analysis.Extension extension (list (analysis.text name))))))]))
 
 (def: #export bundle
   Bundle
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/scheme.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/scheme.lux
index e7ff4ba15..8e309a9de 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/scheme.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/scheme.lux
@@ -38,7 +38,7 @@
                    (phase archive lengthC))
          [var_id varT] (analysis/type.with_env check.var)
          _ (analysis/type.infer (type (Array varT)))]
-        (wrap (#analysis.Extension extension (list lengthA)))))]))
+        (in (#analysis.Extension extension (list lengthA)))))]))
 
 (def: array::length
   Handler
@@ -50,7 +50,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer Nat)]
-        (wrap (#analysis.Extension extension (list arrayA)))))]))
+        (in (#analysis.Extension extension (list arrayA)))))]))
 
 (def: array::read
   Handler
@@ -64,7 +64,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer varT)]
-        (wrap (#analysis.Extension extension (list indexA arrayA)))))]))
+        (in (#analysis.Extension extension (list indexA arrayA)))))]))
 
 (def: array::write
   Handler
@@ -80,7 +80,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer (type (Array varT)))]
-        (wrap (#analysis.Extension extension (list indexA valueA arrayA)))))]))
+        (in (#analysis.Extension extension (list indexA valueA arrayA)))))]))
 
 (def: array::delete
   Handler
@@ -94,7 +94,7 @@
          arrayA (analysis/type.with_type (type (Array varT))
                   (phase archive arrayC))
          _ (analysis/type.infer (type (Array varT)))]
-        (wrap (#analysis.Extension extension (list indexA arrayA)))))]))
+        (in (#analysis.Extension extension (list indexA arrayA)))))]))
 
 (def: bundle::array
   Bundle
@@ -131,7 +131,7 @@
     (function (_ extension phase archive name)
       (do phase.monad
         [_ (analysis/type.infer Any)]
-        (wrap (#analysis.Extension extension (list (analysis.text name))))))]))
+        (in (#analysis.Extension extension (list (analysis.text name))))))]))
 
 (def: scheme::apply
   Handler
@@ -143,7 +143,7 @@
                         (phase archive abstractionC))
          inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
          _ (analysis/type.infer Any)]
-        (wrap (#analysis.Extension extension (list& abstractionA inputsA)))))]))
+        (in (#analysis.Extension extension (list& abstractionA inputsA)))))]))
 
 (def: #export bundle
   Bundle
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 d11c6cb49..a3265adb0 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
@@ -77,7 +77,7 @@
   (Parser (Modifier field.Field))
   (`` ($_ <>.either
           (~~ (template [