From 36303d6cb2ce3ab9e36d045b9516c997bd461862 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 24 Aug 2021 05:23:45 -0400 Subject: Outsourced the syntax for labelled type definitions to macros. --- stdlib/source/documentation/lux.lux | 13 +- stdlib/source/documentation/lux/abstract/monad.lux | 6 +- .../source/documentation/lux/abstract/monoid.lux | 2 +- .../source/documentation/lux/data/collection.lux | 17 +- .../documentation/lux/data/collection/set.lux | 63 + .../lux/data/collection/set/multi.lux | 81 + .../lux/data/collection/set/ordered.lux | 64 + .../documentation/lux/data/collection/stack.lux | 44 + .../documentation/lux/data/collection/tree.lux | 55 + .../lux/data/collection/tree/finger.lux | 60 + .../lux/data/collection/tree/zipper.lux | 67 + stdlib/source/documentation/lux/macro/syntax.lux | 8 +- stdlib/source/documentation/lux/math/logic.lux | 2 +- .../source/documentation/lux/meta/annotation.lux | 1 - stdlib/source/documentation/lux/test.lux | 126 ++ stdlib/source/documentation/lux/time.lux | 87 + stdlib/source/documentation/lux/time/date.lux | 46 + stdlib/source/documentation/lux/time/day.lux | 37 + stdlib/source/documentation/lux/time/duration.lux | 54 + stdlib/source/documentation/lux/time/instant.lux | 70 + stdlib/source/documentation/lux/time/month.lux | 47 + stdlib/source/documentation/lux/time/year.lux | 59 + stdlib/source/documentation/lux/type.lux | 43 + stdlib/source/documentation/lux/type/abstract.lux | 150 ++ stdlib/source/documentation/lux/type/check.lux | 96 ++ stdlib/source/documentation/lux/type/dynamic.lux | 38 + stdlib/source/documentation/lux/type/implicit.lux | 60 + stdlib/source/library/lux.lux | 1655 ++++++++++---------- stdlib/source/library/lux/abstract/comonad.lux | 12 +- .../source/library/lux/abstract/comonad/cofree.lux | 8 +- stdlib/source/library/lux/abstract/equivalence.lux | 2 +- stdlib/source/library/lux/abstract/functor.lux | 18 +- .../library/lux/abstract/functor/contravariant.lux | 2 +- stdlib/source/library/lux/abstract/hash.lux | 4 +- stdlib/source/library/lux/abstract/mix.lux | 2 +- stdlib/source/library/lux/abstract/monad.lux | 44 +- stdlib/source/library/lux/abstract/monad/free.lux | 21 +- .../source/library/lux/abstract/monad/indexed.lux | 9 +- stdlib/source/library/lux/abstract/monoid.lux | 8 +- stdlib/source/library/lux/abstract/order.lux | 4 +- stdlib/source/library/lux/abstract/predicate.lux | 4 +- .../source/library/lux/control/concatenative.lux | 13 +- .../library/lux/control/concurrency/actor.lux | 37 +- .../library/lux/control/concurrency/async.lux | 12 +- .../library/lux/control/concurrency/atom.lux | 2 +- .../source/library/lux/control/concurrency/frp.lux | 18 +- .../library/lux/control/concurrency/semaphore.lux | 16 +- .../source/library/lux/control/concurrency/stm.lux | 37 +- .../library/lux/control/concurrency/thread.lux | 13 +- stdlib/source/library/lux/control/continuation.lux | 4 +- stdlib/source/library/lux/control/exception.lux | 25 +- stdlib/source/library/lux/control/function.lux | 2 +- .../source/library/lux/control/function/mixin.lux | 2 +- .../source/library/lux/control/function/mutual.lux | 104 +- stdlib/source/library/lux/control/io.lux | 8 +- stdlib/source/library/lux/control/lazy.lux | 4 +- stdlib/source/library/lux/control/maybe.lux | 10 +- stdlib/source/library/lux/control/parser.lux | 20 +- .../source/library/lux/control/parser/analysis.lux | 4 +- .../source/library/lux/control/parser/binary.lux | 8 +- stdlib/source/library/lux/control/parser/code.lux | 24 +- .../library/lux/control/parser/environment.lux | 2 +- stdlib/source/library/lux/control/parser/json.lux | 6 +- .../library/lux/control/parser/synthesis.lux | 2 +- stdlib/source/library/lux/control/parser/text.lux | 15 +- stdlib/source/library/lux/control/parser/type.lux | 10 +- stdlib/source/library/lux/control/parser/xml.lux | 2 +- stdlib/source/library/lux/control/pipe.lux | 9 +- stdlib/source/library/lux/control/reader.lux | 6 +- stdlib/source/library/lux/control/region.lux | 12 +- stdlib/source/library/lux/control/remember.lux | 4 +- .../library/lux/control/security/capability.lux | 4 +- .../source/library/lux/control/security/policy.lux | 9 +- stdlib/source/library/lux/control/state.lux | 10 +- stdlib/source/library/lux/control/thread.lux | 4 +- stdlib/source/library/lux/control/try.lux | 13 +- stdlib/source/library/lux/control/writer.lux | 19 +- stdlib/source/library/lux/data/binary.lux | 2 +- stdlib/source/library/lux/data/bit.lux | 2 +- .../source/library/lux/data/collection/array.lux | 4 +- .../library/lux/data/collection/dictionary.lux | 66 +- .../lux/data/collection/dictionary/ordered.lux | 27 +- .../lux/data/collection/dictionary/plist.lux | 2 +- stdlib/source/library/lux/data/collection/list.lux | 70 +- .../source/library/lux/data/collection/queue.lux | 13 +- stdlib/source/library/lux/data/collection/row.lux | 60 +- .../library/lux/data/collection/sequence.lux | 17 +- stdlib/source/library/lux/data/collection/set.lux | 2 +- .../library/lux/data/collection/set/multi.lux | 11 +- .../library/lux/data/collection/set/ordered.lux | 4 +- .../source/library/lux/data/collection/stack.lux | 7 +- stdlib/source/library/lux/data/collection/tree.lux | 25 +- .../library/lux/data/collection/tree/finger.lux | 27 +- .../library/lux/data/collection/tree/zipper.lux | 57 +- stdlib/source/library/lux/data/color.lux | 47 +- stdlib/source/library/lux/data/format/binary.lux | 8 +- stdlib/source/library/lux/data/format/css.lux | 27 +- stdlib/source/library/lux/data/format/css/font.lux | 18 +- .../library/lux/data/format/css/selector.lux | 5 +- .../source/library/lux/data/format/css/value.lux | 35 +- stdlib/source/library/lux/data/format/html.lux | 72 +- stdlib/source/library/lux/data/format/json.lux | 61 +- stdlib/source/library/lux/data/format/markdown.lux | 56 +- stdlib/source/library/lux/data/format/tar.lux | 72 +- stdlib/source/library/lux/data/format/xml.lux | 39 +- stdlib/source/library/lux/data/identity.lux | 6 +- stdlib/source/library/lux/data/name.lux | 4 +- stdlib/source/library/lux/data/store.lux | 22 +- stdlib/source/library/lux/data/text.lux | 4 +- stdlib/source/library/lux/data/text/format.lux | 4 +- stdlib/source/library/lux/data/text/regex.lux | 46 +- .../source/library/lux/data/text/unicode/block.lux | 2 +- stdlib/source/library/lux/data/trace.lux | 21 +- stdlib/source/library/lux/debug.lux | 36 +- stdlib/source/library/lux/documentation.lux | 45 +- stdlib/source/library/lux/extension.lux | 11 +- stdlib/source/library/lux/ffi.js.lux | 149 +- stdlib/source/library/lux/ffi.jvm.lux | 447 +++--- stdlib/source/library/lux/ffi.lua.lux | 123 +- stdlib/source/library/lux/ffi.old.lux | 440 +++--- stdlib/source/library/lux/ffi.php.lux | 127 +- stdlib/source/library/lux/ffi.py.lux | 145 +- stdlib/source/library/lux/ffi.rb.lux | 131 +- stdlib/source/library/lux/ffi.scm.lux | 19 +- stdlib/source/library/lux/locale.lux | 6 +- stdlib/source/library/lux/locale/language.lux | 5 +- stdlib/source/library/lux/locale/territory.lux | 9 +- stdlib/source/library/lux/macro.lux | 66 +- stdlib/source/library/lux/macro/code.lux | 22 +- stdlib/source/library/lux/macro/local.lux | 6 +- stdlib/source/library/lux/macro/syntax.lux | 30 +- .../library/lux/macro/syntax/annotations.lux | 2 +- stdlib/source/library/lux/macro/syntax/check.lux | 5 +- .../library/lux/macro/syntax/declaration.lux | 7 +- .../source/library/lux/macro/syntax/definition.lux | 11 +- stdlib/source/library/lux/macro/syntax/input.lux | 5 +- stdlib/source/library/lux/macro/template.lux | 47 +- stdlib/source/library/lux/math/infix.lux | 25 +- .../source/library/lux/math/logic/continuous.lux | 2 +- stdlib/source/library/lux/math/logic/fuzzy.lux | 2 +- stdlib/source/library/lux/math/modular.lux | 9 +- stdlib/source/library/lux/math/number/complex.lux | 25 +- stdlib/source/library/lux/math/number/frac.lux | 4 +- stdlib/source/library/lux/math/number/i64.lux | 4 +- stdlib/source/library/lux/math/number/int.lux | 8 +- stdlib/source/library/lux/math/number/nat.lux | 4 +- stdlib/source/library/lux/math/number/ratio.lux | 13 +- stdlib/source/library/lux/math/number/rev.lux | 4 +- stdlib/source/library/lux/math/random.lux | 22 +- stdlib/source/library/lux/meta.lux | 80 +- stdlib/source/library/lux/meta/annotation.lux | 3 +- stdlib/source/library/lux/program.lux | 5 +- stdlib/source/library/lux/static.lux | 2 +- stdlib/source/library/lux/target/common_lisp.lux | 48 +- stdlib/source/library/lux/target/js.lux | 24 +- stdlib/source/library/lux/target/jvm.lux | 443 +++--- stdlib/source/library/lux/target/jvm/attribute.lux | 12 +- .../library/lux/target/jvm/attribute/code.lux | 13 +- .../lux/target/jvm/attribute/code/exception.lux | 9 +- stdlib/source/library/lux/target/jvm/bytecode.lux | 55 +- .../library/lux/target/jvm/bytecode/address.lux | 2 +- .../lux/target/jvm/bytecode/environment.lux | 7 +- .../lux/target/jvm/bytecode/environment/limit.lux | 7 +- .../jvm/bytecode/environment/limit/registry.lux | 17 +- .../jvm/bytecode/environment/limit/stack.lux | 4 +- .../lux/target/jvm/bytecode/instruction.lux | 12 +- .../library/lux/target/jvm/bytecode/jump.lux | 6 +- stdlib/source/library/lux/target/jvm/class.lux | 25 +- stdlib/source/library/lux/target/jvm/constant.lux | 47 +- .../library/lux/target/jvm/constant/pool.lux | 12 +- .../library/lux/target/jvm/encoding/name.lux | 3 +- stdlib/source/library/lux/target/jvm/field.lux | 11 +- stdlib/source/library/lux/target/jvm/index.lux | 2 +- stdlib/source/library/lux/target/jvm/method.lux | 13 +- stdlib/source/library/lux/target/jvm/modifier.lux | 2 +- .../source/library/lux/target/jvm/reflection.lux | 14 +- stdlib/source/library/lux/target/jvm/type.lux | 21 +- .../source/library/lux/target/jvm/type/alias.lux | 4 +- .../library/lux/target/jvm/type/descriptor.lux | 4 +- stdlib/source/library/lux/target/jvm/type/lux.lux | 44 +- .../source/library/lux/target/jvm/type/parser.lux | 10 +- .../library/lux/target/jvm/type/signature.lux | 10 +- stdlib/source/library/lux/target/lua.lux | 18 +- stdlib/source/library/lux/target/php.lux | 32 +- stdlib/source/library/lux/target/python.lux | 29 +- stdlib/source/library/lux/target/r.lux | 20 +- stdlib/source/library/lux/target/ruby.lux | 33 +- stdlib/source/library/lux/target/scheme.lux | 23 +- stdlib/source/library/lux/test.lux | 133 +- stdlib/source/library/lux/time.lux | 40 +- stdlib/source/library/lux/time/date.lux | 16 +- stdlib/source/library/lux/time/day.lux | 17 +- stdlib/source/library/lux/time/duration.lux | 18 +- stdlib/source/library/lux/time/instant.lux | 12 +- stdlib/source/library/lux/time/month.lux | 29 +- stdlib/source/library/lux/time/year.lux | 12 +- stdlib/source/library/lux/tool/compiler.lux | 18 +- stdlib/source/library/lux/tool/compiler/arity.lux | 3 +- .../library/lux/tool/compiler/default/init.lux | 12 +- .../library/lux/tool/compiler/default/platform.lux | 56 +- .../lux/tool/compiler/language/lux/analysis.lux | 66 +- .../lux/tool/compiler/language/lux/directive.lux | 32 +- .../lux/tool/compiler/language/lux/generation.lux | 19 +- .../compiler/language/lux/phase/analysis/case.lux | 12 +- .../language/lux/phase/analysis/case/coverage.lux | 4 +- .../language/lux/phase/analysis/function.lux | 12 +- .../language/lux/phase/analysis/inference.lux | 10 +- .../language/lux/phase/analysis/module.lux | 18 +- .../compiler/language/lux/phase/analysis/scope.lux | 8 +- .../language/lux/phase/analysis/structure.lux | 50 +- .../tool/compiler/language/lux/phase/directive.lux | 6 +- .../tool/compiler/language/lux/phase/extension.lux | 5 +- .../language/lux/phase/extension/analysis/js.lux | 6 +- .../language/lux/phase/extension/analysis/jvm.lux | 528 +++---- .../language/lux/phase/extension/analysis/lua.lux | 4 +- .../language/lux/phase/extension/analysis/lux.lux | 34 +- .../language/lux/phase/extension/analysis/php.lux | 6 +- .../lux/phase/extension/analysis/python.lux | 4 +- .../language/lux/phase/extension/analysis/ruby.lux | 4 +- .../lux/phase/extension/analysis/scheme.lux | 2 +- .../language/lux/phase/extension/bundle.lux | 2 +- .../language/lux/phase/extension/directive/jvm.lux | 22 +- .../language/lux/phase/extension/directive/lux.lux | 20 +- .../extension/generation/common_lisp/common.lux | 6 +- .../lux/phase/extension/generation/js/common.lux | 12 +- .../lux/phase/extension/generation/js/host.lux | 12 +- .../lux/phase/extension/generation/jvm/common.lux | 30 +- .../lux/phase/extension/generation/jvm/host.lux | 162 +- .../lux/phase/extension/generation/lua/common.lux | 26 +- .../lux/phase/extension/generation/lua/host.lux | 12 +- .../lux/phase/extension/generation/php/common.lux | 30 +- .../lux/phase/extension/generation/php/host.lux | 6 +- .../phase/extension/generation/python/common.lux | 32 +- .../lux/phase/extension/generation/python/host.lux | 10 +- .../lux/phase/extension/generation/r/common.lux | 6 +- .../lux/phase/extension/generation/ruby/common.lux | 26 +- .../lux/phase/extension/generation/ruby/host.lux | 4 +- .../phase/extension/generation/scheme/common.lux | 14 +- .../lux/phase/extension/generation/scheme/host.lux | 2 +- .../lux/phase/generation/common_lisp/case.lux | 34 +- .../lux/phase/generation/common_lisp/function.lux | 14 +- .../lux/phase/generation/common_lisp/loop.lux | 16 +- .../lux/phase/generation/common_lisp/runtime.lux | 14 +- .../lux/phase/generation/common_lisp/structure.lux | 8 +- .../language/lux/phase/generation/extension.lux | 6 +- .../compiler/language/lux/phase/generation/js.lux | 4 +- .../language/lux/phase/generation/js/case.lux | 22 +- .../language/lux/phase/generation/js/function.lux | 8 +- .../language/lux/phase/generation/js/loop.lux | 20 +- .../language/lux/phase/generation/js/runtime.lux | 10 +- .../language/lux/phase/generation/js/structure.lux | 8 +- .../language/lux/phase/generation/jvm/function.lux | 24 +- .../generation/jvm/function/field/constant.lux | 2 +- .../generation/jvm/function/field/variable.lux | 6 +- .../lux/phase/generation/jvm/function/method.lux | 2 +- .../phase/generation/jvm/function/method/apply.lux | 104 +- .../phase/generation/jvm/function/method/init.lux | 14 +- .../phase/generation/jvm/function/method/new.lux | 14 +- .../phase/generation/jvm/function/method/reset.lux | 2 +- .../language/lux/phase/generation/jvm/host.lux | 12 +- .../language/lux/phase/generation/jvm/loop.lux | 34 +- .../language/lux/phase/generation/jvm/program.lux | 4 +- .../lux/phase/generation/jvm/reference.lux | 4 +- .../language/lux/phase/generation/jvm/runtime.lux | 40 +- .../lux/phase/generation/jvm/structure.lux | 16 +- .../compiler/language/lux/phase/generation/lua.lux | 4 +- .../language/lux/phase/generation/lua/case.lux | 32 +- .../language/lux/phase/generation/lua/function.lux | 8 +- .../language/lux/phase/generation/lua/loop.lux | 12 +- .../language/lux/phase/generation/lua/runtime.lux | 12 +- .../lux/phase/generation/lua/structure.lux | 8 +- .../compiler/language/lux/phase/generation/php.lux | 4 +- .../language/lux/phase/generation/php/case.lux | 32 +- .../language/lux/phase/generation/php/function.lux | 12 +- .../language/lux/phase/generation/php/loop.lux | 26 +- .../language/lux/phase/generation/php/runtime.lux | 14 +- .../lux/phase/generation/php/structure.lux | 10 +- .../language/lux/phase/generation/python/case.lux | 32 +- .../lux/phase/generation/python/function.lux | 6 +- .../language/lux/phase/generation/python/loop.lux | 18 +- .../lux/phase/generation/python/runtime.lux | 12 +- .../lux/phase/generation/python/structure.lux | 8 +- .../language/lux/phase/generation/r/case.lux | 22 +- .../language/lux/phase/generation/r/function.lux | 10 +- .../language/lux/phase/generation/r/loop.lux | 8 +- .../lux/phase/generation/r/procedure/common.lux | 34 +- .../lux/phase/generation/r/procedure/host.lux | 4 +- .../language/lux/phase/generation/r/runtime.lux | 12 +- .../language/lux/phase/generation/r/structure.lux | 8 +- .../language/lux/phase/generation/reference.lux | 4 +- .../language/lux/phase/generation/ruby.lux | 4 +- .../language/lux/phase/generation/ruby/case.lux | 30 +- .../lux/phase/generation/ruby/function.lux | 6 +- .../language/lux/phase/generation/ruby/loop.lux | 14 +- .../language/lux/phase/generation/ruby/runtime.lux | 12 +- .../lux/phase/generation/ruby/structure.lux | 8 +- .../language/lux/phase/generation/scheme/case.lux | 20 +- .../phase/generation/scheme/extension/common.lux | 6 +- .../lux/phase/generation/scheme/function.lux | 10 +- .../language/lux/phase/generation/scheme/loop.lux | 6 +- .../lux/phase/generation/scheme/runtime.lux | 12 +- .../lux/phase/generation/scheme/structure.lux | 8 +- .../tool/compiler/language/lux/phase/synthesis.lux | 8 +- .../compiler/language/lux/phase/synthesis/case.lux | 40 +- .../language/lux/phase/synthesis/function.lux | 82 +- .../compiler/language/lux/phase/synthesis/loop.lux | 58 +- .../language/lux/phase/synthesis/variable.lux | 32 +- .../lux/tool/compiler/language/lux/program.lux | 14 +- .../lux/tool/compiler/language/lux/synthesis.lux | 116 +- .../library/lux/tool/compiler/meta/archive.lux | 13 +- .../lux/tool/compiler/meta/archive/artifact.lux | 63 +- .../lux/tool/compiler/meta/archive/descriptor.lux | 13 +- .../lux/tool/compiler/meta/archive/document.lux | 7 +- .../lux/tool/compiler/meta/archive/signature.lux | 5 +- .../lux/tool/compiler/meta/cache/dependency.lux | 21 +- .../library/lux/tool/compiler/meta/io/archive.lux | 112 +- .../library/lux/tool/compiler/meta/io/context.lux | 24 +- .../library/lux/tool/compiler/meta/packager.lux | 14 +- .../lux/tool/compiler/meta/packager/jvm.lux | 6 +- .../lux/tool/compiler/meta/packager/scheme.lux | 12 +- .../lux/tool/compiler/meta/packager/script.lux | 10 +- stdlib/source/library/lux/tool/compiler/phase.lux | 4 +- .../source/library/lux/tool/compiler/reference.lux | 5 +- .../lux/tool/compiler/reference/variable.lux | 5 +- stdlib/source/library/lux/tool/interpreter.lux | 7 +- stdlib/source/library/lux/tool/mediator.lux | 5 +- stdlib/source/library/lux/type.lux | 65 +- stdlib/source/library/lux/type/abstract.lux | 128 +- stdlib/source/library/lux/type/check.lux | 32 +- stdlib/source/library/lux/type/dynamic.lux | 6 +- stdlib/source/library/lux/type/implicit.lux | 135 +- stdlib/source/library/lux/type/poly.lux | 12 +- stdlib/source/library/lux/type/quotient.lux | 5 +- stdlib/source/library/lux/type/refinement.lux | 5 +- stdlib/source/library/lux/type/resource.lux | 4 +- stdlib/source/library/lux/world/console.lux | 2 +- stdlib/source/library/lux/world/db/jdbc.lux | 17 +- stdlib/source/library/lux/world/db/jdbc/input.lux | 6 +- stdlib/source/library/lux/world/db/jdbc/output.lux | 4 +- stdlib/source/library/lux/world/db/sql.lux | 26 +- stdlib/source/library/lux/world/file.lux | 93 +- stdlib/source/library/lux/world/file/watch.lux | 47 +- stdlib/source/library/lux/world/input/keyboard.lux | 5 +- stdlib/source/library/lux/world/net.lux | 5 +- stdlib/source/library/lux/world/net/http.lux | 49 +- .../source/library/lux/world/net/http/client.lux | 18 +- .../source/library/lux/world/net/http/cookie.lux | 5 +- stdlib/source/library/lux/world/net/http/query.lux | 2 +- .../source/library/lux/world/net/http/request.lux | 4 +- .../library/lux/world/output/video/resolution.lux | 5 +- stdlib/source/library/lux/world/program.lux | 12 +- .../source/library/lux/world/service/inventory.lux | 3 +- stdlib/source/library/lux/world/shell.lux | 6 +- stdlib/source/poly/lux/abstract/equivalence.lux | 32 +- stdlib/source/poly/lux/abstract/functor.lux | 28 +- stdlib/source/poly/lux/data/format/json.lux | 68 +- stdlib/source/program/aedifex.lux | 4 +- stdlib/source/program/aedifex/artifact.lux | 10 +- .../source/program/aedifex/artifact/versioning.lux | 2 +- stdlib/source/program/aedifex/cli.lux | 2 +- stdlib/source/program/aedifex/command/auto.lux | 14 +- stdlib/source/program/aedifex/command/build.lux | 6 +- stdlib/source/program/aedifex/command/clean.lux | 8 +- stdlib/source/program/aedifex/command/deploy.lux | 2 +- stdlib/source/program/aedifex/command/pom.lux | 4 +- .../program/aedifex/dependency/deployment.lux | 10 +- .../program/aedifex/dependency/resolution.lux | 16 +- stdlib/source/program/aedifex/format.lux | 16 +- stdlib/source/program/aedifex/input.lux | 8 +- .../source/program/aedifex/metadata/artifact.lux | 2 +- .../source/program/aedifex/metadata/snapshot.lux | 2 +- stdlib/source/program/aedifex/package.lux | 4 +- stdlib/source/program/aedifex/parser.lux | 24 +- stdlib/source/program/aedifex/pom.lux | 32 +- stdlib/source/program/aedifex/profile.lux | 12 +- stdlib/source/program/aedifex/project.lux | 10 +- .../source/program/aedifex/repository/remote.lux | 2 +- stdlib/source/program/aedifex/runtime.lux | 2 +- stdlib/source/program/compositor.lux | 2 +- stdlib/source/program/compositor/export.lux | 34 +- stdlib/source/program/compositor/import.lux | 36 +- stdlib/source/program/scriptum.lux | 156 +- .../specification/compositor/generation/case.lux | 6 +- .../specification/compositor/generation/common.lux | 6 +- .../compositor/generation/function.lux | 10 +- .../compositor/generation/reference.lux | 2 +- .../compositor/generation/structure.lux | 8 +- stdlib/source/specification/lux/abstract/apply.lux | 10 +- .../source/specification/lux/abstract/comonad.lux | 20 +- .../source/specification/lux/abstract/functor.lux | 18 +- .../lux/abstract/functor/contravariant.lux | 2 +- stdlib/source/specification/lux/abstract/monad.lux | 20 +- .../source/specification/lux/abstract/monoid.lux | 8 +- stdlib/source/specification/lux/world/file.lux | 22 +- stdlib/source/specification/lux/world/shell.lux | 14 +- stdlib/source/test/aedifex/artifact/snapshot.lux | 2 +- .../test/aedifex/artifact/snapshot/build.lux | 2 +- .../test/aedifex/artifact/snapshot/stamp.lux | 2 +- .../source/test/aedifex/artifact/snapshot/time.lux | 2 +- .../test/aedifex/artifact/snapshot/version.lux | 2 +- stdlib/source/test/aedifex/artifact/time.lux | 4 +- stdlib/source/test/aedifex/artifact/time/date.lux | 4 +- stdlib/source/test/aedifex/artifact/time/time.lux | 2 +- stdlib/source/test/aedifex/artifact/versioning.lux | 4 +- stdlib/source/test/aedifex/cache.lux | 30 +- stdlib/source/test/aedifex/command/auto.lux | 14 +- stdlib/source/test/aedifex/command/build.lux | 12 +- stdlib/source/test/aedifex/command/clean.lux | 10 +- stdlib/source/test/aedifex/command/deploy.lux | 2 +- stdlib/source/test/aedifex/command/install.lux | 22 +- stdlib/source/test/aedifex/command/pom.lux | 6 +- .../source/test/aedifex/dependency/deployment.lux | 42 +- stdlib/source/test/aedifex/hash.lux | 6 +- stdlib/source/test/aedifex/input.lux | 2 +- stdlib/source/test/aedifex/metadata/artifact.lux | 14 +- stdlib/source/test/aedifex/metadata/snapshot.lux | 14 +- stdlib/source/test/aedifex/package.lux | 4 +- stdlib/source/test/aedifex/parser.lux | 12 +- stdlib/source/test/aedifex/profile.lux | 6 +- stdlib/source/test/aedifex/project.lux | 12 +- stdlib/source/test/aedifex/repository/local.lux | 4 +- stdlib/source/test/aedifex/repository/remote.lux | 14 +- stdlib/source/test/aedifex/runtime.lux | 4 +- stdlib/source/test/lux.lux | 43 +- stdlib/source/test/lux/abstract/comonad/cofree.lux | 4 +- stdlib/source/test/lux/abstract/enum.lux | 6 +- stdlib/source/test/lux/abstract/functor.lux | 8 +- stdlib/source/test/lux/abstract/interval.lux | 48 +- stdlib/source/test/lux/abstract/mix.lux | 2 +- stdlib/source/test/lux/abstract/monad.lux | 10 +- stdlib/source/test/lux/abstract/monad/free.lux | 2 +- stdlib/source/test/lux/abstract/monoid.lux | 6 +- stdlib/source/test/lux/abstract/predicate.lux | 2 +- .../source/test/lux/control/concurrency/actor.lux | 4 +- .../source/test/lux/control/concurrency/async.lux | 2 +- stdlib/source/test/lux/control/concurrency/frp.lux | 10 +- .../test/lux/control/concurrency/semaphore.lux | 24 +- stdlib/source/test/lux/control/concurrency/stm.lux | 4 +- .../source/test/lux/control/concurrency/thread.lux | 2 +- stdlib/source/test/lux/control/exception.lux | 2 +- stdlib/source/test/lux/control/function.lux | 6 +- stdlib/source/test/lux/control/function/memo.lux | 4 +- stdlib/source/test/lux/control/function/mixin.lux | 4 +- stdlib/source/test/lux/control/function/mutual.lux | 4 +- stdlib/source/test/lux/control/lazy.lux | 2 +- stdlib/source/test/lux/control/maybe.lux | 2 +- stdlib/source/test/lux/control/parser.lux | 36 +- stdlib/source/test/lux/control/parser/analysis.lux | 2 +- stdlib/source/test/lux/control/parser/binary.lux | 32 +- stdlib/source/test/lux/control/parser/cli.lux | 2 +- stdlib/source/test/lux/control/parser/code.lux | 8 +- .../source/test/lux/control/parser/environment.lux | 4 +- stdlib/source/test/lux/control/parser/json.lux | 24 +- .../source/test/lux/control/parser/synthesis.lux | 20 +- stdlib/source/test/lux/control/parser/text.lux | 72 +- stdlib/source/test/lux/control/parser/type.lux | 6 +- stdlib/source/test/lux/control/parser/xml.lux | 6 +- stdlib/source/test/lux/control/region.lux | 18 +- stdlib/source/test/lux/control/remember.lux | 4 +- stdlib/source/test/lux/control/state.lux | 2 +- stdlib/source/test/lux/data/binary.lux | 10 +- stdlib/source/test/lux/data/collection/array.lux | 6 +- stdlib/source/test/lux/data/collection/bits.lux | 10 +- .../source/test/lux/data/collection/dictionary.lux | 12 +- .../lux/data/collection/dictionary/ordered.lux | 6 +- .../test/lux/data/collection/dictionary/plist.lux | 6 +- stdlib/source/test/lux/data/collection/list.lux | 64 +- stdlib/source/test/lux/data/collection/queue.lux | 4 +- .../test/lux/data/collection/queue/priority.lux | 6 +- stdlib/source/test/lux/data/collection/row.lux | 10 +- .../source/test/lux/data/collection/sequence.lux | 10 +- stdlib/source/test/lux/data/collection/set.lux | 18 +- .../source/test/lux/data/collection/set/multi.lux | 14 +- .../test/lux/data/collection/set/ordered.lux | 4 +- stdlib/source/test/lux/data/collection/stack.lux | 2 +- stdlib/source/test/lux/data/collection/tree.lux | 12 +- .../test/lux/data/collection/tree/finger.lux | 10 +- .../test/lux/data/collection/tree/zipper.lux | 4 +- stdlib/source/test/lux/data/color.lux | 8 +- stdlib/source/test/lux/data/format/binary.lux | 2 +- stdlib/source/test/lux/data/format/json.lux | 14 +- stdlib/source/test/lux/data/format/tar.lux | 16 +- stdlib/source/test/lux/data/format/xml.lux | 4 +- stdlib/source/test/lux/data/name.lux | 10 +- stdlib/source/test/lux/data/sum.lux | 16 +- stdlib/source/test/lux/data/text.lux | 30 +- stdlib/source/test/lux/data/text/buffer.lux | 2 +- stdlib/source/test/lux/data/text/encoding.lux | 2 +- stdlib/source/test/lux/data/text/escape.lux | 8 +- stdlib/source/test/lux/data/text/format.lux | 4 +- stdlib/source/test/lux/data/text/unicode/block.lux | 10 +- stdlib/source/test/lux/data/text/unicode/set.lux | 2 +- stdlib/source/test/lux/debug.lux | 16 +- stdlib/source/test/lux/documentation.lux | 2 +- stdlib/source/test/lux/extension.lux | 14 +- stdlib/source/test/lux/ffi.js.lux | 8 +- stdlib/source/test/lux/ffi.jvm.lux | 38 +- stdlib/source/test/lux/ffi.old.lux | 10 +- stdlib/source/test/lux/locale.lux | 12 +- stdlib/source/test/lux/locale/language.lux | 21 +- stdlib/source/test/lux/locale/territory.lux | 29 +- stdlib/source/test/lux/macro.lux | 14 +- stdlib/source/test/lux/macro/code.lux | 50 +- .../source/test/lux/macro/syntax/annotations.lux | 2 +- .../source/test/lux/macro/syntax/declaration.lux | 2 +- stdlib/source/test/lux/macro/syntax/export.lux | 12 +- .../source/test/lux/macro/syntax/type/variable.lux | 2 +- stdlib/source/test/lux/math.lux | 24 +- stdlib/source/test/lux/math/logic/fuzzy.lux | 8 +- stdlib/source/test/lux/math/modular.lux | 6 +- stdlib/source/test/lux/math/modulus.lux | 2 +- stdlib/source/test/lux/math/number/complex.lux | 8 +- stdlib/source/test/lux/math/number/frac.lux | 14 +- stdlib/source/test/lux/math/number/i16.lux | 4 +- stdlib/source/test/lux/math/number/i32.lux | 4 +- stdlib/source/test/lux/math/number/i64.lux | 18 +- stdlib/source/test/lux/math/number/i8.lux | 4 +- stdlib/source/test/lux/math/number/int.lux | 10 +- stdlib/source/test/lux/math/number/nat.lux | 8 +- stdlib/source/test/lux/math/number/ratio.lux | 10 +- stdlib/source/test/lux/math/number/rev.lux | 18 +- stdlib/source/test/lux/meta.lux | 82 +- stdlib/source/test/lux/meta/annotation.lux | 9 +- stdlib/source/test/lux/target/jvm.lux | 73 +- stdlib/source/test/lux/test.lux | 6 +- stdlib/source/test/lux/time.lux | 16 +- stdlib/source/test/lux/time/date.lux | 10 +- stdlib/source/test/lux/time/day.lux | 2 +- stdlib/source/test/lux/time/duration.lux | 8 +- stdlib/source/test/lux/time/month.lux | 8 +- .../compiler/language/lux/phase/analysis/case.lux | 60 +- .../language/lux/phase/analysis/function.lux | 10 +- .../language/lux/phase/analysis/primitive.lux | 2 +- .../language/lux/phase/analysis/reference.lux | 3 +- .../language/lux/phase/analysis/structure.lux | 52 +- .../language/lux/phase/extension/analysis/lux.lux | 30 +- .../compiler/language/lux/phase/synthesis/case.lux | 54 +- .../language/lux/phase/synthesis/function.lux | 58 +- .../compiler/language/lux/phase/synthesis/loop.lux | 26 +- .../language/lux/phase/synthesis/primitive.lux | 6 +- .../language/lux/phase/synthesis/structure.lux | 6 +- .../language/lux/phase/synthesis/variable.lux | 28 +- .../test/lux/tool/compiler/language/lux/syntax.lux | 32 +- stdlib/source/test/lux/type.lux | 28 +- stdlib/source/test/lux/type/check.lux | 52 +- stdlib/source/test/lux/type/implicit.lux | 16 +- stdlib/source/test/lux/type/poly/equivalence.lux | 37 +- stdlib/source/test/lux/type/poly/json.lux | 45 +- stdlib/source/test/lux/type/quotient.lux | 2 +- stdlib/source/test/lux/type/refinement.lux | 24 +- stdlib/source/test/lux/type/resource.lux | 12 +- stdlib/source/test/lux/type/unit.lux | 22 +- stdlib/source/test/lux/world/file/watch.lux | 4 +- 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 | 4 +- 557 files changed, 8048 insertions(+), 6579 deletions(-) create mode 100644 stdlib/source/documentation/lux/data/collection/set.lux create mode 100644 stdlib/source/documentation/lux/data/collection/set/multi.lux create mode 100644 stdlib/source/documentation/lux/data/collection/set/ordered.lux create mode 100644 stdlib/source/documentation/lux/data/collection/stack.lux create mode 100644 stdlib/source/documentation/lux/data/collection/tree.lux create mode 100644 stdlib/source/documentation/lux/data/collection/tree/finger.lux create mode 100644 stdlib/source/documentation/lux/data/collection/tree/zipper.lux create mode 100644 stdlib/source/documentation/lux/test.lux create mode 100644 stdlib/source/documentation/lux/time.lux create mode 100644 stdlib/source/documentation/lux/time/date.lux create mode 100644 stdlib/source/documentation/lux/time/day.lux create mode 100644 stdlib/source/documentation/lux/time/duration.lux create mode 100644 stdlib/source/documentation/lux/time/instant.lux create mode 100644 stdlib/source/documentation/lux/time/month.lux create mode 100644 stdlib/source/documentation/lux/time/year.lux create mode 100644 stdlib/source/documentation/lux/type.lux create mode 100644 stdlib/source/documentation/lux/type/abstract.lux create mode 100644 stdlib/source/documentation/lux/type/check.lux create mode 100644 stdlib/source/documentation/lux/type/dynamic.lux create mode 100644 stdlib/source/documentation/lux/type/implicit.lux (limited to 'stdlib/source') diff --git a/stdlib/source/documentation/lux.lux b/stdlib/source/documentation/lux.lux index ac01ef0f1..4365ea0eb 100644 --- a/stdlib/source/documentation/lux.lux +++ b/stdlib/source/documentation/lux.lux @@ -22,10 +22,10 @@ ["#." program] ["#." static] ["#." target] - ... ["#." test] - ... ["#." time] - ... ... ["#." tool] ... TODO: Documentation for this - ... ["#." type] + ["#." test] + ["#." time] + ... ["#." tool] ... TODO: Documentation for this + ["#." type] ... ["#." world] ... ["#." extension] ... ["#." target #_ @@ -49,7 +49,10 @@ /meta.documentation /program.documentation /static.documentation - /target.documentation])) + /target.documentation + /test.documentation + /time.documentation + /type.documentation])) (program: inputs (io.io (debug.log! ($.documentation ..documentation)))) diff --git a/stdlib/source/documentation/lux/abstract/monad.lux b/stdlib/source/documentation/lux/abstract/monad.lux index cdf12eedf..9b2772a52 100644 --- a/stdlib/source/documentation/lux/abstract/monad.lux +++ b/stdlib/source/documentation/lux/abstract/monad.lux @@ -29,9 +29,9 @@ "Run all the monadic values in the list and produce a list of the base values." [(all monad)]) -(documentation: /.map +(documentation: /.each "Apply a monadic function to all values in a list." - [(map monad function items)]) + [(each monad function items)]) (documentation: /.only "Filter the values in a list with a monadic function." @@ -49,7 +49,7 @@ ..do ..then ..all - ..map + ..each ..only ..mix] [/free.documentation])) diff --git a/stdlib/source/documentation/lux/abstract/monoid.lux b/stdlib/source/documentation/lux/abstract/monoid.lux index e9c7a590e..a8eb4b603 100644 --- a/stdlib/source/documentation/lux/abstract/monoid.lux +++ b/stdlib/source/documentation/lux/abstract/monoid.lux @@ -17,5 +17,5 @@ ($.module /._ "" [..Monoid - ($.default /.composite)] + ($.default /.and)] [])) diff --git a/stdlib/source/documentation/lux/data/collection.lux b/stdlib/source/documentation/lux/data/collection.lux index e96f59465..04470c5ca 100644 --- a/stdlib/source/documentation/lux/data/collection.lux +++ b/stdlib/source/documentation/lux/data/collection.lux @@ -15,14 +15,9 @@ ["#." queue] ["#." row] ["#." sequence] - ... ["#." stack] - ... ["#." set - ... ["#/." multi] - ... ["#/." ordered]] - ... ["#." tree - ... ["#/." finger] - ... ["#/." zipper]] - ]) + ["#." stack] + ["#." set] + ["#." tree]]) (.def: .public documentation (.List $.Module) @@ -34,7 +29,7 @@ /queue.documentation /row.documentation /sequence.documentation - ... /stack.documentation - ... /set.documentation - ... /tree.documentation + /stack.documentation + /set.documentation + /tree.documentation ))) diff --git a/stdlib/source/documentation/lux/data/collection/set.lux b/stdlib/source/documentation/lux/data/collection/set.lux new file mode 100644 index 000000000..2778305ec --- /dev/null +++ b/stdlib/source/documentation/lux/data/collection/set.lux @@ -0,0 +1,63 @@ +(.module: + [library + [lux (#- list) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]] + ["." / #_ + ["#." multi] + ["#." ordered]]) + +(documentation: /.has + "" + [(has elem set)]) + +(documentation: /.difference + "" + [(difference sub base)]) + +(documentation: /.intersection + "" + [(intersection filter base)]) + +(documentation: /.sub? + "" + [(sub? super sub)]) + +(documentation: /.super? + "" + [(super? sub super)]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..has + ..difference + ..intersection + ..sub? + ..super? + ($.default /.Set) + ($.default /.member_hash) + ($.default /.empty) + ($.default /.size) + ($.default /.lacks) + ($.default /.member?) + ($.default /.list) + ($.default /.union) + ($.default /.equivalence) + ($.default /.hash) + ($.default /.monoid) + ($.default /.empty?) + ($.default /.of_list) + ($.default /.predicate)] + [/multi.documentation + /ordered.documentation])) diff --git a/stdlib/source/documentation/lux/data/collection/set/multi.lux b/stdlib/source/documentation/lux/data/collection/set/multi.lux new file mode 100644 index 000000000..6e38886dc --- /dev/null +++ b/stdlib/source/documentation/lux/data/collection/set/multi.lux @@ -0,0 +1,81 @@ +(.module: + [library + [lux (#- list) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Set + "A set that keeps track of repetition in its entries.") + +(documentation: /.has + "" + [(has multiplicity elem set)]) + +(documentation: /.lacks + "" + [(lacks multiplicity elem set)]) + +(documentation: /.multiplicity + "" + [(multiplicity set elem)]) + +(template [] + [(documentation: + "" + [( parameter subject)])] + + [/.union] + [/.sum] + [/.intersection] + [/.difference] + ) + +(documentation: /.sub? + "Is 'subject' a sub-set of 'reference'?" + [(sub? reference subject)]) + +(documentation: /.support + "A set of the unique (non repeated) members." + [(support set)]) + +(documentation: /.member? + "" + [(member? set elem)]) + +(documentation: /.super? + "Is 'subject' a super-set of 'reference'?") + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Set + ..has + ..lacks + ..multiplicity + ..union + ..sum + ..intersection + ..difference + ..sub? + ..support + ..member? + ..super? + ($.default /.empty) + ($.default /.size) + ($.default /.list) + ($.default /.equivalence) + ($.default /.hash) + ($.default /.empty?) + ($.default /.of_list) + ($.default /.of_set)] + [])) diff --git a/stdlib/source/documentation/lux/data/collection/set/ordered.lux b/stdlib/source/documentation/lux/data/collection/set/ordered.lux new file mode 100644 index 000000000..0ace59c12 --- /dev/null +++ b/stdlib/source/documentation/lux/data/collection/set/ordered.lux @@ -0,0 +1,64 @@ +(.module: + [library + [lux (#- list) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Set + "A set with ordered entries.") + +(documentation: /.member? + "" + [(member? set elem)]) + +(documentation: /.has + "" + [(has elem set)]) + +(documentation: /.lacks + "" + [(lacks elem set)]) + +(documentation: /.difference + "" + [(difference param subject)]) + +(documentation: /.sub? + "Is 'sub' a sub-set of 'super'?" + [(sub? super sub)]) + +(documentation: /.super? + "Is 'super' a super-set of 'sub'?" + [(super? sub super)]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Set + ..member? + ..has + ..lacks + ..difference + ..sub? + ..super? + ($.default /.empty) + ($.default /.min) + ($.default /.max) + ($.default /.size) + ($.default /.empty?) + ($.default /.list) + ($.default /.of_list) + ($.default /.union) + ($.default /.intersection) + ($.default /.equivalence)] + [])) diff --git a/stdlib/source/documentation/lux/data/collection/stack.lux b/stdlib/source/documentation/lux/data/collection/stack.lux new file mode 100644 index 000000000..c020db741 --- /dev/null +++ b/stdlib/source/documentation/lux/data/collection/stack.lux @@ -0,0 +1,44 @@ +(.module: + [library + [lux (#- list) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Stack + "A first-in, last-out sequential data-structure.") + +(documentation: /.value + "Yields the top value in the stack, if any." + [(value stack)]) + +(documentation: /.next + "" + [(next stack)]) + +(documentation: /.top + "" + [(top value stack)]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Stack + ..value + ..next + ..top + ($.default /.empty) + ($.default /.size) + ($.default /.empty?) + ($.default /.equivalence) + ($.default /.functor)] + [])) diff --git a/stdlib/source/documentation/lux/data/collection/tree.lux b/stdlib/source/documentation/lux/data/collection/tree.lux new file mode 100644 index 000000000..310073287 --- /dev/null +++ b/stdlib/source/documentation/lux/data/collection/tree.lux @@ -0,0 +1,55 @@ +(.module: + [library + [lux (#- list) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]] + ["." / #_ + ["#." finger] + ["#." zipper]]) + +(documentation: /.Tree + "A generic tree data-structure.") + +(documentation: /.flat + "All the leaf values of the tree, in order." + [(flat tree)]) + +(documentation: /.leaf + "" + [(leaf value)]) + +(documentation: /.branch + "" + [(branch value children)]) + +(documentation: /.tree + "Tree literals." + [(: (Tree Nat) + (tree 12 + {34 {} + 56 {} + 78 {90 {}}}))]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Tree + ..flat + ..leaf + ..branch + ..tree + ($.default /.equivalence) + ($.default /.functor) + ($.default /.mix)] + [/finger.documentation + /zipper.documentation])) diff --git a/stdlib/source/documentation/lux/data/collection/tree/finger.lux b/stdlib/source/documentation/lux/data/collection/tree/finger.lux new file mode 100644 index 000000000..683d98f51 --- /dev/null +++ b/stdlib/source/documentation/lux/data/collection/tree/finger.lux @@ -0,0 +1,60 @@ +(.module: + [library + [lux (#- list) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Tree + "A finger tree.") + +(documentation: /.Builder + "A builder for finter tree structures.") + +(documentation: /.builder + "A new builder using the given monoid." + [(builder monoid)]) + +(documentation: /.value + "" + [(value tree)]) + +(documentation: /.tags + "" + [(tags tree)]) + +(documentation: /.values + "" + [(values tree)]) + +(documentation: /.one + "Finds one value that meets the predicate." + [(one predicate tree)]) + +(documentation: /.exists? + "Verifies that a value exists which meets the predicate." + [(exists? predicate tree)]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Tree + ..Builder + ..builder + ..value + ..tags + ..values + ..one + ..exists? + ($.default /.tag) + ($.default /.root)] + [])) diff --git a/stdlib/source/documentation/lux/data/collection/tree/zipper.lux b/stdlib/source/documentation/lux/data/collection/tree/zipper.lux new file mode 100644 index 000000000..d67fb37bf --- /dev/null +++ b/stdlib/source/documentation/lux/data/collection/tree/zipper.lux @@ -0,0 +1,67 @@ +(.module: + [library + [lux (#- list) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Zipper + "Tree zippers, for easy navigation and editing of trees.") + +(documentation: /.set + "" + [(set value zipper)]) + +(documentation: /.update + "" + [(update transform zipper)]) + +(documentation: /.interpose + "" + [(interpose value zipper)]) + +(documentation: /.adopt + "" + [(adopt value zipper)]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Zipper + ..set + ..update + ..interpose + ..adopt + ($.default /.equivalence) + ($.default /.zipper) + ($.default /.tree) + ($.default /.value) + ($.default /.leaf?) + ($.default /.branch?) + ($.default /.start?) + ($.default /.down) + ($.default /.up) + ($.default /.right) + ($.default /.rightmost) + ($.default /.left) + ($.default /.leftmost) + ($.default /.next) + ($.default /.previous) + ($.default /.end) + ($.default /.start) + ($.default /.end?) + ($.default /.remove) + ($.default /.insert_left) + ($.default /.insert_right) + ($.default /.functor) + ($.default /.comonad)] + [])) diff --git a/stdlib/source/documentation/lux/macro/syntax.lux b/stdlib/source/documentation/lux/macro/syntax.lux index b0e76e1a8..feb49c8e9 100644 --- a/stdlib/source/documentation/lux/macro/syntax.lux +++ b/stdlib/source/documentation/lux/macro/syntax.lux @@ -30,11 +30,11 @@ interfaces (tuple (some (super_class_decl^ imports class_vars))) constructor_args (constructor_args^ imports class_vars) methods (some (overriden_method_def^ imports))]) - (let [def_code ($_ text\compose "anon-class:" + (let [def_code ($_ text\composite "anon-class:" (spaced (list (super_class_decl$ (maybe.else object_super_class super)) - (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))))))] + (with_brackets (spaced (list\each super_class_decl$ interfaces))) + (with_brackets (spaced (list\each constructor_arg$ constructor_args))) + (with_brackets (spaced (list\each (method_def$ id) methods))))))] (in (list (` ((~ (code.text def_code))))))))]) (.def: .public documentation diff --git a/stdlib/source/documentation/lux/math/logic.lux b/stdlib/source/documentation/lux/math/logic.lux index f5aaddfc3..35f21fbe7 100644 --- a/stdlib/source/documentation/lux/math/logic.lux +++ b/stdlib/source/documentation/lux/math/logic.lux @@ -13,6 +13,6 @@ (.def: .public documentation (.List $.Module) - ($_ list\compose + ($_ list\composite /continuous.documentation /fuzzy.documentation)) diff --git a/stdlib/source/documentation/lux/meta/annotation.lux b/stdlib/source/documentation/lux/meta/annotation.lux index 42582dad5..ba739e129 100644 --- a/stdlib/source/documentation/lux/meta/annotation.lux +++ b/stdlib/source/documentation/lux/meta/annotation.lux @@ -50,7 +50,6 @@ ($.default /.flagged?) ($.default /.implementation?) ($.default /.recursive_type?) - ($.default /.interface?) ($.default /.function_arguments) ($.default /.type_arguments)] [])) diff --git a/stdlib/source/documentation/lux/test.lux b/stdlib/source/documentation/lux/test.lux new file mode 100644 index 000000000..c241747c0 --- /dev/null +++ b/stdlib/source/documentation/lux/test.lux @@ -0,0 +1,126 @@ +(.module: + [library + [lux (#- and for) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Tally + "A record of successes and failures while executing tests.") + +(documentation: /.Assertion + "An asynchronous operation that yields test results.") + +(documentation: /.Test + "A test that relies on random data generation to thoroughly cover different scenarios.") + +(documentation: /.and' + "Sequencing combinator (for assertions)." + [(and' left right)]) + +(documentation: /.and + "Sequencing combinator." + [(and left right)]) + +(documentation: /.context + "Adds a contextual description to a test's documentation." + [(context description)]) + +(documentation: /.failure + "A failing test, with a given error message.") + +(documentation: /.assertion + "Check that a condition is #1, and fail with the given message otherwise." + [(assertion message condition)]) + +(documentation: /.test + "Check that a condition is #1, and fail with the given message otherwise." + [(test message condition)]) + +(documentation: /.lifted + "" + [(lifted message random)]) + +(documentation: /.Seed + "The seed value used for random testing (if that feature is used).") + +(documentation: /.seed + (format "Execute the given test with a specific seed value." + \n "This allows you to reproduce a failing test case as many times as you want while debugging.") + [(seed value test)]) + +(documentation: /.times + (format "Allows executing a test several times." + \n "By doing this, it's possible to thoroughly test code with many different scenarios." + \n "This assumes that random data generation is being used in tests instead of fixed/constant inputs.") + [(times amount test)]) + +(documentation: /.run! + (format "Executes a test, and exits the program with either a successful or a failing exit code." + \n "WARNING: This procedure is only meant to be used in (program: ...) forms.") + [(run! test)]) + +(template [] + [(documentation: + (format "Specifies a test as covering one or more definitions." + \n "Adds to the test tally information to track which definitions have been tested.") + [( [definition/0 definition/1 ,,, definition/N] + (: Bit + (some "computation")))])] + + [/.cover'] + [/.cover] + ) + +(documentation: /.for + (format "Specifies a context for tests as covering one or more definitions." + \n "Adds to the test tally information to track which definitions have been tested.") + [(for [definition/0 definition/1 ,,, definition/N] + (: Test + some_test))]) + +(documentation: /.covering + (format "Specifies the module being covered by a test." + \n "Adds tracking information to the tally to know which exported definitions in the module need to be covered.") + [(covering .._ + (: Test + some_test))]) + +(documentation: /.in_parallel + "Executes multiple tests in parallel (if the host platform supports it) to take advantage of multiple cores." + [(in_parallel tests)]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "Tools for unit & property-based/generative testing." + [..Tally + ..Assertion + ..Test + ..and' + ..and + ..context + ..failure + ..assertion + ..test + ..lifted + ..Seed + ..seed + ..times + ..run! + ..cover' + ..cover + ..for + ..covering + ..in_parallel + ($.default /.must_try_test_at_least_once) + ($.default /.error_during_execution)] + [])) diff --git a/stdlib/source/documentation/lux/time.lux b/stdlib/source/documentation/lux/time.lux new file mode 100644 index 000000000..1960eec4b --- /dev/null +++ b/stdlib/source/documentation/lux/time.lux @@ -0,0 +1,87 @@ +(.module: + [library + [lux (#- and) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]] + ["." / #_ + ["#." date] + ["#." day] + ["#." duration] + ["#." instant] + ["#." month] + ["#." year]]) + +(template [ ] + [(documentation: + )] + + [/.milli_seconds "Number of milli-seconds in a second."] + [/.seconds "Number of seconds in a minute."] + [/.minutes "Number of minutes in an hour."] + [/.hours "Number of hours in an day."] + ) + +(documentation: /.Time + "Time is defined as milliseconds since the start of the day (00:00:00.000).") + +(documentation: /.midnight + "The instant corresponding to the start of the day: 00:00:00.000") + +(documentation: /.of_millis + "" + [(of_millis milli_seconds)]) + +(documentation: /.Clock + "A clock marking the specific hour, minute, second, and milli-second in a day.") + +(documentation: /.clock + "" + [(clock time)]) + +(documentation: /.time + "" + [(time clock)]) + +(documentation: /.codec + (format "Based on ISO 8601." + \n "For example: 21:14:51.827")) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..milli_seconds + ..seconds + ..minutes + ..hours + ..Time + ..midnight + ..of_millis + ..Clock + ..clock + ..time + ..codec + ($.default /.time_exceeds_a_day) + ($.default /.invalid_hour) + ($.default /.invalid_minute) + ($.default /.invalid_second) + ($.default /.millis) + ($.default /.equivalence) + ($.default /.order) + ($.default /.enum) + ($.default /.parser)] + [/date.documentation + /day.documentation + /duration.documentation + /instant.documentation + /month.documentation + /year.documentation])) diff --git a/stdlib/source/documentation/lux/time/date.lux b/stdlib/source/documentation/lux/time/date.lux new file mode 100644 index 000000000..ebb55be13 --- /dev/null +++ b/stdlib/source/documentation/lux/time/date.lux @@ -0,0 +1,46 @@ +(.module: + [library + [lux (#- and) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Date + "A date specified as a year/month/day triplet.") + +(documentation: /.date + "A date, within the allowed limits." + [(date year month day_of_month)]) + +(documentation: /.codec + (format "Based on ISO 8601." + \n "For example: 2017-01-15")) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Date + ..date + ..codec + ($.default /.invalid_day) + ($.default /.epoch) + ($.default /.year) + ($.default /.month) + ($.default /.day_of_month) + ($.default /.equivalence) + ($.default /.order) + ($.default /.invalid_month) + ($.default /.parser) + ($.default /.days) + ($.default /.of_days) + ($.default /.enum)] + [])) diff --git a/stdlib/source/documentation/lux/time/day.lux b/stdlib/source/documentation/lux/time/day.lux new file mode 100644 index 000000000..df87b2ea8 --- /dev/null +++ b/stdlib/source/documentation/lux/time/day.lux @@ -0,0 +1,37 @@ +(.module: + [library + [lux (#- and) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Day + "A day of the week.") + +(documentation: /.week + "All the days, ordered by when they come in a week.") + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Day + ..week + ($.default /.equivalence) + ($.default /.order) + ($.default /.enum) + ($.default /.not_a_day_of_the_week) + ($.default /.codec) + ($.default /.number) + ($.default /.invalid_day) + ($.default /.by_number) + ($.default /.hash)] + [])) diff --git a/stdlib/source/documentation/lux/time/duration.lux b/stdlib/source/documentation/lux/time/duration.lux new file mode 100644 index 000000000..be4cf82b4 --- /dev/null +++ b/stdlib/source/documentation/lux/time/duration.lux @@ -0,0 +1,54 @@ +(.module: + [library + [lux (#- and) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Duration + "Durations have a resolution of milli-seconds.") + +(documentation: /.difference + "" + [(difference from to)]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Duration + ..difference + ($.default /.of_millis) + ($.default /.millis) + ($.default /.merged) + ($.default /.framed) + ($.default /.up) + ($.default /.down) + ($.default /.inverse) + ($.default /.ticks) + ($.default /.equivalence) + ($.default /.order) + ($.default /.positive?) + ($.default /.negative?) + ($.default /.neutral?) + ($.default /.empty) + ($.default /.milli_second) + ($.default /.second) + ($.default /.minute) + ($.default /.hour) + ($.default /.day) + ($.default /.week) + ($.default /.normal_year) + ($.default /.leap_year) + ($.default /.monoid) + ($.default /.codec) + ($.default /.enum)] + [])) diff --git a/stdlib/source/documentation/lux/time/instant.lux b/stdlib/source/documentation/lux/time/instant.lux new file mode 100644 index 000000000..6672c2329 --- /dev/null +++ b/stdlib/source/documentation/lux/time/instant.lux @@ -0,0 +1,70 @@ +(.module: + [library + [lux (#- and) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Instant + "Instant is defined as milli-seconds since the epoch.") + +(documentation: /.span + "" + [(span from to)]) + +(documentation: /.after + "" + [(after duration instant)]) + +(documentation: /.relative + "" + [(relative instant)]) + +(documentation: /.absolute + "" + [(absolute offset)]) + +(documentation: /.epoch + "The instant corresponding to 1970-01-01T00:00:00Z.") + +(documentation: /.codec + (format "Based on ISO 8601." + \n "For example: 2017-01-15T21:14:51.827Z")) + +(documentation: /.now + "Yields the current instant, as measured from the operating-system's clock.") + +(documentation: /.of_date_time + "" + [(of_date_time date time)]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Instant + ..span + ..after + ..relative + ..absolute + ..epoch + ..codec + ..now + ..of_date_time + ($.default /.of_millis) + ($.default /.millis) + ($.default /.equivalence) + ($.default /.order) + ($.default /.enum) + ($.default /.date) + ($.default /.time) + ($.default /.day_of_week)] + [])) diff --git a/stdlib/source/documentation/lux/time/month.lux b/stdlib/source/documentation/lux/time/month.lux new file mode 100644 index 000000000..9c142401e --- /dev/null +++ b/stdlib/source/documentation/lux/time/month.lux @@ -0,0 +1,47 @@ +(.module: + [library + [lux (#- and) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Month + "A month of the year.") + +(documentation: /.days + "The amount of days of a month." + [(days month)]) + +(documentation: /.leap_year_days + "The amount of days of a month (in a leap year)." + [(leap_year_days month)]) + +(documentation: /.year + "All the months, ordered by when they come in a year.") + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Month + ..days + ..leap_year_days + ..year + ($.default /.equivalence) + ($.default /.number) + ($.default /.invalid_month) + ($.default /.by_number) + ($.default /.hash) + ($.default /.order) + ($.default /.enum) + ($.default /.not_a_month_of_the_year) + ($.default /.codec)] + [])) diff --git a/stdlib/source/documentation/lux/time/year.lux b/stdlib/source/documentation/lux/time/year.lux new file mode 100644 index 000000000..1949a750a --- /dev/null +++ b/stdlib/source/documentation/lux/time/year.lux @@ -0,0 +1,59 @@ +(.module: + [library + [lux (#- and) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Year + (format "A year in the gregorian calendar." + \n "Both negative (< 0) and positive (> 0) values are valid, but not 0." + \n "This is because the first year of the gregorian calendar was year 1.")) + +(documentation: /.year + "A valid year in the gregorian calendar, if possible." + [(year value)]) + +(documentation: /.days + "The amount of days in a typical year.") + +(documentation: /.Period + "An amount of years.") + +(documentation: /.leaps + "The number of leap years in a period of years." + [(leaps year)]) + +(documentation: /.codec + (format "Based on ISO 8601." + \n "For example: 2017")) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Year + ..year + ..days + ..Period + ..leaps + ..codec + ($.default /.there_is_no_year_0) + ($.default /.value) + ($.default /.epoch) + ($.default /.leap) + ($.default /.century) + ($.default /.era) + ($.default /.leap?) + ($.default /.parser) + ($.default /.equivalence) + ($.default /.order)] + [])) diff --git a/stdlib/source/documentation/lux/type.lux b/stdlib/source/documentation/lux/type.lux new file mode 100644 index 000000000..0ad9a5f51 --- /dev/null +++ b/stdlib/source/documentation/lux/type.lux @@ -0,0 +1,43 @@ +(.module: + [library + [lux (#- and) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]] + ["." / #_ + ["#." abstract] + ["#." check] + ["#." dynamic] + ["#." implicit] + ... ["#." poly] + ... ["#." quotient] + ... ["#." refinement] + ... ["#." resource] + ... ["#." unit] + ... ["#." variance] + ]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [] + [/abstract.documentation + /check.documentation + /dynamic.documentation + /implicit.documentation + ... /poly.documentation + ... /quotient.documentation + ... /refinement.documentation + ... /resource.documentation + ... /unit.documentation + ... /variance.documentation + ])) diff --git a/stdlib/source/documentation/lux/type/abstract.lux b/stdlib/source/documentation/lux/type/abstract.lux new file mode 100644 index 000000000..8b1bf10ca --- /dev/null +++ b/stdlib/source/documentation/lux/type/abstract.lux @@ -0,0 +1,150 @@ +(.module: + [library + [lux (#- and) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Frame + "Meta-data about an abstract/nominal type in a stack of them.") + +(documentation: /.current + "The currently-being-defined abstract/nominal type.") + +(documentation: /.specific + "A specific abstract/nominal type still being defined somewhere in the scope." + [(specific name)]) + +(template [ ] + [(documentation: + "Type-casting macro for abstract/nominal types." + [(: + ( (: value)))])] + + [/.:abstraction representation abstraction] + [/.:representation abstraction representation] + ) + +(documentation: /.abstract: + (format "Define abstract/nominal types which hide their representation details." + \n "You can convert between the abstraction and its representation selectively to access the value, while hiding it from others.") + [(abstract: String + {} + + Text + + (def: (string value) + (-> Text String) + (:abstraction value)) + + (def: (text value) + (-> String Text) + (:representation value)))] + ["Type-parameters are optional." + (abstract: (Duplicate a) + {} + + [a a] + + (def: (duplicate value) + (All [a] (-> a (Duplicate a))) + (:abstraction [value value])))] + ["Definitions can be nested." + (abstract: (Single a) + {} + + a + + (def: (single value) + (All [a] (-> a (Single a))) + (:abstraction value)) + + (abstract: (Double a) + {} + + [a a] + + (def: (double value) + (All [a] (-> a (Double a))) + (:abstraction [value value])) + + (def: (single' value) + (All [a] (-> a (Single a))) + (:abstraction Single [value value])) + + (let [value 0123] + (same? value + (|> value + single' + (:representation Single) + double + :representation)))))] + ["Type-parameters do not necessarily have to be used in the representation type." + "If they are not used, they become phantom types and can be used to customize types without changing the representation." + (abstract: (JavaScript a) + {} + + Text + + (abstract: Expression {} Any) + (abstract: Statement {} Any) + + (def: (+ x y) + (-> (JavaScript Expression) (JavaScript Expression) (JavaScript Expression)) + (:abstraction + (format "(" (:representation x) "+" (:representation y) ")"))) + + (def: (while test body) + (-> (JavaScript Expression) (JavaScript Statement) (JavaScript Statement)) + (:abstraction + (format "while(" (:representation test) ") {" + (:representation body) + "}"))))]) + +(documentation: /.:transmutation + "Transmutes an abstract/nominal type's phantom types." + [(abstract: (JavaScript a) + {} + + Text + + (abstract: Expression {} Any) + (abstract: Statement {} Any) + + (def: (statement expression) + (-> (JavaScript Expression) (JavaScript Statement)) + (:transmutation expression)) + + (def: (statement' expression) + (-> (JavaScript Expression) (JavaScript Statement)) + (:transmutation JavaScript expression)))]) + +(documentation: /.^:representation + "Pattern-matching macro to easily extract a representation." + [(def: (computation abstraction) + (All [a] (-> (Abstract a) ???)) + (let [(^:representation value) abstraction] + (foo (bar (baz value)))))]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Frame + ..current + ..specific + ..:abstraction + ..:representation + ..abstract: + ..:transmutation + ..^:representation + ($.default /.no_active_frames)] + [])) diff --git a/stdlib/source/documentation/lux/type/check.lux b/stdlib/source/documentation/lux/type/check.lux new file mode 100644 index 000000000..3264a87a3 --- /dev/null +++ b/stdlib/source/documentation/lux/type/check.lux @@ -0,0 +1,96 @@ +(.module: + [library + [lux (#- and) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Var + "The ID for a type-variable in a type-checking context.") + +(documentation: /.Check + "A type-checking computation which may fail or yield a value.") + +(documentation: /.result + "" + [(result context proc)]) + +(documentation: /.failure + "" + [(failure message)]) + +(documentation: /.assertion + "" + [(assertion message test)]) + +(documentation: /.except + "" + [(except exception message)]) + +(documentation: /.existential + "A brand-new existential type.") + +(documentation: /.bind + (format "Attemmpts to buy a type-variable." + \n "Fails if the variable has been bound already.") + [(bind type id)]) + +(documentation: /.var + "A brand-new (unbound) type-variable.") + +(documentation: /.fresh_context + "An empty/un-used type-checking context.") + +(documentation: /.check + "Type-check to ensure that the 'expected' type subsumes the 'actual' type." + [(check expected actual)]) + +(documentation: /.subsumes? + "A simple type-checking function that just returns a yes/no answer." + [(subsumes? expected actual)]) + +(documentation: /.context + "The current state of the type-checking context.") + +(documentation: /.clean + "Resolves every bound type-variable to yield a new type that is as resolved as possible." + [(clean inputT)]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "Type-checking functionality." + [..Var + ..Check + ..result + ..failure + ..assertion + ..except + ..existential + ..bind + ..var + ..fresh_context + ..check + ..subsumes? + ..context + ..clean + ($.default /.unknown_type_var) + ($.default /.unbound_type_var) + ($.default /.invalid_type_application) + ($.default /.cannot_rebind_var) + ($.default /.type_check_failed) + ($.default /.functor) + ($.default /.apply) + ($.default /.monad) + ($.default /.bound?) + ($.default /.read') + ($.default /.read)] + [])) diff --git a/stdlib/source/documentation/lux/type/dynamic.lux b/stdlib/source/documentation/lux/type/dynamic.lux new file mode 100644 index 000000000..2811fc92e --- /dev/null +++ b/stdlib/source/documentation/lux/type/dynamic.lux @@ -0,0 +1,38 @@ +(.module: + [library + [lux (#- and) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Dynamic + "A value coupled with its type, so it can be checked later.") + +(documentation: /.:dynamic + "" + [(: Dynamic + (:dynamic 123))]) + +(documentation: /.:static + "" + [(: (try.Try Nat) + (:static Nat (:dynamic 123)))]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Dynamic + ..:dynamic + ..:static + ($.default /.wrong_type) + ($.default /.format)] + [])) diff --git a/stdlib/source/documentation/lux/type/implicit.lux b/stdlib/source/documentation/lux/type/implicit.lux new file mode 100644 index 000000000..fea6cbf44 --- /dev/null +++ b/stdlib/source/documentation/lux/type/implicit.lux @@ -0,0 +1,60 @@ +(.module: + [library + [lux (#- and) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.\\ + (format "Automatic implementation selection (for type-class style polymorphism)." + \n "This feature layers type-class style polymorphism on top of Lux's signatures and implementations." + \n "When calling a polymorphic function, or using a polymorphic constant," + \n "this macro will check the types of the arguments, and the expected type for the whole expression" + \n "and it will search in the local scope, the module's scope and the imports' scope" + \n "in order to find suitable implementations to satisfy those requirements." + \n "If a single alternative is found, that one will be used automatically." + \n "If no alternative is found, or if more than one alternative is found (ambiguity)" + \n "a compile-time error will be raised, to alert the user." + \n \n "Caveat emptor: You need to make sure to import the module of any implementation you want to use." + \n "Otherwise, this macro will not find it.") + ["Nat equivalence" + (\ number.equivalence = x y) + (\\ = x y)] + ["Can optionally add the prefix of the module where the signature was defined." + (\\ equivalence.= x y)] + ["(List Nat) equivalence" + (\\ = + (list.indices 10) + (list.indices 10))] + ["(Functor List) each" + (\\ each ++ (list.indices 10))]) + +(documentation: /.with + "Establish lexical bindings for implementations that will be prioritized over non-lexically-bound implementations." + [(with [n.addition] + (n.= (\ n.addition composite left right) + (\\ composite left right)))]) + +(documentation: /.implicit: + "Establish local definitions for implementations that will be prioritized over foreign definitions." + [(implicit: [n.multiplication]) + + (n.= (\ n.multiplication composite left right) + (\\ composite left right))]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..\\ + ..with + ..implicit:] + [])) diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index ffe7daf46..9770f131c 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -837,7 +837,7 @@ _ (failure "Wrong syntax for let''")} tokens))) - (record$ #.End) + (record$ #End) #0) ("lux def" function'' @@ -874,7 +874,7 @@ _ (failure "Wrong syntax for function''")} tokens))) - (record$ #.End) + (record$ #End) #0) ("lux def" location_code @@ -959,7 +959,7 @@ _ (failure "Wrong syntax for def''")} tokens))) - (record$ #.End) + (record$ #End) #0) ("lux def" macro:' @@ -984,7 +984,7 @@ _ (failure "Wrong syntax for macro:'")} tokens))) - (record$ #.End) + (record$ #End) #0) (macro:' .public (comment tokens) @@ -1012,7 +1012,7 @@ (failure "Wrong syntax for $'")} tokens)) -(def:'' .private (list\map f xs) +(def:'' .private (list\each f xs) #End (#UnivQ #End (#UnivQ #End @@ -1023,7 +1023,7 @@ #End (#Item x xs') - (#Item (f x) (list\map f xs'))} + (#Item (f x) (list\each f xs'))} xs)) (def:'' .private Replacement_Environment @@ -1073,25 +1073,25 @@ (..replacement name reps)) [meta (#Form parts)] - [meta (#Form (list\map (with_replacements reps) parts))] + [meta (#Form (list\each (with_replacements reps) parts))] [meta (#Tuple members)] - [meta (#Tuple (list\map (with_replacements reps) members))] + [meta (#Tuple (list\each (with_replacements reps) members))] [meta (#Record slots)] - [meta (#Record (list\map ("lux type check" (#Function (#Product Code Code) (#Product Code Code)) - (function'' [slot] - ({[k v] - [(with_replacements reps k) (with_replacements reps v)]} - slot))) - slots))] + [meta (#Record (list\each ("lux type check" (#Function (#Product Code Code) (#Product Code Code)) + (function'' [slot] + ({[k v] + [(with_replacements reps k) (with_replacements reps v)]} + slot))) + slots))] _ syntax} syntax)) (def:'' .private (n/* param subject) - #.End + #End (#Function Nat (#Function Nat Nat)) ("lux type as" Nat ("lux i64 *" @@ -1102,20 +1102,20 @@ #End (#Function Code Code) ({[_ (#Tuple members)] - (tuple$ (list\map nested_quantification members)) + (tuple$ (list\each nested_quantification members)) [_ (#Record pairs)] - (record$ (list\map ("lux type check" (#Function (#Product Code Code) (#Product Code Code)) - (function'' [pair] - (let'' [name val] pair - [name (nested_quantification val)]))) - pairs)) + (record$ (list\each ("lux type check" (#Function (#Product Code Code) (#Product Code Code)) + (function'' [pair] + (let'' [name val] pair + [name (nested_quantification val)]))) + pairs)) [_ (#Form (#Item [_ (#Tag "library/lux" "Parameter")] (#Item [_ (#Nat idx)] #End)))] (form$ (#Item (tag$ ["library/lux" "Parameter"]) (#Item (nat$ ("lux i64 +" 2 idx)) #End))) [_ (#Form members)] - (form$ (list\map nested_quantification members)) + (form$ (list\each nested_quantification members)) _ code} @@ -1173,7 +1173,7 @@ ("lux text concat" "(All [a] (-> a a))" __paragraph) ("lux text concat" ("lux text concat" "... A name can be provided, to specify a recursive type." __paragraph) - "(All List [a] (Variant Any [a (List a)]))"))))] + "(All List [a] (Union Any [a (List a)]))"))))] #End) (let'' [self_name tokens] ({(#Item [_ (#Identifier "" self_name)] tokens) [self_name tokens] @@ -1315,15 +1315,15 @@ (failure "Wrong syntax for list&")} (list\reversed xs))) -(macro:' .public (Variant tokens) +(macro:' .public (Union tokens) (#Item [(tag$ ["library/lux" "doc"]) (text$ ("lux text concat" - ("lux text concat" "... Variant types:" __paragraph) + ("lux text concat" "... Union types:" __paragraph) ("lux text concat" - ("lux text concat" "(Variant Text Int Bit)" __paragraph) + ("lux text concat" "(Union Text Int Bit)" __paragraph) ("lux text concat" ("lux text concat" "... Nothing." __paragraph) - "(Variant)"))))] + "(Union)"))))] #End) ({#End (in_meta (list (identifier$ ["library/lux" "Nothing"]))) @@ -1413,10 +1413,10 @@ (def:''' .public Or (#Item [(tag$ ["library/lux" "doc"]) - (text$ "An alias for the Variant type constructor.")] + (text$ "An alias for the Union type constructor.")] #End) Macro - ..Variant) + ..Union) (def:''' .public And (#Item [(tag$ ["library/lux" "doc"]) @@ -1479,11 +1479,11 @@ (_ann (#Form (list (_ann (#Tag ["library/lux" "Item"])) token (untemplated_list tokens'))))} tokens)) -(def:''' .private (list\compose xs ys) +(def:''' .private (list\composite xs ys) #End (All [a] (-> ($' List a) ($' List a) ($' List a))) ({(#Item x xs') - (#Item x (list\compose xs' ys)) + (#Item x (list\composite xs' ys)) #End ys} @@ -1493,7 +1493,7 @@ #End (-> Code Code Code Code) ({[_ (#Form parts)] - (form$ (list\compose parts (list a1 a2))) + (form$ (list\composite parts (list a1 a2))) _ (form$ (list op a1 a2))} @@ -1511,10 +1511,10 @@ (text$ ("lux text concat" ("lux text concat" "... Left-association for the application of binary functions over variadic arguments." ..\n) ("lux text concat" - ("lux text concat" "(_$ text\compose ''Hello, '' name ''. How are you?'')" ..\n) + ("lux text concat" "(_$ text\composite ''Hello, '' name ''. How are you?'')" ..\n) ("lux text concat" ("lux text concat" "... =>" ..\n) - "(text\compose (text\compose ''Hello, '' name) ''. How are you?'')"))))] + "(text\composite (text\composite ''Hello, '' name) ''. How are you?'')"))))] #End) ({(#Item op tokens') ({(#Item first nexts) @@ -1533,10 +1533,10 @@ (text$ ("lux text concat" ("lux text concat" "... Right-association for the application of binary functions over variadic arguments." ..\n) ("lux text concat" - ("lux text concat" "($_ text\compose ''Hello, '' name ''. How are you?'')" ..\n) + ("lux text concat" "($_ text\composite ''Hello, '' name ''. How are you?'')" ..\n) ("lux text concat" ("lux text concat" "... =>" ..\n) - "(text\compose ''Hello, '' (text\compose name ''. How are you?''))"))))] + "(text\composite ''Hello, '' (text\composite name ''. How are you?''))"))))] #End) ({(#Item op tokens') ({(#Item last prevs) @@ -1629,7 +1629,7 @@ (failure "Wrong syntax for do")} tokens)) -(def:''' .private (monad\map m f xs) +(def:''' .private (monad\each m f xs) #End ... (All [m a b] ... (-> (Monad m) (-> a (m b)) (List a) (m (List b)))) @@ -1645,7 +1645,7 @@ (#Item x xs') (do m [y (f x) - ys (monad\map m f xs')] + ys (monad\each m f xs')] (in (#Item y ys)))} xs))) @@ -1702,7 +1702,7 @@ #None} plist)) -(def:''' .private (text\compose x y) +(def:''' .private (text\composite x y) #End (-> Text Text Text) ("lux text concat" x y)) @@ -1712,7 +1712,7 @@ (-> Name Text) (let' [[module name] full_name] ({"" name - _ ($_ text\compose module "." name)} + _ ($_ text\composite module "." name)} module))) (def:''' .private (global_identifier full_name state) @@ -1733,11 +1733,11 @@ constant) #None - (#Left ($_ text\compose "Unknown definition: " (name\encoded full_name)))} + (#Left ($_ text\composite "Unknown definition: " (name\encoded full_name)))} (plist\value name definitions)) #None - (#Left ($_ text\compose "Unknown module: " module " @ " (name\encoded full_name)))} + (#Left ($_ text\composite "Unknown module: " module " @ " (name\encoded full_name)))} (plist\value module modules)))) (def:''' .private (code_list expression) @@ -1771,7 +1771,7 @@ ({[_ (#Form (#Item [[_ (#Identifier ["" "~+"])] (#Item [spliced #End])]))] (let' [g!in-module (form$ (list (text$ "lux in-module") (text$ "library/lux") - (identifier$ ["library/lux" "list\compose"])))] + (identifier$ ["library/lux" "list\composite"])))] (in (form$ (list g!in-module (code_list spliced) rightO)))) _ @@ -1784,7 +1784,7 @@ (list\reversed elems)) #0 (do meta_monad - [=elems (monad\map meta_monad untemplated elems)] + [=elems (monad\each meta_monad untemplated elems)] (in (untemplated_list =elems)))} replace?)) @@ -1872,15 +1872,15 @@ [_ [_ (#Record fields)]] (do meta_monad - [=fields (monad\map meta_monad - ("lux type check" (-> (Tuple Code Code) ($' Meta Code)) - (function' [kv] - (let' [[k v] kv] - (do meta_monad - [=k (untemplated replace? subst k) - =v (untemplated replace? subst v)] - (in (tuple$ (list =k =v))))))) - fields)] + [=fields (monad\each meta_monad + ("lux type check" (-> (Tuple Code Code) ($' Meta Code)) + (function' [kv] + (let' [[k v] kv] + (do meta_monad + [=k (untemplated replace? subst k) + =v (untemplated replace? subst v)] + (in (tuple$ (list =k =v))))))) + fields)] (in (with_location (form$ (list (tag$ ["library/lux" "Record"]) (untemplated_list =fields))))))} [replace? token])) @@ -1965,17 +1965,17 @@ (list [(tag$ ["library/lux" "doc"]) (text$ ($_ "lux text concat" "... Piping macro." __paragraph - "(|> elems (list\map int\encoded) (interposed '' '') (mix text\compose ''''))" __paragraph + "(|> elems (list\each int\encoded) (interposed '' '') (mix text\composite ''''))" __paragraph "... =>" __paragraph - "(mix text\compose '''' (interposed '' '' (list\map int\encoded elems)))"))]) + "(mix text\composite '''' (interposed '' '' (list\each int\encoded elems)))"))]) ({(#Item [init apps]) (in_meta (list (list\mix ("lux type check" (-> Code Code Code) (function' [app acc] ({[_ (#Tuple parts)] - (tuple$ (list\compose parts (list acc))) + (tuple$ (list\composite parts (list acc))) [_ (#Form parts)] - (form$ (list\compose parts (list acc))) + (form$ (list\composite parts (list acc))) _ (` ((~ app) (~ acc)))} @@ -1991,17 +1991,17 @@ (list [(tag$ ["library/lux" "doc"]) (text$ ($_ "lux text concat" "... Reverse piping macro." __paragraph - "(<| (mix text\compose '''') (interposed '' '') (list\map int\encoded) elems)" __paragraph + "(<| (mix text\composite '''') (interposed '' '') (list\each int\encoded) elems)" __paragraph "... =>" __paragraph - "(mix text\compose '''' (interposed '' '' (list\map int\encoded elems)))"))]) + "(mix text\composite '''' (interposed '' '' (list\each int\encoded elems)))"))]) ({(#Item [init apps]) (in_meta (list (list\mix ("lux type check" (-> Code Code Code) (function' [app acc] ({[_ (#Tuple parts)] - (tuple$ (list\compose parts (list acc))) + (tuple$ (list\composite parts (list acc))) [_ (#Form parts)] - (form$ (list\compose parts (list acc))) + (form$ (list\composite parts (list acc))) _ (` ((~ app) (~ acc)))} @@ -2072,17 +2072,17 @@ (..replacement sname env)) [meta (#Tuple elems)] - [meta (#Tuple (list\map (realized_template env) elems))] + [meta (#Tuple (list\each (realized_template env) elems))] [meta (#Form elems)] - [meta (#Form (list\map (realized_template env) elems))] + [meta (#Form (list\each (realized_template env) elems))] [meta (#Record members)] - [meta (#Record (list\map ("lux type check" (-> (Tuple Code Code) (Tuple Code Code)) - (function' [kv] - (let' [[slot value] kv] - [(realized_template env slot) (realized_template env value)]))) - members))] + [meta (#Record (list\each ("lux type check" (-> (Tuple Code Code) (Tuple Code Code)) + (function' [kv] + (let' [[slot value] kv] + [(realized_template env slot) (realized_template env value)]))) + members))] _ template} @@ -2129,11 +2129,11 @@ #1 ("lux i64 =" reference sample))) -(def:''' .private (list\joined xs) +(def:''' .private (list\conjoint xs) #End (All [a] (-> ($' List ($' List a)) ($' List a))) - (list\mix list\compose #End (list\reversed xs))) + (list\mix list\composite #End (list\reversed xs))) (macro:' .public (template tokens) (list [(tag$ ["library/lux" "doc"]) @@ -2146,20 +2146,20 @@ ({(#Item [[_ (#Tuple bindings)] (#Item [[_ (#Tuple templates)] data])]) ({[(#Some bindings') (#Some data')] (let' [apply ("lux type check" (-> Replacement_Environment ($' List Code)) - (function' [env] (list\map (realized_template env) templates))) + (function' [env] (list\each (realized_template env) templates))) num_bindings (list\size bindings')] (if (every? (function' [size] ("lux i64 =" num_bindings size)) - (list\map list\size data')) + (list\each list\size data')) (|> data' - (list\map (function\composite apply (replacement_environment bindings'))) - list\joined + (list\each (function\composite apply (replacement_environment bindings'))) + list\conjoint in_meta) (failure "Irregular arguments tuples for template."))) _ (failure "Wrong syntax for template")} - [(monad\map maybe_monad identifier_short bindings) - (monad\map maybe_monad tuple_list data)]) + [(monad\each maybe_monad identifier_short bindings) + (monad\each maybe_monad tuple_list data)]) _ (failure "Wrong syntax for template")} @@ -2226,8 +2226,8 @@ (if ("lux i64 =" 0 input) output (recur (n// 10 input) - (text\compose (|> input (n/% 10) digit::format) - output)))))] + (text\composite (|> input (n/% 10) digit::format) + output)))))] (loop value ""))} value)) @@ -2249,10 +2249,10 @@ (("lux type check" (-> Int Text Text) (function' recur [input output] (if ("lux i64 =" +0 input) - (text\compose sign output) + (text\composite sign output) (recur ("lux i64 /" +10 input) - (text\compose (|> input ("lux i64 %" +10) ("lux type as" Nat) digit::format) - output))))) + (text\composite (|> input ("lux i64 %" +10) ("lux type as" Nat) digit::format) + output))))) (|> value ("lux i64 /" +10) int\abs) (|> value ("lux i64 %" +10) int\abs ("lux type as" Nat) digit::format))))) @@ -2386,8 +2386,8 @@ ({(#Some macro) (do meta_monad [top_level_expansion (("lux type as" Macro' macro) args) - recursive_expansion (monad\map meta_monad expansion top_level_expansion)] - (in (list\joined recursive_expansion))) + recursive_expansion (monad\each meta_monad expansion top_level_expansion)] + (in (list\conjoint recursive_expansion))) #None (in_meta (list token))} @@ -2407,53 +2407,112 @@ ({(#Some macro) (do meta_monad [expansion (("lux type as" Macro' macro) args) - expansion' (monad\map meta_monad full_expansion expansion)] - (in (list\joined expansion'))) + expansion' (monad\each meta_monad full_expansion expansion)] + (in (list\conjoint expansion'))) #None (do meta_monad - [args' (monad\map meta_monad full_expansion args)] - (in (list (form$ (#Item (identifier$ name) (list\joined args'))))))} + [args' (monad\each meta_monad full_expansion args)] + (in (list (form$ (#Item (identifier$ name) (list\conjoint args'))))))} ?macro)) [_ (#Form members)] (do meta_monad - [members' (monad\map meta_monad full_expansion members)] - (in (list (form$ (list\joined members'))))) + [members' (monad\each meta_monad full_expansion members)] + (in (list (form$ (list\conjoint members'))))) [_ (#Tuple members)] (do meta_monad - [members' (monad\map meta_monad full_expansion members)] - (in (list (tuple$ (list\joined members'))))) + [members' (monad\each meta_monad full_expansion members)] + (in (list (tuple$ (list\conjoint members'))))) [_ (#Record pairs)] (do meta_monad - [pairs' (monad\map meta_monad - (function' [kv] - (let' [[key val] kv] - (do meta_monad - [val' (full_expansion val)] - ({(#Item val'' #End) - (in_meta [key val'']) + [pairs' (monad\each meta_monad + (function' [kv] + (let' [[key val] kv] + (do meta_monad + [val' (full_expansion val)] + ({(#Item val'' #End) + (in_meta [key val'']) - _ - (failure "The value-part of a KV-pair in a record must macro-expand to a single Code.")} - val')))) - pairs)] + _ + (failure "The value-part of a KV-pair in a record must macro-expand to a single Code.")} + val')))) + pairs)] (in (list (record$ pairs')))) _ (in_meta (list syntax))} syntax)) +(def:''' .private (text\encoded original) + #End + (-> Text Text) + ($_ text\composite ..double_quote original ..double_quote)) + +(def:''' .private (code\encoded code) + #End + (-> Code Text) + ({[_ (#Bit value)] + (bit\encoded value) + + [_ (#Nat value)] + (nat\encoded value) + + [_ (#Int value)] + (int\encoded value) + + [_ (#Rev value)] + ("lux io error" "@code\encoded Undefined behavior.") + + [_ (#Frac value)] + (frac\encoded value) + + [_ (#Text value)] + (text\encoded value) + + [_ (#Identifier [module name])] + (if (text\= "" module) + name + ($_ text\composite module "." name)) + + [_ (#Tag [module name])] + (if (text\= "" module) + ($_ text\composite "#" name) + ($_ text\composite "#" module "." name)) + + [_ (#Form xs)] + ($_ text\composite "(" (|> xs + (list\each code\encoded) + (list\interposed " ") + list\reversed + (list\mix text\composite "")) ")") + + [_ (#Tuple xs)] + ($_ text\composite "[" (|> xs + (list\each code\encoded) + (list\interposed " ") + list\reversed + (list\mix text\composite "")) "]") + + [_ (#Record kvs)] + ($_ text\composite "{" (|> kvs + (list\each (function' [kv] ({[k v] ($_ text\composite (code\encoded k) " " (code\encoded v))} + kv))) + (list\interposed " ") + list\reversed + (list\mix text\composite "")) "}")} + code)) + (def:''' .private (normal_type type) #End (-> Code Code) ({[_ (#Form (#Item [_ (#Tag tag)] parts))] - (form$ (#Item [(tag$ tag) (list\map normal_type parts)])) + (form$ (#Item (tag$ tag) (list\each normal_type parts))) [_ (#Tuple members)] - (` (Tuple (~+ (list\map normal_type members)))) + (` (Tuple (~+ (list\each normal_type members)))) [_ (#Form (#Item [_ (#Text "lux in-module")] (#Item [_ (#Text module)] @@ -2468,8 +2527,8 @@ (list\mix ("lux type check" (-> Code Code Code) (function' [arg type_fn] (` (#.Apply (~ arg) (~ type_fn))))) (normal_type type_fn) - (list\map normal_type args)) - + (list\each normal_type args)) + _ type} type)) @@ -2484,7 +2543,7 @@ [type+ (full_expansion type)] ({(#Item type' #End) (in (list (normal_type type'))) - + _ (failure "The expansion of the type-syntax had to yield a single element.")} type+)) @@ -2534,60 +2593,6 @@ [product\left a x] [product\right b y]) -(def:''' .private (type_declaration type_codes) - #End - (-> ($' List Code) ($' Meta (Tuple Code ($' Maybe ($' List Text))))) - ({(#Item [_ (#Record pairs)] #End) - (do meta_monad - [members (monad\map meta_monad - (: (-> [Code Code] (Meta [Text Code])) - (function' [pair] - ({[[_ (#Tag "" member_name)] member_type] - (in_meta [member_name member_type]) - - _ - (failure "Wrong syntax for variant case.")} - pair))) - pairs)] - (in_meta [(` (Tuple (~+ (list\map product\right members)))) - (#Some (list\map product\left members))])) - - (#Item type #End) - ({[_ (#Tag "" member_name)] - (in_meta [(` .Any) (#Some (list member_name))]) - - [_ (#Form (#Item [_ (#Tag "" member_name)] member_types))] - (in_meta [(` (Tuple (~+ member_types))) (#Some (list member_name))]) - - _ - (in_meta [type #None])} - type) - - (#Item case cases) - (do meta_monad - [members (monad\map meta_monad - (: (-> Code (Meta [Text Code])) - (function' [case] - ({[_ (#Tag "" member_name)] - (in_meta [member_name (` .Any)]) - - [_ (#Form (#Item [_ (#Tag "" member_name)] (#Item member_type #End)))] - (in_meta [member_name member_type]) - - [_ (#Form (#Item [_ (#Tag "" member_name)] member_types))] - (in_meta [member_name (` (Tuple (~+ member_types)))]) - - _ - (failure "Wrong syntax for variant case.")} - case))) - (list& case cases))] - (in_meta [(` (..Variant (~+ (list\map product\right members)))) - (#Some (list\map product\left members))])) - - _ - (failure "Improper type-definition syntax")} - type_codes)) - (def:''' .private (identifier prefix state) #End (-> Text ($' Meta Code)) @@ -2601,7 +2606,7 @@ #seed ("lux i64 +" 1 seed) #expected expected #location location #extensions extensions #scope_type_vars scope_type_vars #eval _eval} - (local_identifier$ ($_ text\compose "__gensym__" prefix (nat\encoded seed))))} + (local_identifier$ ($_ text\composite "__gensym__" prefix (nat\encoded seed))))} state)) (macro:' .public (Rec tokens) @@ -2681,63 +2686,6 @@ (failure "Wrong syntax for def'")} parts))) -(def:' .private (text\encoded original) - (-> Text Text) - ($_ text\compose ..double_quote original ..double_quote)) - -(def:' .private (code\encoded code) - (-> Code Text) - ({[_ (#Bit value)] - (bit\encoded value) - - [_ (#Nat value)] - (nat\encoded value) - - [_ (#Int value)] - (int\encoded value) - - [_ (#Rev value)] - ("lux io error" "@code\encoded Undefined behavior.") - - [_ (#Frac value)] - (frac\encoded value) - - [_ (#Text value)] - (text\encoded value) - - [_ (#Identifier [module name])] - (if (text\= "" module) - name - ($_ text\compose module "." name)) - - [_ (#Tag [module name])] - (if (text\= "" module) - ($_ text\compose "#" name) - ($_ text\compose "#" module "." name)) - - [_ (#Form xs)] - ($_ text\compose "(" (|> xs - (list\map code\encoded) - (list\interposed " ") - list\reversed - (list\mix text\compose "")) ")") - - [_ (#Tuple xs)] - ($_ text\compose "[" (|> xs - (list\map code\encoded) - (list\interposed " ") - list\reversed - (list\mix text\compose "")) "]") - - [_ (#Record kvs)] - ($_ text\compose "{" (|> kvs - (list\map (function' [kv] ({[k v] ($_ text\compose (code\encoded k) " " (code\encoded v))} - kv))) - (list\interposed " ") - list\reversed - (list\mix text\compose "")) "}")} - code)) - (def:' .private (expander branches) (-> (List Code) (Meta (List Code))) ({(#Item [_ (#Form (#Item [_ (#Identifier name)] args))] @@ -2764,11 +2712,11 @@ (do meta_monad [] (in (list))) _ - (failure ($_ text\compose "'lux.case' expects an even number of tokens: " (|> branches - (list\map code\encoded) - (list\interposed " ") - list\reversed - (list\mix text\compose ""))))} + (failure ($_ text\composite "'lux.case' expects an even number of tokens: " (|> branches + (list\each code\encoded) + (list\interposed " ") + list\reversed + (list\mix text\composite ""))))} branches)) (macro:' .public (case tokens) @@ -2838,9 +2786,9 @@ _ (let' [pairs (|> patterns - (list\map (function' [pattern] (list pattern body))) - (list\joined))] - (in_meta (list\compose pairs branches)))) + (list\each (function' [pattern] (list pattern body))) + (list\conjoint))] + (in_meta (list\composite pairs branches)))) _ (failure "Wrong syntax for ^or"))) @@ -2940,27 +2888,27 @@ [_ (#Tuple xs)] (|> xs - (list\map definition_annotation_value) + (list\each definition_annotation_value) untemplated_list (meta_code ["library/lux" "Tuple"])) [_ (#Record kvs)] (|> kvs - (list\map (: (-> [Code Code] Code) - (function (_ [k v]) - (` [(~ (definition_annotation_value k)) - (~ (definition_annotation_value v))])))) + (list\each (: (-> [Code Code] Code) + (function (_ [k v]) + (` [(~ (definition_annotation_value k)) + (~ (definition_annotation_value v))])))) untemplated_list (meta_code ["library/lux" "Record"])) )) (def:' .private (definition_annotations kvs) (-> (List [Code Code]) Code) - (untemplated_list (list\map (: (-> [Code Code] Code) - (function (_ [k v]) - (` [(~ (definition_annotation_value k)) - (~ (definition_annotation_value v))]))) - kvs))) + (untemplated_list (list\each (: (-> [Code Code] Code) + (function (_ [k v]) + (` [(~ (definition_annotation_value k)) + (~ (definition_annotation_value v))]))) + kvs))) (def:' .private (with_function_parameters parameters meta) (-> (List Code) Code Code) @@ -2970,21 +2918,21 @@ _ (` (#.Item [[(~ location_code) (#.Tag ["library/lux" "func_args"])] - [(~ location_code) (#.Tuple (.list (~+ (list\map (function (_ parameter) - (` [(~ location_code) (#.Text (~ (text$ (code\encoded parameter))))])) - parameters))))]] + [(~ location_code) (#.Tuple (.list (~+ (list\each (function (_ parameter) + (` [(~ location_code) (#.Text (~ (text$ (code\encoded parameter))))])) + parameters))))]] (~ meta))))) (def:' .private (with_type_args args) (-> (List Code) Code) - (` {#.type_args [(~+ (list\map (function (_ arg) (text$ (code\encoded arg))) - args))]})) + (` {#.type_args [(~+ (list\each (function (_ arg) (text$ (code\encoded arg))) + args))]})) (def:' .private (endP tokens) (-> (List Code) (Maybe Any)) (case tokens (^ (list)) - (#.Some []) + (#Some []) _ #None)) @@ -2996,7 +2944,7 @@ (#Some [tokens' code]) _ - #.None)) + #None)) (def:' .private (local_identifierP tokens) (-> (List Code) (Maybe [(List Code) Text])) @@ -3005,14 +2953,14 @@ (#Some [tokens' local_identifier]) _ - #.None)) + #None)) (template [ ] [(def:' .private ( tokens) (-> (List Code) (Maybe (List ))) (case tokens #End - (#.Some #End) + (#Some #End) _ (do maybe_monad @@ -3264,7 +3212,7 @@ _ (` ("lux macro" - (function ((~ name) (~+ (list\map local_identifier$ args))) (~ body))))) + (function ((~ name) (~+ (list\each local_identifier$ args))) (~ body))))) =annotations (definition_annotations annotations)] (in_meta (list (` ("lux def" (~ name) (~ body) @@ -3272,7 +3220,7 @@ (#Record (~ =annotations))] (~ export_policy)))))) - #.None + #None (failure "Wrong syntax for macro:"))) (def: (list\one f xs) @@ -3496,7 +3444,7 @@ (#Right state module) _ - (#Left ($_ text\compose "Unknown module: " name)))))) + (#Left ($_ text\composite "Unknown module: " name)))))) (def: (type_tag [module name]) (-> Name (Meta [Nat (List Name) Bit Type])) @@ -3508,7 +3456,7 @@ (in_meta output) _ - (failure (text\compose "Unknown tag: " (name\encoded [module name])))))) + (failure (text\composite "Unknown tag: " (name\encoded [module name])))))) (def: (record_slots type) (-> Type (Meta (Maybe [(List Name) (List Type)]))) @@ -3573,7 +3521,7 @@ " (= test subject)))" ..\n " ))"))} (do meta_monad - [tokens' (monad\map meta_monad expansion tokens) + [tokens' (monad\each meta_monad expansion tokens) struct_type ..expected_type tags+type (record_slots struct_type) tags (: (Meta (List Name)) @@ -3584,23 +3532,23 @@ _ (failure "No tags available for type."))) .let [tag_mappings (: (List [Text Code]) - (list\map (function (_ tag) [(product\right tag) (tag$ tag)]) - tags))] - members (monad\map meta_monad - (: (-> Code (Meta [Code Code])) - (function (_ token) - (case token - (^ [_ (#Form (list [_ (#Text "lux def")] [_ (#Identifier "" tag_name)] value meta export_policy))]) - (case (plist\value tag_name tag_mappings) - (#Some tag) - (in [tag value]) + (list\each (function (_ tag) [(product\right tag) (tag$ tag)]) + tags))] + members (monad\each meta_monad + (: (-> Code (Meta [Code Code])) + (function (_ token) + (case token + (^ [_ (#Form (list [_ (#Text "lux def")] [_ (#Identifier "" tag_name)] value meta export_policy))]) + (case (plist\value tag_name tag_mappings) + (#Some tag) + (in [tag value]) - _ - (failure (text\compose "Unknown implementation member: " tag_name))) + _ + (failure (text\composite "Unknown implementation member: " tag_name))) - _ - (failure "Invalid implementation member.")))) - (list\joined tokens'))] + _ + (failure "Invalid implementation member.")))) + (list\conjoint tokens'))] (in (list (record$ members))))) (def: (text\interposed separator parts) @@ -3611,7 +3559,7 @@ (#Item head tail) (list\mix (function (_ right left) - ($_ text\compose left separator right)) + ($_ text\composite left separator right)) head tail))) @@ -3695,6 +3643,83 @@ (All [a] (-> a a)) value) +(def: (everyP itP tokens) + (All [a] (-> (-> (List Code) (Maybe [(List Code) a])) + (-> (List Code) (Maybe (List a))))) + (case tokens + (#Item _) + (do maybe_monad + [% (itP tokens) + .let [[tokens' head] %] + tail (case tokens' + (#Item _) + (everyP itP tokens') + + #End + (in (list)))] + (in (list& head tail))) + + #End + (#Some (list)))) + +(def: (caseP tokens) + (-> (List Code) (Maybe [(List Code) [Text Code]])) + (case tokens + (^ (list& [_ (#Tag ["" niladic])] tokens')) + (#Some [tokens' [niladic (` .Any)]]) + + (^ (list& [_ (#Form (list& [_ (#Tag ["" polyadic])] caseT))] tokens')) + (#Some [tokens' [polyadic (` (..Tuple (~+ caseT)))]]) + + _ + #None)) + +(macro: .public (Variant tokens) + (case (everyP caseP tokens) + (#Some cases) + (in_meta (list (` (..Union (~+ (list\each product\right cases)))) + (tuple$ (list\each (function (_ case) + (text$ (product\left case))) + cases)))) + + #None + (failure "Wrong syntax for Variant"))) + +(def: (slotP tokens) + (-> (List Code) (Maybe [(List Code) [Text Code]])) + (case tokens + (^ (list& [_ (#Tag ["" slot])] type tokens')) + (#Some [tokens' [slot type]]) + + _ + #.None)) + +(def: un_paired + (-> (List [Code Code]) (List Code)) + (let [pair_list (: (-> [Code Code] (List Code)) + (function (_ [left right]) + (list left right)))] + (function (_ it) + (|> it + (list\each pair_list) + list\conjoint)))) + +(macro: .public (Record tokens) + (case tokens + (^ (list [_ (#Record record)])) + (case (everyP slotP (un_paired record)) + (#Some slots) + (in_meta (list (` (..Tuple (~+ (list\each product\right slots)))) + (tuple$ (list\each (function (_ slot) + (text$ (product\left slot))) + slots)))) + + #None + (failure "Wrong syntax for Record")) + + _ + (failure "Wrong syntax for Record"))) + (def: (recP tokens) (-> (List Code) [(List Code) Bit]) (case tokens @@ -3704,49 +3729,90 @@ _ [tokens #0])) -(def:' .private (typeP tokens) - (-> (List Code) (Maybe [Code Bit Text (List Text) (List [Code Code]) (List Code)])) - (|> (do maybe_monad - [% (anyP tokens) - .let' [[tokens export_policy] %] - .let' [[tokens rec?] (recP tokens)] - % (local_declarationP tokens) - .let' [[tokens [name parameters]] %] - % (annotationsP tokens) - .let' [[tokens annotations] %] - tokens (remainderP tokens)] - (in [export_policy rec? name parameters annotations tokens])) - ... (^ (list _export_policy _rec _declaration _annotations _body)) - ... (^ (list _export_policy _declaration _annotations _body)) - (maybe\else' (do maybe_monad - [.let' [[tokens rec?] (recP tokens)] - % (local_declarationP tokens) - .let' [[tokens [name parameters]] %] - % (annotationsP tokens) - .let' [[tokens annotations] %] - tokens (remainderP tokens)] - (in [(` ..private) rec? name parameters annotations tokens]))) - ... (^ (list _rec _declaration _annotations _body)) - ... (^ (list _declaration _annotations _body)) - (maybe\else' (do maybe_monad - [.let' [[tokens rec?] (recP tokens)] - % (local_declarationP tokens) - .let' [[tokens [name parameters]] %] - tokens (remainderP tokens)] - (in [(` ..private) rec? name parameters #End tokens]))) - ... (^ (list _rec _declaration _body)) - ... (^ (list _declaration _body)) - (maybe\else' (do maybe_monad - [% (anyP tokens) - .let' [[tokens export_policy] %] - .let' [[tokens rec?] (recP tokens)] - % (local_declarationP tokens) - .let' [[tokens [name parameters]] %] - tokens (remainderP tokens)] - (in [export_policy rec? name parameters #End tokens]))) - ... (^ (list _export_policy _rec _declaration _body)) - ... (^ (list _export_policy _declaration _body)) - )) +(def: (typeP tokens) + (-> (List Code) (Maybe [Code Bit Text (List Text) (List [Code Code]) Code])) + (|> (do maybe_monad + [% (anyP tokens) + .let' [[tokens export_policy] %] + .let' [[tokens rec?] (recP tokens)] + % (local_declarationP tokens) + .let' [[tokens [name parameters]] %] + % (annotationsP tokens) + .let' [[tokens annotations] %] + % (anyP tokens) + .let' [[tokens definition] %] + _ (endP tokens)] + (in [export_policy rec? name parameters annotations definition])) + ... (^ (list _export_policy _rec _declaration _annotations _body)) + ... (^ (list _export_policy _declaration _annotations _body)) + (maybe\else' (do maybe_monad + [.let' [[tokens rec?] (recP tokens)] + % (local_declarationP tokens) + .let' [[tokens [name parameters]] %] + % (annotationsP tokens) + .let' [[tokens annotations] %] + % (anyP tokens) + .let' [[tokens definition] %] + _ (endP tokens)] + (in [(` ..private) rec? name parameters annotations definition]))) + ... (^ (list _rec _declaration _annotations _body)) + ... (^ (list _declaration _annotations _body)) + (maybe\else' (do maybe_monad + [.let' [[tokens rec?] (recP tokens)] + % (local_declarationP tokens) + .let' [[tokens [name parameters]] %] + % (anyP tokens) + .let' [[tokens definition] %] + _ (endP tokens)] + (in [(` ..private) rec? name parameters #End definition]))) + ... (^ (list _rec _declaration _body)) + ... (^ (list _declaration _body)) + (maybe\else' (do maybe_monad + [% (anyP tokens) + .let' [[tokens export_policy] %] + .let' [[tokens rec?] (recP tokens)] + % (local_declarationP tokens) + .let' [[tokens [name parameters]] %] + % (anyP tokens) + .let' [[tokens definition] %] + _ (endP tokens)] + (in [export_policy rec? name parameters #End definition]))) + ... (^ (list _export_policy _rec _declaration _body)) + ... (^ (list _export_policy _declaration _body)) + )) + +(def: (textP tokens) + (-> (List Code) (Maybe [(List Code) Text])) + (case tokens + (^ (list& [_ (#Text it)] tokens')) + (#Some [tokens' it]) + + _ + #None)) + +(def: (type_declaration it) + (-> Code (Meta (Tuple Code (Maybe (List Text))))) + ({[_ (#Form (#Item [_ (#Identifier declarer)] parameters))] + (do meta_monad + [declaration (single_expansion (form$ (list& (identifier$ declarer) parameters)))] + (case declaration + (^ (list type [_ (#Tuple tags)])) + (case (everyP textP tags) + (#Some tags) + (in_meta [type (#Some tags)]) + + #None + (failure "Improper type-definition syntax")) + + (^ (list type)) + (in_meta [it #None]) + + _ + (failure "Improper type-definition syntax"))) + + type + (in_meta [type #None])} + it)) (macro: .public (type: tokens) {#.doc (text$ ($_ "lux text concat" @@ -3759,53 +3825,53 @@ (#Some [export_policy rec? name args meta type_codes]) (do meta_monad [type+tags?? (..type_declaration type_codes) - module_name current_module_name] - (let [type_name (local_identifier$ name) - [type tags??] type+tags?? - type' (: (Maybe Code) - (if rec? - (if (empty? args) - (let [g!param (local_identifier$ "") - prime_name (local_identifier$ name) - type+ (with_replacements (list [name (` ((~ prime_name) .Nothing))]) - type)] - (#Some (` ((All (~ prime_name) [(~ g!param)] (~ type+)) - .Nothing)))) - #None) - (case args - #End - (#Some type) + module_name current_module_name + .let' [type_name (local_identifier$ name) + [type tags??] type+tags?? + type' (: (Maybe Code) + (if rec? + (if (empty? args) + (let [g!param (local_identifier$ "") + prime_name (local_identifier$ name) + type+ (with_replacements (list [name (` ((~ prime_name) .Nothing))]) + type)] + (#Some (` ((All (~ prime_name) [(~ g!param)] (~ type+)) + .Nothing)))) + #None) + (case args + #End + (#Some type) - _ - (#Some (` (.All (~ type_name) [(~+ (list\map local_identifier$ args))] (~ type))))))) - total_meta (let [meta (definition_annotations meta) - meta (if rec? - (` (#.Item (~ (flag_meta "type_rec?")) (~ meta))) - meta)] - (` [(~ location_code) - (#.Record (~ meta))]))] - (case type' - (#Some type'') - (let [typeC (` (#.Named [(~ (text$ module_name)) - (~ (text$ name))] - (.type (~ type''))))] - (in_meta (list (case tags?? - (#Some tags) - (` ("lux def type tagged" (~ type_name) - (~ typeC) - (~ total_meta) - [(~+ (list\map text$ tags))] - (~ export_policy))) - - _ - (` ("lux def" (~ type_name) - ("lux type check type" - (~ typeC)) - (~ total_meta) - (~ export_policy))))))) + _ + (#Some (` (.All (~ type_name) [(~+ (list\each local_identifier$ args))] (~ type))))))) + total_meta (let [meta (definition_annotations meta) + meta (if rec? + (` (#.Item (~ (flag_meta "type_rec?")) (~ meta))) + meta)] + (` [(~ location_code) + (#.Record (~ meta))]))]] + (case type' + (#Some type'') + (let [typeC (` (#.Named [(~ (text$ module_name)) + (~ (text$ name))] + (.type (~ type''))))] + (in_meta (list (case tags?? + (#Some tags) + (` ("lux def type tagged" (~ type_name) + (~ typeC) + (~ total_meta) + [(~+ (list\each text$ tags))] + (~ export_policy))) + + _ + (` ("lux def" (~ type_name) + ("lux type check type" + (~ typeC)) + (~ total_meta) + (~ export_policy))))))) - #None - (failure "Wrong syntax for type:")))) + #None + (failure "Wrong syntax for type:"))) #None (failure "Wrong syntax for type:"))) @@ -3843,32 +3909,34 @@ (case (interfaceP tokens) (#Some [export_policy name args annotations methods]) (do meta_monad - [methods' (monad\map meta_monad expansion methods) + [methods' (monad\each meta_monad expansion methods) members (: (Meta (List [Text Code])) - (monad\map meta_monad - (: (-> Code (Meta [Text Code])) - (function (_ token) - (case token - (^ [_ (#Form (list [_ (#Text "lux type check")] type [_ (#Identifier ["" name])]))]) - (in [name type]) - - _ - (failure "Interfaces require typed members!")))) - (list\joined methods'))) + (monad\each meta_monad + (: (-> Code (Meta [Text Code])) + (function (_ token) + (case token + (^ [_ (#Form (list [_ (#Text "lux type check")] type [_ (#Identifier ["" name])]))]) + (in [name type]) + + _ + (failure "Interfaces require typed members!")))) + (list\conjoint methods'))) .let [def_name (local_identifier$ name) - interface_type (record$ (list\map (: (-> [Text Code] [Code Code]) - (function (_ [module_name m_type]) - [(local_tag$ module_name) m_type])) - members)) - interface_annotations (merged_definition_annotations (` {#.interface? #1}) - (record$ annotations)) + interface_type (` (..Record + (~ (record$ (list\each (: (-> [Text Code] [Code Code]) + (function (_ [module_name m_type]) + [(local_tag$ module_name) m_type])) + members))))) usage (case args #End def_name _ - (` ((~ def_name) (~+ (list\map local_identifier$ args)))))]] - (in_meta (list (` (..type: (~ export_policy) (~ usage) (~ interface_annotations) (~ interface_type)))))) + (` ((~ def_name) (~+ (list\each local_identifier$ args)))))]] + (in_meta (list (` (..type: (~ export_policy) + (~ usage) + (~ (record$ annotations)) + (~ interface_type)))))) #None (failure "Wrong syntax for interface:"))) @@ -3886,36 +3954,39 @@ ) (type: Referrals - #All - (#Only (List Text)) - (#Exclude (List Text)) - #Ignore - #Nothing) + (Variant + #All + (#Only (List Text)) + (#Exclude (List Text)) + #Ignore + #Nothing)) (type: Openings [Text (List Text)]) (type: Refer - {#refer_defs Referrals - #refer_open (List Openings)}) + (Record + {#refer_defs Referrals + #refer_open (List Openings)})) (type: Importation - {#import_name Text - #import_alias (Maybe Text) - #import_refer Refer}) + (Record + {#import_name Text + #import_alias (Maybe Text) + #import_refer Refer})) (def: (referral_references defs) (-> (List Code) (Meta (List Text))) - (monad\map meta_monad - (: (-> Code (Meta Text)) - (function (_ def) - (case def - [_ (#Identifier ["" name])] - (in_meta name) + (monad\each meta_monad + (: (-> Code (Meta Text)) + (function (_ def) + (case def + [_ (#Identifier ["" name])] + (in_meta name) - _ - (failure "#only/#+ and #exclude/#- require identifiers.")))) - defs)) + _ + (failure "#only/#+ and #exclude/#- require identifiers.")))) + defs)) (def: (referrals_parser tokens) (-> (List Code) (Meta [Referrals (List Code)])) @@ -3946,27 +4017,27 @@ (def: (openings_parser parts) (-> (List Code) (Meta [(List Openings) (List Code)])) (case parts - #.End - (in_meta [#.End #.End]) + #End + (in_meta [#End #End]) (^ (list& [_ (#Form (list& [_ (#Text prefix)] structs))] parts')) (do meta_monad - [structs' (monad\map meta_monad - (function (_ struct) - (case struct - [_ (#Identifier ["" struct_name])] - (in_meta struct_name) - - _ - (failure "Expected all implementations of opening form to be identifiers."))) - structs) + [structs' (monad\each meta_monad + (function (_ struct) + (case struct + [_ (#Identifier ["" struct_name])] + (in_meta struct_name) + + _ + (failure "Expected all implementations of opening form to be identifiers."))) + structs) next+remainder (openings_parser parts')] (let [[next remainder] next+remainder] - (in_meta [(#.Item [prefix structs'] next) + (in_meta [(#Item [prefix structs'] next) remainder]))) _ - (in_meta [#.End parts]))) + (in_meta [#End parts]))) (def: (text\split_at' at x) (-> Nat Text [Text Text]) @@ -3986,10 +4057,10 @@ ((: (-> Text Text Text) (function (recur left right) (case (..text\split_by pattern right) - (#.Some [pre post]) + (#Some [pre post]) (recur ($_ "lux text concat" left pre replacement) post) - #.None + #None ("lux text concat" left right)))) "" template)) @@ -4013,23 +4084,23 @@ (-> Text Text Text) (case [(text\split_by ..module_separator hierarchy) (text\split_by ..parallel_hierarchy_sigil root)] - [(#.Some [_ hierarchy']) - (#.Some ["" root'])] + [(#Some [_ hierarchy']) + (#Some ["" root'])] (normal_parallel_path' hierarchy' root') _ (case root "" hierarchy - _ ($_ text\compose root ..module_separator hierarchy)))) + _ ($_ text\composite root ..module_separator hierarchy)))) (def: (normal_parallel_path hierarchy root) (-> Text Text (Maybe Text)) (case (text\split_by ..parallel_hierarchy_sigil root) - (#.Some ["" root']) - (#.Some (normal_parallel_path' hierarchy root')) + (#Some ["" root']) + (#Some (normal_parallel_path' hierarchy root')) _ - #.None)) + #None)) (def: (relative_ups relatives input) (-> Nat Text Nat) @@ -4071,7 +4142,7 @@ clean ("lux text clip" relatives (|> module "lux text size" ("lux i64 -" relatives)) module) output (case ("lux text size" clean) 0 prefix - _ ($_ text\compose prefix ..module_separator clean))] + _ ($_ text\composite prefix ..module_separator clean))] (in_meta output)) (failure ($_ "lux text concat" "Cannot climb the module hierarchy..." ..\n @@ -4081,78 +4152,78 @@ (def: (imports_parser nested? relative_root context_alias imports) (-> Bit Text Text (List Code) (Meta (List Importation))) (do meta_monad - [imports' (monad\map meta_monad - (: (-> Code (Meta (List Importation))) - (function (_ token) - (case token - ... Simple - [_ (#Identifier ["" module_name])] - (do meta_monad - [absolute_module_name (..absolute_module_name nested? relative_root module_name)] - (in (list {#import_name absolute_module_name - #import_alias #None - #import_refer {#refer_defs #All - #refer_open (list)}}))) - - ... Nested - (^ [_ (#Tuple (list& [_ (#Identifier ["" module_name])] extra))]) - (do meta_monad - [absolute_module_name (case (normal_parallel_path relative_root module_name) - (#.Some parallel_path) - (in parallel_path) - - #.None - (..absolute_module_name nested? relative_root module_name)) - referral+extra (referrals_parser extra) - .let [[referral extra] referral+extra] - openings+extra (openings_parser extra) - .let [[openings extra] openings+extra] - sub_imports (imports_parser #1 absolute_module_name context_alias extra)] - (in (case [referral openings] - [#Nothing #End] - sub_imports - - _ - (list& {#import_name absolute_module_name - #import_alias #None - #import_refer {#refer_defs referral - #refer_open openings}} - sub_imports)))) - - (^ [_ (#Tuple (list& [_ (#Text alias)] [_ (#Identifier ["" module_name])] extra))]) - (do meta_monad - [absolute_module_name (case (normal_parallel_path relative_root module_name) - (#.Some parallel_path) - (in parallel_path) - - #.None - (..absolute_module_name nested? relative_root module_name)) - referral+extra (referrals_parser extra) - .let [[referral extra] referral+extra] - openings+extra (openings_parser extra) - .let [[openings extra] openings+extra - module_alias (..module_alias context_alias module_name alias)] - sub_imports (imports_parser #1 absolute_module_name module_alias extra)] - (in (case [referral openings] - [#Ignore #End] - sub_imports - - _ - (list& {#import_name absolute_module_name - #import_alias (#Some module_alias) - #import_refer {#refer_defs referral - #refer_open openings}} - sub_imports)))) - - ... Unrecognized syntax. - _ - (do meta_monad - [current_module current_module_name] - (failure ($_ text\compose - "Wrong syntax for import @ " current_module - ..\n (code\encoded token))))))) - imports)] - (in (list\joined imports')))) + [imports' (monad\each meta_monad + (: (-> Code (Meta (List Importation))) + (function (_ token) + (case token + ... Simple + [_ (#Identifier ["" module_name])] + (do meta_monad + [absolute_module_name (..absolute_module_name nested? relative_root module_name)] + (in (list {#import_name absolute_module_name + #import_alias #None + #import_refer {#refer_defs #All + #refer_open (list)}}))) + + ... Nested + (^ [_ (#Tuple (list& [_ (#Identifier ["" module_name])] extra))]) + (do meta_monad + [absolute_module_name (case (normal_parallel_path relative_root module_name) + (#Some parallel_path) + (in parallel_path) + + #None + (..absolute_module_name nested? relative_root module_name)) + referral+extra (referrals_parser extra) + .let [[referral extra] referral+extra] + openings+extra (openings_parser extra) + .let [[openings extra] openings+extra] + sub_imports (imports_parser #1 absolute_module_name context_alias extra)] + (in (case [referral openings] + [#Nothing #End] + sub_imports + + _ + (list& {#import_name absolute_module_name + #import_alias #None + #import_refer {#refer_defs referral + #refer_open openings}} + sub_imports)))) + + (^ [_ (#Tuple (list& [_ (#Text alias)] [_ (#Identifier ["" module_name])] extra))]) + (do meta_monad + [absolute_module_name (case (normal_parallel_path relative_root module_name) + (#Some parallel_path) + (in parallel_path) + + #None + (..absolute_module_name nested? relative_root module_name)) + referral+extra (referrals_parser extra) + .let [[referral extra] referral+extra] + openings+extra (openings_parser extra) + .let [[openings extra] openings+extra + module_alias (..module_alias context_alias module_name alias)] + sub_imports (imports_parser #1 absolute_module_name module_alias extra)] + (in (case [referral openings] + [#Ignore #End] + sub_imports + + _ + (list& {#import_name absolute_module_name + #import_alias (#Some module_alias) + #import_refer {#refer_defs referral + #refer_open openings}} + sub_imports)))) + + ... Unrecognized syntax. + _ + (do meta_monad + [current_module current_module_name] + (failure ($_ text\composite + "Wrong syntax for import @ " current_module + ..\n (code\encoded token))))))) + imports)] + (in (list\conjoint imports')))) (def: (exported_definitions module state) (-> Text (Meta (List Text))) @@ -4164,23 +4235,23 @@ [current_module modules])] (case (plist\value module modules) (#Some =module) - (let [to_alias (list\map (: (-> [Text Global] - (List Text)) - (function (_ [name definition]) - (case definition - (#Left _) - (list) - - (#Right [exported? def_type def_meta def_value]) - (if exported? - (list name) - (list))))) - (let [{#module_hash _ #module_aliases _ #definitions definitions #imports _ #tags tags #types types #module_annotations _ #module_state _} =module] - definitions))] - (#Right state (list\joined to_alias))) + (let [to_alias (list\each (: (-> [Text Global] + (List Text)) + (function (_ [name definition]) + (case definition + (#Left _) + (list) + + (#Right [exported? def_type def_meta def_value]) + (if exported? + (list name) + (list))))) + (let [{#module_hash _ #module_aliases _ #definitions definitions #imports _ #tags tags #types types #module_annotations _ #module_state _} =module] + definitions))] + (#Right state (list\conjoint to_alias))) #None - (#Left ($_ text\compose + (#Left ($_ text\composite "Unknown module: " (text\encoded module) ..\n "Current module: " (case current_module (#Some current_module) @@ -4189,8 +4260,8 @@ #None "???") ..\n "Known modules: " (|> modules - (list\map (function (_ [name module]) - (text$ name))) + (list\each (function (_ [name module]) + (text$ name))) tuple$ code\encoded)))) )) @@ -4278,12 +4349,12 @@ #scope_type_vars scope_type_vars #eval _eval} state] (case (plist\value v_module modules) #None - (#Left (text\compose "Unknown definition: " (name\encoded name))) + (#Left (text\composite "Unknown definition: " (name\encoded name))) (#Some {#definitions definitions #module_hash _ #module_aliases _ #imports _ #tags tags #types types #module_annotations _ #module_state _}) (case (plist\value v_name definitions) #None - (#Left (text\compose "Unknown definition: " (name\encoded name))) + (#Left (text\composite "Unknown definition: " (name\encoded name))) (#Some definition) (case definition @@ -4321,13 +4392,13 @@ (#Right [compiler struct_type]) _ - (#Left ($_ text\compose "Unknown var: " (name\encoded full_name))))) + (#Left ($_ text\composite "Unknown var: " (name\encoded full_name))))) (case (definition_type full_name compiler) (#Some struct_type) (#Right [compiler struct_type]) _ - (#Left ($_ text\compose "Unknown var: " (name\encoded full_name)))))] + (#Left ($_ text\composite "Unknown var: " (name\encoded full_name)))))] (case temp (#Right [compiler (#Var type_id)]) (let [{#info _ #source _ #current_module _ #modules _ @@ -4369,37 +4440,37 @@ name _ - ($_ text\compose "(" name " " (|> params (list\map type\encoded) (list\interposed " ") list\reversed (list\mix text\compose "")) ")")) + ($_ text\composite "(" name " " (|> params (list\each type\encoded) (list\interposed " ") list\reversed (list\mix text\composite "")) ")")) (#Sum _) - ($_ text\compose "(Or " (|> (flat_variant type) (list\map type\encoded) (list\interposed " ") list\reversed (list\mix text\compose "")) ")") + ($_ text\composite "(Or " (|> (flat_variant type) (list\each type\encoded) (list\interposed " ") list\reversed (list\mix text\composite "")) ")") (#Product _) - ($_ text\compose "[" (|> (flat_tuple type) (list\map type\encoded) (list\interposed " ") list\reversed (list\mix text\compose "")) "]") + ($_ text\composite "[" (|> (flat_tuple type) (list\each type\encoded) (list\interposed " ") list\reversed (list\mix text\composite "")) "]") (#Function _) - ($_ text\compose "(-> " (|> (flat_lambda type) (list\map type\encoded) (list\interposed " ") list\reversed (list\mix text\compose "")) ")") + ($_ text\composite "(-> " (|> (flat_lambda type) (list\each type\encoded) (list\interposed " ") list\reversed (list\mix text\composite "")) ")") (#Parameter id) (nat\encoded id) (#Var id) - ($_ text\compose "⌈v:" (nat\encoded id) "⌋") + ($_ text\composite "⌈v:" (nat\encoded id) "⌋") (#Ex id) - ($_ text\compose "⟨e:" (nat\encoded id) "⟩") + ($_ text\composite "⟨e:" (nat\encoded id) "⟩") (#UnivQ env body) - ($_ text\compose "(All " (type\encoded body) ")") + ($_ text\composite "(All " (type\encoded body) ")") (#ExQ env body) - ($_ text\compose "(Ex " (type\encoded body) ")") + ($_ text\composite "(Ex " (type\encoded body) ")") (#Apply _) (let [[func args] (flat_application type)] - ($_ text\compose + ($_ text\composite "(" (type\encoded func) " " - (|> args (list\map type\encoded) (list\interposed " ") list\reversed (list\mix text\compose "")) + (|> args (list\each type\encoded) (list\interposed " ") list\reversed (list\mix text\composite "")) ")")) (#Named name _) @@ -4425,16 +4496,16 @@ struct_evidence (record_slots init_type)] (case struct_evidence #None - (failure (text\compose "Can only 'open' structs: " (type\encoded init_type))) + (failure (text\composite "Can only 'open' structs: " (type\encoded init_type))) (#Some tags&members) (do meta_monad [full_body ((: (-> Name [(List Name) (List Type)] Code (Meta Code)) (function (recur source [tags members] target) - (let [locals (list\map (function (_ [t_module t_name]) - ["" (..module_alias "" t_name alias)]) - tags) - pattern (tuple$ (list\map identifier$ locals))] + (let [locals (list\each (function (_ [t_module t_name]) + ["" (..module_alias "" t_name alias)]) + tags) + pattern (tuple$ (list\each identifier$ locals))] (do meta_monad [enhanced_target (monad\mix meta_monad (function (_ [m_local m_type] enhanced_target) @@ -4513,13 +4584,13 @@ g!output (..identifier "")] (case (interface_methods type) (#Some members) - (let [pattern (record$ (list\map (: (-> [Name [Nat Type]] [Code Code]) - (function (_ [[r_module r_name] [r_idx r_type]]) - [(tag$ [r_module r_name]) - (if ("lux i64 =" idx r_idx) - g!output - g!_)])) - (zipped/2 tags (enumeration members))))] + (let [pattern (record$ (list\each (: (-> [Name [Nat Type]] [Code Code]) + (function (_ [[r_module r_name] [r_idx r_type]]) + [(tag$ [r_module r_name]) + (if ("lux i64 =" idx r_idx) + g!output + g!_)])) + (zipped/2 tags (enumeration members))))] (in_meta (list (` ({(~ pattern) (~ g!output)} (~ record)))))) _ @@ -4549,26 +4620,26 @@ .let [g!output (local_identifier$ short) pattern (|> tags enumeration - (list\map (function (_ [tag_idx tag]) - (if ("lux i64 =" my_tag_index tag_idx) - g!output - g!_))) + (list\each (function (_ [tag_idx tag]) + (if ("lux i64 =" my_tag_index tag_idx) + g!output + g!_))) tuple$) source+ (` ({(~ pattern) (~ g!output)} (~ source)))]] (case output (#Some [tags' members']) (do meta_monad - [decls' (monad\map meta_monad - (: (-> [Nat Name Type] (Meta (List Code))) - (function (_ [sub_tag_index sname stype]) - (open_declaration alias tags' sub_tag_index sname source+ stype))) - (enumeration (zipped/2 tags' members')))] - (in_meta (list\joined decls'))) + [decls' (monad\each meta_monad + (: (-> [Nat Name Type] (Meta (List Code))) + (function (_ [sub_tag_index sname stype]) + (open_declaration alias tags' sub_tag_index sname source+ stype))) + (enumeration (zipped/2 tags' members')))] + (in_meta (list\conjoint decls'))) _ (in_meta (list (` ("lux def" (~ (local_identifier$ (..module_alias "" short alias))) (~ source+) - [(~ location_code) (#.Record #End)] + [(~ location_code) (#.Record #.End)] #0))))))) (macro: .public (open: tokens) @@ -4594,20 +4665,20 @@ (case output (#Some [tags members]) (do meta_monad - [decls' (monad\map meta_monad (: (-> [Nat Name Type] (Meta (List Code))) - (function (_ [tag_index sname stype]) - (open_declaration alias tags tag_index sname source stype))) - (enumeration (zipped/2 tags members)))] - (in_meta (list\joined decls'))) + [decls' (monad\each meta_monad (: (-> [Nat Name Type] (Meta (List Code))) + (function (_ [tag_index sname stype]) + (open_declaration alias tags tag_index sname source stype))) + (enumeration (zipped/2 tags members)))] + (in_meta (list\conjoint decls'))) _ - (failure (text\compose "Can only 'open:' structs: " (type\encoded struct_type))))) + (failure (text\composite "Can only 'open:' structs: " (type\encoded struct_type))))) _ (do meta_monad [g!struct (..identifier "struct")] (in_meta (list (` ("lux def" (~ g!struct) (~ struct) - [(~ location_code) (#.Record #End)] + [(~ location_code) (#.Record #.End)] #0)) (` (..open: (~ (text$ alias)) (~ g!struct))))))) @@ -4617,9 +4688,9 @@ (macro: .public (|>> tokens) {#.doc (text$ ($_ "lux text concat" "... Similar to the piping macro, but rather than taking an initial object to work on, creates a function for taking it." ..\n - "(|>> (list\map int\encoded) (interposed '' '') (mix text\compose ''''))" ..\n + "(|>> (list\each int\encoded) (interposed '' '') (mix text\composite ''''))" ..\n "... =>" ..\n - "(function (_ ) (mix text\compose '''' (interposed '' '' (list\map int\encoded ))))"))} + "(function (_ ) (mix text\composite '''' (interposed '' '' (list\each int\encoded ))))"))} (do meta_monad [g!_ (..identifier "_") g!arg (..identifier "arg")] @@ -4628,9 +4699,9 @@ (macro: .public (<<| tokens) {#.doc (text$ ($_ "lux text concat" "... Similar to the piping macro, but rather than taking an initial object to work on, creates a function for taking it." ..\n - "(<<| (mix text\compose '''') (interposed '' '') (list\map int\encoded))" ..\n + "(<<| (mix text\composite '''') (interposed '' '') (list\each int\encoded))" ..\n "... =>" ..\n - "(function (_ ) (mix text\compose '''' (interposed '' '' (list\map int\encoded ))))"))} + "(function (_ ) (mix text\composite '''' (interposed '' '' (list\each int\encoded ))))"))} (do meta_monad [g!_ (..identifier "_") g!arg (..identifier "arg")] @@ -4657,11 +4728,11 @@ #refer_open openings}) _ - (failure ($_ text\compose "Wrong syntax for refer @ " current_module + (failure ($_ text\composite "Wrong syntax for refer @ " current_module ..\n (|> options - (list\map code\encoded) + (list\each code\encoded) (list\interposed " ") - (list\mix text\compose ""))))))) + (list\mix text\composite ""))))))) (def: (referral_definitions module_name [r_defs r_opens]) (-> Text Refer (Meta (List Code))) @@ -4669,13 +4740,13 @@ [current_module current_module_name .let [test_referrals (: (-> Text (List Text) (List Text) (Meta (List Any))) (function (_ module_name all_defs referred_defs) - (monad\map meta_monad - (: (-> Text (Meta Any)) - (function (_ _def) - (if (is_member? all_defs _def) - (in_meta []) - (failure ($_ text\compose _def " is not defined in module " module_name " @ " current_module))))) - referred_defs)))] + (monad\each meta_monad + (: (-> Text (Meta Any)) + (function (_ _def) + (if (is_member? all_defs _def) + (in_meta []) + (failure ($_ text\composite _def " is not defined in module " module_name " @ " current_module))))) + referred_defs)))] defs' (case r_defs #All (exported_definitions module_name) @@ -4697,18 +4768,18 @@ #Nothing (in (list))) - .let [defs (list\map (: (-> Text Code) - (function (_ def) - (` ("lux def alias" (~ (local_identifier$ def)) (~ (identifier$ [module_name def])))))) - defs') + .let [defs (list\each (: (-> Text Code) + (function (_ def) + (` ("lux def alias" (~ (local_identifier$ def)) (~ (identifier$ [module_name def])))))) + defs') openings (|> r_opens - (list\map (: (-> Openings (List Code)) - (function (_ [alias structs]) - (list\map (function (_ name) - (` (open: (~ (text$ alias)) (~ (identifier$ [module_name name]))))) - structs)))) - list\joined)]] - (in (list\compose defs openings)))) + (list\each (: (-> Openings (List Code)) + (function (_ [alias structs]) + (list\each (function (_ name) + (` (open: (~ (text$ alias)) (~ (identifier$ [module_name name]))))) + structs)))) + list\conjoint)]] + (in (list\composite defs openings)))) (macro: (refer tokens) (case tokens @@ -4729,20 +4800,20 @@ (list (' #*)) (#Only defs) - (list (form$ (list& (' #+) (list\map local_identifier$ defs)))) + (list (form$ (list& (' #+) (list\each local_identifier$ defs)))) (#Exclude defs) - (list (form$ (list& (' #-) (list\map local_identifier$ defs)))) + (list (form$ (list& (' #-) (list\each local_identifier$ defs)))) #Ignore (list) #Nothing (list))) - openings (list\map (function (_ [alias structs]) - (form$ (list& (text$ (..replaced ..contextual_reference module_alias alias)) - (list\map local_identifier$ structs)))) - r_opens)] + openings (list\each (function (_ [alias structs]) + (form$ (list& (text$ (..replaced ..contextual_reference module_alias alias)) + (list\each local_identifier$ structs)))) + r_opens)] (` ((~! ..refer) (~ (text$ module_name)) (~+ localizations) (~+ openings))))) @@ -4776,14 +4847,14 @@ current_module current_module_name imports (imports_parser #0 current_module "" _imports) .let [=imports (|> imports - (list\map (: (-> Importation Code) - (function (_ [module_name m_alias =refer]) - (` [(~ (text$ module_name)) (~ (text$ (..else "" m_alias)))])))) + (list\each (: (-> Importation Code) + (function (_ [module_name m_alias =refer]) + (` [(~ (text$ module_name)) (~ (text$ (..else "" m_alias)))])))) tuple$) - =refers (list\map (: (-> Importation Code) - (function (_ [module_name m_alias =refer]) - (refer_code module_name m_alias =refer))) - imports) + =refers (list\each (: (-> Importation Code) + (function (_ [module_name m_alias =refer]) + (refer_code module_name m_alias =refer))) + imports) =module (` ("lux def module" [(~ location_code) (#.Record (~ (definition_annotations _meta)))] (~ =imports)))]] @@ -4826,25 +4897,25 @@ (case (interface_methods type) (#Some members) (do meta_monad - [pattern' (monad\map meta_monad - (: (-> [Name [Nat Type]] (Meta [Name Nat Code])) - (function (_ [r_slot_name [r_idx r_type]]) - (do meta_monad - [g!slot (..identifier "")] - (in_meta [r_slot_name r_idx g!slot])))) - (zipped/2 tags (enumeration members)))] - (let [pattern (record$ (list\map (: (-> [Name Nat Code] [Code Code]) + [pattern' (monad\each meta_monad + (: (-> [Name [Nat Type]] (Meta [Name Nat Code])) + (function (_ [r_slot_name [r_idx r_type]]) + (do meta_monad + [g!slot (..identifier "")] + (in_meta [r_slot_name r_idx g!slot])))) + (zipped/2 tags (enumeration members)))] + (let [pattern (record$ (list\each (: (-> [Name Nat Code] [Code Code]) + (function (_ [r_slot_name r_idx r_var]) + [(tag$ r_slot_name) + r_var])) + pattern')) + output (record$ (list\each (: (-> [Name Nat Code] [Code Code]) (function (_ [r_slot_name r_idx r_var]) [(tag$ r_slot_name) - r_var])) - pattern')) - output (record$ (list\map (: (-> [Name Nat Code] [Code Code]) - (function (_ [r_slot_name r_idx r_var]) - [(tag$ r_slot_name) - (if ("lux i64 =" idx r_idx) - value - r_var)])) - pattern'))] + (if ("lux i64 =" idx r_idx) + value + r_var)])) + pattern'))] (in_meta (list (` ({(~ pattern) (~ output)} (~ record))))))) _ @@ -4857,10 +4928,10 @@ _ (do meta_monad - [bindings (monad\map meta_monad - (: (-> Code (Meta Code)) - (function (_ _) (..identifier "temp"))) - slots) + [bindings (monad\each meta_monad + (: (-> Code (Meta Code)) + (function (_ _) (..identifier "temp"))) + slots) .let [pairs (zipped/2 slots bindings) update_expr (list\mix (: (-> [Code Code] Code Code) (function (_ [s b] v) @@ -4873,7 +4944,7 @@ (#Item (list new_binding old_record) accesses')])) [record (: (List (List Code)) #End)] pairs) - accesses (list\joined (list\reversed accesses'))]] + accesses (list\conjoint (list\reversed accesses'))]] (in (list (` (let [(~+ accesses)] (~ update_expr))))))) @@ -4915,25 +4986,25 @@ (case (interface_methods type) (#Some members) (do meta_monad - [pattern' (monad\map meta_monad - (: (-> [Name [Nat Type]] (Meta [Name Nat Code])) - (function (_ [r_slot_name [r_idx r_type]]) - (do meta_monad - [g!slot (..identifier "")] - (in_meta [r_slot_name r_idx g!slot])))) - (zipped/2 tags (enumeration members)))] - (let [pattern (record$ (list\map (: (-> [Name Nat Code] [Code Code]) + [pattern' (monad\each meta_monad + (: (-> [Name [Nat Type]] (Meta [Name Nat Code])) + (function (_ [r_slot_name [r_idx r_type]]) + (do meta_monad + [g!slot (..identifier "")] + (in_meta [r_slot_name r_idx g!slot])))) + (zipped/2 tags (enumeration members)))] + (let [pattern (record$ (list\each (: (-> [Name Nat Code] [Code Code]) + (function (_ [r_slot_name r_idx r_var]) + [(tag$ r_slot_name) + r_var])) + pattern')) + output (record$ (list\each (: (-> [Name Nat Code] [Code Code]) (function (_ [r_slot_name r_idx r_var]) [(tag$ r_slot_name) - r_var])) - pattern')) - output (record$ (list\map (: (-> [Name Nat Code] [Code Code]) - (function (_ [r_slot_name r_idx r_var]) - [(tag$ r_slot_name) - (if ("lux i64 =" idx r_idx) - (` ((~ fun) (~ r_var))) - r_var)])) - pattern'))] + (if ("lux i64 =" idx r_idx) + (` ((~ fun) (~ r_var))) + r_var)])) + pattern'))] (in_meta (list (` ({(~ pattern) (~ output)} (~ record))))))) _ @@ -4977,7 +5048,7 @@ " (-> (List Type) Type Type)" ..\n " (case type" ..\n " (#.Primitive name params)" ..\n - " (#.Primitive name (list\map (reduced env) params))" + " (#.Primitive name (list\each (reduced env) params))" __paragraph " (^template []" ..\n " [( left right)" ..\n @@ -5012,20 +5083,20 @@ branches)) (case (: (Maybe (List Code)) (do maybe_monad - [bindings' (monad\map maybe_monad identifier_short bindings) - data' (monad\map maybe_monad tuple_list data)] + [bindings' (monad\each maybe_monad identifier_short bindings) + data' (monad\each maybe_monad tuple_list data)] (let [num_bindings (list\size bindings')] (if (every? (|>> ("lux i64 =" num_bindings)) - (list\map list\size data')) + (list\each list\size data')) (let [apply (: (-> Replacement_Environment (List Code)) - (function (_ env) (list\map (realized_template env) templates)))] + (function (_ env) (list\each (realized_template env) templates)))] (|> data' - (list\map (function\composite apply (replacement_environment bindings'))) - list\joined + (list\each (function\composite apply (replacement_environment bindings'))) + list\conjoint in)) #None)))) (#Some output) - (in_meta (list\compose output branches)) + (in_meta (list\composite output branches)) #None (failure "Wrong syntax for ^template")) @@ -5050,19 +5121,20 @@ (^template [] [[[_ _ column] ( parts)] - (list\mix n/min column (list\map baseline_column parts))]) + (list\mix n/min column (list\each baseline_column parts))]) ([#Form] [#Tuple]) [[_ _ column] (#Record pairs)] (list\mix n/min column - (list\compose (list\map (|>> product\left baseline_column) pairs) - (list\map (|>> product\right baseline_column) pairs))) + (list\composite (list\each (|>> product\left baseline_column) pairs) + (list\each (|>> product\right baseline_column) pairs))) )) (type: Documentation_Fragment - (#Documentation_Comment Text) - (#Documentation_Example Code)) + (Variant + (#Documentation_Comment Text) + (#Documentation_Example Code))) (def: (documentation_fragment code) (-> Code Documentation_Fragment) @@ -5085,7 +5157,8 @@ (def: tag\encoded (-> Name Text) - (|>> name\encoded (text\compose "#"))) + (|>> name\encoded + (text\composite "#"))) (def: (repeated n x) (All [a] (-> Int a (List a))) @@ -5099,7 +5172,7 @@ (text\interposed "" (repeated (.int ("lux i64 -" old_column new_column)) " ")) (let [extra_lines (text\interposed "" (repeated (.int ("lux i64 -" old_line new_line)) ..\n)) space_padding (text\interposed "" (repeated (.int ("lux i64 -" baseline new_column)) " "))] - (text\compose extra_lines space_padding)))) + (text\composite extra_lines space_padding)))) (def: (text\size x) (-> Text Nat) @@ -5109,14 +5182,6 @@ (-> Location Text Location) [file line ("lux i64 +" column (text\size code_text))]) -(def: un_paired - (-> (List [Code Code]) (List Code)) - (let [pair_list (: (-> [Code Code] (List Code)) - (function (_ [left right]) - (list left right)))] - (|>> (list\map pair_list) - list\joined))) - (def: (example_documentation prev_location baseline example) (-> Location Nat Code [Location Text]) (case example @@ -5124,8 +5189,8 @@ [[new_location ( value)] (let [as_text ( value)] [(updated_location new_location as_text) - (text\compose (location_padding baseline prev_location new_location) - as_text)])]) + (text\composite (location_padding baseline prev_location new_location) + as_text)])]) ([#Bit bit\encoded] [#Nat nat\encoded] [#Int int\encoded] @@ -5138,11 +5203,11 @@ [[group_location ( parts)] (let [[group_location' parts_text] (list\mix (function (_ part [last_location text_accum]) (let [[part_location part_text] (example_documentation last_location baseline part)] - [part_location (text\compose text_accum part_text)])) + [part_location (text\composite text_accum part_text)])) [(revised@ #column ++ group_location) ""] ( parts))] [(revised@ #column ++ group_location') - ($_ text\compose (location_padding baseline prev_location group_location) + ($_ text\composite (location_padding baseline prev_location group_location) parts_text )])]) @@ -5160,14 +5225,14 @@ (#Documentation_Comment comment) (|> comment (text\all_split_by ..\n) - (list\map (function (_ line) ($_ text\compose "... " line ..\n))) + (list\each (function (_ line) ($_ text\composite "... " line ..\n))) (text\interposed "")) (#Documentation_Example example) (let [baseline (baseline_column example) [location _] example - [_ text] (..example_documentation (with@ #.column baseline location) baseline example)] - (text\compose text __paragraph)))) + [_ text] (..example_documentation (with@ #column baseline location) baseline example)] + (text\composite text __paragraph)))) (macro: .public (example tokens) {#.doc (text$ ($_ "lux text concat" @@ -5183,7 +5248,7 @@ " x)))"))} (in_meta (list (` [(~ location_code) (#.Text (~ (|> tokens - (list\map (|>> ..documentation_fragment ..fragment_documentation)) + (list\each (|>> ..documentation_fragment ..fragment_documentation)) (text\interposed "") text$)))])))) @@ -5205,7 +5270,7 @@ (-> Type Code) (case type (#Primitive name params) - (` (#.Primitive (~ (text$ name)) (~ (untemplated_list (list\map type_code params))))) + (` (#.Primitive (~ (text$ name)) (~ (untemplated_list (list\each type_code params))))) (^template [] [( left right) @@ -5221,7 +5286,7 @@ (^template [] [( env type) - (let [env' (untemplated_list (list\map type_code env))] + (let [env' (untemplated_list (list\each type_code env))] (` ( (~ env') (~ (type_code type)))))]) ([#.UnivQ] [#.ExQ]) @@ -5250,43 +5315,43 @@ x)))} (let [?params (case tokens (^ (list name [_ (#Tuple bindings)] body)) - (#.Some [name bindings body]) + (#Some [name bindings body]) (^ (list [_ (#Tuple bindings)] body)) - (#.Some [(local_identifier$ "recur") bindings body]) + (#Some [(local_identifier$ "recur") bindings body]) _ - #.None)] + #None)] (case ?params - (#.Some [name bindings body]) + (#Some [name bindings body]) (let [pairs (pairs bindings) - vars (list\map product\left pairs) - inits (list\map product\right pairs)] + vars (list\each product\left pairs) + inits (list\each product\right pairs)] (if (every? identifier? inits) (do meta_monad [inits' (: (Meta (List Name)) - (case (monad\map maybe_monad identifier_name inits) + (case (monad\each maybe_monad identifier_name inits) (#Some inits') (in_meta inits') #None (failure "Wrong syntax for loop"))) - init_types (monad\map meta_monad type_definition inits') + init_types (monad\each meta_monad type_definition inits') expected ..expected_type] (in_meta (list (` (("lux type check" - (-> (~+ (list\map type_code init_types)) + (-> (~+ (list\each type_code init_types)) (~ (type_code expected))) (function ((~ name) (~+ vars)) (~ body))) (~+ inits)))))) (do meta_monad - [aliases (monad\map meta_monad - (: (-> Code (Meta Code)) - (function (_ _) (..identifier ""))) - inits)] + [aliases (monad\each meta_monad + (: (-> Code (Meta Code)) + (function (_ _) (..identifier ""))) + inits)] (in_meta (list (` (let [(~+ (..interleaved aliases inits))] (.loop (~ name) [(~+ (..interleaved vars aliases))] (~ body))))))))) - #.None + #None (failure "Wrong syntax for loop")))) (macro: .public (^slots tokens) @@ -5301,7 +5366,7 @@ (case (: (Maybe [Name (List Name)]) (do maybe_monad [hslot (..tag_name hslot') - tslots (monad\map maybe_monad ..tag_name tslots')] + tslots (monad\each maybe_monad ..tag_name tslots')] (in [hslot tslots]))) (#Some slots) (in_meta slots) @@ -5310,21 +5375,21 @@ (failure "Wrong syntax for ^slots"))) .let [[hslot tslots] slots] hslot (..normal hslot) - tslots (monad\map meta_monad ..normal tslots) + tslots (monad\each meta_monad ..normal tslots) output (..type_tag hslot) g!_ (..identifier "_") .let [[idx tags exported? type] output - slot_pairings (list\map (: (-> Name [Text Code]) - (function (_ [module name]) - [name (local_identifier$ name)])) - (list& hslot tslots)) - pattern (record$ (list\map (: (-> Name [Code Code]) - (function (_ [module name]) - (let [tag (tag$ [module name])] - (case (plist\value name slot_pairings) - (#Some binding) [tag binding] - #None [tag g!_])))) - tags))]] + slot_pairings (list\each (: (-> Name [Text Code]) + (function (_ [module name]) + [name (local_identifier$ name)])) + (list& hslot tslots)) + pattern (record$ (list\each (: (-> Name [Code Code]) + (function (_ [module name]) + (let [tag (tag$ [module name])] + (case (plist\value name slot_pairings) + (#Some binding) [tag binding] + #None [tag g!_])))) + tags))]] (in_meta (list& pattern body branches))) _ @@ -5345,26 +5410,26 @@ (^template [] [[location ( elems)] (do maybe_monad - [placements (monad\map maybe_monad (with_expansions' label tokens) elems)] - (in (list [location ( (list\joined placements))])))]) + [placements (monad\each maybe_monad (with_expansions' label tokens) elems)] + (in (list [location ( (list\conjoint placements))])))]) ([#Tuple] [#Form]) [location (#Record pairs)] (do maybe_monad - [=pairs (monad\map maybe_monad - (: (-> [Code Code] (Maybe [Code Code])) - (function (_ [slot value]) - (do maybe_monad - [slot' (with_expansions' label tokens slot) - value' (with_expansions' label tokens value)] - (case [slot' value'] - (^ [(list =slot) (list =value)]) - (in [=slot =value]) - - _ - #None)))) - pairs)] + [=pairs (monad\each maybe_monad + (: (-> [Code Code] (Maybe [Code Code])) + (function (_ [slot value]) + (do maybe_monad + [slot' (with_expansions' label tokens slot) + value' (with_expansions' label tokens value)] + (case [slot' value'] + (^ [(list =slot) (list =value)]) + (in [=slot =value]) + + _ + #None)))) + pairs)] (in (list [location (#Record =pairs)]))))) (macro: .public (with_expansions tokens) @@ -5448,7 +5513,7 @@ ["Text" Text text$]) _ - (failure (text\compose "Cannot anti-quote type: " (name\encoded name)))))) + (failure (text\composite "Cannot anti-quote type: " (name\encoded name)))))) (def: (static_literal token) (-> Code (Meta Code)) @@ -5463,20 +5528,20 @@ (^template [] [[meta ( parts)] (do meta_monad - [=parts (monad\map meta_monad static_literal parts)] + [=parts (monad\each meta_monad static_literal parts)] (in [meta ( =parts)]))]) ([#Form] [#Tuple]) [meta (#Record pairs)] (do meta_monad - [=pairs (monad\map meta_monad - (: (-> [Code Code] (Meta [Code Code])) - (function (_ [slot value]) - (do meta_monad - [=value (static_literal value)] - (in [slot =value])))) - pairs)] + [=pairs (monad\each meta_monad + (: (-> [Code Code] (Meta [Code Code])) + (function (_ [slot value]) + (do meta_monad + [=value (static_literal value)] + (in [slot =value])))) + pairs)] (in [meta (#Record =pairs)])) _ @@ -5537,14 +5602,14 @@ (#Item init extras) (do meta_monad - [extras' (monad\map meta_monad case_level^ extras)] + [extras' (monad\each meta_monad case_level^ extras)] (in [init extras'])))) (def: (multi_level_case$ g!_ [[init_pattern levels] body]) (-> Code [Multi_Level_Case Code] (List Code)) (let [inner_pattern_body (list\mix (function (_ [calculation pattern] success) (let [bind? (case pattern - [_ (#.Identifier _)] + [_ (#Identifier _)] #1 _ @@ -5565,28 +5630,28 @@ "Useful in situations where the result of a branch depends on further refinements on the values being matched." "For example:" (case (split (size static) uri) - (^multi (#.Some [chunk uri']) + (^multi (#Some [chunk uri']) {(text\= static chunk) #1}) (match_uri endpoint? parts' uri') _ - (#.Left (format "Static part " (%t static) " does not match URI: " uri))) + (#Left (format "Static part " (%t static) " does not match URI: " uri))) "Short-cuts can be taken when using bit tests." "The example above can be rewritten as..." (case (split (size static) uri) - (^multi (#.Some [chunk uri']) + (^multi (#Some [chunk uri']) (text\= static chunk)) (match_uri endpoint? parts' uri') _ - (#.Left (format "Static part " (%t static) " does not match URI: " uri))))} + (#Left (format "Static part " (%t static) " does not match URI: " uri))))} (case tokens (^ (list& [_meta (#Form levels)] body next_branches)) (do meta_monad [mlc (multi_level_case^ levels) .let [initial_bind? (case mlc - [[_ (#.Identifier _)] _] + [[_ (#Identifier _)] _] #1 _ @@ -5618,7 +5683,7 @@ (def: wrong_syntax_error (-> Name Text) (|>> name\encoded - (text\compose "Wrong syntax for "))) + (text\composite "Wrong syntax for "))) (macro: .public (name_of tokens) {#.doc (example "Given an identifier or a tag, gives back a 2 tuple with the module and name parts, both as Text." @@ -5662,7 +5727,7 @@ (in (list (` (#Ex (~ (nat$ var_id)))))) #None - (failure (text\compose "Indexed-type does not exist: " (nat\encoded idx))))) + (failure (text\composite "Indexed-type does not exist: " (nat\encoded idx))))) _ (failure (..wrong_syntax_error (name_of ..$))))) @@ -5785,36 +5850,36 @@ _ #None)) -(def:' .private (templateP tokens) - (-> (List Code) (Maybe [Code Text (List Text) (List [Code Code]) (List Code)])) - (|> (do maybe_monad - [% (declarationP tokens) - .let' [[tokens [export_policy name parameters]] %] - % (annotationsP tokens) - .let' [[tokens annotations] %] - % (tupleP tokens) - .let' [[tokens templates] %] - _ (endP tokens)] - (in [export_policy name parameters annotations templates])) - ... (^ (list _export_policy _declaration _annotations _body)) - ... (^ (list _declaration _annotations _body)) - (maybe\else' (do maybe_monad - [% (declarationP tokens) - .let' [[tokens [export_policy name parameters]] %] - % (tupleP tokens) - .let' [[tokens templates] %] - _ (endP tokens)] - (in [export_policy name parameters #End templates]))) - ... (^ (list _export_policy _declaration _body)) - (maybe\else' (do maybe_monad - [% (local_declarationP tokens) - .let' [[tokens [name parameters]] %] - % (tupleP tokens) - .let' [[tokens templates] %] - _ (endP tokens)] - (in [(` ..private) name parameters #End templates]))) - ... (^ (list _declaration _body)) - )) +(def: (templateP tokens) + (-> (List Code) (Maybe [Code Text (List Text) (List [Code Code]) (List Code)])) + (|> (do maybe_monad + [% (declarationP tokens) + .let' [[tokens [export_policy name parameters]] %] + % (annotationsP tokens) + .let' [[tokens annotations] %] + % (tupleP tokens) + .let' [[tokens templates] %] + _ (endP tokens)] + (in [export_policy name parameters annotations templates])) + ... (^ (list _export_policy _declaration _annotations _body)) + ... (^ (list _declaration _annotations _body)) + (maybe\else' (do maybe_monad + [% (declarationP tokens) + .let' [[tokens [export_policy name parameters]] %] + % (tupleP tokens) + .let' [[tokens templates] %] + _ (endP tokens)] + (in [export_policy name parameters #End templates]))) + ... (^ (list _export_policy _declaration _body)) + (maybe\else' (do maybe_monad + [% (local_declarationP tokens) + .let' [[tokens [name parameters]] %] + % (tupleP tokens) + .let' [[tokens templates] %] + _ (endP tokens)] + (in [(` ..private) name parameters #End templates]))) + ... (^ (list _declaration _body)) + )) (macro: .public (template: tokens) {#.doc (example "Define macros in the style of template and ^template." @@ -5822,30 +5887,30 @@ (template: (square x) (* x x)))} (case (templateP tokens) - (#.Some [export_policy name args anns input_templates]) + (#Some [export_policy name args anns input_templates]) (do meta_monad [g!tokens (..identifier "tokens") g!compiler (..identifier "compiler") g!_ (..identifier "_") - .let [rep_env (list\map (function (_ arg) - [arg (` ((~' ~) (~ (local_identifier$ arg))))]) - args)] + .let [rep_env (list\each (function (_ arg) + [arg (` ((~' ~) (~ (local_identifier$ arg))))]) + args)] this_module current_module_name] (in (list (` (macro: (~ export_policy) ((~ (local_identifier$ name)) (~ g!tokens) (~ g!compiler)) (~ (record$ anns)) (case (~ g!tokens) - (^ (list (~+ (list\map local_identifier$ args)))) + (^ (list (~+ (list\each local_identifier$ args)))) (#.Right [(~ g!compiler) - (list (~+ (list\map (function (_ template) - (` (`' (~ (with_replacements rep_env - template))))) - input_templates)))]) + (list (~+ (list\each (function (_ template) + (` (`' (~ (with_replacements rep_env + template))))) + input_templates)))]) (~ g!_) (#.Left (~ (text$ (..wrong_syntax_error [this_module name])))))))))) - #.None + #None (failure (..wrong_syntax_error (name_of ..template:))))) (macro: .public (as_is tokens compiler) @@ -5896,12 +5961,12 @@ (in (:as ..Text value)) _ - (failure ($_ text\compose + (failure ($_ text\composite "Invalid target platform (must be a value of type Text): " (name\encoded identifier) " : " (..code\encoded (..type_code type)))))) _ - (failure ($_ text\compose + (failure ($_ text\composite "Invalid target platform syntax: " (..code\encoded choice) ..\n "Must be either a text literal or an identifier.")))) @@ -5910,10 +5975,10 @@ (case options #End (case default - #.None - (failure ($_ text\compose "No code for target platform: " target)) + #None + (failure ($_ text\composite "No code for target platform: " target)) - (#.Some default) + (#Some default) (in_meta (list default))) (#Item [key pick] options') @@ -5934,10 +5999,10 @@ [target ..target] (case tokens (^ (list [_ (#Record options)])) - (target_pick target options #.None) + (target_pick target options #None) (^ (list [_ (#Record options)] default)) - (target_pick target options (#.Some default)) + (target_pick target options (#Some default)) _ (failure (..wrong_syntax_error (name_of ..for)))))) @@ -5961,24 +6026,24 @@ (^template [] [[ann ( parts)] (do meta_monad - [=parts (monad\map meta_monad embedded_expansions parts)] - (in [(list\mix list\compose (list) (list\map left =parts)) - [ann ( (list\map right =parts))]]))]) + [=parts (monad\each meta_monad embedded_expansions parts)] + (in [(list\mix list\composite (list) (list\each left =parts)) + [ann ( (list\each right =parts))]]))]) ([#Form] [#Tuple]) [ann (#Record kvs)] (do meta_monad - [=kvs (monad\map meta_monad - (function (_ [key val]) - (do meta_monad - [=key (embedded_expansions key) - =val (embedded_expansions val) - .let [[key_labels key_labelled] =key - [val_labels val_labelled] =val]] - (in [(list\compose key_labels val_labels) [key_labelled val_labelled]]))) - kvs)] - (in [(list\mix list\compose (list) (list\map left =kvs)) - [ann (#Record (list\map right =kvs))]])) + [=kvs (monad\each meta_monad + (function (_ [key val]) + (do meta_monad + [=key (embedded_expansions key) + =val (embedded_expansions val) + .let [[key_labels key_labelled] =key + [val_labels val_labelled] =val]] + (in [(list\composite key_labels val_labels) [key_labelled val_labelled]]))) + kvs)] + (in [(list\mix list\composite (list) (list\each left =kvs)) + [ann (#Record (list\each right =kvs))]])) _ (in_meta [(list) code]))) @@ -5994,8 +6059,8 @@ [=raw (..embedded_expansions raw) .let [[labels labelled] =raw]] (in (list (` (with_expansions [(~+ (|> labels - (list\map (function (_ [label expansion]) (list label expansion))) - list\joined))] + (list\each (function (_ [label expansion]) (list label expansion))) + list\conjoint))] (~ labelled)))))) _ @@ -6018,13 +6083,13 @@ (-> Code (-> Code (Meta Code)) (-> (List [Code Code]) (Meta Code))) (do meta_monad - [=fields (monad\map meta_monad - (function (_ [key value]) - (do meta_monad - [=key (untemplated_pattern key) - =value (untemplated_pattern value)] - (in (` [(~ =key) (~ =value)])))) - fields)] + [=fields (monad\each meta_monad + (function (_ [key value]) + (do meta_monad + [=key (untemplated_pattern key) + =value (untemplated_pattern value)] + (in (` [(~ =key) (~ =value)])))) + fields)] (in (` [(~ g!meta) (#.Record (~ (untemplated_list =fields)))])))) (template [ ] @@ -6035,12 +6100,12 @@ (#Item [_ (#Form (#Item [[_ (#Identifier ["" "~+"])] (#Item [spliced #End])]))] inits) (do meta_monad - [=inits (monad\map meta_monad untemplated_pattern (list\reversed inits))] + [=inits (monad\each meta_monad untemplated_pattern (list\reversed inits))] (in (` [(~ g!meta) ( (~ (untemplated_list& spliced =inits)))]))) _ (do meta_monad - [=elems (monad\map meta_monad untemplated_pattern elems)] + [=elems (monad\each meta_monad untemplated_pattern elems)] (in (` [(~ g!meta) ( (~ (untemplated_list =elems)))])))))] [#.Tuple untemplated_tuple] @@ -6073,8 +6138,8 @@ (^template [ ] [[_ ( elems)] ( g!meta untemplated_pattern elems)]) - ([#.Tuple ..untemplated_tuple] - [#.Form ..untemplated_form]) + ([#Tuple ..untemplated_tuple] + [#Form ..untemplated_form]) [_ (#Record fields)] (..untemplated_record g!meta untemplated_pattern fields) @@ -6122,9 +6187,9 @@ (if (multiple? 2 (list\size bindings)) (in_meta (list (` (..with_expansions [(~+ (|> bindings ..pairs - (list\map (function (_ [localT valueT]) - (list localT (` (..as_is (~ valueT)))))) - (list\mix list\compose (list))))] + (list\each (function (_ [localT valueT]) + (list localT (` (..as_is (~ valueT)))))) + (list\mix list\composite (list))))] (~ bodyT))))) (..failure ":let requires an even number of parts")) diff --git a/stdlib/source/library/lux/abstract/comonad.lux b/stdlib/source/library/lux/abstract/comonad.lux index 281dc7fc9..6de1b97d0 100644 --- a/stdlib/source/library/lux/abstract/comonad.lux +++ b/stdlib/source/library/lux/abstract/comonad.lux @@ -20,7 +20,7 @@ out) (: (All [a] (-> (w a) (w (w a)))) - split)) + disjoint)) (macro: .public (be tokens state) (case (: (Maybe [(Maybe Text) Code (List Code) Code]) @@ -39,11 +39,11 @@ identifier (: (-> Text Code) (|>> ($_ "lux text concat" module " " short " ") [""] #.Identifier [location.dummy])) g!_ (identifier "_") - g!map (identifier "map") - g!split (identifier "split") + g!each (identifier "each") + g!disjoint (identifier "disjoint") body' (list\mix (: (-> [Code Code] Code Code) (function (_ binding body') - (with_expansions [ (` (|> (~ value) (~ g!split) ((~ g!map) (function ((~ g!_) (~ var)) (~ body')))))] + (with_expansions [ (` (|> (~ value) (~ g!disjoint) ((~ g!each) (function ((~ g!_) (~ var)) (~ body')))))] (let [[var value] binding] (case var [_ (#.Identifier ["" _])] @@ -60,13 +60,13 @@ (#.Some name) (let [name [location.dummy (#.Identifier ["" name])]] (` ({(~ name) - ({[(~ g!map) (~' out) (~ g!split)] + ({[(~ g!each) (~' out) (~ g!disjoint)] (~ body')} (~ name))} (~ comonad)))) #.None - (` ({[(~ g!map) (~' out) (~ g!split)] + (` ({[(~ g!each) (~' out) (~ g!disjoint)] (~ 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 c5d61dbb4..e7d9cea7f 100644 --- a/stdlib/source/library/lux/abstract/comonad/cofree.lux +++ b/stdlib/source/library/lux/abstract/comonad/cofree.lux @@ -11,8 +11,8 @@ (implementation: .public (functor dsl) (All [F] (-> (Functor F) (Functor (CoFree F)))) - (def: (map f [head tail]) - [(f head) (\ dsl map (map f) tail)])) + (def: (each f [head tail]) + [(f head) (\ dsl each (each f) tail)])) (implementation: .public (comonad dsl) (All [F] (-> (Functor F) (CoMonad (CoFree F)))) @@ -22,6 +22,6 @@ (def: (out [head tail]) head) - (def: (split [head tail]) + (def: (disjoint [head tail]) [[head tail] - (\ dsl map split tail)])) + (\ dsl each disjoint tail)])) diff --git a/stdlib/source/library/lux/abstract/equivalence.lux b/stdlib/source/library/lux/abstract/equivalence.lux index 43598f09e..69f90bb06 100644 --- a/stdlib/source/library/lux/abstract/equivalence.lux +++ b/stdlib/source/library/lux/abstract/equivalence.lux @@ -18,7 +18,7 @@ (implementation: .public functor (contravariant.Functor Equivalence) - (def: (map f equivalence) + (def: (each f equivalence) (implementation (def: (= reference sample) (\ equivalence = (f reference) (f sample)))))) diff --git a/stdlib/source/library/lux/abstract/functor.lux b/stdlib/source/library/lux/abstract/functor.lux index 6f7053018..28e90dbb0 100644 --- a/stdlib/source/library/lux/abstract/functor.lux +++ b/stdlib/source/library/lux/abstract/functor.lux @@ -6,7 +6,7 @@ (: (All [a b] (-> (-> a b) (-> (f a) (f b)))) - map)) + each)) (type: .public (Fix f) (f (Fix f))) @@ -17,13 +17,13 @@ (def: .public (sum (^open "f\.") (^open "g\.")) (All [F G] (-> (Functor F) (Functor G) (Functor (..Or F G)))) (implementation - (def: (map f fa|ga) + (def: (each f fa|ga) (case fa|ga (#.Left fa) - (#.Left (f\map f fa)) + (#.Left (f\each f fa)) (#.Right ga) - (#.Right (g\map f ga)))))) + (#.Right (g\each f ga)))))) (type: .public (And f g) (All [a] (.And (f a) (g a)))) @@ -31,9 +31,9 @@ (def: .public (product (^open "f\.") (^open "g\.")) (All [F G] (-> (Functor F) (Functor G) (Functor (..And F G)))) (implementation - (def: (map f [fa ga]) - [(f\map f fa) - (g\map f ga)]))) + (def: (each f [fa ga]) + [(f\each f fa) + (g\each f ga)]))) (type: .public (Then f g) (All [a] (f (g a)))) @@ -41,5 +41,5 @@ (def: .public (composite (^open "f\.") (^open "g\.")) (All [F G] (-> (Functor F) (Functor G) (Functor (..Then F G)))) (implementation - (def: (map f fga) - (f\map (g\map f) fga)))) + (def: (each f fga) + (f\each (g\each f) fga)))) diff --git a/stdlib/source/library/lux/abstract/functor/contravariant.lux b/stdlib/source/library/lux/abstract/functor/contravariant.lux index 9c5fe673a..ac35b9360 100644 --- a/stdlib/source/library/lux/abstract/functor/contravariant.lux +++ b/stdlib/source/library/lux/abstract/functor/contravariant.lux @@ -6,4 +6,4 @@ (: (All [a b] (-> (-> b a) (-> (f a) (f b)))) - map)) + each)) diff --git a/stdlib/source/library/lux/abstract/hash.lux b/stdlib/source/library/lux/abstract/hash.lux index 3180691f3..48816744a 100644 --- a/stdlib/source/library/lux/abstract/hash.lux +++ b/stdlib/source/library/lux/abstract/hash.lux @@ -15,10 +15,10 @@ (implementation: .public functor (contravariant.Functor Hash) - (def: (map f super) + (def: (each f super) (implementation (def: &equivalence - (\ equivalence.functor map f + (\ equivalence.functor each f (\ super &equivalence))) (def: hash diff --git a/stdlib/source/library/lux/abstract/mix.lux b/stdlib/source/library/lux/abstract/mix.lux index 0788f38d0..07bddfec0 100644 --- a/stdlib/source/library/lux/abstract/mix.lux +++ b/stdlib/source/library/lux/abstract/mix.lux @@ -13,4 +13,4 @@ (All [F a] (-> (Monoid a) (Mix F) (F a) a)) (let [(^open "/\.") monoid] - (mix /\compose /\identity value))) + (mix /\composite /\identity value))) diff --git a/stdlib/source/library/lux/abstract/monad.lux b/stdlib/source/library/lux/abstract/monad.lux index 85159e505..4a1abdc82 100644 --- a/stdlib/source/library/lux/abstract/monad.lux +++ b/stdlib/source/library/lux/abstract/monad.lux @@ -51,7 +51,7 @@ in) (: (All [a] (-> (m (m a)) (m a))) - join)) + conjoint)) (macro: .public (do tokens state) (case (: (Maybe [(Maybe Text) Code (List Code) Code]) @@ -70,11 +70,11 @@ identifier (: (-> Text Code) (|>> ($_ "lux text concat" module " " short " ") [""] #.Identifier [location.dummy])) g!_ (identifier "_") - g!map (identifier "map") - g!join (identifier "join") + g!each (identifier "each") + g!conjoint (identifier "conjoint") body' (list\mix (: (-> [Code Code] Code Code) (function (_ binding body') - (with_expansions [ (` (|> (~ value) ((~ g!map) (function ((~ g!_) (~ var)) (~ body'))) (~ g!join)))] + (with_expansions [ (` (|> (~ value) ((~ g!each) (function ((~ g!_) (~ var)) (~ body'))) (~ g!conjoint)))] (let [[var value] binding] (case var [_ (#.Identifier ["" _])] @@ -91,13 +91,13 @@ (#.Some name) (let [name [location.dummy (#.Identifier ["" name])]] (` ({(~ name) - ({[(~ g!map) (~' in) (~ g!join)] + ({[(~ g!each) (~' in) (~ g!conjoint)] (~ body')} (~ name))} (~ monad)))) #.None - (` ({[(~ g!map) (~' in) (~ g!join)] + (` ({[(~ g!each) (~' in) (~ g!conjoint)] (~ body')} (~ monad)))))])) (#.Left "'do' bindings must have an even number of parts.")) @@ -109,8 +109,8 @@ (All [! a b] (-> (Monad !) (-> a (! b)) (-> (! a) (! b)))) - (|>> (\ monad map f) - (\ monad join))) + (|>> (\ monad each f) + (\ monad conjoint))) (def: .public (all monad) (All [! a] @@ -124,11 +124,11 @@ (#.Item x xs') (|> x - (!\map (function (_ _x) - (!\map (|>> (#.Item _x)) (recur xs')))) - !\join))))) + (!\each (function (_ _x) + (!\each (|>> (#.Item _x)) (recur xs')))) + !\conjoint))))) -(def: .public (map monad f) +(def: .public (each monad f) (All [M a b] (-> (Monad M) (-> a (M b)) (List a) (M (List b)))) @@ -140,9 +140,9 @@ (#.Item x xs') (|> (f x) - (!\map (function (_ _x) - (!\map (|>> (#.Item _x)) (recur xs')))) - !\join))))) + (!\each (function (_ _x) + (!\each (|>> (#.Item _x)) (recur xs')))) + !\conjoint))))) (def: .public (only monad f) (All [! a b] @@ -156,13 +156,13 @@ (#.Item head xs') (|> (f head) - (!\map (function (_ verdict) - (!\map (function (_ tail) - (if verdict - (#.Item head tail) - tail)) - (recur xs')))) - !\join))))) + (!\each (function (_ verdict) + (!\each (function (_ tail) + (if verdict + (#.Item head tail) + tail)) + (recur xs')))) + !\conjoint))))) (def: .public (mix monad f init xs) (All [M a b] diff --git a/stdlib/source/library/lux/abstract/monad/free.lux b/stdlib/source/library/lux/abstract/monad/free.lux index 82b405ccc..101a23d87 100644 --- a/stdlib/source/library/lux/abstract/monad/free.lux +++ b/stdlib/source/library/lux/abstract/monad/free.lux @@ -7,19 +7,20 @@ [monad (#+ Monad)]]) (type: .public (Free F a) - (#Pure a) - (#Effect (F (Free F a)))) + (Variant + (#Pure a) + (#Effect (F (Free F a))))) (implementation: .public (functor dsl) (All [F] (-> (Functor F) (Functor (Free F)))) - (def: (map f ea) + (def: (each f ea) (case ea (#Pure a) (#Pure (f a)) (#Effect value) - (#Effect (\ dsl map (map f) value))))) + (#Effect (\ dsl each (each f) value))))) (implementation: .public (apply dsl) (All [F] (-> (Functor F) (Apply (Free F)))) @@ -33,12 +34,12 @@ (#Pure (f a)) [(#Pure f) (#Effect fa)] - (#Effect (\ dsl map - (\ (..functor dsl) map f) + (#Effect (\ dsl each + (\ (..functor dsl) each f) fa)) [(#Effect ff) _] - (#Effect (\ dsl map (on ea) ff)) + (#Effect (\ dsl each (on ea) ff)) ))) (implementation: .public (monad dsl) @@ -49,7 +50,7 @@ (def: (in a) (#Pure a)) - (def: (join efefa) + (def: (conjoint efefa) (case efefa (#Pure efa) (case efa @@ -60,7 +61,7 @@ (#Effect fa)) (#Effect fefa) - (#Effect (\ dsl map - (\ (monad dsl) join) + (#Effect (\ dsl each + (\ (monad dsl) conjoint) fefa)) ))) diff --git a/stdlib/source/library/lux/abstract/monad/indexed.lux b/stdlib/source/library/lux/abstract/monad/indexed.lux index f255f9727..ad06165f3 100644 --- a/stdlib/source/library/lux/abstract/monad/indexed.lux +++ b/stdlib/source/library/lux/abstract/monad/indexed.lux @@ -31,8 +31,9 @@ (<>.and .any .any)) (type: Context - (#Macro Name Code) - (#Binding Binding)) + (Variant + (#Macro Name Code) + (#Binding Binding))) (def: global_identifier (Parser Name) @@ -53,10 +54,10 @@ (def: named_monad (Parser [(Maybe Text) Code]) - (<>.either (.record (<>.and (\ <>.monad map (|>> #.Some) + (<>.either (.record (<>.and (\ <>.monad each (|>> #.Some) .local_identifier) .any)) - (\ <>.monad map (|>> [#.None]) + (\ <>.monad each (|>> [#.None]) .any))) (syntax: .public (do [[?name monad] ..named_monad diff --git a/stdlib/source/library/lux/abstract/monoid.lux b/stdlib/source/library/lux/abstract/monoid.lux index 01dacde2e..6e8aff164 100644 --- a/stdlib/source/library/lux/abstract/monoid.lux +++ b/stdlib/source/library/lux/abstract/monoid.lux @@ -6,7 +6,7 @@ (: a identity) (: (-> a a a) - compose)) + composite)) (def: .public (and left right) (All [l r] (-> (Monoid l) (Monoid r) (Monoid [l r]))) @@ -14,6 +14,6 @@ (def: identity [(\ left identity) (\ right identity)]) - (def: (compose [lL rL] [lR rR]) - [(\ left compose lL lR) - (\ right compose rL rR)]))) + (def: (composite [lL rL] [lR rR]) + [(\ left composite lL lR) + (\ right composite rL rR)]))) diff --git a/stdlib/source/library/lux/abstract/order.lux b/stdlib/source/library/lux/abstract/order.lux index 279c3beb0..7f055199a 100644 --- a/stdlib/source/library/lux/abstract/order.lux +++ b/stdlib/source/library/lux/abstract/order.lux @@ -47,10 +47,10 @@ (implementation: .public functor (contravariant.Functor Order) - (def: (map f order) + (def: (each f order) (implementation (def: &equivalence - (\ equivalence.functor map f (\ order &equivalence))) + (\ equivalence.functor each f (\ order &equivalence))) (def: (< reference sample) (\ order < (f reference) (f sample)))))) diff --git a/stdlib/source/library/lux/abstract/predicate.lux b/stdlib/source/library/lux/abstract/predicate.lux index 20101f7a9..5c5cde91b 100644 --- a/stdlib/source/library/lux/abstract/predicate.lux +++ b/stdlib/source/library/lux/abstract/predicate.lux @@ -31,7 +31,7 @@ (All [a] (Monoid (Predicate a))) (def: identity ) - (def: compose ))] + (def: composite ))] [union ..none ..or] [intersection ..all ..and] @@ -57,5 +57,5 @@ (implementation: .public functor (contravariant.Functor Predicate) - (def: (map f fb) + (def: (each f fb) (|>> f fb))) diff --git a/stdlib/source/library/lux/control/concatenative.lux b/stdlib/source/library/lux/control/concatenative.lux index de474236a..9cc286c29 100644 --- a/stdlib/source/library/lux/control/concatenative.lux +++ b/stdlib/source/library/lux/control/concatenative.lux @@ -30,8 +30,9 @@ [Text Code]) (type: Stack - {#bottom (Maybe Nat) - #top (List Code)}) + (Record + {#bottom (Maybe Nat) + #top (List Code)})) (def: aliases^ (Parser (List Alias)) @@ -48,7 +49,7 @@ (Parser Stack) (<>.either (<>.and (<>.maybe bottom^) (.tuple (<>.some .any))) - (<>.and (|> bottom^ (<>\map (|>> #.Some))) + (<>.and (|> bottom^ (<>\each (|>> #.Some))) (<>\in (list))))) (def: (stack_mix tops bottom) @@ -68,7 +69,7 @@ _ (meta.failure (format "Cannot expand to more than a single AST/Code node:" text.new_line - (|> expansion (list\map %.code) (text.interposed " "))))))) + (|> expansion (list\each %.code) (text.interposed " "))))))) (syntax: .public (=> [aliases aliases^ inputs stack^ @@ -78,8 +79,8 @@ (code.replaced (code.local_identifier from) to pre)) aliased aliases))] - (case [(|> inputs (value@ #bottom) (maybe\map (|>> code.nat (~) #.Parameter (`)))) - (|> outputs (value@ #bottom) (maybe\map (|>> code.nat (~) #.Parameter (`))))] + (case [(|> inputs (value@ #bottom) (maybe\each (|>> code.nat (~) #.Parameter (`)))) + (|> outputs (value@ #bottom) (maybe\each (|>> code.nat (~) #.Parameter (`))))] [(#.Some bottomI) (#.Some bottomO)] (monad.do meta.monad [inputC (singleton (macro.full_expansion (stack_mix (value@ #top inputs) bottomI))) diff --git a/stdlib/source/library/lux/control/concurrency/actor.lux b/stdlib/source/library/lux/control/concurrency/actor.lux index 0e248ff9b..f7f5644d3 100644 --- a/stdlib/source/library/lux/control/concurrency/actor.lux +++ b/stdlib/source/library/lux/control/concurrency/actor.lux @@ -56,7 +56,7 @@ [current (async.value read)] (case current (#.Some [head tail]) - (\ ! map (|>> (#.Item head)) + (\ ! each (|>> (#.Item head)) (pending tail)) #.None @@ -65,9 +65,10 @@ (abstract: .public (Actor s) {} - {#obituary [(Async ) - (Resolver )] - #mailbox (Atom )} + (Record + {#obituary [(Async ) + (Resolver )] + #mailbox (Atom )}) (type: .public (Mail s) ) @@ -76,8 +77,9 @@ ) (type: .public (Behavior o s) - {#on_init (-> o s) - #on_mail (-> (Mail s) s (Actor s) (Async (Try s)))}) + (Record + {#on_init (-> o s) + #on_mail (-> (Mail s) s (Actor s) (Async (Try s)))})) (def: .public (spawn! behavior init) (All [o s] (-> (Behavior o s) o (IO (Actor s)))) @@ -112,7 +114,7 @@ (let [[obituary _] (value@ #obituary (:representation actor))] (|> obituary async.value - (\ io.functor map + (\ io.functor each (|>> (case> #.None bit.yes @@ -263,7 +265,7 @@ (do meta.monad [g!type (macro.identifier (format name "_abstract_type")) .let [g!actor (code.local_identifier name) - g!vars (list\map code.local_identifier vars)]] + g!vars (list\each code.local_identifier vars)]] (in (list (` ((~! abstract:) (~ export_policy) ((~ g!type) (~+ g!vars)) {} @@ -288,11 +290,12 @@ (~ init))))))))) (type: Signature - {#vars (List Text) - #name Text - #inputs (List |input|.Input) - #state Text - #self Text}) + (Record + {#vars (List Text) + #name Text + #inputs (List |input|.Input) + #state Text + #self Text})) (def: signature^ (Parser Signature) @@ -326,9 +329,9 @@ .let [g!type (code.local_identifier (value@ #abstract.name actor_scope)) g!message (code.local_identifier (value@ #name signature)) g!actor_vars (value@ #abstract.type_vars actor_scope) - g!all_vars (|> signature (value@ #vars) (list\map code.local_identifier) (list\compose g!actor_vars)) - g!inputsC (|> signature (value@ #inputs) (list\map product.left)) - g!inputsT (|> signature (value@ #inputs) (list\map product.right)) + g!all_vars (|> signature (value@ #vars) (list\each code.local_identifier) (list\composite g!actor_vars)) + g!inputsC (|> signature (value@ #inputs) (list\each product.left)) + g!inputsT (|> signature (value@ #inputs) (list\each product.right)) g!state (|> signature (value@ #state) code.local_identifier) g!self (|> signature (value@ #self) code.local_identifier)]] (in (list (` (def: (~ export_policy) ((~ g!message) (~+ g!inputsC)) @@ -365,6 +368,6 @@ (if continue? (|> actor (..mail! (action event stop)) - (\ ! map try.maybe)) + (\ ! each try.maybe)) (in #.None)))) channel))) diff --git a/stdlib/source/library/lux/control/concurrency/async.lux b/stdlib/source/library/lux/control/concurrency/async.lux index bdd852ffc..c996e1dcc 100644 --- a/stdlib/source/library/lux/control/concurrency/async.lux +++ b/stdlib/source/library/lux/control/concurrency/async.lux @@ -42,8 +42,8 @@ succeeded? (atom.compare_and_swap! old new async)] (if succeeded? (do ! - [_ (monad.map ! (function (_ f) (f value)) - _observers)] + [_ (monad.each ! (function (_ f) (f value)) + _observers)] (in #1)) (resolve value)))))))) @@ -60,7 +60,7 @@ (All [a] (-> (Async a) (IO (Maybe a)))) (|>> :representation atom.read! - (\ io.functor map product.left))) + (\ io.functor each product.left))) (def: .public (upon! f async) (All [a] (-> (-> a (IO Any)) (Async a) (IO Any))) @@ -83,7 +83,7 @@ (def: .public resolved? (All [a] (-> (Async a) (IO Bit))) (|>> ..value - (\ io.functor map + (\ io.functor each (|>> (case> #.None #0 @@ -93,7 +93,7 @@ (implementation: .public functor (Functor Async) - (def: (map f fa) + (def: (each f fa) (let [[fb resolve] (..async [])] (exec (io.run! (..upon! (|>> f resolve) fa)) @@ -119,7 +119,7 @@ (def: in ..resolved) - (def: (join mma) + (def: (conjoint mma) (let [[ma resolve] (async [])] (exec (io.run! (..upon! (..upon! resolve) mma)) diff --git a/stdlib/source/library/lux/control/concurrency/atom.lux b/stdlib/source/library/lux/control/concurrency/atom.lux index b6d9461f0..5be4a9059 100644 --- a/stdlib/source/library/lux/control/concurrency/atom.lux +++ b/stdlib/source/library/lux/control/concurrency/atom.lux @@ -95,4 +95,4 @@ (All [a] (-> a (Atom a) (IO a))) (|> atom (..update! (function.constant value)) - (io\map product.left))) + (io\each product.left))) diff --git a/stdlib/source/library/lux/control/concurrency/frp.lux b/stdlib/source/library/lux/control/concurrency/frp.lux index 1e447ef17..df0ef8160 100644 --- a/stdlib/source/library/lux/control/concurrency/frp.lux +++ b/stdlib/source/library/lux/control/concurrency/frp.lux @@ -85,11 +85,11 @@ (implementation: .public functor (Functor Channel) - (def: (map f) - (async\map - (maybe\map + (def: (each f) + (async\each + (maybe\each (function (_ [head tail]) - [(f head) (map f tail)]))))) + [(f head) (each f tail)]))))) (implementation: .public apply (Apply Channel) @@ -119,7 +119,7 @@ (def: (in a) (async.resolved (#.Some [a ..empty]))) - (def: (join mma) + (def: (conjoint mma) (let [[output sink] (channel [])] (exec (: (Async Any) @@ -185,9 +185,9 @@ (def: .public (of_async async) (All [a] (-> (Async a) (Channel a))) - (async\map (function (_ value) - (#.Some [value ..empty])) - async)) + (async\each (function (_ value) + (#.Some [value ..empty])) + async)) (def: .public (mix f init channel) (All [a b] @@ -276,7 +276,7 @@ [item channel] (case item (#.Some [head tail]) - (\ ! map (|>> (#.Item head)) + (\ ! each (|>> (#.Item head)) (list tail)) #.None diff --git a/stdlib/source/library/lux/control/concurrency/semaphore.lux b/stdlib/source/library/lux/control/concurrency/semaphore.lux index e2cdb2aca..8f2378d3d 100644 --- a/stdlib/source/library/lux/control/concurrency/semaphore.lux +++ b/stdlib/source/library/lux/control/concurrency/semaphore.lux @@ -25,9 +25,10 @@ ["." async (#+ Async Resolver)]]) (type: State - {#max_positions Nat - #open_positions Int - #waiting_list (Queue (Resolver Any))}) + (Record + {#max_positions Nat + #open_positions Int + #waiting_list (Queue (Resolver Any))})) (abstract: .public Semaphore {} @@ -130,10 +131,11 @@ (abstract: .public Barrier {} - {#limit Limit - #count (Atom Nat) - #start_turnstile Semaphore - #end_turnstile Semaphore} + (Record + {#limit Limit + #count (Atom Nat) + #start_turnstile Semaphore + #end_turnstile Semaphore}) (def: .public (barrier limit) (-> Limit Barrier) diff --git a/stdlib/source/library/lux/control/concurrency/stm.lux b/stdlib/source/library/lux/control/concurrency/stm.lux index 5e9759bdb..cb6a1e702 100644 --- a/stdlib/source/library/lux/control/concurrency/stm.lux +++ b/stdlib/source/library/lux/control/concurrency/stm.lux @@ -52,16 +52,16 @@ succeeded? (atom.compare_and_swap! old [new_value observers] var')] (if succeeded? (do ! - [_ (monad.map ! (function (_ sink) - (do ! - [result (\ sink feed new_value)] - (case result - (#try.Success _) - (in []) - - (#try.Failure _) - (un_follow! sink var)))) - observers)] + [_ (monad.each ! (function (_ sink) + (do ! + [result (\ sink feed new_value)] + (case result + (#try.Success _) + (in []) + + (#try.Failure _) + (un_follow! sink var)))) + observers)] (in [])) (write! new_value var)))) @@ -76,9 +76,10 @@ ) (type: (Tx_Frame a) - {#var (Var a) - #original a - #current a}) + (Record + {#var (Var a) + #original a + #current a})) (type: Tx (List (Ex [a] (Tx_Frame a)))) @@ -92,8 +93,8 @@ (list.example (function (_ [_var _original _current]) (same? (:as (Var Any) var) (:as (Var Any) _var)))) - (\ maybe.monad map (function (_ [_var _original _current]) - _current)) + (\ maybe.monad each (function (_ [_var _original _current]) + _current)) :expected)) (def: .public (read var) @@ -141,7 +142,7 @@ (implementation: .public functor (Functor STM) - (def: (map f fa) + (def: (each f fa) (function (_ tx) (let [[tx' a] (fa tx)] [tx' (f a)])))) @@ -166,7 +167,7 @@ (function (_ tx) [tx a])) - (def: (join mma) + (def: (conjoint mma) (function (_ tx) (let [[tx' ma] (mma tx)] (ma tx'))))) @@ -233,7 +234,7 @@ [finished_tx value] (stm_proc fresh_tx)] (if (can_commit? finished_tx) (do {! io.monad} - [_ (monad.map ! ..commit_var! finished_tx)] + [_ (monad.each ! ..commit_var! finished_tx)] (resolve value)) (..issue_commit! commit)))) diff --git a/stdlib/source/library/lux/control/concurrency/thread.lux b/stdlib/source/library/lux/control/concurrency/thread.lux index 1011da5bb..d618d7270 100644 --- a/stdlib/source/library/lux/control/concurrency/thread.lux +++ b/stdlib/source/library/lux/control/concurrency/thread.lux @@ -59,9 +59,10 @@ ... Default (type: Thread - {#creation Nat - #delay Nat - #action (IO Any)}) + (Record + {#creation Nat + #delay Nat + #action (IO Any)})) )) (def: .public parallelism @@ -127,7 +128,7 @@ ... Default (do {! io.monad} - [now (\ ! map (|>> instant.millis .nat) instant.now) + [now (\ ! each (|>> instant.millis .nat) instant.now) _ (atom.update! (|>> (#.Item {#creation now #delay milli_seconds #action action})) @@ -156,7 +157,7 @@ _ (do ! - [now (\ ! map (|>> instant.millis .nat) instant.now) + [now (\ ! each (|>> instant.millis .nat) instant.now) .let [[ready pending] (list.partition (function (_ thread) (|> (value@ #creation thread) (n.+ (value@ #delay thread)) @@ -165,7 +166,7 @@ swapped? (atom.compare_and_swap! threads pending ..runner)] (if swapped? (do ! - [_ (monad.map ! (|>> (value@ #action) ..execute! io.io) ready)] + [_ (monad.each ! (|>> (value@ #action) ..execute! io.io) ready)] (recur [])) (panic! (exception.error ..cannot_continue_running_threads [])))) )))) diff --git a/stdlib/source/library/lux/control/continuation.lux b/stdlib/source/library/lux/control/continuation.lux index 15fdc16d1..f56d127c7 100644 --- a/stdlib/source/library/lux/control/continuation.lux +++ b/stdlib/source/library/lux/control/continuation.lux @@ -54,7 +54,7 @@ (implementation: .public functor (All [o] (Functor (All [i] (Cont i o)))) - (def: (map f fv) + (def: (each f fv) (function (_ k) (fv (function.composite k f))))) @@ -77,7 +77,7 @@ (def: (in value) (function (_ k) (k value))) - (def: (join ffa) + (def: (conjoint ffa) (function (_ k) (ffa (continued k))))) diff --git a/stdlib/source/library/lux/control/exception.lux b/stdlib/source/library/lux/control/exception.lux index c59767584..cf00522fa 100644 --- a/stdlib/source/library/lux/control/exception.lux +++ b/stdlib/source/library/lux/control/exception.lux @@ -27,8 +27,9 @@ ["//" try (#+ Try)]]) (type: .public (Exception a) - {#label Text - #constructor (-> a Text)}) + (Record + {#label Text + #constructor (-> a Text)})) (def: .public (match? exception error) (All [e] (-> (Exception e) Text Bit)) @@ -93,16 +94,16 @@ (macro.with_identifiers [g!descriptor] (do meta.monad [current_module meta.current_module_name - .let [descriptor ($_ text\compose "{" current_module "." name "}" text.new_line) + .let [descriptor ($_ text\composite "{" current_module "." name "}" text.new_line) g!self (code.local_identifier name)]] (in (list (` (def: (~ export_policy) (~ g!self) - (All [(~+ (list\map |type_variable|.format t_vars))] - (..Exception [(~+ (list\map (value@ #|input|.type) inputs))])) + (All [(~+ (list\each |type_variable|.format t_vars))] + (..Exception [(~+ (list\each (value@ #|input|.type) inputs))])) (let [(~ g!descriptor) (~ (code.text descriptor))] {#..label (~ g!descriptor) - #..constructor (function ((~ g!self) [(~+ (list\map (value@ #|input|.binding) inputs))]) - ((~! text\compose) (~ g!descriptor) + #..constructor (function ((~ g!self) [(~+ (list\each (value@ #|input|.binding) inputs))]) + ((~! text\composite) (~ g!descriptor) (~ (maybe.else (' "") body))))})))))))) (def: (report' entries) @@ -116,7 +117,7 @@ (list.repeated (n.+ (text.size header_separator) largest_header_size)) text.together - (text\compose text.new_line)) + (text\composite text.new_line)) on_entry (: (-> [Text Text] Text) (function (_ [header message]) (let [padding (|> " " @@ -125,21 +126,21 @@ text.together)] (|> message (text.replaced text.new_line on_new_line) - ($_ text\compose padding header header_separator)))))] + ($_ text\composite padding header header_separator)))))] (case entries #.End "" (#.Item head tail) (list\mix (function (_ post pre) - ($_ text\compose pre text.new_line (on_entry post))) + ($_ text\composite pre text.new_line (on_entry post))) (on_entry head) tail)))) (syntax: .public (report [entries (<>.many (.tuple (<>.and .any .any)))]) (in (list (` ((~! report') (list (~+ (|> entries - (list\map (function (_ [header message]) - (` [(~ header) (~ message)]))))))))))) + (list\each (function (_ [header message]) + (` [(~ header) (~ message)]))))))))))) (def: .public (listing format entries) (All [a] diff --git a/stdlib/source/library/lux/control/function.lux b/stdlib/source/library/lux/control/function.lux index 11cc82e62..3bbcd1bce 100644 --- a/stdlib/source/library/lux/control/function.lux +++ b/stdlib/source/library/lux/control/function.lux @@ -31,4 +31,4 @@ (All [a] (Monoid (-> a a))) (def: identity ..identity) - (def: compose ..composite)) + (def: composite ..composite)) diff --git a/stdlib/source/library/lux/control/function/mixin.lux b/stdlib/source/library/lux/control/function/mixin.lux index 98009b21d..4f5013f77 100644 --- a/stdlib/source/library/lux/control/function/mixin.lux +++ b/stdlib/source/library/lux/control/function/mixin.lux @@ -31,7 +31,7 @@ (All [i o] (Monoid (Mixin i o))) (def: identity ..nothing) - (def: compose ..with)) + (def: composite ..with)) (def: .public (advice when then) (All [i o] (-> (Predicate i) (Mixin i o) (Mixin i o))) diff --git a/stdlib/source/library/lux/control/function/mutual.lux b/stdlib/source/library/lux/control/function/mutual.lux index dd647ce41..3d26dedd1 100644 --- a/stdlib/source/library/lux/control/function/mutual.lux +++ b/stdlib/source/library/lux/control/function/mutual.lux @@ -25,9 +25,10 @@ ["." //]) (type: Mutual - {#declaration Declaration - #type Code - #body Code}) + (Record + {#declaration Declaration + #type Code + #body Code})) (.def: mutual (Parser [Declaration Code Code]) @@ -68,35 +69,36 @@ (macro.with_identifiers [g!context g!output] (do {! meta.monad} [here_name meta.current_module_name - hidden_names (monad.map ! (//.constant (macro.identifier "mutual_function#")) - functions) - .let [definitions (list\map (..mutual_definition hidden_names g!context) - (list.zipped/2 hidden_names - functions)) - context_types (list\map (function (_ mutual) - (` (-> (~ g!context) (~ (value@ #type mutual))))) - functions) - user_names (list\map (|>> (value@ [#declaration #declaration.name]) code.local_identifier) - functions)] - g!pop (local.push (list\map (function (_ [g!name mutual]) - [[here_name (value@ [#declaration #declaration.name] mutual)] - (..macro g!context g!name)]) - (list.zipped/2 hidden_names - functions)))] + hidden_names (monad.each ! (//.constant (macro.identifier "mutual_function#")) + functions) + .let [definitions (list\each (..mutual_definition hidden_names g!context) + (list.zipped/2 hidden_names + functions)) + context_types (list\each (function (_ mutual) + (` (-> (~ g!context) (~ (value@ #type mutual))))) + functions) + user_names (list\each (|>> (value@ [#declaration #declaration.name]) code.local_identifier) + functions)] + g!pop (local.push (list\each (function (_ [g!name mutual]) + [[here_name (value@ [#declaration #declaration.name] mutual)] + (..macro g!context g!name)]) + (list.zipped/2 hidden_names + functions)))] (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))]) + [(~+ (list\each (function (_ g!name) + (` ((~ g!name) (~ g!context)))) + user_names))]) (~ g!output) (~ body)] (exec (~ g!pop) (~ g!output)))))))))) (type: Definition - {#export_policy Code - #mutual Mutual}) + (Record + {#export_policy Code + #mutual Mutual})) (.def: definition (Parser Definition) @@ -119,37 +121,37 @@ (macro.with_identifiers [g!context g!output] (do {! meta.monad} [here_name meta.current_module_name - hidden_names (monad.map ! (//.constant (macro.identifier "mutual_function#")) - functions) - .let [definitions (list\map (..mutual_definition hidden_names g!context) - (list.zipped/2 hidden_names - (list\map (value@ #mutual) functions))) - context_types (list\map (function (_ mutual) - (` (-> (~ g!context) (~ (value@ [#mutual #type] mutual))))) - functions) - user_names (list\map (|>> (value@ [#mutual #declaration #declaration.name]) code.local_identifier) - functions)] - g!pop (local.push (list\map (function (_ [g!name mutual]) - [[here_name (value@ [#mutual #declaration #declaration.name] mutual)] - (..macro g!context g!name)]) - (list.zipped/2 hidden_names - functions)))] + hidden_names (monad.each ! (//.constant (macro.identifier "mutual_function#")) + functions) + .let [definitions (list\each (..mutual_definition hidden_names g!context) + (list.zipped/2 hidden_names + (list\each (value@ #mutual) functions))) + context_types (list\each (function (_ mutual) + (` (-> (~ g!context) (~ (value@ [#mutual #type] mutual))))) + functions) + user_names (list\each (|>> (value@ [#mutual #declaration #declaration.name]) code.local_identifier) + functions)] + g!pop (local.push (list\each (function (_ [g!name mutual]) + [[here_name (value@ [#mutual #declaration #declaration.name] mutual)] + (..macro g!context g!name)]) + (list.zipped/2 hidden_names + functions)))] (in (list& (` (.def: (~ g!context) - [(~+ (list\map (value@ [#mutual #type]) functions))] + [(~+ (list\each (value@ [#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))]))) + [(~+ (list\each (function (_ g!name) + (` ((~ g!name) (~ g!context)))) + user_names))]))) g!pop - (list\map (function (_ mutual) - (.let [g!name (|> mutual (value@ [#mutual #declaration #declaration.name]) code.local_identifier)] - (` (.def: - (~ (value@ #export_policy mutual)) - (~ g!name) - (~ (value@ [#mutual #type] mutual)) - (.let [[(~+ user_names)] (~ g!context)] - (~ g!name)))))) - functions))))))) + (list\each (function (_ mutual) + (.let [g!name (|> mutual (value@ [#mutual #declaration #declaration.name]) code.local_identifier)] + (` (.def: + (~ (value@ #export_policy mutual)) + (~ g!name) + (~ (value@ [#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 4666dfb8a..4f051e604 100644 --- a/stdlib/source/library/lux/control/io.lux +++ b/stdlib/source/library/lux/control/io.lux @@ -44,7 +44,7 @@ (implementation: .public functor (Functor IO) - (def: (map f) + (def: (each f) (|>> run!' f !io))) (implementation: .public apply @@ -60,7 +60,9 @@ (def: &functor ..functor) - (def: in (|>> !io)) + (def: in + (|>> !io)) - (def: join (|>> run!' run!' !io))) + (def: conjoint + (|>> run!' run!' !io))) ) diff --git a/stdlib/source/library/lux/control/lazy.lux b/stdlib/source/library/lux/control/lazy.lux index 58cf7a526..e12de5bb9 100644 --- a/stdlib/source/library/lux/control/lazy.lux +++ b/stdlib/source/library/lux/control/lazy.lux @@ -54,7 +54,7 @@ (implementation: .public functor (Functor Lazy) - (def: (map f fa) + (def: (each f fa) (lazy (f (value fa))))) (implementation: .public apply @@ -69,4 +69,4 @@ (def: &functor ..functor) (def: in (|>> lazy)) - (def: join value)) + (def: conjoint ..value)) diff --git a/stdlib/source/library/lux/control/maybe.lux b/stdlib/source/library/lux/control/maybe.lux index 854ef0402..6fbc4b294 100644 --- a/stdlib/source/library/lux/control/maybe.lux +++ b/stdlib/source/library/lux/control/maybe.lux @@ -20,7 +20,7 @@ (def: identity #.None) - (def: (compose mx my) + (def: (composite mx my) (case mx #.None my @@ -31,7 +31,7 @@ (implementation: .public functor (Functor Maybe) - (def: (map f ma) + (def: (each f ma) (case ma #.None #.None (#.Some a) (#.Some (f a))))) @@ -57,7 +57,7 @@ (def: (in x) (#.Some x)) - (def: (join mma) + (def: (conjoint mma) (case mma #.None #.None @@ -102,7 +102,7 @@ (def: in (|>> (\ ..monad in) (\ monad in))) - (def: (join MmMma) + (def: (conjoint MmMma) (do monad [mMma MmMma] (case mMma @@ -114,7 +114,7 @@ (def: .public (lifted monad) (All [M a] (-> (Monad M) (-> (M a) (M (Maybe a))))) - (\ monad map (\ ..monad in))) + (\ monad each (\ ..monad in))) (macro: .public (else tokens state) (case tokens diff --git a/stdlib/source/library/lux/control/parser.lux b/stdlib/source/library/lux/control/parser.lux index 30c728cd2..4d32c8df6 100644 --- a/stdlib/source/library/lux/control/parser.lux +++ b/stdlib/source/library/lux/control/parser.lux @@ -22,7 +22,7 @@ (implementation: .public functor (All [s] (Functor (Parser s))) - (def: (map f ma) + (def: (each f ma) (function (_ input) (case (ma input) (#try.Failure msg) @@ -59,7 +59,7 @@ (function (_ input) (#try.Success [input x]))) - (def: (join mma) + (def: (conjoint mma) (function (_ input) (case (mma input) (#try.Failure msg) @@ -96,7 +96,7 @@ (-> (Parser s a) (Parser s b) (Parser s [a b]))) (do {! ..monad} [head first] - (\ ! map (|>> [head]) second))) + (\ ! each (|>> [head]) second))) (def: .public (or left right) (All [s a b] @@ -134,7 +134,7 @@ (#try.Success [input (list)]) (#try.Success [input' head]) - (..result (\ ..monad map (|>> (list& head)) + (..result (\ ..monad each (|>> (list& head)) (some parser)) input')))) @@ -143,7 +143,7 @@ (-> (Parser s a) (Parser s (List a)))) (|> (..some parser) (..and parser) - (\ ..monad map (|>> #.Item)))) + (\ ..monad each (|>> #.Item)))) (def: .public (exactly amount parser) (All [s a] (-> Nat (Parser s a) (Parser s (List a)))) @@ -153,13 +153,13 @@ [x parser] (|> parser (exactly (-- amount)) - (\ ! map (|>> (#.Item x))))))) + (\ ! each (|>> (#.Item x))))))) (def: .public (at_least amount parser) (All [s a] (-> Nat (Parser s a) (Parser s (List a)))) (do {! ..monad} [minimum (..exactly amount parser)] - (\ ! map (list\compose minimum) (..some parser)))) + (\ ! each (list\composite minimum) (..some parser)))) (def: .public (at_most amount parser) (All [s a] (-> Nat (Parser s a) (Parser s (List a)))) @@ -171,7 +171,7 @@ (#try.Success [input (list)]) (#try.Success [input' x]) - (..result (\ ..monad map (|>> (#.Item x)) + (..result (\ ..monad each (|>> (#.Item x)) (at_most (-- amount) parser)) input'))))) @@ -181,7 +181,7 @@ [minimum (..exactly minimum parser)] (case additional 0 (in minimum) - _ (\ ! map (list\compose minimum) + _ (\ ! each (list\composite minimum) (..at_most additional parser))))) (def: .public (separated_by separator parser) @@ -196,7 +196,7 @@ (|> parser (..and separator) ..some - (\ ! map (|>> (list\map product.right) (#.Item x))))))) + (\ ! each (|>> (list\each product.right) (#.Item x))))))) (def: .public (not parser) (All [s a] (-> (Parser s a) (Parser s Any))) diff --git a/stdlib/source/library/lux/control/parser/analysis.lux b/stdlib/source/library/lux/control/parser/analysis.lux index 42bffc310..27caea2af 100644 --- a/stdlib/source/library/lux/control/parser/analysis.lux +++ b/stdlib/source/library/lux/control/parser/analysis.lux @@ -1,6 +1,6 @@ (.module: [library - [lux (#- Variant Tuple nat int rev local) + [lux (#- Tuple Variant nat int rev local) [abstract [monad (#+ do)]] [control @@ -36,7 +36,7 @@ (-> (List Analysis) Text) (format text.new_line "Remaining input: " (|> asts - (list\map /.%analysis) + (list\each /.%analysis) (text.interposed " ")))) (exception: .public (cannot_parse {input (List Analysis)}) diff --git a/stdlib/source/library/lux/control/parser/binary.lux b/stdlib/source/library/lux/control/parser/binary.lux index 4fd9d15f5..220dd5ea2 100644 --- a/stdlib/source/library/lux/control/parser/binary.lux +++ b/stdlib/source/library/lux/control/parser/binary.lux @@ -99,7 +99,7 @@ (def: .public frac (Parser Frac) - (//\map frac.of_bits ..bits/64)) + (//\each frac.of_bits ..bits/64)) (exception: .public (invalid_tag {range Nat} {byte Nat}) (exception.report @@ -112,7 +112,7 @@ ..bits/8)] (`` (case flag (^template [ ] - [ (\ ! map (|>> ) )]) + [ (\ ! each (|>> ) )]) ((~~ (template.spliced +))) _ (//.lifted (exception.except ..invalid_tag [(~~ (template.amount +)) flag])))))]) @@ -153,13 +153,13 @@ 0 (#try.Success [[offset binary] (/.empty 0)]) _ (|> binary (/.slice offset size) - (\ try.monad map (|>> [[(n.+ size offset) binary]])))))) + (\ try.monad each (|>> [[(n.+ size offset) binary]])))))) (template [ ] [(`` (def: .public (Parser Binary) (do //.monad - [size (//\map .nat )] + [size (//\each .nat )] (..segment size))))] [08 binary/8 ..bits/8] diff --git a/stdlib/source/library/lux/control/parser/code.lux b/stdlib/source/library/lux/control/parser/code.lux index 1a3bbc5a7..9b83d835a 100644 --- a/stdlib/source/library/lux/control/parser/code.lux +++ b/stdlib/source/library/lux/control/parser/code.lux @@ -32,9 +32,9 @@ (def: remaining_inputs (-> (List Code) Text) - (|>> (list\map code.format) + (|>> (list\each code.format) (text.interposed " ") - ($_ text\compose text.new_line "Remaining input: "))) + ($_ text\composite text.new_line "Remaining input: "))) (def: .public any (Parser Code) @@ -47,7 +47,7 @@ (#try.Success [tokens' t])))) (template [ ] - [(with_expansions [ (as_is (#try.Failure ($_ text\compose "Cannot parse " (remaining_inputs tokens))))] + [(with_expansions [ (as_is (#try.Failure ($_ text\composite "Cannot parse " (remaining_inputs tokens))))] (def: .public (Parser ) (function (_ tokens) @@ -87,14 +87,14 @@ (#.Item [token tokens']) (if (code\= code token) (#try.Success [tokens' []]) - (#try.Failure ($_ text\compose "Expected a " (code.format code) " but instead got " (code.format token) + (#try.Failure ($_ text\composite "Expected a " (code.format code) " but instead got " (code.format token) (remaining_inputs tokens)))) _ (#try.Failure "There are no tokens to parse!")))) (template [ ] - [(with_expansions [ (as_is (#try.Failure ($_ text\compose "Cannot parse " (remaining_inputs tokens))))] + [(with_expansions [ (as_is (#try.Failure ($_ text\composite "Cannot parse " (remaining_inputs tokens))))] (def: .public (Parser Text) (function (_ tokens) @@ -130,10 +130,10 @@ (#.Item [[_ ( members)] tokens']) (case (p members) (#try.Success [#.End x]) (#try.Success [tokens' x]) - _ (#try.Failure ($_ text\compose "Parser was expected to fully consume " (remaining_inputs tokens)))) + _ (#try.Failure ($_ text\composite "Parser was expected to fully consume " (remaining_inputs tokens)))) _ - (#try.Failure ($_ text\compose "Cannot parse " (remaining_inputs tokens))))))] + (#try.Failure ($_ text\composite "Cannot parse " (remaining_inputs tokens))))))] [ form #.Form "form"] [tuple #.Tuple "tuple"] @@ -147,17 +147,17 @@ (#.Item [[_ (#.Record pairs)] tokens']) (case (p (un_paired pairs)) (#try.Success [#.End x]) (#try.Success [tokens' x]) - _ (#try.Failure ($_ text\compose "Parser was expected to fully consume record" (remaining_inputs tokens)))) + _ (#try.Failure ($_ text\composite "Parser was expected to fully consume record" (remaining_inputs tokens)))) _ - (#try.Failure ($_ text\compose "Cannot parse record" (remaining_inputs tokens)))))) + (#try.Failure ($_ text\composite "Cannot parse record" (remaining_inputs tokens)))))) (def: .public end! (Parser Any) (function (_ tokens) (case tokens #.End (#try.Success [tokens []]) - _ (#try.Failure ($_ text\compose "Expected list of tokens to be empty!" (remaining_inputs tokens)))))) + _ (#try.Failure ($_ text\composite "Expected list of tokens to be empty!" (remaining_inputs tokens)))))) (def: .public end? (Parser Bit) @@ -179,9 +179,9 @@ _ (#try.Failure (|> unconsumed - (list\map code.format) + (list\each code.format) (text.interposed ", ") - (text\compose "Unconsumed inputs: ")))))) + (text\composite "Unconsumed inputs: ")))))) (def: .public (local inputs parser) (All [a] (-> (List Code) (Parser a) (Parser a))) diff --git a/stdlib/source/library/lux/control/parser/environment.lux b/stdlib/source/library/lux/control/parser/environment.lux index f084a838d..fbb7335f5 100644 --- a/stdlib/source/library/lux/control/parser/environment.lux +++ b/stdlib/source/library/lux/control/parser/environment.lux @@ -41,4 +41,4 @@ (def: .public (result parser environment) (All [a] (-> (Parser a) Environment (Try a))) - (\ try.monad map product.right (parser environment))) + (\ try.monad each 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 1348b92b4..dcbda6f71 100644 --- a/stdlib/source/library/lux/control/parser/json.lux +++ b/stdlib/source/library/lux/control/parser/json.lux @@ -146,8 +146,8 @@ (#/.Object kvs) (case (|> kvs dictionary.entries - (list\map (function (_ [key value]) - (list (#/.String key) value))) + (list\each (function (_ [key value]) + (list (#/.String key) value))) list.together (//.result parser)) (#try.Failure error) @@ -195,4 +195,4 @@ (|>> (//.and ..string) //.some ..object - (//\map (dictionary.of_list text.hash)))) + (//\each (dictionary.of_list text.hash)))) diff --git a/stdlib/source/library/lux/control/parser/synthesis.lux b/stdlib/source/library/lux/control/parser/synthesis.lux index df28b3df1..d6c6fbeca 100644 --- a/stdlib/source/library/lux/control/parser/synthesis.lux +++ b/stdlib/source/library/lux/control/parser/synthesis.lux @@ -1,6 +1,6 @@ (.module: [library - [lux (#- Variant Tuple function loop i64 local) + [lux (#- Tuple Variant function loop i64 local) [abstract [monad (#+ do)]] [control diff --git a/stdlib/source/library/lux/control/parser/text.lux b/stdlib/source/library/lux/control/parser/text.lux index 0e9724a15..24a2f9e3c 100644 --- a/stdlib/source/library/lux/control/parser/text.lux +++ b/stdlib/source/library/lux/control/parser/text.lux @@ -31,8 +31,9 @@ (//.Parser [Offset Text])) (type: .public Slice - {#basis Offset - #distance Offset}) + (Record + {#basis Offset + #distance Offset})) (def: (remaining' offset tape) (-> Offset Text Text) @@ -161,7 +162,7 @@ (do //.monad [char any .let [char' (maybe.trusted (/.char 0 char))] - _ (//.assertion ($_ /\compose "Character is not within range: " (/.of_char bottom) "-" (/.of_char top)) + _ (//.assertion ($_ /\composite "Character is not within range: " (/.of_char bottom) "-" (/.of_char top)) (.and (n.>= bottom char') (n.<= top char')))] (in char))) @@ -265,7 +266,7 @@ (do //.monad [=left left =right right] - (in ($_ /\compose =left =right)))) + (in ($_ /\composite =left =right)))) (def: .public (and! left right) (-> (Parser Slice) (Parser Slice) (Parser Slice)) @@ -277,7 +278,7 @@ (template [ ] [(def: .public ( parser) (-> (Parser Text) (Parser Text)) - (|> parser (\ //.monad map /.together)))] + (|> parser (\ //.monad each /.together)))] [some //.some "some"] [many //.many "many"] @@ -297,7 +298,7 @@ (-> Nat (Parser Text) (Parser Text)) (|> parser ( amount) - (\ //.monad map /.together)))] + (\ //.monad each /.together)))] [exactly //.exactly "exactly"] [at_most //.at_most "at most"] @@ -319,7 +320,7 @@ (-> Nat Nat (Parser Text) (Parser Text)) (|> parser (//.between minimum additional) - (\ //.monad map /.together))) + (\ //.monad each /.together))) (def: .public (between! minimum additional parser) (-> Nat Nat (Parser Slice) (Parser Slice)) diff --git a/stdlib/source/library/lux/control/parser/type.lux b/stdlib/source/library/lux/control/parser/type.lux index 0b726282a..d51ebc152 100644 --- a/stdlib/source/library/lux/control/parser/type.lux +++ b/stdlib/source/library/lux/control/parser/type.lux @@ -54,7 +54,7 @@ (exception: .public (unconsumed_input {remaining (List Type)}) (exception.report ["Types" (|> remaining - (list\map (|>> %.type (format text.new_line "* "))) + (list\each (|>> %.type (format text.new_line "* "))) (text.interposed ""))])) (type: .public Env @@ -132,7 +132,7 @@ (def: (label idx) (-> Nat Code) - (code.local_identifier ($_ text\compose "label" text.tab (n\encoded idx)))) + (code.local_identifier ($_ text\composite "label" text.tab (n\encoded idx)))) (def: .public (with_extension type poly) (All [a] (-> Type (Parser a) (Parser [Code a]))) @@ -175,7 +175,7 @@ (All [a] (-> (Parser a) (Parser [Code (List Code) a]))) (do {! //.monad} [headT any - funcI (\ ! map dictionary.size ..env) + funcI (\ ! each dictionary.size ..env) [num_args non_poly] (local (list headT) ..polymorphic') env ..env .let [funcL (label funcI) @@ -194,7 +194,7 @@ partial_varI (++ partialI) partial_varL (label partial_varI) partialC (` ((~ funcL) (~+ (|> (list.indices num_args) - (list\map (|>> (n.* 2) ++ (n.+ funcI) label)) + (list\each (|>> (n.* 2) ++ (n.+ funcI) label)) list.reversed))))] (recur (++ current_arg) (|> env' @@ -344,6 +344,6 @@ _ (local (list funcT) (..parameter! 0)) allC (let [allT (list& funcT argsT)] (|> allT - (monad.map ! (function.constant ..parameter)) + (monad.each ! (function.constant ..parameter)) (local allT)))] (in (` ((~+ allC)))))) diff --git a/stdlib/source/library/lux/control/parser/xml.lux b/stdlib/source/library/lux/control/parser/xml.lux index 2e982ad45..6be4241d0 100644 --- a/stdlib/source/library/lux/control/parser/xml.lux +++ b/stdlib/source/library/lux/control/parser/xml.lux @@ -108,7 +108,7 @@ (if (name\= expected actual) (|> children (..result' parser attrs') - (try\map (|>> [[attrs tail]]))) + (try\each (|>> [[attrs tail]]))) (exception.except ..wrong_tag [expected actual])))))) (def: .public any diff --git a/stdlib/source/library/lux/control/pipe.lux b/stdlib/source/library/lux/control/pipe.lux index 8fda36325..760dfb143 100644 --- a/stdlib/source/library/lux/control/pipe.lux +++ b/stdlib/source/library/lux/control/pipe.lux @@ -104,11 +104,12 @@ prev .any]) (with_identifiers [g!temp] (in (list (` (let [(~ g!temp) (~ prev)] - [(~+ (list\map (function (_ body) (` (|> (~ g!temp) (~+ body)))) - paths))])))))) + [(~+ (list\each (function (_ body) (` (|> (~ g!temp) (~+ body)))) + paths))])))))) (syntax: .public (case> [branches (<>.many (<>.and .any .any)) prev .any]) (in (list (` (case (~ prev) - (~+ (list\join (list\map (function (_ [pattern body]) (list pattern body)) - branches)))))))) + (~+ (|> branches + (list\each (function (_ [pattern body]) (list pattern body))) + list\conjoint))))))) diff --git a/stdlib/source/library/lux/control/reader.lux b/stdlib/source/library/lux/control/reader.lux index 7d6462858..b5b6c3e6e 100644 --- a/stdlib/source/library/lux/control/reader.lux +++ b/stdlib/source/library/lux/control/reader.lux @@ -24,7 +24,7 @@ (implementation: .public functor (All [r] (Functor (Reader r))) - (def: (map f fa) + (def: (each f fa) (function (_ env) (f (fa env))))) @@ -45,7 +45,7 @@ (def: (in x) (function (_ env) x)) - (def: (join mma) + (def: (conjoint mma) (function (_ env) (mma env env)))) @@ -58,7 +58,7 @@ (def: in (|>> (\ monad in) (\ ..monad in))) - (def: (join eMeMa) + (def: (conjoint eMeMa) (function (_ env) (do monad [eMa (result env eMeMa)] diff --git a/stdlib/source/library/lux/control/region.lux b/stdlib/source/library/lux/control/region.lux index 1ca544ca6..a8a30cfd2 100644 --- a/stdlib/source/library/lux/control/region.lux +++ b/stdlib/source/library/lux/control/region.lux @@ -58,8 +58,8 @@ (do {! monad} [[cleaners output] (computation [[] (list)])] (|> cleaners - (monad.map ! (function (_ cleaner) (cleaner []))) - (\ ! map (list\mix clean output))))) + (monad.each ! (function (_ cleaner) (cleaner []))) + (\ ! each (list\mix clean output))))) (def: .public (acquire! monad cleaner value) (All [! a] (-> (Monad !) (-> a (! (Try Any))) a @@ -74,10 +74,10 @@ (-> (Functor !) (All [r] (Functor (Region r !))))) - (def: (map f) + (def: (each f) (function (_ fa) (function (_ region+cleaners) - (\ super map + (\ super each (function (_ [cleaners' temp]) [cleaners' (case temp (#try.Success value) @@ -124,7 +124,7 @@ (function (_ [region cleaners]) (\ super in [cleaners (#try.Success value)]))) - (def: (join ffa) + (def: (conjoint ffa) (function (_ [region cleaners]) (do super [[cleaners efa] (ffa [region cleaners])] @@ -153,6 +153,6 @@ (-> (Monad !) (! a) (All [r] (Region r ! a)))) (function (_ [region cleaners]) - (\ monad map + (\ monad each (|>> #try.Success [cleaners]) operation))) diff --git a/stdlib/source/library/lux/control/remember.lux b/stdlib/source/library/lux/control/remember.lux index eaba75049..8ba79f6a7 100644 --- a/stdlib/source/library/lux/control/remember.lux +++ b/stdlib/source/library/lux/control/remember.lux @@ -36,8 +36,8 @@ (def: deadline (Parser Date) ($_ <>.either - (<>\map (|>> instant.of_millis instant.date) - .int) + (<>\each (|>> instant.of_millis instant.date) + .int) (do <>.monad [raw .text] (case (\ date.codec decoded raw) diff --git a/stdlib/source/library/lux/control/security/capability.lux b/stdlib/source/library/lux/control/security/capability.lux index 45b2bd083..ec84db916 100644 --- a/stdlib/source/library/lux/control/security/capability.lux +++ b/stdlib/source/library/lux/control/security/capability.lux @@ -51,14 +51,14 @@ (do {! meta.monad} [this_module meta.current_module_name .let [[name vars] declaration] - g!brand (\ ! map (|>> %.code code.text) + g!brand (\ ! each (|>> %.code code.text) (macro.identifier (format (%.name [this_module name])))) .let [capability (` (..Capability (.primitive (~ g!brand)) (~ input) (~ output)))]] (in (list (` (type: (~ export_policy) (~ (|declaration|.format declaration)) (~ capability))) (` (def: (~ (code.local_identifier forger)) - (All [(~+ (list\map code.local_identifier vars))] + (All [(~+ (list\each code.local_identifier vars))] (-> (-> (~ input) (~ output)) (~ capability))) (~! ..capability))) diff --git a/stdlib/source/library/lux/control/security/policy.lux b/stdlib/source/library/lux/control/security/policy.lux index 497e250ff..1087cf751 100644 --- a/stdlib/source/library/lux/control/security/policy.lux +++ b/stdlib/source/library/lux/control/security/policy.lux @@ -20,8 +20,9 @@ (-> (Policy brand value label) value)) (type: .public (Privilege brand label) - {#can_upgrade (Can_Upgrade brand label) - #can_downgrade (Can_Downgrade brand label)}) + (Record + {#can_upgrade (Can_Upgrade brand label) + #can_downgrade (Can_Downgrade brand label)})) (type: .public (Delegation brand from to) (All [value] @@ -58,7 +59,7 @@ (implementation: .public functor (:~ (..of_policy Functor)) - (def: (map f fa) + (def: (each f fa) (|> fa :representation f :abstraction))) (implementation: .public apply @@ -74,7 +75,7 @@ (def: &functor ..functor) (def: in (|>> :abstraction)) - (def: join (|>> :representation))) + (def: conjoint (|>> :representation))) ) (template [ ] diff --git a/stdlib/source/library/lux/control/state.lux b/stdlib/source/library/lux/control/state.lux index 586cb652c..4b3a64a08 100644 --- a/stdlib/source/library/lux/control/state.lux +++ b/stdlib/source/library/lux/control/state.lux @@ -42,7 +42,7 @@ (implementation: .public functor (All [s] (Functor (State s))) - (def: (map f ma) + (def: (each f ma) (function (_ state) (let [[state' a] (ma state)] [state' (f a)])))) @@ -67,7 +67,7 @@ (function (_ state) [state a])) - (def: (join mma) + (def: (conjoint mma) (function (_ state) (let [[state' ma] (mma state)] (ma state'))))) @@ -91,9 +91,9 @@ (implementation: (with//functor functor) (All [M s] (-> (Functor M) (Functor (All [a] (-> s (M [s a])))))) - (def: (map f sfa) + (def: (each f sfa) (function (_ state) - (\ functor map (function (_ [s a]) [s (f a)]) + (\ functor each (function (_ [s a]) [s (f a)]) (sfa state))))) (implementation: (with//apply monad) @@ -124,7 +124,7 @@ (function (_ state) (\ monad in [state a]))) - (def: (join sMsMa) + (def: (conjoint sMsMa) (function (_ state) (do monad [[state' sMa] (sMsMa state)] diff --git a/stdlib/source/library/lux/control/thread.lux b/stdlib/source/library/lux/control/thread.lux index 8366b2efc..a7acf841e 100644 --- a/stdlib/source/library/lux/control/thread.lux +++ b/stdlib/source/library/lux/control/thread.lux @@ -71,7 +71,7 @@ (implementation: .public functor (All [!] (Functor (Thread !))) - (def: (map f) + (def: (each f) (function (_ fa) (function (_ !) (f (fa !)))))) @@ -94,7 +94,7 @@ (function (_ !) value)) - (def: (join ffa) + (def: (conjoint ffa) (function (_ !) ((ffa !) !)))) diff --git a/stdlib/source/library/lux/control/try.lux b/stdlib/source/library/lux/control/try.lux index 2a1fce570..48ee21443 100644 --- a/stdlib/source/library/lux/control/try.lux +++ b/stdlib/source/library/lux/control/try.lux @@ -10,13 +10,14 @@ ["." location]]]]) (type: .public (Try a) - (#Failure Text) - (#Success a)) + (Variant + (#Failure Text) + (#Success a))) (implementation: .public functor (Functor Try) - (def: (map f ma) + (def: (each f ma) (case ma (#Failure msg) (#Failure msg) @@ -50,7 +51,7 @@ (def: (in a) (#Success a)) - (def: (join mma) + (def: (conjoint mma) (case mma (#Failure msg) (#Failure msg) @@ -69,7 +70,7 @@ (|>> (\ ..monad in) (\ monad in))) - (def: (join MeMea) + (def: (conjoint MeMea) (do monad [eMea MeMea] (case eMea @@ -81,7 +82,7 @@ (def: .public (lifted monad) (All [! a] (-> (Monad !) (-> (! a) (! (Try a))))) - (\ monad map (\ ..monad in))) + (\ monad each (\ ..monad in))) (implementation: .public (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 d42e57780..825700d8f 100644 --- a/stdlib/source/library/lux/control/writer.lux +++ b/stdlib/source/library/lux/control/writer.lux @@ -9,8 +9,9 @@ ["." monad (#+ Monad do)]]]]) (type: .public (Writer log value) - {#log log - #value value}) + (Record + {#log log + #value value})) (def: .public (write message) (All [log] (-> log (Writer log Any))) @@ -20,7 +21,7 @@ (All [l] (Functor (Writer l))) - (def: (map f fa) + (def: (each f fa) (let [[log datum] fa] [log (f datum)]))) @@ -33,7 +34,7 @@ (def: (on fa ff) (let [[log1 f] ff [log2 a] fa] - [(\ monoid compose log1 log2) (f a)]))) + [(\ monoid composite log1 log2) (f a)]))) (implementation: .public (monad monoid) (All [l] @@ -44,9 +45,9 @@ (def: in (|>> [(\ monoid identity)])) - (def: (join mma) + (def: (conjoint mma) (let [[log1 [log2 a]] mma] - [(\ monoid compose log1 log2) a]))) + [(\ monoid composite log1 log2) a]))) (implementation: .public (with monoid monad) (All [l M] (-> (Monoid l) (Monad M) (Monad (All [a] (M (Writer l a)))))) @@ -59,7 +60,7 @@ (let [writer (..monad monoid)] (|>> (\ writer in) (\ monad in)))) - (def: (join MlMla) + (def: (conjoint MlMla) (do monad [[l1 Mla] (for {@.old (: ((:parameter 1) (Writer (:parameter 0) ((:parameter 1) (Writer (:parameter 0) (:parameter 2))))) @@ -67,10 +68,10 @@ ... On new compiler MlMla) [l2 a] Mla] - (in [(\ monoid compose l1 l2) a])))) + (in [(\ monoid composite l1 l2) a])))) (def: .public (lifted monoid monad) (All [l M a] (-> (Monoid l) (Monad M) (-> (M a) (M (Writer l a))))) - (\ monad map (|>> [(\ monoid identity)]))) + (\ monad each (|>> [(\ monoid identity)]))) diff --git a/stdlib/source/library/lux/data/binary.lux b/stdlib/source/library/lux/data/binary.lux index 6028c1a68..ada9bc855 100644 --- a/stdlib/source/library/lux/data/binary.lux +++ b/stdlib/source/library/lux/data/binary.lux @@ -359,7 +359,7 @@ (def: identity (..empty 0)) - (def: (compose left right) + (def: (composite left right) (let [sizeL (!size left) sizeR (!size right) output (..empty (n.+ sizeL sizeR))] diff --git a/stdlib/source/library/lux/data/bit.lux b/stdlib/source/library/lux/data/bit.lux index 38f7b5f8d..6efecceb7 100644 --- a/stdlib/source/library/lux/data/bit.lux +++ b/stdlib/source/library/lux/data/bit.lux @@ -40,7 +40,7 @@ (Monoid Bit) (def: identity ) - (def: (compose x y) ( x y)))] + (def: (composite x y) ( x y)))] [disjunction #0 or] [conjunction #1 and] diff --git a/stdlib/source/library/lux/data/collection/array.lux b/stdlib/source/library/lux/data/collection/array.lux index 4ec5d1612..3ae79571c 100644 --- a/stdlib/source/library/lux/data/collection/array.lux +++ b/stdlib/source/library/lux/data/collection/array.lux @@ -331,7 +331,7 @@ (def: identity (empty 0)) - (def: (compose xs ys) + (def: (composite xs ys) (let [sxs (size xs) sxy (size ys)] (|> (empty (n.+ sxy sxs)) @@ -341,7 +341,7 @@ (implementation: .public functor (Functor Array) - (def: (map f ma) + (def: (each f ma) (let [arr_size (size ma)] (if (n.= 0 arr_size) (empty arr_size) diff --git a/stdlib/source/library/lux/data/collection/dictionary.lux b/stdlib/source/library/lux/data/collection/dictionary.lux index afc1cd356..e06983307 100644 --- a/stdlib/source/library/lux/data/collection/dictionary.lux +++ b/stdlib/source/library/lux/data/collection/dictionary.lux @@ -57,11 +57,12 @@ ... Nodes for the tree data-structure that organizes the data inside ... Dictionaries. (type: (Node k v) - (#Hierarchy Nat (Array (Node k v))) - (#Base Bit_Map - (Array (Either (Node k v) - [k v]))) - (#Collisions Hash_Code (Array [k v]))) + (Variant + (#Hierarchy Nat (Array (Node k v))) + (#Base Bit_Map + (Array (Either (Node k v) + [k v]))) + (#Collisions Hash_Code (Array [k v])))) ... #Hierarchy nodes are meant to point down only to lower-level nodes. (type: (Hierarchy k v) @@ -225,7 +226,7 @@ ... Produces the index of a KV-pair within a #Collisions node. (def: (collision_index key_hash key colls) (All [k v] (-> (Hash k) k (Collisions k v) (Maybe Index))) - (\ maybe.monad map product.left + (\ maybe.monad each product.left (array.example+ (function (_ idx [key' val']) (\ key_hash = key key')) colls))) @@ -509,7 +510,7 @@ ... For #Collisions nodes, do a linear scan of all the known KV-pairs. (#Collisions _hash _colls) - (\ maybe.monad map product.right + (\ maybe.monad each product.right (array.example (|>> product.left (\ key_hash = key)) _colls)) )) @@ -518,14 +519,14 @@ (All [k v] (-> (Node k v) Nat)) (case node (#Hierarchy _size hierarchy) - (array\mix n.+ 0 (array\map size' hierarchy)) + (array\mix n.+ 0 (array\each size' hierarchy)) (#Base _ base) - (array\mix n.+ 0 (array\map (function (_ sub_node') - (case sub_node' - (#.Left sub_node) (size' sub_node) - (#.Right _) 1)) - base)) + (array\mix n.+ 0 (array\each (function (_ sub_node') + (case sub_node' + (#.Left sub_node) (size' sub_node) + (#.Right _) 1)) + base)) (#Collisions hash colls) (array.size colls) @@ -535,7 +536,7 @@ (All [k v] (-> (Node k v) (List [k v]))) (case node (#Hierarchy _size hierarchy) - (array\mix (function (_ sub_node tail) (list\compose (entries' sub_node) tail)) + (array\mix (function (_ sub_node tail) (list\composite (entries' sub_node) tail)) #.End hierarchy) @@ -543,7 +544,7 @@ (array\mix (function (_ branch tail) (case branch (#.Left sub_node) - (list\compose (entries' sub_node) tail) + (list\composite (entries' sub_node) tail) (#.Right [key' val']) (#.Item [key' val'] tail))) @@ -556,8 +557,9 @@ colls))) (type: .public (Dictionary k v) - {#hash (Hash k) - #root (Node k v)}) + (Record + {#hash (Hash k) + #root (Node k v)})) (def: .public key_hash (All [k v] (-> (Dictionary k v) (Hash k))) @@ -701,28 +703,28 @@ (implementation: functor' (All [k] (Functor (Node k))) - (def: (map f fa) + (def: (each f fa) (case fa (#Hierarchy size hierarchy) - (#Hierarchy size (array\map (map f) hierarchy)) + (#Hierarchy size (array\each (each f) hierarchy)) (#Base bitmap base) - (#Base bitmap (array\map (function (_ either) - (case either - (#.Left fa') - (#.Left (map f fa')) - - (#.Right [k v]) - (#.Right [k (f v)]))) - base)) + (#Base bitmap (array\each (function (_ either) + (case either + (#.Left fa') + (#.Left (each f fa')) + + (#.Right [k v]) + (#.Right [k (f v)]))) + base)) (#Collisions hash collisions) - (#Collisions hash (array\map (function (_ [k v]) - [k (f v)]) - collisions))))) + (#Collisions hash (array\each (function (_ [k v]) + [k (f v)]) + collisions))))) (implementation: .public functor (All [k] (Functor (Dictionary k))) - (def: (map f fa) - (revised@ #root (\ ..functor' map f) fa))) + (def: (each f fa) + (revised@ #root (\ ..functor' each f) fa))) diff --git a/stdlib/source/library/lux/data/collection/dictionary/ordered.lux b/stdlib/source/library/lux/data/collection/dictionary/ordered.lux index 49d4068d5..ef9e53973 100644 --- a/stdlib/source/library/lux/data/collection/dictionary/ordered.lux +++ b/stdlib/source/library/lux/data/collection/dictionary/ordered.lux @@ -19,15 +19,17 @@ "Invariant violation") (type: Color - #Red - #Black) + (Variant + #Red + #Black)) (type: (Node k v) - {#color Color - #key k - #value v - #left (Maybe (Node k v)) - #right (Maybe (Node k v))}) + (Record + {#color Color + #key k + #value v + #left (Maybe (Node k v)) + #right (Maybe (Node k v))})) (template [ ] [(def: ( key value left right) @@ -43,8 +45,9 @@ ) (type: .public (Dictionary k v) - {#&order (Order k) - #root (Maybe (Node k v))}) + (Record + {#&order (Order k) + #root (Maybe (Node k v))})) (def: .public (empty order) (All [k v] (-> (Order k) (Dictionary k v))) @@ -352,7 +355,7 @@ (#.Some (right_balanced (value@ #key right) (value@ #value right) (value@ #right right>>left) - (\ maybe.functor map reddened (value@ #right right))))) + (\ maybe.functor each reddened (value@ #right right))))) _ (panic! error_message)) @@ -379,7 +382,7 @@ (value@ #value left>>right) (#.Some (left_balanced (value@ #key left) (value@ #value left) - (\ maybe.functor map reddened (value@ #left left)) + (\ maybe.functor each reddened (value@ #left left)) (value@ #left left>>right))) (#.Some (black key value (value@ #right left>>right) ?right))) @@ -547,7 +550,7 @@ (list) (#.Some node') - ($_ list\compose + ($_ list\composite (recur (value@ #left node')) (list ) (recur (value@ #right node'))))))] diff --git a/stdlib/source/library/lux/data/collection/dictionary/plist.lux b/stdlib/source/library/lux/data/collection/dictionary/plist.lux index e98a2c51b..df834ae4c 100644 --- a/stdlib/source/library/lux/data/collection/dictionary/plist.lux +++ b/stdlib/source/library/lux/data/collection/dictionary/plist.lux @@ -42,7 +42,7 @@ (template [ ] [(def: .public (All [a] (-> (PList a) (List ))) - (list\map ))] + (list\each ))] [keys Text product.left] [values a product.right] diff --git a/stdlib/source/library/lux/data/collection/list.lux b/stdlib/source/library/lux/data/collection/list.lux index 98a3224e4..b40e94669 100644 --- a/stdlib/source/library/lux/data/collection/list.lux +++ b/stdlib/source/library/lux/data/collection/list.lux @@ -312,26 +312,26 @@ (All [a] (Monoid (List a))) (def: identity #.End) - (def: (compose xs ys) + (def: (composite xs ys) (case xs #.End ys (#.Item x xs') - (#.Item x (compose xs' ys))))) + (#.Item x (composite xs' ys))))) (open: "." ..monoid) (implementation: .public functor (Functor List) - (def: (map f ma) + (def: (each f ma) (case ma #.End #.End (#.Item a ma') - (#.Item (f a) (map f ma'))))) + (#.Item (f a) (each f ma'))))) (open: "." ..functor) @@ -348,7 +348,7 @@ (#.Item f ff') (|> ff' (on fa) - (compose (map f fa)))))) + (composite (each f fa)))))) (implementation: .public monad (Monad List) @@ -358,8 +358,8 @@ (def: (in a) (#.Item a #.End)) - (def: join - (|>> reversed (mix compose identity)))) + (def: conjoint + (|>> reversed (mix composite identity)))) (def: .public (sorted < xs) (All [a] (-> (-> a a Bit) (List a) (List a))) @@ -374,7 +374,7 @@ [pre (#.Item x' post)])) [(list) (list)] xs')] - ($_ compose (sorted < pre) (list x) (sorted < post))))) + ($_ composite (sorted < pre) (list x) (sorted < post))))) (def: .public (empty? xs) (All [a] (Predicate (List a))) @@ -447,27 +447,27 @@ (if (n.> 0 num_lists) (let [(^open ".") ..functor indices (..indices num_lists) - type_vars (: (List Code) (map (|>> nat\encoded identifier$) indices)) + type_vars (: (List Code) (each (|>> nat\encoded identifier$) indices)) zipped_type (` (All [(~+ type_vars)] - (-> (~+ (map (: (-> Code Code) (function (_ var) (` (List (~ var))))) - type_vars)) + (-> (~+ (each (: (-> Code Code) (function (_ var) (` (List (~ var))))) + type_vars)) (List [(~+ type_vars)])))) vars+lists (|> indices - (map ++) - (map (function (_ idx) - (let [base (nat\encoded idx)] - [(identifier$ base) - (identifier$ ("lux text concat" base "'"))])))) - pattern (` [(~+ (map (function (_ [v vs]) (` (#.Item (~ v) (~ vs)))) - vars+lists))]) + (each ++) + (each (function (_ idx) + (let [base (nat\encoded idx)] + [(identifier$ base) + (identifier$ ("lux text concat" base "'"))])))) + pattern (` [(~+ (each (function (_ [v vs]) (` (#.Item (~ v) (~ vs)))) + vars+lists))]) g!step (identifier$ "0step0") g!blank (identifier$ "0,0") - list_vars (map product.right vars+lists) + list_vars (each product.right vars+lists) code (` (: (~ zipped_type) (function ((~ g!step) (~+ list_vars)) (case [(~+ list_vars)] (~ pattern) - (#.Item [(~+ (map product.left vars+lists))] + (#.Item [(~+ (each product.left vars+lists))] ((~ g!step) (~+ list_vars))) (~ g!blank) @@ -489,28 +489,28 @@ indices (..indices num_lists) g!return_type (identifier$ "0return_type0") g!func (identifier$ "0func0") - type_vars (: (List Code) (map (|>> nat\encoded identifier$) indices)) + type_vars (: (List Code) (each (|>> nat\encoded identifier$) indices)) zipped_type (` (All [(~+ type_vars) (~ g!return_type)] (-> (-> (~+ type_vars) (~ g!return_type)) - (~+ (map (: (-> Code Code) (function (_ var) (` (List (~ var))))) - type_vars)) + (~+ (each (: (-> Code Code) (function (_ var) (` (List (~ var))))) + type_vars)) (List (~ g!return_type))))) vars+lists (|> indices - (map ++) - (map (function (_ idx) - (let [base (nat\encoded idx)] - [(identifier$ base) - (identifier$ ("lux text concat" base "'"))])))) - pattern (` [(~+ (map (function (_ [v vs]) (` (#.Item (~ v) (~ vs)))) - vars+lists))]) + (each ++) + (each (function (_ idx) + (let [base (nat\encoded idx)] + [(identifier$ base) + (identifier$ ("lux text concat" base "'"))])))) + pattern (` [(~+ (each (function (_ [v vs]) (` (#.Item (~ v) (~ vs)))) + vars+lists))]) g!step (identifier$ "0step0") g!blank (identifier$ "0,0") - list_vars (map product.right vars+lists) + list_vars (each product.right vars+lists) code (` (: (~ zipped_type) (function ((~ g!step) (~ g!func) (~+ list_vars)) (case [(~+ list_vars)] (~ pattern) - (#.Item ((~ g!func) (~+ (map product.left vars+lists))) + (#.Item ((~ g!func) (~+ (each product.left vars+lists))) ((~ g!step) (~ g!func) (~+ list_vars))) (~ g!blank) @@ -556,7 +556,7 @@ (def: .public together (All [a] (-> (List (List a)) (List a))) - (\ ..monad join)) + (\ ..monad conjoint)) (implementation: .public (with monad) (All [M] (-> (Monad M) (Monad (All [a] (M (List a)))))) @@ -568,7 +568,7 @@ (def: in (|>> (\ ..monad in) (\ monad in))) - (def: (join MlMla) + (def: (conjoint MlMla) (do {! monad} [lMla MlMla ... TODO: Remove this version ASAP and use one below. @@ -580,7 +580,7 @@ (def: .public (lifted monad) (All [M a] (-> (Monad M) (-> (M a) (M (List a))))) - (\ monad map (\ ..monad in))) + (\ monad each (\ ..monad in))) (def: .public (enumeration xs) (All [a] (-> (List a) (List [Nat a]))) diff --git a/stdlib/source/library/lux/data/collection/queue.lux b/stdlib/source/library/lux/data/collection/queue.lux index e8caf83f7..ca41352b6 100644 --- a/stdlib/source/library/lux/data/collection/queue.lux +++ b/stdlib/source/library/lux/data/collection/queue.lux @@ -12,8 +12,9 @@ ["n" nat]]]]]) (type: .public (Queue a) - {#front (List a) - #rear (List a)}) + (Record + {#front (List a) + #rear (List a)})) (def: .public empty Queue @@ -28,7 +29,7 @@ (def: .public (list queue) (All [a] (-> (Queue a) (List a))) (let [(^slots [#front #rear]) queue] - (list\compose front (list.reversed rear)))) + (list\composite front (list.reversed rear)))) (def: .public front (All [a] (-> (Queue a) (Maybe a))) @@ -88,6 +89,6 @@ (implementation: .public functor (Functor Queue) - (def: (map f fa) - {#front (|> fa (value@ #front) (list\map f)) - #rear (|> fa (value@ #rear) (list\map f))})) + (def: (each f fa) + {#front (|> fa (value@ #front) (list\each f)) + #rear (|> fa (value@ #rear) (list\each f))})) diff --git a/stdlib/source/library/lux/data/collection/row.lux b/stdlib/source/library/lux/data/collection/row.lux index d7a792cdc..6cba59b62 100644 --- a/stdlib/source/library/lux/data/collection/row.lux +++ b/stdlib/source/library/lux/data/collection/row.lux @@ -33,15 +33,21 @@ ["." i64]]]]]) (type: (Node a) - (#Base (Array a)) - (#Hierarchy (Array (Node a)))) + (Variant + (#Base (Array a)) + (#Hierarchy (Array (Node a))))) -(type: (Base a) (Array a)) -(type: (Hierarchy a) (Array (Node a))) +(type: (Base a) + (Array a)) -(type: Level Nat) +(type: (Hierarchy a) + (Array (Node a))) -(type: Index Nat) +(type: Level + Nat) + +(type: Index + Nat) (def: branching_exponent Nat @@ -179,14 +185,15 @@ (|> hierarchy array.list list.reversed - (list\mix (function (_ sub acc) (list\compose (list' sub) acc)) + (list\mix (function (_ sub acc) (list\composite (list' sub) acc)) #.End)))) (type: .public (Row a) - {#level Level - #size Nat - #root (Hierarchy a) - #tail (Base a)}) + (Record + {#level Level + #size Nat + #root (Hierarchy a) + #tail (Base a)})) (def: .public empty Row @@ -341,8 +348,8 @@ (def: .public (list row) (All [a] (-> (Row a) (List a))) - (list\compose (list' (#Hierarchy (value@ #root row))) - (list' (#Base (value@ #tail row))))) + (list\composite (list' (#Hierarchy (value@ #root row))) + (list' (#Base (value@ #tail row))))) (def: .public of_list (All [a] (-> (List a) (Row a))) @@ -413,28 +420,28 @@ (def: identity ..empty) - (def: (compose xs ys) + (def: (composite xs ys) (list\mix suffix xs (..list ys)))) (implementation: node_functor (Functor Node) - (def: (map f xs) + (def: (each f xs) (case xs (#Base base) - (#Base (array\map f base)) + (#Base (array\each f base)) (#Hierarchy hierarchy) - (#Hierarchy (array\map (map f) hierarchy))))) + (#Hierarchy (array\each (each f) hierarchy))))) (implementation: .public functor (Functor Row) - (def: (map f xs) + (def: (each f xs) {#level (value@ #level xs) #size (value@ #size xs) - #root (|> xs (value@ #root) (array\map (\ node_functor map f))) - #tail (|> xs (value@ #tail) (array\map f))})) + #root (|> xs (value@ #root) (array\each (\ node_functor each f))) + #tail (|> xs (value@ #tail) (array\each f))})) (implementation: .public apply (Apply Row) @@ -445,21 +452,22 @@ (let [(^open ".") ..functor (^open ".") ..mix (^open ".") ..monoid - results (map (function (_ f) (map f fa)) - ff)] - (mix compose identity results)))) + results (each (function (_ f) (each f fa)) + ff)] + (mix composite identity results)))) (implementation: .public monad (Monad Row) (def: &functor ..functor) - (def: in (|>> row)) + (def: in + (|>> row)) - (def: join + (def: conjoint (let [(^open ".") ..mix (^open ".") ..monoid] - (mix (function (_ post pre) (compose pre post)) identity)))) + (mix (function (_ post pre) (composite pre post)) identity)))) (def: .public reversed (All [a] (-> (Row a) (Row a))) diff --git a/stdlib/source/library/lux/data/collection/sequence.lux b/stdlib/source/library/lux/data/collection/sequence.lux index 2bed3b721..8efb47cce 100644 --- a/stdlib/source/library/lux/data/collection/sequence.lux +++ b/stdlib/source/library/lux/data/collection/sequence.lux @@ -112,9 +112,9 @@ (implementation: .public functor (Functor Sequence) - (def: (map f fa) + (def: (each f fa) (let [[head tail] (//.result fa)] - (//.pending [(f head) (map f tail)])))) + (//.pending [(f head) (each f tail)])))) (implementation: .public comonad (CoMonad Sequence) @@ -123,17 +123,18 @@ (def: out head) - (def: (split wa) + (def: (disjoint wa) (let [[head tail] (//.result wa)] - (//.pending [wa (split tail)])))) + (//.pending [wa (disjoint tail)])))) (syntax: .public (^sequence& [patterns (.form (<>.many .any)) body .any branches (<>.some .any)]) (with_identifiers [g!sequence] - (let [body+ (` (let [(~+ (list\join (list\map (function (_ pattern) - (list (` [(~ pattern) (~ g!sequence)]) - (` ((~! //.result) (~ g!sequence))))) - patterns)))] + (let [body+ (` (let [(~+ (|> patterns + (list\each (function (_ pattern) + (list (` [(~ pattern) (~ g!sequence)]) + (` ((~! //.result) (~ g!sequence)))))) + list\conjoint))] (~ body)))] (in (list& g!sequence body+ branches))))) diff --git a/stdlib/source/library/lux/data/collection/set.lux b/stdlib/source/library/lux/data/collection/set.lux index 00edc5a47..d9c18877b 100644 --- a/stdlib/source/library/lux/data/collection/set.lux +++ b/stdlib/source/library/lux/data/collection/set.lux @@ -82,7 +82,7 @@ (All [a] (-> (Hash a) (Monoid (Set a)))) (def: identity (..empty hash)) - (def: compose ..union)) + (def: composite ..union)) (def: .public empty? (All [a] (-> (Set a) Bit)) diff --git a/stdlib/source/library/lux/data/collection/set/multi.lux b/stdlib/source/library/lux/data/collection/set/multi.lux index f176dc46a..73964bc7a 100644 --- a/stdlib/source/library/lux/data/collection/set/multi.lux +++ b/stdlib/source/library/lux/data/collection/set/multi.lux @@ -19,7 +19,7 @@ ["." dictionary (#+ Dictionary)]]]) (abstract: .public (Set a) - {#.doc (example "A set that keeps track of repetition in its entries.")} + {} (Dictionary a Nat) @@ -63,13 +63,13 @@ (|>> :representation dictionary.entries (list\mix (function (_ [elem multiplicity] output) - (list\compose (list.repeated multiplicity elem) output)) + (list\composite (list.repeated multiplicity elem) output)) #.End))) - (template [ ] + (template [ ] [(def: .public ( parameter subject) (All [a] (-> (Set a) (Set a) (Set a))) - (:abstraction (dictionary.merged_with (:representation parameter) (:representation subject))))] + (:abstraction (dictionary.merged_with (:representation parameter) (:representation subject))))] [union n.max] [sum n.+] @@ -95,7 +95,6 @@ subject))) (def: .public (sub? reference subject) - {#.doc (example "Is 'subject' a sub-set of 'reference'?")} (All [a] (-> (Set a) (Set a) Bit)) (|> subject :representation @@ -106,7 +105,6 @@ (n.>= multiplicity)))))) (def: .public (support set) - {#.doc (example "A set of the unique (non repeated) members.")} (All [a] (-> (Set a) (//.Set a))) (let [(^@ set [hash _]) (:representation set)] (|> set @@ -157,6 +155,5 @@ (//.list subject))) (def: .public super? - {#.doc (example "Is 'subject' a super-set of 'reference'?")} (All [a] (-> (Set a) (Set a) Bit)) (function.flipped sub?)) diff --git a/stdlib/source/library/lux/data/collection/set/ordered.lux b/stdlib/source/library/lux/data/collection/set/ordered.lux index d6d532d02..eeb66fa5e 100644 --- a/stdlib/source/library/lux/data/collection/set/ordered.lux +++ b/stdlib/source/library/lux/data/collection/set/ordered.lux @@ -13,7 +13,7 @@ abstract]]]) (abstract: .public (Set a) - {#.doc (example "A set with ordered entries.")} + {} (/.Dictionary a a) @@ -77,13 +77,11 @@ ) (def: .public (sub? super sub) - {#.doc (example "Is 'sub' a sub-set of 'super'?")} (All [a] (-> (Set a) (Set a) Bit)) (|> sub ..list (list.every? (..member? super)))) (def: .public (super? sub super) - {#.doc (example "Is 'super' a super-set of 'sub'?")} (All [a] (-> (Set a) (Set a) Bit)) (sub? super sub)) diff --git a/stdlib/source/library/lux/data/collection/stack.lux b/stdlib/source/library/lux/data/collection/stack.lux index 2b9cbc2e4..549450cbd 100644 --- a/stdlib/source/library/lux/data/collection/stack.lux +++ b/stdlib/source/library/lux/data/collection/stack.lux @@ -11,7 +11,7 @@ abstract]]]) (abstract: .public (Stack a) - {#.doc (example "A first-in, last-out sequential data-structure.")} + {} (List a) @@ -28,7 +28,6 @@ (|>> :representation //.empty?)) (def: .public (value stack) - {#.doc (example "Yields the top value in the stack, if any.")} (All [a] (-> (Stack a) (Maybe a))) (case (:representation stack) #.End @@ -61,9 +60,9 @@ (implementation: .public functor (Functor Stack) - (def: (map f value) + (def: (each f value) (|> value :representation - (\ //.functor map f) + (\ //.functor each f) :abstraction))) ) diff --git a/stdlib/source/library/lux/data/collection/tree.lux b/stdlib/source/library/lux/data/collection/tree.lux index bdf10e85b..d3222b959 100644 --- a/stdlib/source/library/lux/data/collection/tree.lux +++ b/stdlib/source/library/lux/data/collection/tree.lux @@ -17,17 +17,16 @@ ["." code]]]]) (type: .public (Tree a) - {#.doc (example "A generic tree data-structure.")} - {#value a - #children (List (Tree a))}) + (Record + {#value a + #children (List (Tree a))})) (def: .public (flat tree) - {#.doc (example "All the leaf values of the tree, in order.")} (All [a] (-> (Tree a) (List a))) (|> tree (value@ #children) - (list\map flat) - list\join + (list\each flat) + list\conjoint (#.Item (value@ #value tree)))) (def: .public (leaf value) @@ -55,15 +54,9 @@ (<>.and .any))) (syntax: .public (tree [root tree^]) - {#.doc (example "Tree literals." - (: (Tree Nat) - (tree 12 - {34 {} - 56 {} - 78 {90 {}}})))} (in (list (` (~ (loop [[value children] root] (` {#value (~ value) - #children (list (~+ (list\map recur children)))}))))))) + #children (list (~+ (list\each recur children)))}))))))) (implementation: .public (equivalence super) (All [a] (-> (Equivalence a) (Equivalence (Tree a)))) @@ -75,10 +68,10 @@ (implementation: .public functor (Functor Tree) - (def: (map f fa) + (def: (each f fa) {#value (f (value@ #value fa)) - #children (list\map (map f) - (value@ #children fa))})) + #children (list\each (each f) + (value@ #children fa))})) (implementation: .public mix (Mix Tree) diff --git a/stdlib/source/library/lux/data/collection/tree/finger.lux b/stdlib/source/library/lux/data/collection/tree/finger.lux index 588cb4e5a..b0dcece05 100644 --- a/stdlib/source/library/lux/data/collection/tree/finger.lux +++ b/stdlib/source/library/lux/data/collection/tree/finger.lux @@ -12,15 +12,15 @@ ... https://en.wikipedia.org/wiki/Finger_tree (abstract: .public (Tree @ t v) - {#.doc (example "A finger tree.")} + {} - {#monoid (Monoid t) - #tag t - #root (Or v - [(Tree @ t v) (Tree @ t v)])} + (Record + {#monoid (Monoid t) + #tag t + #root (Or v + [(Tree @ t v) (Tree @ t v)])}) (interface: .public (Builder @ t) - {#.doc (example "A builder for finter tree structures.")} (: (All [v] (-> t v (Tree @ t v))) leaf) @@ -40,7 +40,6 @@ ) (implementation: .public (builder monoid) - {#.doc (example "A new builder using the given monoid.")} (All [t] (Ex [@] (-> (Monoid t) (Builder @ t)))) (def: (leaf tag value) @@ -52,7 +51,7 @@ (def: (branch left right) (:abstraction {#monoid monoid - #tag (\ monoid compose (..tag left) (..tag right)) + #tag (\ monoid composite (..tag left) (..tag right)) #root (0 #1 [left right])}))) (def: .public (value tree) @@ -71,8 +70,8 @@ (list (value@ #tag (:representation tree))) (0 #1 [left right]) - (list\compose (tags left) - (tags right)))) + (list\composite (tags left) + (tags right)))) (def: .public (values tree) (All [@ t v] (-> (Tree @ t v) (List v))) @@ -81,11 +80,10 @@ (list value) (0 #1 [left right]) - (list\compose (values left) - (values right)))) + (list\composite (values left) + (values right)))) (def: .public (one predicate tree) - {#.doc (example "Finds one value that meets the predicate.")} (All [@ t v] (-> (Predicate t) (Tree @ t v) (Maybe v))) (let [[monoid tag root] (:representation tree)] (if (predicate tag) @@ -97,7 +95,7 @@ (#.Some value) (0 #1 [left right]) - (let [shifted_tag (tag//compose _tag (..tag left))] + (let [shifted_tag (tag//composite _tag (..tag left))] (if (predicate shifted_tag) (recur _tag (value@ #root (:representation left))) (recur shifted_tag (value@ #root (:representation right)))))))) @@ -105,7 +103,6 @@ ) (def: .public (exists? predicate tree) - {#.doc (example "Verifies that a value exists which meets the predicate.")} (All [@ t v] (-> (Predicate t) (Tree @ t v) Bit)) (case (..one predicate tree) (#.Some _) diff --git a/stdlib/source/library/lux/data/collection/tree/zipper.lux b/stdlib/source/library/lux/data/collection/tree/zipper.lux index 1c99353bc..cec25e125 100644 --- a/stdlib/source/library/lux/data/collection/tree/zipper.lux +++ b/stdlib/source/library/lux/data/collection/tree/zipper.lux @@ -18,15 +18,16 @@ ["." // (#+ Tree) ("#\." functor)]) (type: (Family Zipper a) - {#parent (Zipper a) - #lefts (List (Tree a)) - #rights (List (Tree a))}) + (Record + {#parent (Zipper a) + #lefts (List (Tree a)) + #rights (List (Tree a))})) ... https://en.wikipedia.org/wiki/Zipper_(data_structure) (type: .public (Zipper a) - {#.doc "Tree zippers, for easy navigation and editing of trees."} - {#family (Maybe (Family Zipper a)) - #node (Tree a)}) + (Record + {#family (Maybe (Family Zipper a)) + #node (Tree a)})) (implementation: .public (equivalence super) (All [a] @@ -105,14 +106,14 @@ (for {@.old (revised@ #node (: (-> (Tree (:parameter 0)) (Tree (:parameter 0))) - (with@ #//.children (list\compose (list.reversed lefts) - (#.Item (value@ #node zipper) - rights)))) + (with@ #//.children (list\composite (list.reversed lefts) + (#.Item (value@ #node zipper) + rights)))) parent)} (with@ [#node #//.children] - (list\compose (list.reversed lefts) - (#.Item (value@ #node zipper) - rights)) + (list\composite (list.reversed lefts) + (#.Item (value@ #node zipper) + rights)) parent)))))) (template [ ] @@ -155,13 +156,13 @@ (#.Some (for {@.old {#family (#.Some (|> family (with@ #.End) (revised@ (|>> (#.Item (value@ #node zipper)) - (list\compose prevs))))) + (list\composite prevs))))) #node last}} (let [move (: (All [a] (-> (List (Tree a)) (Zipper a) (Family Zipper a) (Family Zipper a))) (function (_ prevs zipper) (|>> (with@ #.End) (revised@ (|>> (#.Item (value@ #node zipper)) - (list\compose prevs))))))] + (list\composite prevs))))))] {#family (#.Some (move prevs zipper family)) #node last}))))))] @@ -291,13 +292,13 @@ (implementation: .public functor (Functor Zipper) - (def: (map f (^slots [#family #node])) - {#family (maybe\map (function (_ (^slots [#parent #lefts #rights])) - {#parent (map f parent) - #lefts (list\map (//\map f) lefts) - #rights (list\map (//\map f) rights)}) - family) - #node (//\map f node)})) + (def: (each f (^slots [#family #node])) + {#family (maybe\each (function (_ (^slots [#parent #lefts #rights])) + {#parent (each f parent) + #lefts (list\each (//\each f) lefts) + #rights (list\each (//\each f) rights)}) + family) + #node (//\each f node)})) (implementation: .public comonad (CoMonad Zipper) @@ -306,16 +307,16 @@ (def: out (value@ [#node #//.value])) - (def: (split (^slots [#family #node])) + (def: (disjoint (^slots [#family #node])) (let [tree_splitter (: (All [a] (-> (Tree a) (Tree (Zipper a)))) (function (tree_splitter tree) {#//.value (..zipper tree) #//.children (|> tree (value@ #//.children) - (list\map tree_splitter))}))] - {#family (maybe\map (function (_ (^slots [#parent #lefts #rights])) - {#parent (split parent) - #lefts (list\map tree_splitter lefts) - #rights (list\map tree_splitter rights)}) - family) + (list\each tree_splitter))}))] + {#family (maybe\each (function (_ (^slots [#parent #lefts #rights])) + {#parent (disjoint parent) + #lefts (list\each tree_splitter lefts) + #rights (list\each tree_splitter rights)}) + family) #node (tree_splitter node)}))) diff --git a/stdlib/source/library/lux/data/color.lux b/stdlib/source/library/lux/data/color.lux index fb67c971f..3cf8fa6d5 100644 --- a/stdlib/source/library/lux/data/color.lux +++ b/stdlib/source/library/lux/data/color.lux @@ -36,18 +36,20 @@ (|>> (f.* rgb_factor) f.int .nat)) (type: .public RGB - {#red Nat - #green Nat - #blue Nat}) + (Record + {#red Nat + #green Nat + #blue Nat})) (type: .public HSL [Frac Frac Frac]) (type: .public CMYK - {#cyan Frac - #magenta Frac - #yellow Frac - #key Frac}) + (Record + {#cyan Frac + #magenta Frac + #yellow Frac + #key Frac})) (type: .public HSB [Frac Frac Frac]) @@ -106,7 +108,7 @@ (def: identity ..black) - (def: (compose left right) + (def: (composite left right) (let [[lR lG lB] (:representation left) [rR rG rB] (:representation right)] (:abstraction {#red (n.max lR rR) @@ -129,7 +131,7 @@ (def: identity ..white) - (def: (compose left right) + (def: (composite left right) (let [[lR lG lB] (:representation (..complement left)) [rR rG rB] (:representation right)] (:abstraction {#red (n.min lR rR) @@ -395,23 +397,23 @@ Palette (let [[hue saturation brightness] (hsb color) spread (..normal spread)] - (list\map (function (_ idx) - (of_hsb [(|> idx ++ .int int.frac (f.* spread) (f.+ hue) ..normal) - saturation - brightness])) - (list.indices variations))))) + (list\each (function (_ idx) + (of_hsb [(|> idx ++ .int int.frac (f.* spread) (f.+ hue) ..normal) + saturation + brightness])) + (list.indices variations))))) (`` (def: .public (monochromatic spread variations color) Palette (let [[hue saturation brightness] (hsb color) spread (..normal spread)] (|> (list.indices variations) - (list\map (|>> ++ .int int.frac - (f.* spread) - (f.+ brightness) - ..normal - [hue saturation] - of_hsb)))))) + (list\each (|>> ++ .int int.frac + (f.* spread) + (f.+ brightness) + ..normal + [hue saturation] + of_hsb)))))) (type: .public Alpha Rev) @@ -429,5 +431,6 @@ rev\top) (type: .public Pigment - {#color Color - #alpha Alpha}) + (Record + {#color Color + #alpha Alpha})) diff --git a/stdlib/source/library/lux/data/format/binary.lux b/stdlib/source/library/lux/data/format/binary.lux index 85eb0534d..1e0ca5937 100644 --- a/stdlib/source/library/lux/data/format/binary.lux +++ b/stdlib/source/library/lux/data/format/binary.lux @@ -52,7 +52,7 @@ (def: identity ..no_op) - (def: (compose [sizeL mutL] [sizeR mutR]) + (def: (composite [sizeL mutL] [sizeR mutR]) [(n.+ sizeL sizeR) (|>> mutL mutR)])) @@ -101,7 +101,7 @@ (def: .public (and pre post) (All [a b] (-> (Writer a) (Writer b) (Writer [a b]))) (function (_ [preV postV]) - (\ ..monoid compose (pre preV) (post postV)))) + (\ ..monoid composite (pre preV) (post postV)))) (def: .public (rec body) (All [a] (-> (-> (Writer a) (Writer a)) (Writer a))) @@ -187,10 +187,10 @@ (|> value row.list (list.first capped_count) row.of_list)) (^open "specification\.") ..monoid [size mutation] (|> value - (row\map valueW) + (row\each valueW) (\ row.mix mix (function (_ post pre) - (specification\compose pre post)) + (specification\composite pre post)) specification\identity))] [(n.+ size) (function (_ [offset binary]) diff --git a/stdlib/source/library/lux/data/format/css.lux b/stdlib/source/library/lux/data/format/css.lux index 75e886e0d..57a7d33de 100644 --- a/stdlib/source/library/lux/data/format/css.lux +++ b/stdlib/source/library/lux/data/format/css.lux @@ -65,8 +65,8 @@ ["font-style" (|> font (value@ #/font.style) (maybe.else /value.normal_style) /value.value)] ["font-weight" (|> font (value@ #/font.weight) (maybe.else /value.normal_weight) /value.value)] with_unicode) - (list\map (function (_ [property value]) - (format property ": " value ";"))) + (list\each (function (_ [property value]) + (format property ": " value ";"))) (text.interposed /style.separator) (text.enclosed ["{" "}"]) (format "@font-face") @@ -87,41 +87,42 @@ text.new_line) (type: .public Frame - {#when Percentage - #what Style}) + (Record + {#when Percentage + #what Style})) (def: .public (key_frames animation frames) (-> (Value Animation) (List Frame) (CSS Special)) (:abstraction (format "@keyframes " (/value.value animation) " {" (|> frames - (list\map (function (_ frame) - (format (/value.percentage (value@ #when frame)) " {" - (/style.inline (value@ #what frame)) - "}"))) + (list\each (function (_ frame) + (format (/value.percentage (value@ #when frame)) " {" + (/style.inline (value@ #what frame)) + "}"))) (text.interposed ..css_separator)) "}"))) - (template: (!compose
 )
+  (template: (!composite 
 )
     (:abstraction (format (:representation 
) ..css_separator
                           (:representation ))))
   
   (def: .public (and pre post)
     (-> (CSS Any) (CSS Any) (CSS Any))
-    (!compose pre post))
+    (!composite pre post))
 
   (def: .public (alter combinator selector css)
     (-> Combinator (Selector Any) (CSS Common) (CSS Common))
     (|> css
         :representation
         (text.all_split_by ..css_separator)
-        (list\map (|>> (format (/selector.selector (|> selector (combinator (/selector.tag "")))))))
+        (list\each (|>> (format (/selector.selector (|> selector (combinator (/selector.tag "")))))))
         (text.interposed ..css_separator)
         :abstraction))
 
   (def: .public (dependent combinator selector style inner)
     (-> Combinator (Selector Any) Style (CSS Common) (CSS Common))
-    (!compose (..rule selector style)
-              (..alter combinator selector inner)))
+    (!composite (..rule selector style)
+                (..alter combinator selector inner)))
 
   (template [ ]
     [(def: .public 
diff --git a/stdlib/source/library/lux/data/format/css/font.lux b/stdlib/source/library/lux/data/format/css/font.lux
index 9149bf899..2ebe6644d 100644
--- a/stdlib/source/library/lux/data/format/css/font.lux
+++ b/stdlib/source/library/lux/data/format/css/font.lux
@@ -14,13 +14,15 @@
    ["#." value (#+ Value Font_Stretch Font_Style Font_Weight)]])
 
 (type: .public Unicode_Range
-  {#start Nat
-   #end Nat})
+  (Record
+   {#start Nat
+    #end Nat}))
 
 (type: .public Font
-  {#family Text
-   #source URL
-   #stretch (Maybe (Value Font_Stretch))
-   #style (Maybe (Value Font_Style))
-   #weight (Maybe (Value Font_Weight))
-   #unicode_range (Maybe Unicode_Range)})
+  (Record
+   {#family Text
+    #source URL
+    #stretch (Maybe (Value Font_Stretch))
+    #style (Maybe (Value Font_Style))
+    #weight (Maybe (Value Font_Weight))
+    #unicode_range (Maybe Unicode_Range)}))
diff --git a/stdlib/source/library/lux/data/format/css/selector.lux b/stdlib/source/library/lux/data/format/css/selector.lux
index 1bee5183d..a1f801779 100644
--- a/stdlib/source/library/lux/data/format/css/selector.lux
+++ b/stdlib/source/library/lux/data/format/css/selector.lux
@@ -181,8 +181,9 @@
       )
 
     (type: .public Formula
-      {#constant Int
-       #variable Int})
+      (Record
+       {#constant Int
+        #variable Int}))
 
     (def: .public (formula input)
       (-> Formula Index)
diff --git a/stdlib/source/library/lux/data/format/css/value.lux b/stdlib/source/library/lux/data/format/css/value.lux
index 54de6d97a..20b15f0eb 100644
--- a/stdlib/source/library/lux/data/format/css/value.lux
+++ b/stdlib/source/library/lux/data/format/css/value.lux
@@ -804,7 +804,7 @@
   (def: .public (cubic_bezier p0 p1 p2 p3)
     (-> Frac Frac Frac Frac (Value Timing))
     (|> (list p0 p1 p2 p3)
-        (list\map %number)
+        (list\each %number)
         (..apply "cubic-bezier")))
 
   (template [ ]
@@ -972,7 +972,7 @@
          (let [[now after] next]
            (..apply  (list& (:representation Angle angle)
                                       (with_hint now)
-                                      (list\map with_hint after)))))]
+                                      (list\each with_hint after)))))]
 
       [linear_gradient "linear-gradient"]
       [repeating_linear_gradient "repeating-linear-gradient"]
@@ -1099,7 +1099,7 @@
              [now after] next]
          (..apply  (list& (..shape shape)
                                     (with_hint now)
-                                    (list\map with_hint after)))))]
+                                    (list\each with_hint after)))))]
     
     [radial_gradient "radial-gradient"]
     [repeating_radial_gradient "repeating-radial-gradient"]
@@ -1123,10 +1123,11 @@
           :abstraction)))
 
   (type: .public Rectangle
-    {#top (Value Length)
-     #right (Value Length)
-     #bottom (Value Length)
-     #left (Value Length)})
+    (Record
+     {#top (Value Length)
+      #right (Value Length)
+      #bottom (Value Length)
+      #left (Value Length)}))
 
   (def: .public (clip rectangle)
     (-> Rectangle (Value Clip))
@@ -1171,7 +1172,7 @@
        (case options
          (#.Item _)
          (|> options
-             (list\map ..font_name)
+             (list\each ..font_name)
              (text.interposed ",")
              (:abstraction Value))
          
@@ -1210,10 +1211,10 @@
     (-> (List (List (Maybe (Value Grid)))) (Value Grid_Template))
     (let [empty (: (Value Grid)
                    (:abstraction "."))]
-      (|>> (list\map (|>> (list\map (|>> (maybe.else empty)
-                                         :representation))
-                          (text.interposed ..grid_column_separator)
-                          (text.enclosed ["'" "'"])))
+      (|>> (list\each (|>> (list\each (|>> (maybe.else empty)
+                                           :representation))
+                           (text.interposed ..grid_column_separator)
+                           (text.enclosed ["'" "'"])))
            (text.interposed ..grid_row_separator)
            :abstraction)))
 
@@ -1247,7 +1248,7 @@
   (def: .public (quotes [left0 right0] [left1 right1])
     (-> [Quote Quote] [Quote Quote] (Value Quotes))
     (|> (list left0 right0 left1 right1)
-        (list\map (|>> ..quote_text %.text))
+        (list\each (|>> ..quote_text %.text))
         (text.interposed ..quote_separator)
         :abstraction))
 
@@ -1257,7 +1258,7 @@
         [Frac Frac]
         (Value Transform))
     (|> (list a b c d tx ty)
-        (list\map %number)
+        (list\each %number)
         (..apply "matrix")))
 
   (def: .public (matrix_3d [a0 b0 c0 d0] [a1 b1 c1 d1] [a2 b2 c2 d2] [a3 b3 c3 d3])
@@ -1267,14 +1268,14 @@
         [Frac Frac Frac Frac]
         (Value Transform))
     (|> (list a0 b0 c0 d0 a1 b1 c1 d1 a2 b2 c2 d2 a3 b3 c3 d3)
-        (list\map %number)
+        (list\each %number)
         (..apply "matrix3d")))
 
   (template [   ]
     [(`` (def: .public ( [(~~ (template.spliced ))])
            (-> [(~~ (template.spliced ))] (Value Transform))
            (|> (list (~~ (template.spliced )))
-               (list\map %number)
+               (list\each %number)
                (..apply ))))]
 
     [translate_2d "translate" [Frac Frac] [x y]]
@@ -1296,7 +1297,7 @@
     [(`` (def: .public ( [(~~ (template.spliced ))])
            (-> [(~~ (template.spliced ))] (Value Transform))
            (|> (list (~~ (template.spliced )))
-               (list\map ..angle)
+               (list\each ..angle)
                (..apply ))))]
 
     [rotate_2d "rotate" [Angle] [angle]]
diff --git a/stdlib/source/library/lux/data/format/html.lux b/stdlib/source/library/lux/data/format/html.lux
index 5bb422c0d..ffd4ab75a 100644
--- a/stdlib/source/library/lux/data/format/html.lux
+++ b/stdlib/source/library/lux/data/format/html.lux
@@ -32,14 +32,16 @@
   {#.doc "Attributes for an HTML tag."}
   (List [Text Text]))
 
-(type: .public Script js.Statement)
+(type: .public Script
+  js.Statement)
 
 (type: .public Target
-  #Blank
-  #Parent
-  #Self
-  #Top
-  (#Frame Text))
+  (Variant
+   #Blank
+   #Parent
+   #Self
+   #Top
+   (#Frame Text)))
 
 (def: (target value)
   (-> Target Text)
@@ -62,8 +64,8 @@
 
 (def: attributes
   (-> Attributes Text)
-  (|>> (list\map (function (_ [key val])
-                   (format key "=" text.double_quote (..safe val) text.double_quote)))
+  (|>> (list\each (function (_ [key val])
+                    (format key "=" text.double_quote (..safe val) text.double_quote)))
        (text.interposed " ")))
 
 (def: (open tag attributes)
@@ -190,7 +192,7 @@
   (def: .public (script attributes inline)
     (-> Attributes (Maybe Script) Meta)
     (|> inline
-        (maybe\map js.code)
+        (maybe\each js.code)
         (maybe.else "")
         (..raw "script" attributes)))
 
@@ -223,8 +225,9 @@
         (..raw "svg" attributes)))
 
   (type: .public Coord
-    {#horizontal Nat
-     #vertical Nat})
+    (Record
+     {#horizontal Nat
+      #vertical Nat}))
 
   (def: metric_separator ",")
   (def: coord_separator ",")
@@ -234,18 +237,21 @@
     (format (%.nat horizontal) ..metric_separator (%.nat vertical)))
   
   (type: .public Rectangle
-    {#start Coord
-     #end Coord})
+    (Record
+     {#start Coord
+      #end Coord}))
 
   (type: .public Circle
-    {#center Coord
-     #radius Nat})
+    (Record
+     {#center Coord
+      #radius Nat}))
 
   (type: .public Polygon
-    {#first Coord
-     #second Coord
-     #third Coord
-     #extra (List Coord)})
+    (Record
+     {#first Coord
+      #second Coord
+      #third Coord
+      #extra (List Coord)}))
 
   (def: (%rectangle [start end])
     (Format Rectangle)
@@ -258,13 +264,14 @@
   (def: (%polygon [first second third extra])
     (Format Polygon)
     (|> (list& first second third extra)
-        (list\map %coord)
+        (list\each %coord)
         (text.interposed ..coord_separator)))
   
   (type: .public Shape
-    (#Rectangle Rectangle)
-    (#Circle Circle)
-    (#Polygon Polygon))
+    (Variant
+     (#Rectangle Rectangle)
+     (#Circle Circle)
+     (#Polygon Polygon)))
 
   (template [   ]
     [(def: ( attributes shape)
@@ -290,11 +297,11 @@
       (#Polygon polygon)
       (..polygon attributes polygon)))
 
-  (def: .public (map attributes areas for)
+  (def: .public (each attributes areas for)
     (-> Attributes (List [Attributes Shape]) Image Image)
     ($_ ..and
         for
-        (case (list\map (product.uncurried ..area) areas)
+        (case (list\each (product.uncurried ..area) areas)
           #.End
           (..empty "map" attributes)
           
@@ -367,7 +374,8 @@
     [iframe "iframe" Element]
     )
 
-  (type: .public Phrase (-> Attributes Content Element))
+  (type: .public Phrase
+    (-> Attributes Content Element))
 
   (template [ ]
     [(def: .public 
@@ -455,11 +463,11 @@
 
   (def: .public (description_list attributes descriptions)
     (-> Attributes (List [Content Element]) Element)
-    (case (list\map (function (_ [term description])
-                      ($_ ..and
-                          (..term term)
-                          (..description description)))
-                    descriptions)
+    (case (list\each (function (_ [term description])
+                       ($_ ..and
+                           (..term term)
+                           (..description description)))
+                     descriptions)
       #.End
       (..empty "dl" attributes)
       
@@ -517,7 +525,7 @@
   (def: .public (table attributes caption columns headers rows footer)
     (-> Attributes (Maybe Content) (Maybe Column) Header (List Cell) (Maybe Cell) Element)
     (let [head (..table_head (..table_row headers))
-          content (case (list\map table_row rows)
+          content (case (list\each table_row rows)
                     #.End
                     head
 
diff --git a/stdlib/source/library/lux/data/format/json.lux b/stdlib/source/library/lux/data/format/json.lux
index bcfd44f80..6582b7402 100644
--- a/stdlib/source/library/lux/data/format/json.lux
+++ b/stdlib/source/library/lux/data/format/json.lux
@@ -41,12 +41,13 @@
   )
 
 (type: .public #rec JSON
-  (#Null    Null)
-  (#Boolean Boolean)
-  (#Number  Number)
-  (#String  String)
-  (#Array   (Row JSON))
-  (#Object  (Dictionary String JSON)))
+  (Variant
+   (#Null    Null)
+   (#Boolean Boolean)
+   (#Number  Number)
+   (#String  String)
+   (#Array   (Row JSON))
+   (#Object  (Dictionary String JSON))))
 
 (template [ ]
   [(type: .public 
@@ -80,19 +81,19 @@
       (in (list (` (: JSON #..Null))))
 
       [_ (#.Tuple members)]
-      (in (list (` (: JSON (#..Array ((~! row) (~+ (list\map wrapper members))))))))
+      (in (list (` (: JSON (#..Array ((~! row) (~+ (list\each wrapper members))))))))
 
       [_ (#.Record pairs)]
       (do {! ..monad}
-        [pairs' (monad.map !
-                           (function (_ [slot value])
-                             (case slot
-                               [_ (#.Text key_name)]
-                               (in (` [(~ (code.text key_name)) (~ (wrapper value))]))
-
-                               _
-                               (meta.failure "Wrong syntax for JSON object.")))
-                           pairs)]
+        [pairs' (monad.each !
+                            (function (_ [slot value])
+                              (case slot
+                                [_ (#.Text key_name)]
+                                (in (` [(~ (code.text key_name)) (~ (wrapper value))]))
+
+                                _
+                                (meta.failure "Wrong syntax for JSON object.")))
+                            pairs)]
         (in (list (` (: JSON (#..Object ((~! dictionary.of_list)
                                          (~! text.hash)
                                          (list (~+ pairs')))))))))
@@ -107,7 +108,7 @@
     (#try.Success (dictionary.keys obj))
 
     _
-    (#try.Failure ($_ text\compose "Cannot get the fields of a non-object."))))
+    (#try.Failure ($_ text\composite "Cannot get the fields of a non-object."))))
 
 (def: .public (field key json)
   (-> String JSON (Try JSON))
@@ -118,10 +119,10 @@
       (#try.Success value)
 
       #.None
-      (#try.Failure ($_ text\compose "Missing field '" key "' on object.")))
+      (#try.Failure ($_ text\composite "Missing field '" key "' on object.")))
 
     _
-    (#try.Failure ($_ text\compose "Cannot get field '" key "' on a non-object."))))
+    (#try.Failure ($_ text\composite "Cannot get field '" key "' on a non-object."))))
 
 (def: .public (has key value json)
   (-> String JSON JSON (Try JSON))
@@ -130,7 +131,7 @@
     (#try.Success (#Object (dictionary.has key value obj)))
 
     _
-    (#try.Failure ($_ text\compose "Cannot set field '" key "' on a non-object."))))
+    (#try.Failure ($_ text\composite "Cannot set field '" key "' on a non-object."))))
 
 (template [  ]
   [(def: .public ( key json)
@@ -140,7 +141,7 @@
        (#try.Success value)
 
        (#try.Success _)
-       (#try.Failure ($_ text\compose "Wrong value type at key: " key))
+       (#try.Failure ($_ text\composite "Wrong value type at key: " key))
 
        (#try.Failure error)
        (#try.Failure error)))]
@@ -216,7 +217,7 @@
                   (|> raw (text.split_at 1) maybe.trusted product.right))))))
 
 (def: escape "\")
-(def: escaped_dq (text\compose ..escape text.double_quote))
+(def: escaped_dq (text\composite ..escape text.double_quote))
 
 (def: string_format
   (-> String Text)
@@ -240,14 +241,14 @@
 
 (def: (array_format format)
   (-> (-> JSON Text) (-> Array Text))
-  (|>> (row\map format)
+  (|>> (row\each format)
        row.list
        (text.interposed ..value_separator)
        (text.enclosed [..array_start ..array_end])))
 
 (def: (kv_format format [key value])
   (-> (-> JSON Text) (-> [String JSON] Text))
-  ($_ text\compose
+  ($_ text\composite
       (..string_format key)
       ..entry_separator
       (format value)
@@ -256,7 +257,7 @@
 (def: (object_format format)
   (-> (-> JSON Text) (-> Object Text))
   (|>> dictionary.entries
-       (list\map (..kv_format format))
+       (list\each (..kv_format format))
        (text.interposed ..value_separator)
        (text.enclosed [..object_start ..object_end])))
 
@@ -326,8 +327,8 @@
                     [mark (.one_of "eE")
                      signed?' (<>.parses? (.this "-"))
                      offset (.many .decimal)]
-                    (in ($_ text\compose mark (if signed?' "-" "") offset))))]
-    (case (f\decoded ($_ text\compose (if signed? "-" "") digits "." decimals exp))
+                    (in ($_ text\composite mark (if signed?' "-" "") offset))))]
+    (case (f\decoded ($_ text\composite (if signed? "-" "") digits "." decimals exp))
       (#try.Failure message)
       (<>.failure message)
       
@@ -347,7 +348,7 @@
                 (<>\in text.carriage_return))
       (<>.after (.this "\f")
                 (<>\in text.form_feed))
-      (<>.after (.this (text\compose "\" text.double_quote))
+      (<>.after (.this (text\composite "\" text.double_quote))
                 (<>\in text.double_quote))
       (<>.after (.this "\\")
                 (<>\in "\"))))
@@ -357,13 +358,13 @@
   (<| (.enclosed [text.double_quote text.double_quote])
       (loop [_ []])
       (do {! <>.monad}
-        [chars (.some (.none_of (text\compose "\" text.double_quote)))
+        [chars (.some (.none_of (text\composite "\" text.double_quote)))
          stop .next])
       (if (text\= "\" stop)
         (do !
           [escaped escaped_parser
            next_chars (recur [])]
-          (in ($_ text\compose chars escaped next_chars)))
+          (in ($_ text\composite chars escaped next_chars)))
         (in chars))))
 
 (def: (kv_parser json_parser)
diff --git a/stdlib/source/library/lux/data/format/markdown.lux b/stdlib/source/library/lux/data/format/markdown.lux
index 11254a92c..fdbfd4b69 100644
--- a/stdlib/source/library/lux/data/format/markdown.lux
+++ b/stdlib/source/library/lux/data/format/markdown.lux
@@ -89,10 +89,10 @@
   (def: (prefix with)
     (-> Text (-> Text Text))
     (|>> (text.all_split_by text.new_line)
-         (list\map (function (_ line)
-                     (if (text.empty? line)
-                       line
-                       (format with line))))
+         (list\each (function (_ line)
+                      (if (text.empty? line)
+                        line
+                        (format with line))))
          (text.interposed text.new_line)))
 
   (def: indent
@@ -109,36 +109,36 @@
     (-> (List [(Markdown Span) (Maybe (Markdown Block))])
         (Markdown Block))
     (|>> list.enumeration
-         (list\map (function (_ [idx [summary detail]])
-                     (format "1. " (:representation summary)
-                             (case detail
-                               (#.Some detail)
-                               (|> detail
-                                   :representation
-                                   ..indent
-                                   (text.enclosed [text.new_line text.new_line])
-                                   (format text.new_line))
-                               
-                               #.None
-                               ""))))
+         (list\each (function (_ [idx [summary detail]])
+                      (format "1. " (:representation summary)
+                              (case detail
+                                (#.Some detail)
+                                (|> detail
+                                    :representation
+                                    ..indent
+                                    (text.enclosed [text.new_line text.new_line])
+                                    (format text.new_line))
+                                
+                                #.None
+                                ""))))
          (text.interposed text.new_line)
          ..block))
 
   (def: .public bullet_list
     (-> (List [(Markdown Span) (Maybe (Markdown Block))])
         (Markdown Block))
-    (|>> (list\map (function (_ [summary detail])
-                     (format "* " (:representation summary)
-                             (case detail
-                               (#.Some detail)
-                               (|> detail
-                                   :representation
-                                   ..indent
-                                   (text.enclosed [text.new_line text.new_line])
-                                   (format text.new_line))
-                               
-                               #.None
-                               ""))))
+    (|>> (list\each (function (_ [summary detail])
+                      (format "* " (:representation summary)
+                              (case detail
+                                (#.Some detail)
+                                (|> detail
+                                    :representation
+                                    ..indent
+                                    (text.enclosed [text.new_line text.new_line])
+                                    (format text.new_line))
+                                
+                                #.None
+                                ""))))
          (text.interposed text.new_line)
          ..block))
 
diff --git a/stdlib/source/library/lux/data/format/tar.lux b/stdlib/source/library/lux/data/format/tar.lux
index f452a2693..745acf38d 100644
--- a/stdlib/source/library/lux/data/format/tar.lux
+++ b/stdlib/source/library/lux/data/format/tar.lux
@@ -332,7 +332,7 @@
        _ (<>.assertion (exception.error ..wrong_character [expected end])
                        (n.= expected end))]
       (<>.lifted
-       (\ try.monad map (|>> :abstraction)
+       (\ try.monad each (|>> :abstraction)
           (\ utf8.codec decoded string)))))
   )
 
@@ -518,7 +518,7 @@
     (def: mode_parser
       (Parser Mode)
       (do {! <>.monad}
-        [value (\ ! map ..from_small ..small_parser)]
+        [value (\ ! each ..from_small ..small_parser)]
         (if (n.<= (:representation ..maximum_mode)
                   value)
           (in (:abstraction value))
@@ -560,12 +560,14 @@
   (..as_small 0))
 
 (type: .public Owner
-  {#name Name
-   #id ID})
+  (Record
+   {#name Name
+    #id ID}))
 
 (type: .public Ownership
-  {#user Owner
-   #group Owner})
+  (Record
+   {#user Owner
+    #group Owner}))
 
 (type: .public File
   [Path Instant Mode Ownership Content])
@@ -576,10 +578,11 @@
 (type: .public Contiguous File)
 
 (type: .public Entry
-  (#Normal ..Normal)
-  (#Symbolic_Link ..Symbolic_Link)
-  (#Directory ..Directory)
-  (#Contiguous ..Contiguous))
+  (Variant
+   (#Normal ..Normal)
+   (#Symbolic_Link ..Symbolic_Link)
+   (#Directory ..Directory)
+   (#Contiguous ..Contiguous)))
 
 (type: Device
   Small)
@@ -605,20 +608,21 @@
        (n.* ..block_size)))
 
 (type: Header
-  {#path Path
-   #mode Mode
-   #user_id ID
-   #group_id ID
-   #size Big
-   #modification_time Big
-   #checksum Checksum
-   #link_flag Link_Flag
-   #link_name Path
-   #magic Magic
-   #user_name Name
-   #group_name Name
-   #major_device Device
-   #minor_device Device})
+  (Record
+   {#path Path
+    #mode Mode
+    #user_id ID
+    #group_id ID
+    #size Big
+    #modification_time Big
+    #checksum Checksum
+    #link_flag Link_Flag
+    #link_name Path
+    #magic Magic
+    #user_name Name
+    #group_name Name
+    #major_device Device
+    #minor_device Device}))
 
 (def: header_writer'
   (Writer Header)
@@ -739,11 +743,11 @@
   (Writer Tar)
   (let [end_of_archive (binary.empty ..end_of_archive_size)]
     (function (_ tar)
-      (format\compose (row\mix (function (_ next total)
-                                 (format\compose total (..entry_writer next)))
-                               format\identity
-                               tar)
-                      (format.segment ..end_of_archive_size end_of_archive)))))
+      (format\composite (row\mix (function (_ next total)
+                                   (format\composite total (..entry_writer next)))
+                                 format\identity
+                                 tar)
+                        (format.segment ..end_of_archive_size end_of_archive)))))
 
 (exception: .public (wrong_checksum {expected Nat} {actual Nat})
   (exception.report
@@ -851,14 +855,14 @@
 (def: entry_parser
   (Parser Entry)
   ($_ <>.either
-      (\ <>.monad map (|>> #..Normal)
+      (\ <>.monad each (|>> #..Normal)
          (<>.either (..file_parser ..normal)
                     (..file_parser ..old_normal)))
-      (\ <>.monad map (|>> #..Symbolic_Link)
+      (\ <>.monad each (|>> #..Symbolic_Link)
          (..file_name_parser ..symbolic_link (value@ #link_name)))
-      (\ <>.monad map (|>> #..Directory)
+      (\ <>.monad each (|>> #..Directory)
          (..file_name_parser ..directory (value@ #path)))
-      (\ <>.monad map (|>> #..Contiguous)
+      (\ <>.monad each (|>> #..Contiguous)
          (..file_parser ..contiguous))))
 
 ... It's safe to implement the parser this way because the range of values for Nat is 2^64
@@ -886,5 +890,5 @@
 (def: .public parser
   (Parser Tar)
   (|> (<>.some entry_parser)
-      (\ <>.monad map row.of_list)
+      (\ <>.monad each row.of_list)
       (<>.before ..end_of_archive_parser)))
diff --git a/stdlib/source/library/lux/data/format/xml.lux b/stdlib/source/library/lux/data/format/xml.lux
index 064476a7f..ef2c8e19a 100644
--- a/stdlib/source/library/lux/data/format/xml.lux
+++ b/stdlib/source/library/lux/data/format/xml.lux
@@ -35,8 +35,9 @@
   (dictionary.empty name.hash))
 
 (type: .public #rec XML
-  (#Text Text)
-  (#Node Tag Attrs (List XML)))
+  (Variant
+   (#Text Text)
+   (#Node Tag Attrs (List XML))))
 
 (def: namespace_separator
   ":")
@@ -72,7 +73,7 @@
 
 (def: xml_char^
   (Parser Text)
-  (<>.either (.none_of ($_ text\compose "<>&" text.double_quote))
+  (<>.either (.none_of ($_ text\composite "<>&" text.double_quote))
              xml_escape_char^))
 
 (def: xml_identifier
@@ -82,7 +83,7 @@
                      .alpha)
      tail (.some (<>.either (.one_of "_.-")
                                   .alpha_num))]
-    (in ($_ text\compose head tail))))
+    (in ($_ text\composite head tail))))
 
 (def: namespaced_symbol^
   (Parser Name)
@@ -113,7 +114,7 @@
 
 (def: attrs^
   (Parser Attrs)
-  (<| (\ <>.monad map (dictionary.of_list name.hash))
+  (<| (\ <>.monad each (dictionary.of_list name.hash))
       <>.some
       (<>.and (..spaced^ attr_name^))
       (<>.after (.this "="))
@@ -126,7 +127,7 @@
                 ..spaced^
                 (<>.after (.this "/"))
                 (.enclosed ["<" ">"]))]
-    (<>.assertion ($_ text\compose "Close tag does not match open tag." text.new_line
+    (<>.assertion ($_ text\composite "Close tag does not match open tag." text.new_line
                       "Expected: " (name\encoded expected) text.new_line
                       "  Actual: " (name\encoded actual) text.new_line)
                   (name\= expected actual))))
@@ -157,7 +158,7 @@
   (Parser XML)
   (|> (..spaced^ (.many xml_char^))
       (<>.either cdata^)
-      (<>\map (|>> #Text))))
+      (<>\each (|>> #Text))))
 
 (def: null^
   (Parser Any)
@@ -209,7 +210,7 @@
   (-> Tag Text)
   (case namespace
     "" name
-    _ ($_ text\compose namespace ..namespace_separator name)))
+    _ ($_ text\composite namespace ..namespace_separator name)))
 
 (def: .public attribute
   (-> Attribute Text)
@@ -219,8 +220,8 @@
   Text
   (let [quote (: (-> Text Text)
                  (function (_ value)
-                   ($_ text\compose text.double_quote value text.double_quote)))]
-    ($_ text\compose
+                   ($_ text\composite text.double_quote value text.double_quote)))]
+    ($_ text\composite
         " attrs
                               dictionary.entries
-                              (list\map (function (_ [key value])
-                                          ($_ text\compose (..attribute key) "=" text.double_quote (sanitize_value value) text.double_quote)))
+                              (list\each (function (_ [key value])
+                                           ($_ text\composite (..attribute key) "=" text.double_quote (sanitize_value value) text.double_quote)))
                               (text.interposed " "))))]
       (function (_ input)
-        ($_ text\compose
+        ($_ text\composite
             ..xml_header text.new_line
             (loop [prefix ""
                    input input]
@@ -250,8 +251,8 @@
                 (let [tag (..tag xml_tag)
                       attrs (if (dictionary.empty? xml_attrs)
                               ""
-                              ($_ text\compose " " (attributes xml_attrs)))]
-                  ($_ text\compose
+                              ($_ text\composite " " (attributes xml_attrs)))]
+                  ($_ text\composite
                       prefix "<" tag attrs ">"
                       (sanitize_value value)
                       ""))
@@ -260,12 +261,12 @@
                 (let [tag (..tag xml_tag)
                       attrs (if (dictionary.empty? xml_attrs)
                               ""
-                              ($_ text\compose " " (attributes xml_attrs)))]
+                              ($_ text\composite " " (attributes xml_attrs)))]
                   (if (list.empty? xml_children)
-                    ($_ text\compose prefix "<" tag attrs "/>")
-                    ($_ text\compose prefix "<" tag attrs ">"
+                    ($_ text\composite prefix "<" tag attrs "/>")
+                    ($_ text\composite prefix "<" tag attrs ">"
                         (|> xml_children
-                            (list\map (|>> (recur (text\compose prefix text.tab)) (text\compose text.new_line)))
+                            (list\each (|>> (recur (text\composite prefix text.tab)) (text\composite text.new_line)))
                             text.together)
                         text.new_line prefix "")))))
             ))))
diff --git a/stdlib/source/library/lux/data/identity.lux b/stdlib/source/library/lux/data/identity.lux
index 300c0cd7b..ac82be699 100644
--- a/stdlib/source/library/lux/data/identity.lux
+++ b/stdlib/source/library/lux/data/identity.lux
@@ -15,7 +15,7 @@
 (implementation: .public functor
   (Functor Identity)
 
-  (def: map function.identity))
+  (def: each function.identity))
 
 (implementation: .public apply
   (Apply Identity)
@@ -29,11 +29,11 @@
   
   (def: &functor ..functor)
   (def: in function.identity)
-  (def: join function.identity))
+  (def: conjoint function.identity))
 
 (implementation: .public comonad
   (CoMonad Identity)
   
   (def: &functor ..functor)
   (def: out function.identity)
-  (def: split function.identity))
+  (def: disjoint function.identity))
diff --git a/stdlib/source/library/lux/data/name.lux b/stdlib/source/library/lux/data/name.lux
index 99d158095..bb0216ba5 100644
--- a/stdlib/source/library/lux/data/name.lux
+++ b/stdlib/source/library/lux/data/name.lux
@@ -48,7 +48,7 @@
   (def: (encoded [module short])
     (case module
       "" short
-      _ ($_ text\compose module ..separator short)))
+      _ ($_ text\composite module ..separator short)))
   
   (def: (decoded input)
     (case (text.all_split_by ..separator input)
@@ -59,4 +59,4 @@
       (#.Right [module short])
 
       _
-      (#.Left (text\compose "Invalid format for Name: " input)))))
+      (#.Left (text\composite "Invalid format for Name: " input)))))
diff --git a/stdlib/source/library/lux/data/store.lux b/stdlib/source/library/lux/data/store.lux
index a25331cd4..5fc594957 100644
--- a/stdlib/source/library/lux/data/store.lux
+++ b/stdlib/source/library/lux/data/store.lux
@@ -8,8 +8,9 @@
      implicit]]])
 
 (type: .public (Store s a)
-  {#cursor s
-   #peek (-> s a)})
+  (Record
+   {#cursor s
+    #peek (-> s a)}))
 
 (def: (extend f wa)
   (All [s a b] (-> (-> (Store s a) b) (Store s a) (Store s b)))
@@ -19,7 +20,7 @@
 (implementation: .public functor
   (All [s] (Functor (Store s)))
   
-  (def: (map f fa)
+  (def: (each f fa)
     (extend (function (_ store)
               (f (\ store peek (\ store cursor))))
             fa)))
@@ -27,11 +28,14 @@
 (implementation: .public comonad
   (All [s] (CoMonad (Store s)))
   
-  (def: &functor ..functor)
+  (def: &functor
+    ..functor)
 
-  (def: (out wa) (\\ peek (\\ cursor)))
+  (def: (out wa)
+    (\\ peek (\\ cursor)))
 
-  (def: split (extend id)))
+  (def: disjoint
+    (extend id)))
 
 (def: .public (peeks trans store)
   (All [s a] (-> (-> s s) (Store s a) a))
@@ -39,12 +43,12 @@
 
 (def: .public (seek cursor store)
   (All [s a] (-> s (Store s a) (Store s a)))
-  (\ (\\ split store) peek cursor))
+  (\ (\\ disjoint store) peek cursor))
 
 (def: .public (seeks change store)
   (All [s a] (-> (-> s s) (Store s a) (Store s a)))
-  (|> store (\\ split) (peeks change)))
+  (|> store (\\ disjoint) (peeks change)))
 
 (def: .public (experiment Functor change store)
   (All [f s a] (-> (Functor f) (-> s (f s)) (Store s a) (f a)))
-  (\ Functor map (\\ peek) (change (\\ cursor))))
+  (\ Functor each (\\ peek) (change (\\ cursor))))
diff --git a/stdlib/source/library/lux/data/text.lux b/stdlib/source/library/lux/data/text.lux
index 5a1b8a981..daf951a7d 100644
--- a/stdlib/source/library/lux/data/text.lux
+++ b/stdlib/source/library/lux/data/text.lux
@@ -248,7 +248,7 @@
   
   (def: identity "")
   
-  (def: (compose left right)
+  (def: (composite left right)
     ("lux text concat" left right)))
 
 (implementation: .public hash
@@ -288,7 +288,7 @@
   (-> (List Text) Text)
   (let [(^open ".") ..monoid]
     (|>> list.reversed
-         (list\mix compose identity))))
+         (list\mix composite identity))))
 
 (def: .public (interposed separator texts)
   (-> Text (List Text) Text)
diff --git a/stdlib/source/library/lux/data/text/format.lux b/stdlib/source/library/lux/data/text/format.lux
index cd953ef05..11d1523e8 100644
--- a/stdlib/source/library/lux/data/text/format.lux
+++ b/stdlib/source/library/lux/data/text/format.lux
@@ -45,7 +45,7 @@
 (implementation: .public functor
   (contravariant.Functor Format)
   
-  (def: (map f fb)
+  (def: (each f fb)
     (|>> f fb)))
 
 (syntax: .public (format [fragments (<>.many .any)])
@@ -117,7 +117,7 @@
 
 (def: .public (list formatter)
   (All [a] (-> (Format a) (Format (List a))))
-  (|>> (list\map (|>> formatter (format " ")))
+  (|>> (list\each (|>> formatter (format " ")))
        text.together
        (text.enclosed ["(list" ")"])))
 
diff --git a/stdlib/source/library/lux/data/text/regex.lux b/stdlib/source/library/lux/data/text/regex.lux
index fa822c33b..77d4e94e1 100644
--- a/stdlib/source/library/lux/data/text/regex.lux
+++ b/stdlib/source/library/lux/data/text/regex.lux
@@ -52,9 +52,9 @@
   (-> Text (Parser Text))
   (<>.after (.this reference) (<>\in reference)))
 
-(def: join_text^
+(def: together^
   (-> (Parser (List Text)) (Parser Text))
-  (\ <>.monad map //.together))
+  (\ <>.monad each //.together))
 
 (def: name_char^
   (Parser Text)
@@ -85,9 +85,9 @@
 (def: re_range^
   (Parser Code)
   (do {! <>.monad}
-    [from (|> regex_char^ (\ ! map (|>> (//.char 0) maybe.trusted)))
+    [from (|> regex_char^ (\ ! each (|>> (//.char 0) maybe.trusted)))
      _ (.this "-")
-     to (|> regex_char^ (\ ! map (|>> (//.char 0) maybe.trusted)))]
+     to (|> regex_char^ (\ ! each (|>> (//.char 0) maybe.trusted)))]
     (in (` ((~! .range) (~ (code.nat from)) (~ (code.nat to)))))))
 
 (def: re_char^
@@ -221,11 +221,11 @@
       (in (` ((~! <>.else) "" (~ base))))
       
       "*"
-      (in (` ((~! join_text^) ((~! <>.some) (~ base)))))
+      (in (` ((~! together^) ((~! <>.some) (~ base)))))
       
       ... "+"
       _
-      (in (` ((~! join_text^) ((~! <>.many) (~ base)))))
+      (in (` ((~! together^) ((~! <>.many) (~ base)))))
       )))
 
 (exception: .public (incorrect_quantification {from Nat} {to Nat})
@@ -243,19 +243,19 @@
               [[from to] (<>.and number^ (<>.after (.this ",") number^))
                _ (<>.assertion (exception.error ..incorrect_quantification [from to])
                                (n.<= to from))]
-              (in (` ((~! join_text^) ((~! <>.between)
-                                       (~ (code.nat from))
-                                       (~ (code.nat (n.- from to)))
-                                       (~ base))))))
+              (in (` ((~! together^) ((~! <>.between)
+                                      (~ (code.nat from))
+                                      (~ (code.nat (n.- from to)))
+                                      (~ base))))))
             (do !
               [limit (<>.after (.this ",") number^)]
-              (in (` ((~! join_text^) ((~! <>.at_most) (~ (code.nat limit)) (~ base))))))
+              (in (` ((~! together^) ((~! <>.at_most) (~ (code.nat limit)) (~ base))))))
             (do !
               [limit (<>.before (.this ",") number^)]
-              (in (` ((~! join_text^) ((~! <>.at_least) (~ (code.nat limit)) (~ base))))))
+              (in (` ((~! together^) ((~! <>.at_least) (~ (code.nat limit)) (~ base))))))
             (do !
               [limit number^]
-              (in (` ((~! join_text^) ((~! <>.exactly) (~ (code.nat limit)) (~ base))))))))))
+              (in (` ((~! together^) ((~! <>.exactly) (~ (code.nat limit)) (~ base))))))))))
 
 (def: (re_quantified^ current_module)
   (-> Text (Parser Code))
@@ -269,8 +269,9 @@
       (re_simple^ current_module)))
 
 (type: Re_Group
-  #Non_Capturing
-  (#Capturing [(Maybe Text) Nat]))
+  (Variant
+   #Non_Capturing
+   (#Capturing [(Maybe Text) Nat])))
 
 (def: (re_sequential^ capturing? re_scoped^ current_module)
   (-> Bit
@@ -291,7 +292,7 @@
                                             [idx
                                              names
                                              (list& (list g!temp complex
-                                                          (` .let) (` [(~ g!total) (\ (~! //.monoid) (~' compose) (~ g!total) (~ g!temp))]))
+                                                          (` .let) (` [(~ g!total) (\ (~! //.monoid) (~' composite) (~ g!total) (~ g!temp))]))
                                                     steps)]
                                             
                                             (#.Right [(#Capturing [?name num_captures]) scoped])
@@ -307,7 +308,7 @@
                                               [idx!
                                                (list& name! names)
                                                (list& (list name! scoped
-                                                            (` .let) (` [(~ g!total) (\ (~! //.monoid) (~' compose) (~ g!total) (~ access))]))
+                                                            (` .let) (` [(~ g!total) (\ (~! //.monoid) (~' composite) (~ g!total) (~ access))]))
                                                       steps)])
                                             )))
                                      [0
@@ -319,7 +320,7 @@
            0)
          (` ((~! do) (~! <>.monad)
              [.let [(~ g!total) ""]
-              (~+ (|> steps list.reversed list\join))]
+              (~+ (|> steps list.reversed list\conjoint))]
              ((~ (' in)) [(~ g!total) (~+ (list.reversed names))])))])
     ))
 
@@ -374,12 +375,12 @@
      tail (<>.some (<>.after (.this "|") sub^))]
     (if (list.empty? tail)
       (in head)
-      (in [(list\mix n.max (product.left head) (list\map product.left tail))
+      (in [(list\mix n.max (product.left head) (list\each product.left tail))
            (` ($_ ((~ (if capturing?
                         (` (~! |||^))
                         (` (~! |||_^)))))
                   (~ (prep_alternative head))
-                  (~+ (list\map prep_alternative tail))))]))))
+                  (~+ (list\each prep_alternative tail))))]))))
 
 (def: (re_scoped^ current_module)
   (-> Text (Parser [Re_Group Code]))
@@ -407,7 +408,7 @@
 
 (def: (regex^ current_module)
   (-> Text (Parser Code))
-  (\ <>.monad map product.right (re_alternative^ #1 re_scoped^ current_module)))
+  (\ <>.monad each product.right (re_alternative^ #1 re_scoped^ current_module)))
 
 (syntax: .public (regex [pattern .text])
   (do meta.monad
@@ -419,8 +420,7 @@
                             error))
 
       (#try.Success regex)
-      (in (list regex))
-      )))
+      (in (list regex)))))
 
 (syntax: .public (^regex [[pattern bindings] (.form (<>.and .text (<>.maybe .any)))
                           body .any
diff --git a/stdlib/source/library/lux/data/text/unicode/block.lux b/stdlib/source/library/lux/data/text/unicode/block.lux
index 70087d56a..7c473d64d 100644
--- a/stdlib/source/library/lux/data/text/unicode/block.lux
+++ b/stdlib/source/library/lux/data/text/unicode/block.lux
@@ -26,7 +26,7 @@
       (:abstraction
        (interval.between n.enum n\top n\bottom)))
     
-    (def: (compose left right)
+    (def: (composite left right)
       (let [left (:representation left)
             right (:representation right)]
         (:abstraction
diff --git a/stdlib/source/library/lux/data/trace.lux b/stdlib/source/library/lux/data/trace.lux
index 4b5da0b54..f07c533d9 100644
--- a/stdlib/source/library/lux/data/trace.lux
+++ b/stdlib/source/library/lux/data/trace.lux
@@ -8,28 +8,33 @@
     function]])
 
 (type: .public (Trace t a)
-  {#monoid (Monoid t)
-   #trace (-> t a)})
+  (Record
+   {#monoid (Monoid t)
+    #trace (-> t a)}))
 
-(implementation: .public functor (All [t] (Functor (Trace t)))
-  (def: (map f fa)
-    (revised@ #trace (compose f) fa)))
+(implementation: .public functor
+  (All [t] (Functor (Trace t)))
 
-(implementation: .public comonad (All [t] (CoMonad (Trace t)))
+  (def: (each f fa)
+    (revised@ #trace (composite f) fa)))
+
+(implementation: .public comonad
+  (All [t] (CoMonad (Trace t)))
+  
   (def: &functor ..functor)
 
   (def: (out wa)
     ((value@ #trace wa)
      (value@ [#monoid #monoid.identity] wa)))
 
-  (def: (split wa)
+  (def: (disjoint wa)
     (let [monoid (value@ #monoid wa)]
       {#monoid monoid
        #trace (function (_ t1)
                 {#monoid monoid
                  #trace (function (_ t2)
                           ((value@ #trace wa)
-                           (\ monoid compose t1 t2)))})})))
+                           (\ monoid composite t1 t2)))})})))
 
 (def: .public (result context tracer)
   (All [t a] (-> t (Trace t a) a))
diff --git a/stdlib/source/library/lux/debug.lux b/stdlib/source/library/lux/debug.lux
index d033bd3f0..96ccfe30e 100644
--- a/stdlib/source/library/lux/debug.lux
+++ b/stdlib/source/library/lux/debug.lux
@@ -136,7 +136,7 @@
     (`` (|>> (:as (array.Array Any))
              
              array.list
-             (list\map inspection)
+             (list\each inspection)
              (text.interposed " ")
              (text.enclosed ["[" "]"])))))
 
@@ -549,7 +549,7 @@
   (<>.either (<>.and .local_identifier
                      (\ <>.monad in #.None))
              (.record (<>.and .local_identifier
-                                    (\ <>.monad map (|>> #.Some) .any)))))
+                                    (\ <>.monad each (|>> #.Some) .any)))))
 
 (exception: .public (unknown_local_binding {name Text})
   (exception.report
@@ -573,25 +573,25 @@
                   #.End
                   (|> environment
                       dictionary.keys
-                      (list\map (function (_ local) [local #.None]))
+                      (list\each (function (_ local) [local #.None]))
                       in)
 
                   _
-                  (monad.map ! (function (_ [name format])
-                                 (if (dictionary.key? environment name)
-                                   (in [name format])
-                                   (function.constant (exception.except ..unknown_local_binding [name]))))
-                             targets)))]
+                  (monad.each ! (function (_ [name format])
+                                  (if (dictionary.key? environment name)
+                                    (in [name format])
+                                    (function.constant (exception.except ..unknown_local_binding [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))))))))))
+                           (~+ (list\each (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/documentation.lux b/stdlib/source/library/lux/documentation.lux
index 4768a1975..35cebc0f4 100644
--- a/stdlib/source/library/lux/documentation.lux
+++ b/stdlib/source/library/lux/documentation.lux
@@ -33,8 +33,9 @@
         ["." syntax]]]]]]])
 
 (type: Fragment
-  (#Comment Text)
-  (#Code Code))
+  (Variant
+   (#Comment Text)
+   (#Code Code)))
 
 (def: fragment
   (Parser Fragment)
@@ -59,14 +60,14 @@
     (^template []
       [[[_ _ column] ( members)]
        (|> members
-           (list\map reference_column)
+           (list\each reference_column)
            (list\mix n.min column))])
     ([#.Form]
      [#.Tuple])
 
     [[_ _ column] (#.Record pairs)]
-    (|> (list\compose (list\map (|>> product.left reference_column) pairs)
-                      (list\map (|>> product.right reference_column) pairs))
+    (|> (list\composite (list\each (|>> product.left reference_column) pairs)
+                        (list\each (|>> product.right reference_column) pairs))
         (list\mix n.min column))
     ))
 
@@ -187,7 +188,7 @@
 
 (def: example_documentation
   (-> Example Code)
-  (|>> (list\map ..fragment_documentation)
+  (|>> (list\each ..fragment_documentation)
        (list.interposed ..blank_line)
        (text.interposed "")
        code.text))
@@ -242,19 +243,21 @@
                            (list (` (<| ((~! md.code))
                                         ((~! %.format)
                                          (~+ (|> examples
-                                                 (list\map ..example_documentation)
+                                                 (list\each ..example_documentation)
                                                  (list.interposed ..example_separator))))))))))
                  )))))
 
 (type: .public Definition
-  {#definition Text
-   #documentation (Markdown Block)})
+  (Record
+   {#definition Text
+    #documentation (Markdown Block)}))
 
 (type: .public #rec Module
-  {#module Text
-   #description Text
-   #expected (Set Text)
-   #definitions (List Definition)})
+  (Record
+   {#module Text
+    #description Text
+    #expected (Set Text)
+    #definitions (List Definition)}))
 
 (syntax: .public (default [name ..qualified_identifier])
   (let [[_ short] name]
@@ -278,7 +281,7 @@
   (|>> (list.sorted (function (_ left right)
                       (text\< (value@ #definition right)
                               (value@ #definition left))))
-       (list\map (value@ #documentation))
+       (list\each (value@ #documentation))
        (list\mix md.then md.empty)))
 
 (def: expected_separator
@@ -316,10 +319,10 @@
                             (~ (code.text name))
                             (~ description)
                             (~ (code.text (|> expected
-                                              (list\map product.left)
+                                              (list\each product.left)
                                               ..expected_format)))
                             ((~! list.together) (list (~+ definitions))))
-                           ($_ (\ (~! list.monoid) (~' compose))
+                           ($_ (\ (~! list.monoid) (~' composite))
                                (: (List Module)
                                   (\ (~! list.monoid) (~' identity)))
                                (~+ subs)))))))))
@@ -327,9 +330,9 @@
 (def: listing
   (-> (List Text) (Markdown Block))
   (|>> (list.sorted text\<)
-       (list\map (function (_ definition)
-                   [(md.snippet definition)
-                    #.None]))
+       (list\each (function (_ definition)
+                    [(md.snippet definition)
+                     #.None]))
        md.numbered_list))
 
 (def: (module_documentation module)
@@ -369,7 +372,7 @@
         (case (|> module
                   (value@ #definitions)
                   (list.only (|>> (value@ #definition) (set.member? expected) not))
-                  (list\map (value@ #definition)))
+                  (list\each (value@ #definition)))
           #.End
           md.empty
           
@@ -383,7 +386,7 @@
   (-> (List Module) Text)
   (|>> (list.sorted (function (_ left right)
                       (text\< (value@ #module right) (value@ #module left))))
-       (list\map ..module_documentation)
+       (list\each ..module_documentation)
        (list.interposed md.horizontal_rule)
        (list\mix md.then (: (Markdown Block) md.empty))
        md.markdown))
diff --git a/stdlib/source/library/lux/extension.lux b/stdlib/source/library/lux/extension.lux
index acc859dba..b63c91b0c 100644
--- a/stdlib/source/library/lux/extension.lux
+++ b/stdlib/source/library/lux/extension.lux
@@ -20,11 +20,12 @@
       ["." phase]]]]])
 
 (type: Declaration
-  {#name Code
-   #label Text
-   #phase Text
-   #archive Text
-   #inputs (List Code)})
+  (Record
+   {#name Code
+    #label Text
+    #phase Text
+    #archive Text
+    #inputs (List Code)}))
 
 (def: (declaration default)
   (-> Code (Parser Declaration))
diff --git a/stdlib/source/library/lux/ffi.js.lux b/stdlib/source/library/lux/ffi.js.lux
index 6d8ed9658..38a207259 100644
--- a/stdlib/source/library/lux/ffi.js.lux
+++ b/stdlib/source/library/lux/ffi.js.lux
@@ -92,8 +92,9 @@
 (type: Virtual_Method Common_Method)
 
 (type: Method
-  (#Static Static_Method)
-  (#Virtual Virtual_Method))
+  (Variant
+   (#Static Static_Method)
+   (#Virtual Virtual_Method)))
 
 (def: common_method
   (Parser Common_Method)
@@ -114,9 +115,10 @@
                       ..common_method)))
 
 (type: Member
-  (#Constructor Constructor)
-  (#Field Field)
-  (#Method Method))
+  (Variant
+   (#Constructor Constructor)
+   (#Field Field)
+   (#Method Method)))
 
 (def: member
   (Parser Member)
@@ -129,8 +131,8 @@
 (def: input_variables
   (-> (List Nullable) (List [Bit Code]))
   (|>> list.enumeration
-       (list\map (function (_ [idx [nullable? type]])
-                   [nullable? (|> idx %.nat code.local_identifier)]))))
+       (list\each (function (_ [idx [nullable? type]])
+                    [nullable? (|> idx %.nat code.local_identifier)]))))
 
 (def: (nullable_type [nullable? type])
   (-> Nullable Code)
@@ -174,8 +176,9 @@
   [Text (List Text)])
 
 (type: Import
-  (#Class [Class_Declaration Text (List Member)])
-  (#Function Static_Method))
+  (Variant
+   (#Class [Class_Declaration Text (List Member)])
+   (#Function Static_Method)))
 
 (def: class_declaration
   (Parser Class_Declaration)
@@ -220,8 +223,8 @@
   (-> Code Code Text (List Nullable) Bit Bit Nullable Code)
   (let [g!inputs (input_variables inputsT)]
     (` (def: ((~ g!method)
-              [(~+ (list\map product.right g!inputs))])
-         (-> [(~+ (list\map nullable_type inputsT))]
+              [(~+ (list\each product.right g!inputs))])
+         (-> [(~+ (list\each nullable_type inputsT))]
              (~ (|> (nullable_type outputT)
                     (try_type try?)
                     (io_type io?))))
@@ -231,7 +234,7 @@
                  (without_null g!temp outputT)
                  (` ("js apply"
                      ("js constant" (~ (code.text source)))
-                     (~+ (list\map (with_null g!temp) g!inputs)))))))))))
+                     (~+ (list\each (with_null g!temp) g!inputs)))))))))))
 
 (syntax: .public (import: [import ..import])
   {#.doc (example "Easily import types, methods, functions and constants."
@@ -256,71 +259,71 @@
                                (text.replaced "#" class_name)
                                (text.replaced "." member_name)
                                code.local_identifier)))
-              class_parameters (list\map code.local_identifier class_parameters)
+              class_parameters (list\each code.local_identifier class_parameters)
               declaration (` ((~ (code.local_identifier class_name))
                               (~+ class_parameters)))
               real_class (text.replaced "/" "." class_name)]
           (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)))
-                                          (:expected
-                                           ("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))))
-                                          (:expected
-                                           (~ (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.else 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.else 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?)))))
-                                            (:expected
-                                             (~ (<| (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)))))
+                     (list\each (function (_ member)
+                                  (case member
+                                    (#Constructor inputsT)
+                                    (let [g!inputs (input_variables inputsT)]
+                                      (` (def: ((~ (qualify "new"))
+                                                [(~+ (list\each product.right g!inputs))])
+                                           (All [(~+ class_parameters)]
+                                             (-> [(~+ (list\each nullable_type inputsT))]
+                                                 (~ declaration)))
+                                           (:expected
+                                            ("js object new"
+                                             ("js constant" (~ (code.text real_class)))
+                                             [(~+ (list\each (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))))
+                                           (:expected
+                                            (~ (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.else 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.else method alias)))
+                                                  [(~+ (list\each product.right g!inputs))]
+                                                  (~ g!object))
+                                             (All [(~+ class_parameters)]
+                                               (-> [(~+ (list\each nullable_type inputsT))]
+                                                   (~ declaration)
+                                                   (~ (|> (nullable_type outputT)
+                                                          (try_type try?)
+                                                          (io_type io?)))))
+                                             (:expected
+                                              (~ (<| (with_io io?)
+                                                     (with_try try?)
+                                                     (without_null g!temp outputT)
+                                                     (` ("js object do"
+                                                         (~ (code.text method))
+                                                         (~ g!object)
+                                                         [(~+ (list\each (with_null g!temp) g!inputs))])))))))))))
+                                members)))))
       
       (#Function [name alias inputsT io? try? outputT])
       (in (list (..make_function (code.local_identifier (maybe.else name alias))
@@ -365,7 +368,7 @@
 
                             (~ g!_)
                             (..constant (~ type) [(~ (code.local_identifier (%.format head "." next)))
-                                                  (~+ (list\map code.local_identifier tail))])))))))))))
+                                                  (~+ (list\each 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 16c4887ab..d57bde2b1 100644
--- a/stdlib/source/library/lux/ffi.jvm.lux
+++ b/stdlib/source/library/lux/ffi.jvm.lux
@@ -178,131 +178,150 @@
   "")
 
 (type: Primitive_Mode
-  #ManualPrM
-  #AutoPrM)
+  (Variant
+   #ManualPrM
+   #AutoPrM))
 
 (type: .public Privacy
-  #PublicP
-  #PrivateP
-  #ProtectedP
-  #DefaultP)
+  (Variant
+   #PublicP
+   #PrivateP
+   #ProtectedP
+   #DefaultP))
 
 (type: .public State
-  #VolatileS
-  #FinalS
-  #DefaultS)
+  (Variant
+   #VolatileS
+   #FinalS
+   #DefaultS))
 
 (type: .public Inheritance
-  #FinalI
-  #AbstractI
-  #DefaultI)
+  (Variant
+   #FinalI
+   #AbstractI
+   #DefaultI))
 
 (type: Class_Kind
-  #Class
-  #Interface)
+  (Variant
+   #Class
+   #Interface))
 
-(type: StackFrame (primitive "java/lang/StackTraceElement"))
-(type: StackTrace (array.Array StackFrame))
+(type: StackFrame
+  (primitive "java/lang/StackTraceElement"))
+
+(type: StackTrace
+  (array.Array StackFrame))
 
 (type: Annotation_Parameter
   [Text Code])
 
 (type: Annotation
-  {#ann_name   Text
-   #ann_params (List Annotation_Parameter)})
+  (Record
+   {#ann_name   Text
+    #ann_params (List Annotation_Parameter)}))
 
 (type: Member_Declaration
-  {#member_name Text
-   #member_privacy Privacy
-   #member_anns (List Annotation)})
+  (Record
+   {#member_name Text
+    #member_privacy Privacy
+    #member_anns (List Annotation)}))
 
 (type: FieldDecl
-  (#ConstantField (Type Value) Code)
-  (#VariableField State (Type Value)))
+  (Variant
+   (#ConstantField (Type Value) Code)
+   (#VariableField State (Type Value))))
 
 (type: MethodDecl
-  {#method_tvars  (List (Type Var))
-   #method_inputs (List (Type Value))
-   #method_output (Type Return)
-   #method_exs    (List (Type Class))})
+  (Record
+   {#method_tvars  (List (Type Var))
+    #method_inputs (List (Type Value))
+    #method_output (Type Return)
+    #method_exs    (List (Type Class))}))
 
 (type: Method_Definition
-  (#ConstructorMethod [Bit
-                       (List (Type Var))
-                       Text
-                       (List Argument)
-                       (List (Typed Code))
-                       Code
-                       (List (Type Class))])
-  (#VirtualMethod [Bit
-                   Bit
+  (Variant
+   (#ConstructorMethod [Bit
+                        (List (Type Var))
+                        Text
+                        (List Argument)
+                        (List (Typed Code))
+                        Code
+                        (List (Type Class))])
+   (#VirtualMethod [Bit
+                    Bit
+                    (List (Type Var))
+                    Text
+                    (List Argument)
+                    (Type Return)
+                    Code
+                    (List (Type Class))])
+   (#OverridenMethod [Bit
+                      (Type Declaration)
+                      (List (Type Var))
+                      Text
+                      (List Argument)
+                      (Type Return)
+                      Code
+                      (List (Type Class))])
+   (#StaticMethod [Bit
                    (List (Type Var))
-                   Text
                    (List Argument)
                    (Type Return)
                    Code
                    (List (Type Class))])
-  (#OverridenMethod [Bit
-                     (Type Declaration)
-                     (List (Type Var))
-                     Text
+   (#AbstractMethod [(List (Type Var))
                      (List Argument)
                      (Type Return)
-                     Code
                      (List (Type Class))])
-  (#StaticMethod [Bit
-                  (List (Type Var))
-                  (List Argument)
-                  (Type Return)
-                  Code
-                  (List (Type Class))])
-  (#AbstractMethod [(List (Type Var))
-                    (List Argument)
-                    (Type Return)
-                    (List (Type Class))])
-  (#NativeMethod [(List (Type Var))
-                  (List Argument)
-                  (Type Return)
-                  (List (Type Class))]))
+   (#NativeMethod [(List (Type Var))
+                   (List Argument)
+                   (Type Return)
+                   (List (Type Class))])))
 
 (type: Partial_Call
-  {#pc_method Name
-   #pc_args   (List Code)})
+  (Record
+   {#pc_method Name
+    #pc_args   (List Code)}))
 
 (type: ImportMethodKind
-  #StaticIMK
-  #VirtualIMK)
+  (Variant
+   #StaticIMK
+   #VirtualIMK))
 
 (type: ImportMethodCommons
-  {#import_member_mode   Primitive_Mode
-   #import_member_alias  Text
-   #import_member_kind   ImportMethodKind
-   #import_member_tvars  (List (Type Var))
-   #import_member_args   (List [Bit (Type Value)])
-   #import_member_maybe? Bit
-   #import_member_try?   Bit
-   #import_member_io?    Bit})
+  (Record
+   {#import_member_mode   Primitive_Mode
+    #import_member_alias  Text
+    #import_member_kind   ImportMethodKind
+    #import_member_tvars  (List (Type Var))
+    #import_member_args   (List [Bit (Type Value)])
+    #import_member_maybe? Bit
+    #import_member_try?   Bit
+    #import_member_io?    Bit}))
 
 (type: ImportConstructorDecl
-  {})
+  (Record{}))
 
 (type: ImportMethodDecl
-  {#import_method_name    Text
-   #import_method_return  (Type Return)})
+  (Record
+   {#import_method_name    Text
+    #import_method_return  (Type Return)}))
 
 (type: ImportFieldDecl
-  {#import_field_mode    Primitive_Mode
-   #import_field_name    Text
-   #import_field_static? Bit
-   #import_field_maybe?  Bit
-   #import_field_setter? Bit
-   #import_field_type    (Type Value)})
+  (Record
+   {#import_field_mode    Primitive_Mode
+    #import_field_name    Text
+    #import_field_static? Bit
+    #import_field_maybe?  Bit
+    #import_field_setter? Bit
+    #import_field_type    (Type Value)}))
 
 (type: Import_Member_Declaration
-  (#EnumDecl        (List Text))
-  (#ConstructorDecl [ImportMethodCommons ImportConstructorDecl])
-  (#MethodDecl      [ImportMethodCommons ImportMethodDecl])
-  (#FieldAccessDecl ImportFieldDecl))
+  (Variant
+   (#EnumDecl        (List Text))
+   (#ConstructorDecl [ImportMethodCommons ImportConstructorDecl])
+   (#MethodDecl      [ImportMethodCommons ImportMethodDecl])
+   (#FieldAccessDecl ImportFieldDecl)))
 
 (def: (primitive_type mode type)
   (-> Primitive_Mode (Type Primitive) Code)
@@ -354,7 +373,7 @@
                 [parser.upper? limit (parameter_type limit)]
                 [parser.class? [name parameters]
                  (` (.primitive (~ (code.text name))
-                                [(~+ (list\map parameter_type parameters))]))]))
+                                [(~+ (list\each parameter_type parameters))]))]))
           ... else
           (undefined)
           )))
@@ -415,15 +434,15 @@
   (case (f input)
     (^template []
       [[meta ( parts)]
-       [meta ( (list\map (replaced f) parts))]])
+       [meta ( (list\each (replaced f) parts))]])
     ([#.Form]
      [#.Tuple])
     
     [meta (#.Record pairs)]
-    [meta (#.Record (list\map (: (-> [Code Code] [Code Code])
-                                 (function (_ [key val])
-                                   [(replaced f key) (replaced f val)]))
-                              pairs))]
+    [meta (#.Record (list\each (: (-> [Code Code] [Code Code])
+                                  (function (_ [key val])
+                                    [(replaced f key) (replaced f val)]))
+                               pairs))]
     
     ast'
     ast'))
@@ -460,8 +479,8 @@
                                     (.tuple (<>.exactly (list.size arguments) .any)))))]
     (in (` ("jvm member invoke constructor" (~ (code.text class_name))
             (~+ (|> args
-                    (list.zipped/2 (list\map product.right arguments))
-                    (list\map ..decorate_input))))))))
+                    (list.zipped/2 (list\each product.right arguments))
+                    (list\each ..decorate_input))))))))
 
 (def: (static_method_parser class_name method_name arguments)
   (-> Text Text (List Argument) (Parser Code))
@@ -472,8 +491,8 @@
                                     (.tuple (<>.exactly (list.size arguments) .any)))))]
     (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))))))))
+                    (list.zipped/2 (list\each product.right arguments))
+                    (list\each ..decorate_input))))))))
 
 (template [ ]
   [(def: ( class_name method_name arguments self_name)
@@ -486,8 +505,8 @@
        (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))))))))]
+                                (list.zipped/2 (list\each product.right arguments))
+                                (list\each ..decorate_input))))))))]
 
   [special_method_parser "jvm member invoke special"]
   [virtual_method_parser "jvm member invoke virtual"]
@@ -554,7 +573,7 @@
                     (not (text.contains? name.external_separator name)))
      _ (..assertion ..class_name_cannot_be_a_type_variable [name type_vars]
                     (not (list.member? text.equivalence
-                                       (list\map parser.name type_vars)
+                                       (list\each parser.name type_vars)
                                        name)))]
     (in name)))
 
@@ -580,7 +599,7 @@
   (do <>.monad
     [name .local_identifier
      _ (..assertion ..unexpected_type_variable [name type_vars]
-                    (list.member? text.equivalence (list\map parser.name type_vars) name))]
+                    (list.member? text.equivalence (list\each parser.name type_vars) name))]
     (in (type.var name))))
 
 (def: wildcard^
@@ -595,7 +614,7 @@
      (|>> (<>.after (.this! (' )))
           (<>.after ..wildcard^)
           .tuple
-          (\ <>.monad map )))]
+          (\ <>.monad each )))]
 
   [upper^ < type.upper]
   [lower^ > type.lower]
@@ -638,7 +657,7 @@
 (def: array^
   (-> (Parser (Type Value)) (Parser (Type Array)))
   (|>> .tuple
-       (\ <>.monad map type.array)))
+       (\ <>.monad each type.array)))
 
 (def: (type^ type_vars)
   (-> (List (Type Var)) (Parser (Type Value)))
@@ -663,7 +682,7 @@
 
 (def: var^
   (Parser (Type Var))
-  (\ <>.monad map type.var .local_identifier))
+  (\ <>.monad each type.var .local_identifier))
 
 (def: vars^
   (Parser (List (Type Var)))
@@ -719,7 +738,7 @@
   (-> (List (Type Var)) (Parser [Member_Declaration MethodDecl]))
   (.form (do <>.monad
                  [tvars (<>.else (list) ..vars^)
-                  .let [total_vars (list\compose tvars type_vars)]
+                  .let [total_vars (list\composite tvars type_vars)]
                   name .local_identifier
                   anns ..annotations^
                   inputs (.tuple (<>.some (..type^ total_vars)))
@@ -777,7 +796,7 @@
                  [pm privacy_modifier^
                   strict_fp? (<>.parses? (.this! (' #strict)))
                   method_vars (<>.else (list) ..vars^)
-                  .let [total_vars (list\compose class_vars method_vars)]
+                  .let [total_vars (list\composite class_vars method_vars)]
                   [_ self_name arguments] (.form ($_ <>.and
                                                            (.this! (' new))
                                                            .local_identifier
@@ -798,7 +817,7 @@
                   strict_fp? (<>.parses? (.this! (' #strict)))
                   final? (<>.parses? (.this! (' #final)))
                   method_vars (<>.else (list) ..vars^)
-                  .let [total_vars (list\compose class_vars method_vars)]
+                  .let [total_vars (list\composite class_vars method_vars)]
                   [name self_name arguments] (.form ($_ <>.and
                                                               .local_identifier
                                                               .local_identifier
@@ -818,8 +837,8 @@
                  [strict_fp? (<>.parses? (.this! (' #strict)))
                   owner_class ..declaration^
                   method_vars (<>.else (list) ..vars^)
-                  .let [total_vars (list\compose (product.right (parser.declaration owner_class))
-                                                 method_vars)]
+                  .let [total_vars (list\composite (product.right (parser.declaration owner_class))
+                                                   method_vars)]
                   [name self_name arguments] (.form ($_ <>.and
                                                               .local_identifier
                                                               .local_identifier
@@ -944,7 +963,7 @@
                      [tvars (<>.else (list) ..vars^)
                       _ (.identifier! ["" "new"])
                       ?alias import_member_alias^
-                      .let [total_vars (list\compose owner_vars tvars)]
+                      .let [total_vars (list\composite owner_vars tvars)]
                       ?prim_mode (<>.maybe primitive_mode^)
                       args (..import_member_args^ total_vars)
                       [io? try? maybe?] import_member_return_flags^]
@@ -965,7 +984,7 @@
                       tvars (<>.else (list) ..vars^)
                       name .local_identifier
                       ?alias import_member_alias^
-                      .let [total_vars (list\compose owner_vars tvars)]
+                      .let [total_vars (list\composite owner_vars tvars)]
                       ?prim_mode (<>.maybe primitive_mode^)
                       args (..import_member_args^ total_vars)
                       [io? try? maybe?] import_member_return_flags^
@@ -1023,7 +1042,7 @@
 
 (def: (annotation$ [name params])
   (-> Annotation Code)
-  (` ((~ (code.text name)) (~+ (list\map annotation_parameter$ params)))))
+  (` ((~ (code.text name)) (~+ (list\each annotation_parameter$ params)))))
 
 (template [ ]
   [(def: 
@@ -1046,10 +1065,10 @@
   (-> [Member_Declaration MethodDecl] Code)
   (let [(^slots [#method_tvars #method_inputs #method_output #method_exs]) method_decl]
     (` ((~ (code.text name))
-        [(~+ (list\map annotation$ anns))]
-        [(~+ (list\map var$ method_tvars))]
-        [(~+ (list\map class$ method_exs))]
-        [(~+ (list\map value$ method_inputs))]
+        [(~+ (list\each annotation$ anns))]
+        [(~+ (list\each var$ method_tvars))]
+        [(~+ (list\each class$ method_exs))]
+        [(~+ (list\each value$ method_inputs))]
         (~ (return$ method_output))))))
 
 (def: (state_modifier$ sm)
@@ -1064,7 +1083,7 @@
   (case field
     (#ConstantField class value)
     (` ("constant" (~ (code.text name))
-        [(~+ (list\map annotation$ anns))]
+        [(~+ (list\each annotation$ anns))]
         (~ (value$ class))
         (~ value)
         ))
@@ -1073,7 +1092,7 @@
     (` ("variable" (~ (code.text name))
         (~ (privacy_modifier$ pm))
         (~ (state_modifier$ sm))
-        [(~+ (list\map annotation$ anns))]
+        [(~+ (list\each annotation$ anns))]
         (~ (value$ class))
         ))
     ))
@@ -1090,23 +1109,23 @@
   (-> External (Parser Code) (Type Class) (List [Member_Declaration FieldDecl]) [Member_Declaration Method_Definition] Code)
   (case method_def
     (#ConstructorMethod strict_fp? type_vars self_name arguments constructor_args body exs)
-    (let [replacer (|> (list\map (field->parser fully_qualified_class_name self_name) fields)
+    (let [replacer (|> (list\each (field->parser fully_qualified_class_name self_name) fields)
                        (list\mix <>.either method_parser)
                        parser->replacer)]
       (` ("init"
           (~ (privacy_modifier$ pm))
           (~ (code.bit strict_fp?))
-          [(~+ (list\map annotation$ anns))]
-          [(~+ (list\map var$ type_vars))]
-          [(~+ (list\map class$ exs))]
+          [(~+ (list\each annotation$ anns))]
+          [(~+ (list\each var$ type_vars))]
+          [(~+ (list\each class$ exs))]
           (~ (code.text self_name))
-          [(~+ (list\map argument$ arguments))]
-          [(~+ (list\map constructor_arg$ constructor_args))]
+          [(~+ (list\each argument$ arguments))]
+          [(~+ (list\each constructor_arg$ constructor_args))]
           (~ (replaced replacer body))
           )))
     
     (#VirtualMethod final? strict_fp? type_vars self_name arguments return_type body exs)
-    (let [replacer (|> (list\map (field->parser fully_qualified_class_name self_name) fields)
+    (let [replacer (|> (list\each (field->parser fully_qualified_class_name self_name) fields)
                        (list\mix <>.either method_parser)
                        parser->replacer)]
       (` ("virtual"
@@ -1114,16 +1133,16 @@
           (~ (privacy_modifier$ pm))
           (~ (code.bit final?))
           (~ (code.bit strict_fp?))
-          [(~+ (list\map annotation$ anns))]
-          [(~+ (list\map var$ type_vars))]
+          [(~+ (list\each annotation$ anns))]
+          [(~+ (list\each var$ type_vars))]
           (~ (code.text self_name))
-          [(~+ (list\map argument$ arguments))]
+          [(~+ (list\each argument$ arguments))]
           (~ (return$ return_type))
-          [(~+ (list\map class$ exs))]
+          [(~+ (list\each class$ exs))]
           (~ (replaced replacer body)))))
     
     (#OverridenMethod strict_fp? declaration type_vars self_name arguments return_type body exs)
-    (let [replacer (|> (list\map (field->parser fully_qualified_class_name self_name) fields)
+    (let [replacer (|> (list\each (field->parser fully_qualified_class_name self_name) fields)
                        (list\mix <>.either method_parser)
                        parser->replacer)
           super_replacer (parser->replacer (.form (do <>.monad
@@ -1134,18 +1153,18 @@
                                                                   (~ (code.text name))
                                                                   (~ (code.local_identifier self_name))
                                                                   (~+ (|> args
-                                                                          (list.zipped/2 (list\map product.right arguments))
-                                                                          (list\map ..decorate_input)))))))))]
+                                                                          (list.zipped/2 (list\each product.right arguments))
+                                                                          (list\each ..decorate_input)))))))))]
       (` ("override"
           (~ (declaration$ declaration))
           (~ (code.text name))
           (~ (code.bit strict_fp?))
-          [(~+ (list\map annotation$ anns))]
-          [(~+ (list\map var$ type_vars))]
+          [(~+ (list\each annotation$ anns))]
+          [(~+ (list\each var$ type_vars))]
           (~ (code.text self_name))
-          [(~+ (list\map argument$ arguments))]
+          [(~+ (list\each argument$ arguments))]
           (~ (return$ return_type))
-          [(~+ (list\map class$ exs))]
+          [(~+ (list\each class$ exs))]
           (~ (|> body
                  (replaced replacer)
                  (replaced super_replacer)))
@@ -1157,31 +1176,31 @@
           (~ (code.text name))
           (~ (privacy_modifier$ pm))
           (~ (code.bit strict_fp?))
-          [(~+ (list\map annotation$ anns))]
-          [(~+ (list\map var$ type_vars))]
-          [(~+ (list\map argument$ arguments))]
+          [(~+ (list\each annotation$ anns))]
+          [(~+ (list\each var$ type_vars))]
+          [(~+ (list\each argument$ arguments))]
           (~ (return$ return_type))
-          [(~+ (list\map class$ exs))]
+          [(~+ (list\each class$ exs))]
           (~ (replaced replacer body)))))
 
     (#AbstractMethod type_vars arguments return_type exs)
     (` ("abstract"
         (~ (code.text name))
         (~ (privacy_modifier$ pm))
-        [(~+ (list\map annotation$ anns))]
-        [(~+ (list\map var$ type_vars))]
-        [(~+ (list\map argument$ arguments))]
+        [(~+ (list\each annotation$ anns))]
+        [(~+ (list\each var$ type_vars))]
+        [(~+ (list\each argument$ arguments))]
         (~ (return$ return_type))
-        [(~+ (list\map class$ exs))]))
+        [(~+ (list\each class$ exs))]))
 
     (#NativeMethod type_vars arguments return_type exs)
     (` ("native"
         (~ (code.text name))
         (~ (privacy_modifier$ pm))
-        [(~+ (list\map annotation$ anns))]
-        [(~+ (list\map var$ type_vars))]
-        [(~+ (list\map class$ exs))]
-        [(~+ (list\map argument$ arguments))]
+        [(~+ (list\each annotation$ anns))]
+        [(~+ (list\each var$ type_vars))]
+        [(~+ (list\each class$ exs))]
+        [(~+ (list\each argument$ arguments))]
         (~ (return$ return_type))))
     ))
 
@@ -1195,7 +1214,7 @@
 
 (syntax: .public (class: [.let [! <>.monad]
                           im inheritance_modifier^
-                          [full_class_name class_vars] (\ ! map parser.declaration ..declaration^)
+                          [full_class_name class_vars] (\ ! each parser.declaration ..declaration^)
                           super (<>.else $Object
                                          (class^ class_vars))
                           interfaces (<>.else (list)
@@ -1207,28 +1226,28 @@
     [.let [fully_qualified_class_name full_class_name
            method_parser (: (Parser Code)
                             (|> methods
-                                (list\map (method->parser fully_qualified_class_name))
+                                (list\each (method->parser fully_qualified_class_name))
                                 (list\mix <>.either (<>.failure ""))))]]
     (in (list (` ("jvm class"
                   (~ (declaration$ (type.declaration full_class_name class_vars)))
                   (~ (class$ super))
-                  [(~+ (list\map class$ interfaces))]
+                  [(~+ (list\each 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))]))))))
+                  [(~+ (list\each annotation$ annotations))]
+                  [(~+ (list\each field_decl$ fields))]
+                  [(~+ (list\each (method_def$ fully_qualified_class_name method_parser super fields) methods))]))))))
 
 (syntax: .public (interface: [.let [! <>.monad]
-                              [full_class_name class_vars] (\ ! map parser.declaration ..declaration^)
+                              [full_class_name class_vars] (\ ! each parser.declaration ..declaration^)
                               supers (<>.else (list)
                                               (.tuple (<>.some (class^ class_vars))))
                               annotations ..annotations^
                               members (<>.some (..method_decl^ class_vars))])
   (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)))))))
+                [(~+ (list\each class$ supers))]
+                [(~+ (list\each annotation$ annotations))]
+                (~+ (list\each method_decl$ members)))))))
 
 (syntax: .public (object [class_vars ..vars^
                           super (<>.else $Object
@@ -1238,11 +1257,11 @@
                           constructor_args (..constructor_args^ class_vars)
                           methods (<>.some ..overriden_method_def^)])
   (in (list (` ("jvm class anonymous"
-                [(~+ (list\map var$ class_vars))]
+                [(~+ (list\each var$ class_vars))]
                 (~ (class$ super))
-                [(~+ (list\map class$ interfaces))]
-                [(~+ (list\map constructor_arg$ constructor_args))]
-                [(~+ (list\map (method_def$ "" (<>.failure "") super (list)) methods))])))))
+                [(~+ (list\each class$ interfaces))]
+                [(~+ (list\each constructor_arg$ constructor_args))]
+                [(~+ (list\each (method_def$ "" (<>.failure "") super (list)) methods))])))))
 
 (syntax: .public (null [])
   (in (list (` ("jvm object null")))))
@@ -1297,14 +1316,14 @@
                          methods (<>.some partial_call^)])
   (with_identifiers [g!obj]
     (in (list (` (let [(~ g!obj) (~ obj)]
-                   (exec (~+ (list\map (complete_call$ g!obj) methods))
+                   (exec (~+ (list\each (complete_call$ g!obj) methods))
                      (~ g!obj))))))))
 
 (def: (class_import$ declaration)
   (-> (Type Declaration) Code)
   (let [[full_name params] (parser.declaration declaration)
         def_name (..internal full_name)
-        params' (list\map ..var$' params)]
+        params' (list\each ..var$' params)]
     (` (def: (~ (code.identifier ["" def_name]))
          {#..jvm_class (~ (code.text (..internal full_name)))}
          .Type
@@ -1316,7 +1335,7 @@
   (-> (List (Type Var)) Import_Member_Declaration (List (Type Var)))
   (case member
     (#ConstructorDecl [commons _])
-    (list\compose class_tvars (value@ #import_member_tvars commons))
+    (list\composite class_tvars (value@ #import_member_tvars commons))
 
     (#MethodDecl [commons _])
     (case (value@ #import_member_kind commons)
@@ -1324,7 +1343,7 @@
       (value@ #import_member_tvars commons)
 
       _
-      (list\compose class_tvars (value@ #import_member_tvars commons)))
+      (list\composite class_tvars (value@ #import_member_tvars commons)))
 
     _
     class_tvars))
@@ -1335,20 +1354,20 @@
     (^or (#ConstructorDecl [commons _]) (#MethodDecl [commons _]))
     (let [(^slots [#import_member_tvars #import_member_args]) commons]
       (do {! meta.monad}
-        [arg_inputs (monad.map !
-                               (: (-> [Bit (Type Value)] (Meta [Bit Code]))
-                                  (function (_ [maybe? _])
-                                    (with_identifiers [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)
-                                      (function (_ [maybe? arg])
-                                        (let [arg_type (value_type (value@ #import_member_mode commons) arg)]
-                                          (if maybe?
-                                            (` (Maybe (~ arg_type)))
-                                            arg_type))))
-                                   import_member_args)]]
+        [arg_inputs (monad.each !
+                                (: (-> [Bit (Type Value)] (Meta [Bit Code]))
+                                   (function (_ [maybe? _])
+                                     (with_identifiers [arg_name]
+                                       (in [maybe? arg_name]))))
+                                import_member_args)
+         .let [input_jvm_types (list\each product.right import_member_args)
+               arg_types (list\each (: (-> [Bit (Type Value)] Code)
+                                       (function (_ [maybe? arg])
+                                         (let [arg_type (value_type (value@ #import_member_mode commons) arg)]
+                                           (if maybe?
+                                             (` (Maybe (~ arg_type)))
+                                             arg_type))))
+                                    import_member_args)]]
         (in [arg_inputs input_jvm_types arg_types])))
 
     _
@@ -1467,13 +1486,13 @@
   (-> Primitive_Mode (List (Type Value)) (List [Bit Code]) (List Code))
   (|> inputs
       (list.zipped/2 classes)
-      (list\map (function (_ [class [maybe? input]])
-                  (|> (if maybe?
-                        (` (: (.primitive (~ (code.text (..reflection class))))
-                              ((~! !!!) (~ (..un_quoted input)))))
-                        (..un_quoted input))
-                      [class]
-                      (with_automatic_input_conversion mode))))))
+      (list\each (function (_ [class [maybe? input]])
+                   (|> (if maybe?
+                         (` (: (.primitive (~ (code.text (..reflection class))))
+                               ((~! !!!) (~ (..un_quoted input)))))
+                         (..un_quoted input))
+                       [class]
+                       (with_automatic_input_conversion mode))))))
 
 (def: (import_name format class member)
   (-> Text Text Text Text)
@@ -1483,9 +1502,9 @@
 
 (def: syntax_inputs
   (-> (List Code) (List Code))
-  (|>> (list\map (function (_ name)
-                   (list name (` (~! .any)))))
-       list\join))
+  (|>> (list\each (function (_ name)
+                    (list name (` (~! .any)))))
+       list\conjoint))
 
 (def: (member_def_interop vars kind class [arg_function_inputs input_jvm_types arg_types] member method_prefix import_format)
   (-> (List (Type Var)) Class_Kind (Type Declaration) [(List [Bit Code]) (List (Type Value)) (List Code)] Import_Member_Declaration Text Text (Meta (List Code)))
@@ -1499,7 +1518,7 @@
                               (` (primitive (~ (code.text full_name))))
 
                               _
-                              (let [=class_tvars (list\map ..var$' class_tvars)]
+                              (let [=class_tvars (list\each ..var$' class_tvars)]
                                 (` (All [(~+ =class_tvars)] (primitive (~ (code.text full_name)) [(~+ =class_tvars)]))))))
                getter_interop (: (-> Text Code)
                                  (function (_ name)
@@ -1507,7 +1526,7 @@
                                      (` (def: (~ getter_name)
                                           (~ enum_type)
                                           (~ (get_static_field full_name name)))))))]]
-        (in (list\map getter_interop enum_members)))
+        (in (list\each getter_interop enum_members)))
       
       (#ConstructorDecl [commons _])
       (do meta.monad
@@ -1515,17 +1534,17 @@
                def_name (code.identifier ["" (..import_name import_format method_prefix (value@ #import_member_alias commons))])
                jvm_interop (|> [classT
                                 (` ("jvm member invoke constructor"
-                                    [(~+ (list\map ..var$ class_tvars))]
+                                    [(~+ (list\each ..var$ class_tvars))]
                                     (~ (code.text full_name))
-                                    [(~+ (list\map ..var$ (value@ #import_member_tvars commons)))]
+                                    [(~+ (list\each ..var$ (value@ #import_member_tvars commons)))]
                                     (~+ (|> (jvm_invoke_inputs (value@ #import_member_mode commons) input_jvm_types arg_function_inputs)
                                             (list.zipped/2 input_jvm_types)
-                                            (list\map ..decorate_input)))))]
+                                            (list\each ..decorate_input)))))]
                                (with_automatic_output_conversion (value@ #import_member_mode commons))
                                (with_return_maybe member true classT)
                                (with_return_try member)
                                (with_return_io member))]]
-        (in (list (` ((~! syntax:) ((~ def_name) [(~+ (syntax_inputs (list\map product.right arg_function_inputs)))])
+        (in (list (` ((~! syntax:) ((~ def_name) [(~+ (syntax_inputs (list\each product.right arg_function_inputs)))])
                       ((~' in) (.list (.` (~ jvm_interop)))))))))
 
       (#MethodDecl [commons method])
@@ -1553,17 +1572,17 @@
                  method_return (value@ #import_method_return method)
                  callC (: Code
                           (` ((~ (code.text jvm_op))
-                              [(~+ (list\map ..var$ class_tvars))]
+                              [(~+ (list\each ..var$ class_tvars))]
                               (~ (code.text full_name))
                               (~ (code.text import_method_name))
-                              [(~+ (list\map ..var$ (value@ #import_member_tvars commons)))]
+                              [(~+ (list\each ..var$ (value@ #import_member_tvars commons)))]
                               (~+ (|> object_ast
-                                      (list\map ..un_quoted)
+                                      (list\each ..un_quoted)
                                       (list.zipped/2 (list (type.class full_name (list))))
-                                      (list\map (with_automatic_input_conversion (value@ #import_member_mode commons)))))
+                                      (list\each (with_automatic_input_conversion (value@ #import_member_mode commons)))))
                               (~+ (|> (jvm_invoke_inputs (value@ #import_member_mode commons) input_jvm_types arg_function_inputs)
                                       (list.zipped/2 input_jvm_types)
-                                      (list\map ..decorate_input))))))
+                                      (list\each ..decorate_input))))))
                  jvm_interop (: Code
                                 (case (type.void? method_return)
                                   (#.Left method_return)
@@ -1579,7 +1598,7 @@
                                   (|> callC
                                       (with_return_try member)
                                       (with_return_io member))))]]
-          (in (list (` ((~! syntax:) ((~ def_name) [(~+ (syntax_inputs (list\map product.right arg_function_inputs)))
+          (in (list (` ((~! syntax:) ((~ def_name) [(~+ (syntax_inputs (list\each product.right arg_function_inputs)))
                                                     (~+ (syntax_inputs object_ast))])
                         ((~' in) (.list (.` (~ jvm_interop))))))))))
 
@@ -1669,11 +1688,11 @@
   (do {! meta.monad}
     [kind (class_kind declaration)
      =members (|> bundles
-                  (list\map (function (_ [import_format members])
-                              (list\map (|>> [import_format]) members)))
+                  (list\each (function (_ [import_format members])
+                               (list\each (|>> [import_format]) members)))
                   list.together
-                  (monad.map ! (member_import$ class_type_vars kind declaration)))]
-    (in (list& (class_import$ declaration) (list\join =members)))))
+                  (monad.each ! (member_import$ class_type_vars kind declaration)))]
+    (in (list& (class_import$ declaration) (list\conjoint =members)))))
 
 (syntax: .public (array [type (..type^ (list))
                          size .any])
@@ -1748,7 +1767,7 @@
                   (text\= array.type_name name)
                   (case params
                     (#.Item elementLT #.End)
-                    (\ meta.monad map type.array
+                    (\ meta.monad each type.array
                        (lux_type->jvm_type elementLT))
 
                     _
@@ -1758,26 +1777,26 @@
                   (case params
                     #.End
                     (let [[_ unprefixed] (maybe.trusted (text.split_by descriptor.array_prefix name))]
-                      (\ meta.monad map type.array
+                      (\ meta.monad each type.array
                          (lux_type->jvm_type (#.Primitive unprefixed (list)))))
 
                     _
                     )
 
                   ... else
-                  (\ meta.monad map (type.class name)
+                  (\ meta.monad each (type.class name)
                      (: (Meta (List (Type Parameter)))
-                        (monad.map meta.monad
-                                   (function (_ paramLT)
-                                     (do meta.monad
-                                       [paramJT (lux_type->jvm_type paramLT)]
-                                       (case (parser.parameter? paramJT)
-                                         (#.Some paramJT)
-                                         (in paramJT)
-
-                                         #.None
-                                         )))
-                                   params)))))
+                        (monad.each meta.monad
+                                    (function (_ paramLT)
+                                      (do meta.monad
+                                        [paramJT (lux_type->jvm_type paramLT)]
+                                        (case (parser.parameter? paramJT)
+                                          (#.Some paramJT)
+                                          (in paramJT)
+
+                                          #.None
+                                          )))
+                                    params)))))
 
         (#.Apply A F)
         (case (lux_type.applied (list A) F)
diff --git a/stdlib/source/library/lux/ffi.lua.lux b/stdlib/source/library/lux/ffi.lua.lux
index 4d3f5aa26..3d14b554f 100644
--- a/stdlib/source/library/lux/ffi.lua.lux
+++ b/stdlib/source/library/lux/ffi.lua.lux
@@ -91,8 +91,9 @@
 (type: Virtual_Method Common_Method)
 
 (type: Method
-  (#Static Static_Method)
-  (#Virtual Virtual_Method))
+  (Variant
+   (#Static Static_Method)
+   (#Virtual Virtual_Method)))
 
 (def: common_method
   (Parser Common_Method)
@@ -113,8 +114,9 @@
                       ..common_method)))
 
 (type: Member
-  (#Field Field)
-  (#Method Method))
+  (Variant
+   (#Field Field)
+   (#Method Method)))
 
 (def: member
   (Parser Member)
@@ -126,8 +128,8 @@
 (def: input_variables
   (-> (List Nilable) (List [Bit Code]))
   (|>> list.enumeration
-       (list\map (function (_ [idx [nilable? type]])
-                   [nilable? (|> idx %.nat code.local_identifier)]))))
+       (list\each (function (_ [idx [nilable? type]])
+                    [nilable? (|> idx %.nat code.local_identifier)]))))
 
 (def: (nilable_type [nilable? type])
   (-> Nilable Code)
@@ -159,9 +161,10 @@
            (.panic! "Nil is an invalid value!"))))))
 
 (type: Import
-  (#Class [Text Text (List Member)])
-  (#Function Static_Method)
-  (#Constant Field))
+  (Variant
+   (#Class [Text Text (List Member)])
+   (#Function Static_Method)
+   (#Constant Field)))
 
 (def: import
   ($_ <>.or
@@ -201,8 +204,8 @@
   (-> Code Code Code (List Nilable) Bit Bit Nilable Code)
   (let [g!inputs (input_variables inputsT)]
     (` (def: ((~ g!method)
-              [(~+ (list\map product.right g!inputs))])
-         (-> [(~+ (list\map nilable_type inputsT))]
+              [(~+ (list\each product.right g!inputs))])
+         (-> [(~+ (list\each nilable_type inputsT))]
              (~ (|> (nilable_type outputT)
                     (try_type try?)
                     (io_type io?))))
@@ -212,7 +215,7 @@
                  (without_nil g!temp outputT)
                  (` ("lua apply"
                      (:as ..Function (~ source))
-                     (~+ (list\map (with_nil g!temp) g!inputs)))))))))))
+                     (~+ (list\each (with_nil g!temp) g!inputs)))))))))))
 
 (syntax: .public (import: [import ..import])
   {#.doc (example "Easily import types, methods, functions and constants."
@@ -241,54 +244,54 @@
                          (` ("lua import" (~ (code.text class)))))]
           (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)))
-                                          (:expected
-                                           (~ (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.else 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.else 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?))))
-                                            (:expected
-                                             (~ (<| (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)))))
+                     (list\each (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)))
+                                           (:expected
+                                            (~ (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.else 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.else method alias)))
+                                                  [(~+ (list\each product.right g!inputs))]
+                                                  (~ g!object))
+                                             (-> [(~+ (list\each nilable_type inputsT))]
+                                                 (~ g!type)
+                                                 (~ (|> (nilable_type outputT)
+                                                        (try_type try?)
+                                                        (io_type io?))))
+                                             (:expected
+                                              (~ (<| (with_io io?)
+                                                     (with_try try?)
+                                                     (without_nil g!temp outputT)
+                                                     (` ("lua object do"
+                                                         (~ (code.text method))
+                                                         (~ g!object)
+                                                         (~+ (list\each (with_nil g!temp) g!inputs)))))))))))))
+                                members)))))
       
       (#Function [name alias inputsT io? try? outputT])
       (in (list (..make_function (code.local_identifier (maybe.else name alias))
diff --git a/stdlib/source/library/lux/ffi.old.lux b/stdlib/source/library/lux/ffi.old.lux
index 9ec503f1b..496b4475c 100644
--- a/stdlib/source/library/lux/ffi.old.lux
+++ b/stdlib/source/library/lux/ffi.old.lux
@@ -70,161 +70,187 @@
 (def: member_separator "::")
 
 ... Types
-(type: JVM_Code Text)
+(type: JVM_Code
+  Text)
 
 (type: BoundKind
-  #UpperBound
-  #LowerBound)
+  (Variant
+   #UpperBound
+   #LowerBound))
 
 (type: #rec GenericType
-  (#GenericTypeVar Text)
-  (#GenericClass [Text (List GenericType)])
-  (#GenericArray GenericType)
-  (#GenericWildcard (Maybe [BoundKind GenericType])))
+  (Variant
+   (#GenericTypeVar Text)
+   (#GenericClass [Text (List GenericType)])
+   (#GenericArray GenericType)
+   (#GenericWildcard (Maybe [BoundKind GenericType]))))
 
 (type: Type_Parameter
   [Text (List GenericType)])
 
 (type: Primitive_Mode
-  #ManualPrM
-  #AutoPrM)
+  (Variant
+   #ManualPrM
+   #AutoPrM))
 
 (type: .public Privacy
-  #PublicP
-  #PrivateP
-  #ProtectedP
-  #DefaultP)
+  (Variant
+   #PublicP
+   #PrivateP
+   #ProtectedP
+   #DefaultP))
 
 (type: .public State
-  #VolatileS
-  #FinalS
-  #DefaultS)
+  (Variant
+   #VolatileS
+   #FinalS
+   #DefaultS))
 
 (type: .public Inheritance
-  #FinalI
-  #AbstractI
-  #DefaultI)
+  (Variant
+   #FinalI
+   #AbstractI
+   #DefaultI))
 
 (type: Class_Kind
-  #Class
-  #Interface)
+  (Variant
+   #Class
+   #Interface))
 
 (type: Class_Declaration
-  {#class_name   Text
-   #class_params (List Type_Parameter)})
+  (Record
+   {#class_name   Text
+    #class_params (List Type_Parameter)}))
 
-(type: StackFrame (primitive "java/lang/StackTraceElement"))
-(type: StackTrace (Array StackFrame))
+(type: StackFrame
+  (primitive "java/lang/StackTraceElement"))
+
+(type: StackTrace
+  (Array StackFrame))
 
 (type: Super_Class_Decl
-  {#super_class_name   Text
-   #super_class_params (List GenericType)})
+  (Record
+   {#super_class_name   Text
+    #super_class_params (List GenericType)}))
 
 (type: AnnotationParam
   [Text Code])
 
 (type: Annotation
-  {#ann_name   Text
-   #ann_params (List AnnotationParam)})
+  (Record
+   {#ann_name   Text
+    #ann_params (List AnnotationParam)}))
 
 (type: Member_Declaration
-  {#member_name Text
-   #member_privacy Privacy
-   #member_anns (List Annotation)})
+  (Record
+   {#member_name Text
+    #member_privacy Privacy
+    #member_anns (List Annotation)}))
 
 (type: FieldDecl
-  (#ConstantField GenericType Code)
-  (#VariableField State GenericType))
+  (Variant
+   (#ConstantField GenericType Code)
+   (#VariableField State GenericType)))
 
 (type: MethodDecl
-  {#method_tvars  (List Type_Parameter)
-   #method_inputs (List GenericType)
-   #method_output GenericType
-   #method_exs    (List GenericType)})
+  (Record
+   {#method_tvars  (List Type_Parameter)
+    #method_inputs (List GenericType)
+    #method_output GenericType
+    #method_exs    (List GenericType)}))
 
 (type: ArgDecl
-  {#arg_name Text
-   #arg_type GenericType})
+  (Record
+   {#arg_name Text
+    #arg_type GenericType}))
 
 (type: ConstructorArg
   [GenericType Code])
 
 (type: Method_Definition
-  (#ConstructorMethod [Bit
-                       (List Type_Parameter)
-                       (List ArgDecl)
-                       (List ConstructorArg)
-                       Code
-                       (List GenericType)])
-  (#VirtualMethod [Bit
-                   Bit
+  (Variant
+   (#ConstructorMethod [Bit
+                        (List Type_Parameter)
+                        (List ArgDecl)
+                        (List ConstructorArg)
+                        Code
+                        (List GenericType)])
+   (#VirtualMethod [Bit
+                    Bit
+                    (List Type_Parameter)
+                    Text
+                    (List ArgDecl)
+                    GenericType
+                    Code
+                    (List GenericType)])
+   (#OverridenMethod [Bit
+                      Class_Declaration
+                      (List Type_Parameter)
+                      Text
+                      (List ArgDecl)
+                      GenericType
+                      Code
+                      (List GenericType)])
+   (#StaticMethod [Bit
                    (List Type_Parameter)
-                   Text
                    (List ArgDecl)
                    GenericType
                    Code
                    (List GenericType)])
-  (#OverridenMethod [Bit
-                     Class_Declaration
-                     (List Type_Parameter)
-                     Text
+   (#AbstractMethod [(List Type_Parameter)
                      (List ArgDecl)
                      GenericType
-                     Code
                      (List GenericType)])
-  (#StaticMethod [Bit
-                  (List Type_Parameter)
-                  (List ArgDecl)
-                  GenericType
-                  Code
-                  (List GenericType)])
-  (#AbstractMethod [(List Type_Parameter)
-                    (List ArgDecl)
-                    GenericType
-                    (List GenericType)])
-  (#NativeMethod [(List Type_Parameter)
-                  (List ArgDecl)
-                  GenericType
-                  (List GenericType)]))
+   (#NativeMethod [(List Type_Parameter)
+                   (List ArgDecl)
+                   GenericType
+                   (List GenericType)])))
 
 (type: Partial_Call
-  {#pc_method Name
-   #pc_args   (List Code)})
+  (Record
+   {#pc_method Name
+    #pc_args   (List Code)}))
 
 (type: ImportMethodKind
-  #StaticIMK
-  #VirtualIMK)
+  (Variant
+   #StaticIMK
+   #VirtualIMK))
 
 (type: ImportMethodCommons
-  {#import_member_mode   Primitive_Mode
-   #import_member_alias  Text
-   #import_member_kind   ImportMethodKind
-   #import_member_tvars  (List Type_Parameter)
-   #import_member_args   (List [Bit GenericType])
-   #import_member_maybe? Bit
-   #import_member_try?   Bit
-   #import_member_io?    Bit})
+  (Record
+   {#import_member_mode   Primitive_Mode
+    #import_member_alias  Text
+    #import_member_kind   ImportMethodKind
+    #import_member_tvars  (List Type_Parameter)
+    #import_member_args   (List [Bit GenericType])
+    #import_member_maybe? Bit
+    #import_member_try?   Bit
+    #import_member_io?    Bit}))
 
 (type: ImportConstructorDecl
-  {})
+  (Record
+   {}))
 
 (type: ImportMethodDecl
-  {#import_method_name    Text
-   #import_method_return  GenericType})
+  (Record
+   {#import_method_name    Text
+    #import_method_return  GenericType}))
 
 (type: ImportFieldDecl
-  {#import_field_mode    Primitive_Mode
-   #import_field_name    Text
-   #import_field_static? Bit
-   #import_field_maybe?  Bit
-   #import_field_setter? Bit
-   #import_field_type    GenericType})
+  (Record
+   {#import_field_mode    Primitive_Mode
+    #import_field_name    Text
+    #import_field_static? Bit
+    #import_field_maybe?  Bit
+    #import_field_setter? Bit
+    #import_field_type    GenericType}))
 
 (type: Import_Member_Declaration
-  (#EnumDecl        (List Text))
-  (#ConstructorDecl [ImportMethodCommons ImportConstructorDecl])
-  (#MethodDecl      [ImportMethodCommons ImportMethodDecl])
-  (#FieldAccessDecl ImportFieldDecl))
+  (Variant
+   (#EnumDecl        (List Text))
+   (#ConstructorDecl [ImportMethodCommons ImportConstructorDecl])
+   (#MethodDecl      [ImportMethodCommons ImportMethodDecl])
+   (#FieldAccessDecl ImportFieldDecl)))
 
 ... Utils
 (def: (manual_primitive_type class)
@@ -284,7 +310,7 @@
     
     [[name params] _ _]
     (let [name (safe name)
-          =params (list\map (class_type' mode type_params in_array?) params)]
+          =params (list\each (class_type' mode type_params in_array?) params)]
       (` (primitive (~ (code.text name)) [(~+ =params)])))))
 
 (def: (class_type' mode type_params in_array? class)
@@ -326,15 +352,15 @@
 
 (def: (class_decl_type$ (^slots [#class_name #class_params]))
   (-> Class_Declaration Code)
-  (let [=params (list\map (: (-> Type_Parameter Code)
-                             (function (_ [pname pbounds])
-                               (case pbounds
-                                 #.End
-                                 (code.identifier ["" pname])
-
-                                 (#.Item bound1 _)
-                                 (class_type #ManualPrM class_params bound1))))
-                          class_params)]
+  (let [=params (list\each (: (-> Type_Parameter Code)
+                              (function (_ [pname pbounds])
+                                (case pbounds
+                                  #.End
+                                  (code.identifier ["" pname])
+
+                                  (#.Item bound1 _)
+                                  (class_type #ManualPrM class_params bound1))))
+                           class_params)]
     (` (primitive (~ (code.text (safe class_name)))
                   [(~+ =params)]))))
 
@@ -411,15 +437,15 @@
   (case (f input)
     (^template []
       [[meta ( parts)]
-       [meta ( (list\map (pre_walk_replace f) parts))]])
+       [meta ( (list\each (pre_walk_replace f) parts))]])
     ([#.Form]
      [#.Tuple])
     
     [meta (#.Record pairs)]
-    [meta (#.Record (list\map (: (-> [Code Code] [Code Code])
-                                 (function (_ [key val])
-                                   [(pre_walk_replace f key) (pre_walk_replace f val)]))
-                              pairs))]
+    [meta (#.Record (list\each (: (-> [Code Code] [Code Code])
+                                  (function (_ [key val])
+                                    [(pre_walk_replace f key) (pre_walk_replace f val)]))
+                               pairs))]
     
     ast'
     ast'))
@@ -450,7 +476,7 @@
     [args (: (Parser (List Code))
              (.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))]]
+     .let [arg_decls' (: (List Text) (list\each (|>> product.right (simple_class$ params)) arg_decls))]]
     (in (` ((~ (code.text (format "jvm new" ":" class_name ":" (text.interposed "," arg_decls'))))
             (~+ args))))))
 
@@ -461,7 +487,7 @@
      args (: (Parser (List Code))
              (.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))]]
+     .let [arg_decls' (: (List Text) (list\each (|>> product.right (simple_class$ params)) arg_decls))]]
     (in (`' ((~ (code.text (format "jvm invokestatic" ":" class_name ":" method_name ":" (text.interposed "," arg_decls'))))
              (~+ args))))))
 
@@ -473,7 +499,7 @@
         args (: (Parser (List Code))
                 (.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))]]
+        .let [arg_decls' (: (List Text) (list\each (|>> product.right (simple_class$ params)) arg_decls))]]
        (in (`' ((~ (code.text (format  ":" class_name ":" method_name ":" (text.interposed "," arg_decls'))))
                 (~' _jvm_this) (~+ args))))))]
 
@@ -544,7 +570,7 @@
          (do <>.monad
            [name .local_identifier
             _ (no_periods_assertion name)]
-           (if (list.member? text.equivalence (list\map product.left type_vars) name)
+           (if (list.member? text.equivalence (list\each product.left type_vars) name)
              (in (#GenericTypeVar name))
              (in (#GenericClass name (list)))))
          (.tuple (do <>.monad
@@ -569,7 +595,7 @@
                          _ (no_periods_assertion name)
                          params (<>.some recur^)
                          _ (<>.assertion (format name " cannot be a type-parameter!")
-                                         (not (list.member? text.equivalence (list\map product.left type_vars) name)))]
+                                         (not (list.member? text.equivalence (list\each product.left type_vars) name)))]
                         (in (#GenericClass name params))))
          ))))
 
@@ -713,7 +739,7 @@
                  [pm privacy_modifier^
                   strict_fp? (<>.parses? (.this! (' #strict)))
                   method_vars ..type_params^
-                  .let [total_vars (list\compose class_vars method_vars)]
+                  .let [total_vars (list\composite class_vars method_vars)]
                   [_ arg_decls] (.form (<>.and (.this! (' new))
                                                      (..arg_decls^ total_vars)))
                   constructor_args (..constructor_args^ total_vars)
@@ -732,7 +758,7 @@
                   strict_fp? (<>.parses? (.this! (' #strict)))
                   final? (<>.parses? (.this! (' #final)))
                   method_vars ..type_params^
-                  .let [total_vars (list\compose class_vars method_vars)]
+                  .let [total_vars (list\composite class_vars method_vars)]
                   [name this_name arg_decls] (.form ($_ <>.and
                                                               .local_identifier
                                                               .local_identifier
@@ -755,7 +781,7 @@
                  [strict_fp? (<>.parses? (.this! (' #strict)))
                   owner_class ..class_decl^
                   method_vars ..type_params^
-                  .let [total_vars (list\compose (product.right owner_class) method_vars)]
+                  .let [total_vars (list\composite (product.right owner_class) method_vars)]
                   [name this_name arg_decls] (.form ($_ <>.and
                                                               .local_identifier
                                                               .local_identifier
@@ -879,7 +905,7 @@
                      [tvars ..type_params^
                       _ (.this! (' new))
                       ?alias import_member_alias^
-                      .let [total_vars (list\compose owner_vars tvars)]
+                      .let [total_vars (list\composite owner_vars tvars)]
                       ?prim_mode (<>.maybe primitive_mode^)
                       args (..import_member_args^ total_vars)
                       [io? try? maybe?] import_member_return_flags^]
@@ -900,7 +926,7 @@
                       tvars ..type_params^
                       name .local_identifier
                       ?alias import_member_alias^
-                      .let [total_vars (list\compose owner_vars tvars)]
+                      .let [total_vars (list\composite owner_vars tvars)]
                       ?prim_mode (<>.maybe primitive_mode^)
                       args (..import_member_args^ total_vars)
                       [io? try? maybe?] import_member_return_flags^
@@ -972,7 +998,7 @@
 
 (def: (annotation$ [name params])
   (-> Annotation JVM_Code)
-  (format "(" name " " "{" (text.interposed text.tab (list\map annotation_param$ params)) "}" ")"))
+  (format "(" name " " "{" (text.interposed text.tab (list\each annotation_param$ params)) "}" ")"))
 
 (def: (bound_kind$ kind)
   (-> BoundKind JVM_Code)
@@ -987,7 +1013,7 @@
     name
 
     (#GenericClass name params)
-    (format "(" (safe name) " " (spaced (list\map generic_type$ params)) ")")
+    (format "(" (safe name) " " (spaced (list\each generic_type$ params)) ")")
     
     (#GenericArray param)
     (format "(" array.type_name " " (generic_type$ param) ")")
@@ -1000,25 +1026,25 @@
 
 (def: (type_param$ [name bounds])
   (-> Type_Parameter JVM_Code)
-  (format "(" name " " (spaced (list\map generic_type$ bounds)) ")"))
+  (format "(" name " " (spaced (list\each generic_type$ bounds)) ")"))
 
 (def: (class_decl$ (^open "."))
   (-> Class_Declaration JVM_Code)
-  (format "(" (safe class_name) " " (spaced (list\map type_param$ class_params)) ")"))
+  (format "(" (safe class_name) " " (spaced (list\each type_param$ class_params)) ")"))
 
 (def: (super_class_decl$ (^slots [#super_class_name #super_class_params]))
   (-> Super_Class_Decl JVM_Code)
-  (format "(" (safe super_class_name) " " (spaced (list\map generic_type$ super_class_params)) ")"))
+  (format "(" (safe super_class_name) " " (spaced (list\each generic_type$ super_class_params)) ")"))
 
 (def: (method_decl$ [[name pm anns] method_decl])
   (-> [Member_Declaration MethodDecl] JVM_Code)
   (let [(^slots [#method_tvars #method_inputs #method_output #method_exs]) method_decl]
     (with_parens
       (spaced (list name
-                    (with_brackets (spaced (list\map annotation$ anns)))
-                    (with_brackets (spaced (list\map type_param$ method_tvars)))
-                    (with_brackets (spaced (list\map generic_type$ method_exs)))
-                    (with_brackets (spaced (list\map generic_type$ method_inputs)))
+                    (with_brackets (spaced (list\each annotation$ anns)))
+                    (with_brackets (spaced (list\each type_param$ method_tvars)))
+                    (with_brackets (spaced (list\each generic_type$ method_exs)))
+                    (with_brackets (spaced (list\each generic_type$ method_inputs)))
                     (generic_type$ method_output))
               ))))
 
@@ -1035,7 +1061,7 @@
     (#ConstantField class value)
     (with_parens
       (spaced (list "constant" name
-                    (with_brackets (spaced (list\map annotation$ anns)))
+                    (with_brackets (spaced (list\each annotation$ anns)))
                     (generic_type$ class)
                     (code.format value))
               ))
@@ -1045,7 +1071,7 @@
       (spaced (list "variable" name
                     (privacy_modifier$ pm)
                     (state_modifier$ sm)
-                    (with_brackets (spaced (list\map annotation$ anns)))
+                    (with_brackets (spaced (list\each annotation$ anns)))
                     (generic_type$ class))
               ))
     ))
@@ -1068,11 +1094,11 @@
       (spaced (list "init"
                     (privacy_modifier$ pm)
                     (bit\encoded strict_fp?)
-                    (with_brackets (spaced (list\map annotation$ anns)))
-                    (with_brackets (spaced (list\map type_param$ type_vars)))
-                    (with_brackets (spaced (list\map generic_type$ exs)))
-                    (with_brackets (spaced (list\map arg_decl$ arg_decls)))
-                    (with_brackets (spaced (list\map constructor_arg$ constructor_args)))
+                    (with_brackets (spaced (list\each annotation$ anns)))
+                    (with_brackets (spaced (list\each type_param$ type_vars)))
+                    (with_brackets (spaced (list\each generic_type$ exs)))
+                    (with_brackets (spaced (list\each arg_decl$ arg_decls)))
+                    (with_brackets (spaced (list\each constructor_arg$ constructor_args)))
                     (code.format (pre_walk_replace replacer body))
                     )))
     
@@ -1083,10 +1109,10 @@
                     (privacy_modifier$ pm)
                     (bit\encoded final?)
                     (bit\encoded strict_fp?)
-                    (with_brackets (spaced (list\map annotation$ anns)))
-                    (with_brackets (spaced (list\map type_param$ type_vars)))
-                    (with_brackets (spaced (list\map generic_type$ exs)))
-                    (with_brackets (spaced (list\map arg_decl$ arg_decls)))
+                    (with_brackets (spaced (list\each annotation$ anns)))
+                    (with_brackets (spaced (list\each type_param$ type_vars)))
+                    (with_brackets (spaced (list\each generic_type$ exs)))
+                    (with_brackets (spaced (list\each arg_decl$ arg_decls)))
                     (generic_type$ return_type)
                     (code.format (pre_walk_replace replacer (` (let [(~ (code.local_identifier this_name)) (~' _jvm_this)]
                                                                  (~ body))))))))
@@ -1095,8 +1121,8 @@
     (let [super_replacer (parser_replacer (.form (do <>.monad
                                                          [_ (.this! (' ::super!))
                                                           args (.tuple (<>.exactly (list.size arg_decls) .any))
-                                                          .let [arg_decls' (: (List Text) (list\map (|>> product.right (simple_class$ (list)))
-                                                                                                    arg_decls))]]
+                                                          .let [arg_decls' (: (List Text) (list\each (|>> product.right (simple_class$ (list)))
+                                                                                                     arg_decls))]]
                                                          (in (`' ((~ (code.text (format "jvm invokespecial"
                                                                                         ":" (value@ #super_class_name super_class)
                                                                                         ":" name
@@ -1107,10 +1133,10 @@
                       (class_decl$ class_decl)
                       name
                       (bit\encoded strict_fp?)
-                      (with_brackets (spaced (list\map annotation$ anns)))
-                      (with_brackets (spaced (list\map type_param$ type_vars)))
-                      (with_brackets (spaced (list\map generic_type$ exs)))
-                      (with_brackets (spaced (list\map arg_decl$ arg_decls)))
+                      (with_brackets (spaced (list\each annotation$ anns)))
+                      (with_brackets (spaced (list\each type_param$ type_vars)))
+                      (with_brackets (spaced (list\each generic_type$ exs)))
+                      (with_brackets (spaced (list\each arg_decl$ arg_decls)))
                       (generic_type$ return_type)
                       (|> (` (let [(~ (code.local_identifier this_name)) (~' _jvm_this)]
                                (~ body)))
@@ -1125,10 +1151,10 @@
                     name
                     (privacy_modifier$ pm)
                     (bit\encoded strict_fp?)
-                    (with_brackets (spaced (list\map annotation$ anns)))
-                    (with_brackets (spaced (list\map type_param$ type_vars)))
-                    (with_brackets (spaced (list\map generic_type$ exs)))
-                    (with_brackets (spaced (list\map arg_decl$ arg_decls)))
+                    (with_brackets (spaced (list\each annotation$ anns)))
+                    (with_brackets (spaced (list\each type_param$ type_vars)))
+                    (with_brackets (spaced (list\each generic_type$ exs)))
+                    (with_brackets (spaced (list\each arg_decl$ arg_decls)))
                     (generic_type$ return_type)
                     (code.format (pre_walk_replace replacer body)))))
 
@@ -1137,10 +1163,10 @@
       (spaced (list "abstract"
                     name
                     (privacy_modifier$ pm)
-                    (with_brackets (spaced (list\map annotation$ anns)))
-                    (with_brackets (spaced (list\map type_param$ type_vars)))
-                    (with_brackets (spaced (list\map generic_type$ exs)))
-                    (with_brackets (spaced (list\map arg_decl$ arg_decls)))
+                    (with_brackets (spaced (list\each annotation$ anns)))
+                    (with_brackets (spaced (list\each type_param$ type_vars)))
+                    (with_brackets (spaced (list\each generic_type$ exs)))
+                    (with_brackets (spaced (list\each arg_decl$ arg_decls)))
                     (generic_type$ return_type))))
 
     (#NativeMethod type_vars arg_decls return_type exs)
@@ -1148,10 +1174,10 @@
       (spaced (list "native"
                     name
                     (privacy_modifier$ pm)
-                    (with_brackets (spaced (list\map annotation$ anns)))
-                    (with_brackets (spaced (list\map type_param$ type_vars)))
-                    (with_brackets (spaced (list\map generic_type$ exs)))
-                    (with_brackets (spaced (list\map arg_decl$ arg_decls)))
+                    (with_brackets (spaced (list\each annotation$ anns)))
+                    (with_brackets (spaced (list\each type_param$ type_vars)))
+                    (with_brackets (spaced (list\each generic_type$ exs)))
+                    (with_brackets (spaced (list\each arg_decl$ arg_decls)))
                     (generic_type$ return_type))))
     ))
 
@@ -1209,19 +1235,19 @@
   (do meta.monad
     [current_module meta.current_module_name
      .let [fully_qualified_class_name (format (safe current_module) "." full_class_name)
-           field_parsers (list\map (field_parser fully_qualified_class_name) fields)
-           method_parsers (list\map (method_parser (product.right class_decl) fully_qualified_class_name) methods)
+           field_parsers (list\each (field_parser fully_qualified_class_name) fields)
+           method_parsers (list\each (method_parser (product.right class_decl) fully_qualified_class_name) methods)
            replacer (parser_replacer (list\mix <>.either
                                                (<>.failure "")
-                                               (list\compose field_parsers method_parsers)))
+                                               (list\composite field_parsers method_parsers)))
            def_code (format "jvm class:"
                             (spaced (list (class_decl$ class_decl)
                                           (super_class_decl$ super)
-                                          (with_brackets (spaced (list\map super_class_decl$ interfaces)))
+                                          (with_brackets (spaced (list\each super_class_decl$ interfaces)))
                                           (inheritance_modifier$ im)
-                                          (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))))))]]
+                                          (with_brackets (spaced (list\each annotation$ annotations)))
+                                          (with_brackets (spaced (list\each field_decl$ fields)))
+                                          (with_brackets (spaced (list\each (method_def$ replacer super) methods))))))]]
     (in (list (` ((~ (code.text def_code))))))))
 
 (syntax: .public (interface: [class_decl ..class_decl^
@@ -1235,9 +1261,9 @@
                     ([] foo [boolean String] void #throws [Exception])))}
   (let [def_code (format "jvm interface:"
                          (spaced (list (class_decl$ class_decl)
-                                       (with_brackets (spaced (list\map super_class_decl$ supers)))
-                                       (with_brackets (spaced (list\map annotation$ annotations)))
-                                       (spaced (list\map method_decl$ members)))))]
+                                       (with_brackets (spaced (list\each super_class_decl$ supers)))
+                                       (with_brackets (spaced (list\each annotation$ annotations)))
+                                       (spaced (list\each method_decl$ members)))))]
     (in (list (` ((~ (code.text def_code))))))
     ))
 
@@ -1261,9 +1287,9 @@
                   )}
   (let [def_code (format "jvm anon-class:"
                          (spaced (list (super_class_decl$ super)
-                                       (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))))))]
+                                       (with_brackets (spaced (list\each super_class_decl$ interfaces)))
+                                       (with_brackets (spaced (list\each constructor_arg$ constructor_args)))
+                                       (with_brackets (spaced (list\each (method_def$ function.identity super) methods))))))]
     (in (list (` ((~ (code.text def_code))))))))
 
 (syntax: .public (null [])
@@ -1351,12 +1377,12 @@
                     (ClassName::method2 arg3 arg4 arg5)))}
   (with_identifiers [g!obj]
     (in (list (` (let [(~ g!obj) (~ obj)]
-                   (exec (~+ (list\map (complete_call$ g!obj) methods))
+                   (exec (~+ (list\each (complete_call$ g!obj) methods))
                      (~ g!obj))))))))
 
 (def: (class_import$ [full_name params])
   (-> Class_Declaration Code)
-  (let [params' (list\map (|>> product.left code.local_identifier) params)]
+  (let [params' (list\each (|>> product.left code.local_identifier) params)]
     (` (def: (~ (code.identifier ["" full_name]))
          {#..jvm_class (~ (code.text full_name))}
          Type
@@ -1368,7 +1394,7 @@
   (-> (List Type_Parameter) Import_Member_Declaration (List Type_Parameter))
   (case member
     (#ConstructorDecl [commons _])
-    (list\compose class_tvars (value@ #import_member_tvars commons))
+    (list\composite class_tvars (value@ #import_member_tvars commons))
 
     (#MethodDecl [commons _])
     (case (value@ #import_member_kind commons)
@@ -1376,7 +1402,7 @@
       (value@ #import_member_tvars commons)
 
       _
-      (list\compose class_tvars (value@ #import_member_tvars commons)))
+      (list\composite class_tvars (value@ #import_member_tvars commons)))
 
     _
     class_tvars))
@@ -1387,22 +1413,22 @@
     (^or (#ConstructorDecl [commons _]) (#MethodDecl [commons _]))
     (let [(^slots [#import_member_tvars #import_member_args]) commons]
       (do {! meta.monad}
-        [arg_inputs (monad.map !
-                               (: (-> [Bit GenericType] (Meta [Bit Code]))
-                                  (function (_ [maybe? _])
-                                    (with_identifiers [arg_name]
-                                      (in [maybe? arg_name]))))
-                               import_member_args)
+        [arg_inputs (monad.each !
+                                (: (-> [Bit GenericType] (Meta [Bit Code]))
+                                   (function (_ [maybe? _])
+                                     (with_identifiers [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)))
-                                        import_member_args))
-               arg_types (list\map (: (-> [Bit GenericType] Code)
-                                      (function (_ [maybe? arg])
-                                        (let [arg_type (class_type (value@ #import_member_mode commons) type_params arg)]
-                                          (if maybe?
-                                            (` (Maybe (~ arg_type)))
-                                            arg_type))))
-                                   import_member_args)]]
+                              (list\each (|>> product.right (simple_class$ (list\composite type_params import_member_tvars)))
+                                         import_member_args))
+               arg_types (list\each (: (-> [Bit GenericType] Code)
+                                       (function (_ [maybe? arg])
+                                         (let [arg_type (class_type (value@ #import_member_mode commons) type_params arg)]
+                                           (if maybe?
+                                             (` (Maybe (~ arg_type)))
+                                             arg_type))))
+                                    import_member_args)]]
         (in [arg_inputs arg_classes arg_types])))
 
     _
@@ -1478,12 +1504,12 @@
 (def: (jvm_extension_inputs mode classes inputs)
   (-> Primitive_Mode (List Text) (List [Bit Code]) (List Code))
   (|> inputs
-      (list\map (function (_ [maybe? input])
-                  (if maybe?
-                    (` ((~! !!!) (~ (un_quote input))))
-                    (un_quote input))))
+      (list\each (function (_ [maybe? input])
+                   (if maybe?
+                     (` ((~! !!!) (~ (un_quote input))))
+                     (un_quote input))))
       (list.zipped/2 classes)
-      (list\map (auto_convert_input mode))))
+      (list\each (auto_convert_input mode))))
 
 (def: (import_name format class member)
   (-> Text Text Text Text)
@@ -1493,9 +1519,9 @@
 
 (def: syntax_inputs
   (-> (List Code) (List Code))
-  (|>> (list\map (function (_ name)
-                   (list name (` (~! .any)))))
-       list\join))
+  (|>> (list\each (function (_ name)
+                    (list name (` (~! .any)))))
+       list\conjoint))
 
 (def: (member_def_interop type_params kind class [arg_function_inputs arg_classes arg_types] member method_prefix import_format)
   (-> (List Type_Parameter) Class_Kind Class_Declaration [(List [Bit Code]) (List Text) (List Code)] Import_Member_Declaration Text Text (Meta (List Code)))
@@ -1503,7 +1529,7 @@
         full_name (safe full_name)
         all_params (|> (member_type_vars class_tvars member)
                        (list.only free_type_param?)
-                       (list\map lux_type_parameter))]
+                       (list\each lux_type_parameter))]
     (case member
       (#EnumDecl enum_members)
       (do {! meta.monad}
@@ -1515,7 +1541,7 @@
                               _
                               (let [=class_tvars (|> class_tvars
                                                      (list.only free_type_param?)
-                                                     (list\map lux_type_parameter))]
+                                                     (list\each lux_type_parameter))]
                                 (` (All [(~+ =class_tvars)] (primitive (~ (code.text full_name)) [(~+ =class_tvars)]))))))
                getter_interop (: (-> Text Code)
                                  (function (_ name)
@@ -1523,7 +1549,7 @@
                                      (` (def: (~ getter_name)
                                           (~ enum_type)
                                           ((~ (code.text (format "jvm getstatic" ":" full_name ":" name)))))))))]]
-        (in (list\map getter_interop enum_members)))
+        (in (list\each getter_interop enum_members)))
       
       (#ConstructorDecl [commons _])
       (do meta.monad
@@ -1534,7 +1560,7 @@
                                (decorate_return_maybe class member)
                                (decorate_return_try member)
                                (decorate_return_io member))]]
-        (in (list (` ((~! syntax:) ((~ def_name) [(~+ (syntax_inputs (list\map product.right arg_function_inputs)))])
+        (in (list (` ((~! syntax:) ((~ def_name) [(~+ (syntax_inputs (list\each product.right arg_function_inputs)))])
                       ((~' in) (.list (.` (~ jvm_interop)))))))))
 
       (#MethodDecl [commons method])
@@ -1561,13 +1587,13 @@
                                             )))
                  jvm_extension (code.text (format "jvm " jvm_op ":" full_name ":" import_method_name ":" (text.interposed "," arg_classes)))
                  jvm_interop (|> [(simple_class$ (list) (value@ #import_method_return method))
-                                  (` ((~ jvm_extension) (~+ (list\map un_quote object_ast))
+                                  (` ((~ jvm_extension) (~+ (list\each un_quote object_ast))
                                       (~+ (jvm_extension_inputs (value@ #import_member_mode commons) arg_classes arg_function_inputs))))]
                                  (auto_convert_output (value@ #import_member_mode commons))
                                  (decorate_return_maybe class member)
                                  (decorate_return_try member)
                                  (decorate_return_io member))]]
-          (in (list (` ((~! syntax:) ((~ def_name) [(~+ (syntax_inputs (list\map product.right arg_function_inputs)))
+          (in (list (` ((~! syntax:) ((~ def_name) [(~+ (syntax_inputs (list\each product.right arg_function_inputs)))
                                                     (~+ (syntax_inputs object_ast))])
                         ((~' in) (.list (.` (~ jvm_interop))))))))))
 
@@ -1582,7 +1608,7 @@
                tvar_asts (: (List Code)
                             (|> class_tvars
                                 (list.only free_type_param?)
-                                (list\map lux_type_parameter)))
+                                (list\each lux_type_parameter)))
                getter_name (code.identifier ["" (..import_name import_format method_prefix import_field_name)])
                setter_name (code.identifier ["" (..import_name import_format method_prefix (format import_field_name "!"))])]
          getter_interop (with_identifiers [g!obj]
@@ -1715,11 +1741,11 @@
   (do {! meta.monad}
     [kind (class_kind class_decl)
      =members (|> bundles
-                  (list\map (function (_ [import_format members])
-                              (list\map (|>> [import_format]) members)))
+                  (list\each (function (_ [import_format members])
+                               (list\each (|>> [import_format]) members)))
                   list.together
-                  (monad.map ! (member_import$ (product.right class_decl) kind class_decl)))]
-    (in (list& (class_import$ class_decl) (list\join =members)))))
+                  (monad.each ! (member_import$ (product.right class_decl) kind class_decl)))]
+    (in (list& (class_import$ class_decl) (list\conjoint =members)))))
 
 (syntax: .public (array [type (..generic_type^ (list))
                          size .any])
diff --git a/stdlib/source/library/lux/ffi.php.lux b/stdlib/source/library/lux/ffi.php.lux
index 453f2c59e..82208f783 100644
--- a/stdlib/source/library/lux/ffi.php.lux
+++ b/stdlib/source/library/lux/ffi.php.lux
@@ -23,11 +23,11 @@
      ["." code]
      ["." template]]]])
 
-(abstract: .public (Object brand) Any)
+(abstract: .public (Object brand) {} Any)
 
 (template []
   [(with_expansions [ (template.identifier [ "'"])]
-     (abstract: .public  Any)
+     (abstract: .public  {} Any)
      (type: .public 
        (..Object )))]
 
@@ -97,8 +97,9 @@
 (type: Virtual_Method Common_Method)
 
 (type: Method
-  (#Static Static_Method)
-  (#Virtual Virtual_Method))
+  (Variant
+   (#Static Static_Method)
+   (#Virtual Virtual_Method)))
 
 (def: common_method
   (Parser Common_Method)
@@ -119,8 +120,9 @@
                       ..common_method)))
 
 (type: Member
-  (#Field Field)
-  (#Method Method))
+  (Variant
+   (#Field Field)
+   (#Method Method)))
 
 (def: member
   (Parser Member)
@@ -132,8 +134,8 @@
 (def: input_variables
   (-> (List Nullable) (List [Bit Code]))
   (|>> list.enumeration
-       (list\map (function (_ [idx [nullable? type]])
-                   [nullable? (|> idx %.nat code.local_identifier)]))))
+       (list\each (function (_ [idx [nullable? type]])
+                    [nullable? (|> idx %.nat code.local_identifier)]))))
 
 (def: (nullable_type [nullable? type])
   (-> Nullable Code)
@@ -165,9 +167,10 @@
            (.panic! "Null is an invalid value!"))))))
 
 (type: Import
-  (#Class Text (Maybe Alias) Text (List Member))
-  (#Function Static_Method)
-  (#Constant Field))
+  (Variant
+   (#Class Text (Maybe Alias) Text (List Member))
+   (#Function Static_Method)
+   (#Constant Field)))
 
 (def: import
   (Parser Import)
@@ -219,8 +222,8 @@
   (-> Code Code Code (List Nullable) Bit Bit Nullable Code)
   (let [g!inputs (input_variables inputsT)]
     (` (def: ((~ g!method)
-              [(~+ (list\map product.right g!inputs))])
-         (-> [(~+ (list\map nullable_type inputsT))]
+              [(~+ (list\each product.right g!inputs))])
+         (-> [(~+ (list\each nullable_type inputsT))]
              (~ (|> (nullable_type outputT)
                     (try_type try?)
                     (io_type io?))))
@@ -230,7 +233,7 @@
                  (without_null g!temp outputT)
                  (` ("php apply"
                      (:as ..Function (~ source))
-                     (~+ (list\map (with_null g!temp) g!inputs)))))))))))
+                     (~+ (list\each (with_null g!temp) g!inputs)))))))))))
 
 (syntax: .public (import: [import ..import])
   (with_identifiers [g!temp]
@@ -247,54 +250,54 @@
               class_import (` ("php constant" (~ (code.text class))))]
           (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.else 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)))
-                                          (:expected
-                                           (~ (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.else 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.else 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?))))
-                                            (:expected
-                                             (~ (<| (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)))))
+                     (list\each (function (_ member)
+                                  (case member
+                                    (#Field [static? field alias fieldT])
+                                    (if static?
+                                      (` ((~! syntax:) ((~ (qualify (maybe.else 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)))
+                                           (:expected
+                                            (~ (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.else 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.else method alias)))
+                                                  [(~+ (list\each product.right g!inputs))]
+                                                  (~ g!object))
+                                             (-> [(~+ (list\each nullable_type inputsT))]
+                                                 (~ g!type)
+                                                 (~ (|> (nullable_type outputT)
+                                                        (try_type try?)
+                                                        (io_type io?))))
+                                             (:expected
+                                              (~ (<| (with_io io?)
+                                                     (with_try try?)
+                                                     (without_null g!temp outputT)
+                                                     (` ("php object do"
+                                                         (~ (code.text method))
+                                                         (~ g!object)
+                                                         (~+ (list\each (with_null g!temp) g!inputs)))))))))))))
+                                members)))))
       
       (#Function [name alias inputsT io? try? outputT])
       (let [imported (` ("php constant" (~ (code.text name))))]
diff --git a/stdlib/source/library/lux/ffi.py.lux b/stdlib/source/library/lux/ffi.py.lux
index e3eea52e2..3dbd3cc5a 100644
--- a/stdlib/source/library/lux/ffi.py.lux
+++ b/stdlib/source/library/lux/ffi.py.lux
@@ -92,8 +92,9 @@
 (type: Virtual_Method Common_Method)
 
 (type: Method
-  (#Static Static_Method)
-  (#Virtual Virtual_Method))
+  (Variant
+   (#Static Static_Method)
+   (#Virtual Virtual_Method)))
 
 (def: common_method
   (Parser Common_Method)
@@ -114,9 +115,10 @@
                       ..common_method)))
 
 (type: Member
-  (#Constructor Constructor)
-  (#Field Field)
-  (#Method Method))
+  (Variant
+   (#Constructor Constructor)
+   (#Field Field)
+   (#Method Method)))
 
 (def: member
   (Parser Member)
@@ -129,8 +131,8 @@
 (def: input_variables
   (-> (List Noneable) (List [Bit Code]))
   (|>> list.enumeration
-       (list\map (function (_ [idx [noneable? type]])
-                   [noneable? (|> idx %.nat code.local_identifier)]))))
+       (list\each (function (_ [idx [noneable? type]])
+                    [noneable? (|> idx %.nat code.local_identifier)]))))
 
 (def: (noneable_type [noneable? type])
   (-> Noneable Code)
@@ -162,8 +164,9 @@
            (.panic! "None is an invalid value!"))))))
 
 (type: Import
-  (#Class [Text Text (List Member)])
-  (#Function Static_Method))
+  (Variant
+   (#Class [Text Text (List Member)])
+   (#Function Static_Method)))
 
 (def: import
   (Parser Import)
@@ -201,8 +204,8 @@
   (-> Code Code Code (List Noneable) Bit Bit Noneable Code)
   (let [g!inputs (input_variables inputsT)]
     (` (def: ((~ g!method)
-              [(~+ (list\map product.right g!inputs))])
-         (-> [(~+ (list\map noneable_type inputsT))]
+              [(~+ (list\each product.right g!inputs))])
+         (-> [(~+ (list\each noneable_type inputsT))]
              (~ (|> (noneable_type outputT)
                     (try_type try?)
                     (io_type io?))))
@@ -212,7 +215,7 @@
                  (without_none g!temp outputT)
                  (` ("python apply"
                      (:as ..Function (~ source))
-                     (~+ (list\map (with_none g!temp) g!inputs)))))))))))
+                     (~+ (list\each (with_none g!temp) g!inputs)))))))))))
 
 (syntax: .public (import: [import ..import])
   {#.doc (example "Easily import types, methods, functions and constants."
@@ -261,65 +264,65 @@
                          (` ("python import" (~ (code.text class)))))]
           (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))
-                                          (:expected
-                                           ("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)))
-                                          (:expected
-                                           (~ (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.else 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.else 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?))))
-                                            (:expected
-                                             (~ (<| (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)))))
+                     (list\each (function (_ member)
+                                  (case member
+                                    (#Constructor inputsT)
+                                    (let [g!inputs (input_variables inputsT)]
+                                      (` (def: ((~ (qualify "new"))
+                                                [(~+ (list\each product.right g!inputs))])
+                                           (-> [(~+ (list\each noneable_type inputsT))]
+                                               (~ g!type))
+                                           (:expected
+                                            ("python apply"
+                                             (:as ..Function (~ imported))
+                                             (~+ (list\each (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)))
+                                           (:expected
+                                            (~ (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.else 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.else method alias)))
+                                                  [(~+ (list\each product.right g!inputs))]
+                                                  (~ g!object))
+                                             (-> [(~+ (list\each noneable_type inputsT))]
+                                                 (~ g!type)
+                                                 (~ (|> (noneable_type outputT)
+                                                        (try_type try?)
+                                                        (io_type io?))))
+                                             (:expected
+                                              (~ (<| (with_io io?)
+                                                     (with_try try?)
+                                                     (without_none g!temp outputT)
+                                                     (` ("python object do"
+                                                         (~ (code.text method))
+                                                         (~ g!object)
+                                                         (~+ (list\each (with_none g!temp) g!inputs)))))))))))))
+                                members)))))
       
       (#Function [name alias inputsT io? try? outputT])
       (in (list (..make_function (code.local_identifier (maybe.else name alias))
diff --git a/stdlib/source/library/lux/ffi.rb.lux b/stdlib/source/library/lux/ffi.rb.lux
index c01b88565..2ba821582 100644
--- a/stdlib/source/library/lux/ffi.rb.lux
+++ b/stdlib/source/library/lux/ffi.rb.lux
@@ -99,8 +99,9 @@
 (type: Virtual_Method Common_Method)
 
 (type: Method
-  (#Static Static_Method)
-  (#Virtual Virtual_Method))
+  (Variant
+   (#Static Static_Method)
+   (#Virtual Virtual_Method)))
 
 (def: common_method
   (Parser Common_Method)
@@ -121,8 +122,9 @@
                       ..common_method)))
 
 (type: Member
-  (#Field Field)
-  (#Method Method))
+  (Variant
+   (#Field Field)
+   (#Method Method)))
 
 (def: member
   (Parser Member)
@@ -134,8 +136,8 @@
 (def: input_variables
   (-> (List Nilable) (List [Bit Code]))
   (|>> list.enumeration
-       (list\map (function (_ [idx [nilable? type]])
-                   [nilable? (|> idx %.nat code.local_identifier)]))))
+       (list\each (function (_ [idx [nilable? type]])
+                    [nilable? (|> idx %.nat code.local_identifier)]))))
 
 (def: (nilable_type [nilable? type])
   (-> Nilable Code)
@@ -167,9 +169,10 @@
            (.panic! "Nil is an invalid value!"))))))
 
 (type: Import
-  (#Class Text (Maybe Alias) Text (List Member))
-  (#Function Static_Method)
-  (#Constant Field))
+  (Variant
+   (#Class Text (Maybe Alias) Text (List Member))
+   (#Function Static_Method)
+   (#Constant Field)))
 
 (def: import
   (Parser [(Maybe Text) Import])
@@ -214,8 +217,8 @@
   (-> Code Code Code (List Nilable) Bit Bit Nilable Code)
   (let [g!inputs (input_variables inputsT)]
     (` (def: ((~ g!method)
-              [(~+ (list\map product.right g!inputs))])
-         (-> [(~+ (list\map nilable_type inputsT))]
+              [(~+ (list\each product.right g!inputs))])
+         (-> [(~+ (list\each nilable_type inputsT))]
              (~ (|> (nilable_type outputT)
                     (try_type try?)
                     (io_type io?))))
@@ -225,7 +228,7 @@
                  (without_nil g!temp outputT)
                  (` ("ruby apply"
                      (:as ..Function (~ source))
-                     (~+ (list\map (with_nil g!temp) g!inputs)))))))))))
+                     (~+ (list\each (with_nil g!temp) g!inputs)))))))))))
 
 (syntax: .public (import: [[?module import] ..import])
   {#.doc (example "Easily import types, methods, functions and constants."
@@ -268,58 +271,58 @@
               class_import (` ("ruby constant" (~ (code.text class))))]
           (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.else 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)))
-                                          (:expected
-                                           (~ (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.else 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.else 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?))))
-                                            (:expected
-                                             (~ (<| (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)))))
+                     (list\each (function (_ member)
+                                  (case member
+                                    (#Field [static? field alias fieldT])
+                                    (if static?
+                                      (` ((~! syntax:) ((~ (qualify (maybe.else 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)))
+                                           (:expected
+                                            (~ (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.else 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.else method alias)))
+                                                  [(~+ (list\each product.right g!inputs))]
+                                                  (~ g!object))
+                                             (-> [(~+ (list\each nilable_type inputsT))]
+                                                 (~ g!type)
+                                                 (~ (|> (nilable_type outputT)
+                                                        (try_type try?)
+                                                        (io_type io?))))
+                                             (:expected
+                                              (~ (<| (with_io io?)
+                                                     (with_try try?)
+                                                     (without_nil g!temp outputT)
+                                                     (` ("ruby object do"
+                                                         (~ (code.text method))
+                                                         (~ g!object)
+                                                         (~+ (list\each (with_nil g!temp) g!inputs)))))))))))))
+                                members)))))
       
       (#Function [name alias inputsT io? try? outputT])
       (let [imported (` (.exec
diff --git a/stdlib/source/library/lux/ffi.scm.lux b/stdlib/source/library/lux/ffi.scm.lux
index ab2e6cdff..675aadcd1 100644
--- a/stdlib/source/library/lux/ffi.scm.lux
+++ b/stdlib/source/library/lux/ffi.scm.lux
@@ -23,11 +23,11 @@
      ["." code]
      ["." template]]]])
 
-(abstract: .public (Object brand) Any)
+(abstract: .public (Object brand) {} Any)
 
 (template []
   [(with_expansions [ (template.identifier [ "'"])]
-     (abstract: .public  Any)
+     (abstract: .public  {} Any)
      (type: .public 
        (..Object )))]
 
@@ -106,8 +106,8 @@
 (def: input_variables
   (-> (List Nilable) (List [Bit Code]))
   (|>> list.enumeration
-       (list\map (function (_ [idx [nilable? type]])
-                   [nilable? (|> idx %.nat code.local_identifier)]))))
+       (list\each (function (_ [idx [nilable? type]])
+                    [nilable? (|> idx %.nat code.local_identifier)]))))
 
 (def: (nilable_type [nilable? type])
   (-> Nilable Code)
@@ -139,8 +139,9 @@
            (.panic! "Nil is an invalid value!"))))))
 
 (type: Import
-  (#Function Common_Method)
-  (#Constant Field))
+  (Variant
+   (#Function Common_Method)
+   (#Constant Field)))
 
 (def: import
   (Parser Import)
@@ -186,8 +187,8 @@
   (-> Code Code Code (List Nilable) Bit Bit Nilable Code)
   (let [g!inputs (input_variables inputsT)]
     (` (def: ((~ g!method)
-              [(~+ (list\map product.right g!inputs))])
-         (-> [(~+ (list\map nilable_type inputsT))]
+              [(~+ (list\each product.right g!inputs))])
+         (-> [(~+ (list\each nilable_type inputsT))]
              (~ (|> (nilable_type outputT)
                     (try_type try?)
                     (io_type io?))))
@@ -197,7 +198,7 @@
                  (without_nil g!temp outputT)
                  (` ("scheme apply"
                      (:as ..Function (~ source))
-                     (~+ (list\map (with_nil g!temp) g!inputs)))))))))))
+                     (~+ (list\each (with_nil g!temp) g!inputs)))))))))))
 
 (syntax: .public (import: [import ..import])
   (with_identifiers [g!temp]
diff --git a/stdlib/source/library/lux/locale.lux b/stdlib/source/library/lux/locale.lux
index 39befd846..ac8c05384 100644
--- a/stdlib/source/library/lux/locale.lux
+++ b/stdlib/source/library/lux/locale.lux
@@ -28,10 +28,10 @@
     (-> Language (Maybe Territory) (Maybe Encoding) Locale)
     (:abstraction (format (language.code language)
                           (|> territory
-                              (maybe\map (|>> territory.long_code (format ..territory_separator)))
+                              (maybe\each (|>> territory.long_code (format ..territory_separator)))
                               (maybe.else ""))
                           (|> encoding
-                              (maybe\map (|>> encoding.name (format ..encoding_separator)))
+                              (maybe\each (|>> encoding.name (format ..encoding_separator)))
                               (maybe.else "")))))
 
   (def: .public code
@@ -40,7 +40,7 @@
 
   (def: .public hash
     (Hash Locale)
-    (\ hash.functor map ..code text.hash))
+    (\ hash.functor each ..code text.hash))
 
   (def: .public equivalence
     (Equivalence Locale)
diff --git a/stdlib/source/library/lux/locale/language.lux b/stdlib/source/library/lux/locale/language.lux
index 1739135aa..cb4314c59 100644
--- a/stdlib/source/library/lux/locale/language.lux
+++ b/stdlib/source/library/lux/locale/language.lux
@@ -15,8 +15,9 @@
 (abstract: .public Language
   {}
 
-  {#name Text
-   #code Text}
+  (Record
+   {#name Text
+    #code Text})
 
   (template [ ]
     [(def: .public 
diff --git a/stdlib/source/library/lux/locale/territory.lux b/stdlib/source/library/lux/locale/territory.lux
index c4172993a..4b2dfd4b5 100644
--- a/stdlib/source/library/lux/locale/territory.lux
+++ b/stdlib/source/library/lux/locale/territory.lux
@@ -15,10 +15,11 @@
 (abstract: .public Territory
   {}
 
-  {#name Text
-   #short Text
-   #long Text
-   #code Nat}
+  (Record
+   {#name Text
+    #short Text
+    #long Text
+    #code Nat})
 
   (template [  ]
     [(def: .public 
diff --git a/stdlib/source/library/lux/macro.lux b/stdlib/source/library/lux/macro.lux
index cdd76278b..f98f8c452 100644
--- a/stdlib/source/library/lux/macro.lux
+++ b/stdlib/source/library/lux/macro.lux
@@ -45,8 +45,8 @@
         (do {! //.monad}
           [top_level_expansion ((:as Macro' macro) args)]
           (|> top_level_expansion
-              (monad.map //.monad expansion)
-              (\ ! map list\join)))
+              (monad.each //.monad expansion)
+              (\ ! each list\conjoint)))
         
         #.None
         (\ //.monad in (list syntax))))
@@ -64,39 +64,39 @@
         (#.Some macro)
         (do //.monad
           [expansion ((:as Macro' macro) args)
-           expansion' (monad.map //.monad full_expansion expansion)]
-          (in (list\join expansion')))
+           expansion' (monad.each //.monad full_expansion expansion)]
+          (in (list\conjoint expansion')))
         
         #.None
         (do //.monad
-          [parts' (monad.map //.monad full_expansion (list& (code.identifier name) args))]
-          (in (list (code.form (list\join parts')))))))
+          [parts' (monad.each //.monad full_expansion (list& (code.identifier name) args))]
+          (in (list (code.form (list\conjoint parts')))))))
 
     [_ (#.Form (#.Item [harg targs]))]
     (do //.monad
       [harg+ (full_expansion harg)
-       targs+ (monad.map //.monad full_expansion targs)]
-      (in (list (code.form (list\compose harg+ (list\join (: (List (List Code)) targs+)))))))
+       targs+ (monad.each //.monad full_expansion targs)]
+      (in (list (code.form (list\composite harg+ (list\conjoint (: (List (List Code)) targs+)))))))
 
     [_ (#.Tuple members)]
     (do //.monad
-      [members' (monad.map //.monad full_expansion members)]
-      (in (list (code.tuple (list\join members')))))
+      [members' (monad.each //.monad full_expansion members)]
+      (in (list (code.tuple (list\conjoint members')))))
 
     [_ (#.Record members)]
     (|> members
-        (monad.map //.monad
-                   (function (_ [left right])
-                     (do //.monad
-                       [left (full_expansion left)
-                        right (full_expansion right)]
-                       (case [left right]
-                         [(#.Item left #.End) (#.Item right #.End)]
-                         (in [left right])
-
-                         _
-                         (//.failure "Record members must expand into singletons.")))))
-        (\ //.monad map (|>> code.record list)))
+        (monad.each //.monad
+                    (function (_ [left right])
+                      (do //.monad
+                        [left (full_expansion left)
+                         right (full_expansion right)]
+                        (case [left right]
+                          [(#.Item left #.End) (#.Item right #.End)]
+                          (in [left right])
+
+                          _
+                          (//.failure "Record members must expand into singletons.")))))
+        (\ //.monad each (|>> code.record list)))
 
     _
     (\ //.monad in (list syntax))))
@@ -107,7 +107,7 @@
     [id //.seed]
     (in (|> id
             (\ nat.decimal encoded)
-            ($_ text\compose "__gensym__" prefix)
+            ($_ text\composite "__gensym__" prefix)
             [""] code.identifier))))
 
 (def: (local_identifier ast)
@@ -117,22 +117,22 @@
     (\ //.monad in name)
 
     _
-    (//.failure (text\compose "Code is not a local identifier: " (code.format ast)))))
+    (//.failure (text\composite "Code is not a local identifier: " (code.format ast)))))
 
 (def: .public wrong_syntax_error
   (-> Name Text)
   (|>> name\encoded
-       (text.prefix (text\compose "Wrong syntax for " text.\''))
-       (text.suffix (text\compose text.\'' "."))))
+       (text.prefix (text\composite "Wrong syntax for " text.\''))
+       (text.suffix (text\composite text.\'' "."))))
 
 (macro: .public (with_identifiers tokens)
   (case tokens
     (^ (list [_ (#.Tuple identifiers)] body))
     (do {! //.monad}
-      [identifier_names (monad.map ! ..local_identifier identifiers)
-       .let [identifier_defs (list\join (list\map (: (-> Text (List Code))
-                                                     (function (_ name) (list (code.identifier ["" name]) (` (..identifier (~ (code.text name)))))))
-                                                  identifier_names))]]
+      [identifier_names (monad.each ! ..local_identifier identifiers)
+       .let [identifier_defs (list\conjoint (list\each (: (-> Text (List Code))
+                                                          (function (_ name) (list (code.identifier ["" name]) (` (..identifier (~ (code.text name)))))))
+                                                       identifier_names))]]
       (in (list (` ((~! do) (~! //.monad)
                     [(~+ identifier_defs)]
                     (~ body))))))
@@ -171,9 +171,9 @@
          (do //.monad
            [location //.location
             output ( token)
-            .let [_ ("lux io log" ($_ text\compose (name\encoded macro_name) " " (location.format location)))
-                  _ (list\map (|>> code.format "lux io log")
-                              output)
+            .let [_ ("lux io log" ($_ text\composite (name\encoded macro_name) " " (location.format location)))
+                  _ (list\each (|>> code.format "lux io log")
+                               output)
                   _ ("lux io log" "")]]
            (in (if omit?
                  (list)
diff --git a/stdlib/source/library/lux/macro/code.lux b/stdlib/source/library/lux/macro/code.lux
index 5de323722..b27e28c8c 100644
--- a/stdlib/source/library/lux/macro/code.lux
+++ b/stdlib/source/library/lux/macro/code.lux
@@ -108,17 +108,17 @@
     (text.format value)
 
     [_ (#.Tag name)]
-    (text\compose  "#" (\ name.codec encoded name))
+    (text\composite  "#" (\ name.codec encoded name))
 
     (^template [  ]
       [[_ ( members)]
-       ($_ text\compose
+       ($_ text\composite
            
            (list\mix (function (_ next prev)
                        (let [next (format next)]
                          (if (text\= "" prev)
                            next
-                           ($_ text\compose prev " " next))))
+                           ($_ text\composite prev " " next))))
                      ""
                      members)
            )])
@@ -126,13 +126,13 @@
      [#.Tuple "[" "]"])
 
     [_ (#.Record pairs)]
-    ($_ text\compose
+    ($_ text\composite
         "{"
         (list\mix (function (_ [left right] prev)
-                    (let [next ($_ text\compose (format left) " " (format right))]
+                    (let [next ($_ text\composite (format left) " " (format right))]
                       (if (text\= "" prev)
                         next
-                        ($_ text\compose prev " " next))))
+                        ($_ text\composite prev " " next))))
                   ""
                   pairs)
         "}")
@@ -145,15 +145,15 @@
     (case ast
       (^template []
         [[location ( parts)]
-         [location ( (list\map (replaced original substitute) parts))]])
+         [location ( (list\each (replaced original substitute) parts))]])
       ([#.Form]
        [#.Tuple])
 
       [location (#.Record parts)]
-      [location (#.Record (list\map (function (_ [left right])
-                                      [(replaced original substitute left)
-                                       (replaced original substitute right)])
-                                    parts))]
+      [location (#.Record (list\each (function (_ [left right])
+                                       [(replaced original substitute left)
+                                        (replaced original substitute right)])
+                                     parts))]
 
       _
       ast)))
diff --git a/stdlib/source/library/lux/macro/local.lux b/stdlib/source/library/lux/macro/local.lux
index d17ae7728..68e22410e 100644
--- a/stdlib/source/library/lux/macro/local.lux
+++ b/stdlib/source/library/lux/macro/local.lux
@@ -85,7 +85,7 @@
   ("lux macro"
    (function (_ _)
      (do {! meta.monad}
-       [_ (monad.map ! ..pop_one macros)
+       [_ (monad.each ! ..pop_one macros)
         _ (..pop_one self)
         compiler meta.compiler_state]
        (in (case (value@ #.expected compiler)
@@ -98,9 +98,9 @@
 (def: .public (push macros)
   (-> (List [Name Macro]) (Meta Code))
   (do meta.monad
-    [_ (monad.map meta.monad ..push_one macros)
+    [_ (monad.each meta.monad ..push_one macros)
      seed meta.seed
      g!pop (//.identifier "pop")
      _ (let [g!pop (: Name ["" (//code.format g!pop)])]
-         (..push_one [g!pop (..pop_all (list\map product.left macros) g!pop)]))]
+         (..push_one [g!pop (..pop_all (list\each product.left macros) g!pop)]))]
     (in (` ((~ g!pop))))))
diff --git a/stdlib/source/library/lux/macro/syntax.lux b/stdlib/source/library/lux/macro/syntax.lux
index 4caed5bd7..c77d67feb 100644
--- a/stdlib/source/library/lux/macro/syntax.lux
+++ b/stdlib/source/library/lux/macro/syntax.lux
@@ -31,7 +31,7 @@
       (#try.Success [tokens output])
       
       (#try.Failure error)
-      (#try.Failure ($_ text\compose
+      (#try.Failure ($_ text\composite
                         "Failed to parse: " (code.format binding) text.new_line
                         error)))))
 
@@ -73,22 +73,22 @@
           [_ (if (|> args list.size nat.even?)
                (in [])
                (meta.failure "Syntax pattern expects pairs of bindings and code-parsers."))
-           vars+parsers (monad.map !
-                                   (: (-> [Code Code] (Meta [Code Code]))
-                                      (function (_ [var parser])
-                                        (with_expansions [ (in [var
-                                                                         (` ((~! ..self_documenting) (' (~ var))
-                                                                             (~ parser)))])]
-                                          (case var
-                                            [_ (#.Identifier ["" _])]
-                                            
+           vars+parsers (monad.each !
+                                    (: (-> [Code Code] (Meta [Code Code]))
+                                       (function (_ [var parser])
+                                         (with_expansions [ (in [var
+                                                                          (` ((~! ..self_documenting) (' (~ var))
+                                                                              (~ parser)))])]
+                                           (case var
+                                             [_ (#.Identifier ["" _])]
+                                             
 
-                                            [_ (#.Identifier _)]
-                                            (in [var parser])
+                                             [_ (#.Identifier _)]
+                                             (in [var parser])
 
-                                            _
-                                            ))))
-                                   (list.pairs args))
+                                             _
+                                             ))))
+                                    (list.pairs args))
            this_module meta.current_module_name
            .let [g!state (code.identifier ["" "*lux*"])
                  error_msg (code.text (macro.wrong_syntax_error [this_module name]))]]
diff --git a/stdlib/source/library/lux/macro/syntax/annotations.lux b/stdlib/source/library/lux/macro/syntax/annotations.lux
index 29ef222c2..acfaabd37 100644
--- a/stdlib/source/library/lux/macro/syntax/annotations.lux
+++ b/stdlib/source/library/lux/macro/syntax/annotations.lux
@@ -31,7 +31,7 @@
 (def: .public format
   (-> Annotations Code)
   (let [entry (product.then code.tag function.identity)]
-    (|>> (list\map entry)
+    (|>> (list\each entry)
          code.record)))
 
 (def: .public parser
diff --git a/stdlib/source/library/lux/macro/syntax/check.lux b/stdlib/source/library/lux/macro/syntax/check.lux
index 8c045da18..18b0049ee 100644
--- a/stdlib/source/library/lux/macro/syntax/check.lux
+++ b/stdlib/source/library/lux/macro/syntax/check.lux
@@ -18,8 +18,9 @@
   "lux check")
 
 (type: .public Check
-  {#type Code
-   #value Code})
+  (Record
+   {#type Code
+    #value Code}))
 
 (def: .public equivalence
   (Equivalence Check)
diff --git a/stdlib/source/library/lux/macro/syntax/declaration.lux b/stdlib/source/library/lux/macro/syntax/declaration.lux
index 004398916..ae6ae3ee7 100644
--- a/stdlib/source/library/lux/macro/syntax/declaration.lux
+++ b/stdlib/source/library/lux/macro/syntax/declaration.lux
@@ -15,8 +15,9 @@
      ["." code]]]])
 
 (type: .public Declaration
-  {#name Text
-   #arguments (List Text)})
+  (Record
+   {#name Text
+    #arguments (List Text)}))
 
 (def: .public equivalence
   (Equivalence Declaration)
@@ -40,4 +41,4 @@
       g!name
       
       arguments
-      (` ((~ g!name) (~+ (list\map code.local_identifier arguments)))))))
+      (` ((~ g!name) (~+ (list\each code.local_identifier arguments)))))))
diff --git a/stdlib/source/library/lux/macro/syntax/definition.lux b/stdlib/source/library/lux/macro/syntax/definition.lux
index 601f44283..ee7238603 100644
--- a/stdlib/source/library/lux/macro/syntax/definition.lux
+++ b/stdlib/source/library/lux/macro/syntax/definition.lux
@@ -26,11 +26,12 @@
    ["#." check (#+ Check)]])
 
 (type: .public Definition
-  {#name Text
-   #value (Either Check
-                  Code)
-   #anns Annotations
-   #export? Bit})
+  (Record
+   {#name Text
+    #value (Either Check
+                   Code)
+    #anns Annotations
+    #export? Bit}))
 
 (def: .public equivalence
   (Equivalence Definition)
diff --git a/stdlib/source/library/lux/macro/syntax/input.lux b/stdlib/source/library/lux/macro/syntax/input.lux
index 58675bbf7..47bf4d6ac 100644
--- a/stdlib/source/library/lux/macro/syntax/input.lux
+++ b/stdlib/source/library/lux/macro/syntax/input.lux
@@ -12,8 +12,9 @@
      ["." code]]]])
 
 (type: .public Input
-  {#binding Code
-   #type Code})
+  (Record
+   {#binding Code
+    #type Code}))
 
 (def: .public equivalence
   (Equivalence Input)
diff --git a/stdlib/source/library/lux/macro/template.lux b/stdlib/source/library/lux/macro/template.lux
index aea5bfb5c..65b4f96ba 100644
--- a/stdlib/source/library/lux/macro/template.lux
+++ b/stdlib/source/library/lux/macro/template.lux
@@ -36,12 +36,12 @@
                                body .any])
   (do {! meta.monad}
     [g!locals (|> locals
-                  (list\map //.identifier)
+                  (list\each //.identifier)
                   (monad.all !))]
     (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))]
+                                            (list\each (function (_ [name identifier])
+                                                         (list (code.local_identifier name) (as_is identifier))))
+                                            list\conjoint))]
                    (~ body)))))))
 
 (def: (name_side module_side? parser)
@@ -68,11 +68,11 @@
           full_tag
           (<>.either .local_tag
                      full_tag))
-        (<>\map bit\encoded .bit)
-        (<>\map nat\encoded .nat)
-        (<>\map int\encoded .int)
-        (<>\map rev\encoded .rev)
-        (<>\map frac\encoded .frac)
+        (<>\each bit\encoded .bit)
+        (<>\each nat\encoded .nat)
+        (<>\each int\encoded .int)
+        (<>\each rev\encoded .rev)
+        (<>\each frac\encoded .frac)
         )))
 
 (def: (part module_side?)
@@ -113,24 +113,25 @@
 
     (^template []
       [[meta ( elems)]
-       [meta ( (list\map (applied env) elems))]])
+       [meta ( (list\each (applied env) elems))]])
     ([#.Tuple]
      [#.Form])
 
     [meta (#.Record members)]
-    [meta (#.Record (list\map (: (-> [Code Code] [Code Code])
-                                 (function (_ [key value])
-                                   [(applied env key)
-                                    (applied env value)]))
-                              members))]
+    [meta (#.Record (list\each (: (-> [Code Code] [Code Code])
+                                  (function (_ [key value])
+                                    [(applied env key)
+                                     (applied env value)]))
+                               members))]
 
     _
     template))
 
 (type: Local
-  {#name Text
-   #parameters (List Text)
-   #template (List Code)})
+  (Record
+   {#name Text
+    #parameters (List Text)
+    #template (List Code)}))
 
 (exception: .public (irregular_arguments {expected Nat} {actual Nat})
   (exception.report
@@ -147,7 +148,7 @@
          (.let [environment (: Environment
                                (|> (list.zipped/2 parameters inputs)
                                    (dictionary.of_list text.hash)))]
-           (#.Right [compiler (list\map (..applied environment) template)]))
+           (#.Right [compiler (list\each (..applied environment) template)]))
          (exception.except ..irregular_arguments [parameters_amount inputs_amount]))))))
 
 (def: local
@@ -172,10 +173,10 @@
 
                                            (#.Some _)
                                            true)])))
-     g!pop (local.push (list\map (function (_ local)
-                                   [[here_name (value@ #name local)]
-                                    (..macro local)])
-                                 locals))]
+     g!pop (local.push (list\each (function (_ local)
+                                    [[here_name (value@ #name local)]
+                                     (..macro local)])
+                                  locals))]
     (if expression?
       (//.with_identifiers [g!body]
         (in (list (` (.let [(~ g!body) (~ body)]
diff --git a/stdlib/source/library/lux/math/infix.lux b/stdlib/source/library/lux/math/infix.lux
index d2a210e7b..c2847d72e 100644
--- a/stdlib/source/library/lux/math/infix.lux
+++ b/stdlib/source/library/lux/math/infix.lux
@@ -19,22 +19,23 @@
       ["i" int]]]]])
 
 (type: #rec Infix
-  (#Const Code)
-  (#Call (List Code))
-  (#Unary Code Infix)
-  (#Binary Infix Code Infix))
+  (Variant
+   (#Const Code)
+   (#Call (List Code))
+   (#Unary Code Infix)
+   (#Binary Infix Code Infix)))
 
 (def: literal
   (Parser Code)
   ($_ <>.either
-      (<>\map code.bit .bit)
-      (<>\map code.nat .nat)
-      (<>\map code.int .int)
-      (<>\map code.rev .rev)
-      (<>\map code.frac .frac)
-      (<>\map code.text .text)
-      (<>\map code.identifier .identifier)
-      (<>\map code.tag .tag)))
+      (<>\each code.bit .bit)
+      (<>\each code.nat .nat)
+      (<>\each code.int .int)
+      (<>\each code.rev .rev)
+      (<>\each code.frac .frac)
+      (<>\each code.text .text)
+      (<>\each code.identifier .identifier)
+      (<>\each code.tag .tag)))
 
 (def: expression
   (Parser Infix)
diff --git a/stdlib/source/library/lux/math/logic/continuous.lux b/stdlib/source/library/lux/math/logic/continuous.lux
index 6f7e4d116..57f3572b5 100644
--- a/stdlib/source/library/lux/math/logic/continuous.lux
+++ b/stdlib/source/library/lux/math/logic/continuous.lux
@@ -20,7 +20,7 @@
      (Monoid Rev)
 
      (def: identity )
-     (def: compose ))]
+     (def: composite ))]
 
   [or  /.max disjunction ..false]
   [and /.min conjunction ..true]
diff --git a/stdlib/source/library/lux/math/logic/fuzzy.lux b/stdlib/source/library/lux/math/logic/fuzzy.lux
index 5a21a6e39..4c3745470 100644
--- a/stdlib/source/library/lux/math/logic/fuzzy.lux
+++ b/stdlib/source/library/lux/math/logic/fuzzy.lux
@@ -22,7 +22,7 @@
 (implementation: .public functor
   (contravariant.Functor Fuzzy)
   
-  (def: (map f fb)
+  (def: (each f fb)
     (|>> f fb)))
 
 (template [ ]
diff --git a/stdlib/source/library/lux/math/modular.lux b/stdlib/source/library/lux/math/modular.lux
index 9a94151c4..acfdbab2d 100644
--- a/stdlib/source/library/lux/math/modular.lux
+++ b/stdlib/source/library/lux/math/modular.lux
@@ -30,8 +30,9 @@
 (abstract: .public (Mod m)
   {}
 
-  {#modulus (Modulus m)
-   #value Int}
+  (Record
+   {#modulus (Modulus m)
+    #value Int})
 
   (def: .public (modular modulus value)
     (All [%] (-> (Modulus %) Int (Mod %)))
@@ -66,7 +67,7 @@
 
     (def: (encoded modular)
       (let [[_ value] (:representation modular)]
-        ($_ text\compose
+        ($_ text\composite
             (i\encoded value)
             ..separator
             (i\encoded (//.divisor expected)))))
@@ -125,7 +126,7 @@
 
        (def: identity
          (..modular modulus ))
-       (def: compose
+       (def: composite
          ))]
     
     [..+ +0 addition]
diff --git a/stdlib/source/library/lux/math/number/complex.lux b/stdlib/source/library/lux/math/number/complex.lux
index 324b84d43..b3418da98 100644
--- a/stdlib/source/library/lux/math/number/complex.lux
+++ b/stdlib/source/library/lux/math/number/complex.lux
@@ -23,8 +23,9 @@
       ["." int]]]]])
 
 (type: .public Complex
-  {#real Frac
-   #imaginary Frac})
+  (Record
+   {#real Frac
+    #imaginary Frac}))
 
 (syntax: .public (complex [real .any
                            ?imaginary (<>.maybe .any)])
@@ -292,16 +293,16 @@
           nth_phi (|> input ..argument (f./ r_nth))
           slice (|> math.pi (f.* +2.0) (f./ r_nth))]
       (|> (list.indices nth)
-          (list\map (function (_ nth')
-                      (let [inner (|> nth' .int int.frac
-                                      (f.* slice)
-                                      (f.+ nth_phi))
-                            real (f.* nth_root_of_abs
-                                      (math.cos inner))
-                            imaginary (f.* nth_root_of_abs
-                                           (math.sin inner))]
-                        {#real real
-                         #imaginary imaginary})))))))
+          (list\each (function (_ nth')
+                       (let [inner (|> nth' .int int.frac
+                                       (f.* slice)
+                                       (f.+ nth_phi))
+                             real (f.* nth_root_of_abs
+                                       (math.cos inner))
+                             imaginary (f.* nth_root_of_abs
+                                            (math.sin inner))]
+                         {#real real
+                          #imaginary imaginary})))))))
 
 (def: .public (approximately? margin_of_error standard value)
   (-> Frac Complex Complex Bit)
diff --git a/stdlib/source/library/lux/math/number/frac.lux b/stdlib/source/library/lux/math/number/frac.lux
index 4e5eee846..7c4f1d8b1 100644
--- a/stdlib/source/library/lux/math/number/frac.lux
+++ b/stdlib/source/library/lux/math/number/frac.lux
@@ -150,12 +150,12 @@
         (..- f2^-52)
         (..* f2^+1023))))
 
-(template [  ]
+(template [  ]
   [(implementation: .public 
      (Monoid Frac)
      
      (def: identity )
-     (def: compose ))]
+     (def: composite ))]
 
   [addition       ..+   +0.0]
   [multiplication ..*   +1.0]
diff --git a/stdlib/source/library/lux/math/number/i64.lux b/stdlib/source/library/lux/math/number/i64.lux
index 3f02cb4bd..e1706c217 100644
--- a/stdlib/source/library/lux/math/number/i64.lux
+++ b/stdlib/source/library/lux/math/number/i64.lux
@@ -130,12 +130,12 @@
 
   (def: hash .nat))
 
-(template [  ]
+(template [  ]
   [(implementation: .public 
      (All [a] (Monoid (I64 a)))
 
      (def: identity )
-     (def: compose ))]
+     (def: composite ))]
 
   [disjunction ..false ..or]
   [conjunction ..true ..and]
diff --git a/stdlib/source/library/lux/math/number/int.lux b/stdlib/source/library/lux/math/number/int.lux
index 657780bd9..91eaa9de4 100644
--- a/stdlib/source/library/lux/math/number/int.lux
+++ b/stdlib/source/library/lux/math/number/int.lux
@@ -187,12 +187,12 @@
     ... -9,223,372,036,854,775,808
     (//i64.left_shifted 63 +1)))
 
-(template [  ]
+(template [  ]
   [(implementation: .public 
      (Monoid Int)
      
      (def: identity )
-     (def: compose ))]
+     (def: composite ))]
 
   [addition       ..+   +0]
   [multiplication ..*   +1]
@@ -220,13 +220,13 @@
              (|> repr
                  ("lux text clip" 1 (-- input_size))
                  (\  decoded)
-                 (\ try.functor map .int))
+                 (\ try.functor each .int))
              
              (^ (static ..-sign))
              (|> repr
                  ("lux text clip" 1 (-- input_size))
                  (\  decoded)
-                 (\ try.functor map (|>> -- .int ..opposite --)))
+                 (\ try.functor each (|>> -- .int ..opposite --)))
              
              _
              (#try.Failure ))
diff --git a/stdlib/source/library/lux/math/number/nat.lux b/stdlib/source/library/lux/math/number/nat.lux
index 2ec9333b7..0794950b4 100644
--- a/stdlib/source/library/lux/math/number/nat.lux
+++ b/stdlib/source/library/lux/math/number/nat.lux
@@ -168,12 +168,12 @@
   (def: top (-- 0))
   (def: bottom 0))
 
-(template [  ]
+(template [  ]
   [(implementation: .public 
      (Monoid Nat)
      
      (def: identity )
-     (def: compose ))]
+     (def: composite ))]
 
   [addition       ..+   0]
   [multiplication ..*   1]
diff --git a/stdlib/source/library/lux/math/number/ratio.lux b/stdlib/source/library/lux/math/number/ratio.lux
index 6ab6d1349..6be8bce44 100644
--- a/stdlib/source/library/lux/math/number/ratio.lux
+++ b/stdlib/source/library/lux/math/number/ratio.lux
@@ -23,8 +23,9 @@
    ["n" nat ("#\." decimal)]])
 
 (type: .public Ratio
-  {#numerator Nat
-   #denominator Nat})
+  (Record
+   {#numerator Nat
+    #denominator Nat}))
 
 (def: .public (nat value)
   (-> Ratio (Maybe Nat))
@@ -131,7 +132,7 @@
   (Codec Text Ratio)
   
   (def: (encoded (^slots [#numerator #denominator]))
-    ($_ text\compose (n\encoded numerator) ..separator (n\encoded denominator)))
+    ($_ text\composite (n\encoded numerator) ..separator (n\encoded denominator)))
 
   (def: (decoded input)
     (case (text.split_by ..separator input)
@@ -143,14 +144,14 @@
                      #denominator denominator})))
       
       #.None
-      (#.Left (text\compose "Invalid syntax for ratio: " input)))))
+      (#.Left (text\composite "Invalid syntax for ratio: " input)))))
 
-(template [  ]
+(template [  ]
   [(implementation: .public 
      (Monoid Ratio)
 
      (def: identity (..ratio ))
-     (def: compose ))]
+     (def: composite ))]
   
   [0 ..+ addition]
   [1 ..* multiplication]
diff --git a/stdlib/source/library/lux/math/number/rev.lux b/stdlib/source/library/lux/math/number/rev.lux
index b4bf8bcd2..a65025c0b 100644
--- a/stdlib/source/library/lux/math/number/rev.lux
+++ b/stdlib/source/library/lux/math/number/rev.lux
@@ -205,12 +205,12 @@
   (def: top (.rev -1))
   (def: bottom (.rev 0)))
 
-(template [  ]
+(template [  ]
   [(implementation: .public 
      (Monoid Rev)
      
      (def: identity (\ interval ))
-     (def: compose ))]
+     (def: composite ))]
 
   [addition ..+   bottom]
   [maximum  ..max bottom]
diff --git a/stdlib/source/library/lux/math/random.lux b/stdlib/source/library/lux/math/random.lux
index 3e9b14b8c..2f83a8d00 100644
--- a/stdlib/source/library/lux/math/random.lux
+++ b/stdlib/source/library/lux/math/random.lux
@@ -46,7 +46,7 @@
 (implementation: .public functor
   (Functor Random)
   
-  (def: (map f fa)
+  (def: (each f fa)
     (function (_ state)
       (let [[state' a] (fa state)]
         [state' (f a)]))))
@@ -71,7 +71,7 @@
     (function (_ state)
       [state a]))
 
-  (def: (join ffa)
+  (def: (conjoint ffa)
     (function (_ state)
       (let [[state' fa] (ffa state)]
         (fa state')))))
@@ -125,7 +125,7 @@
 (template [  ]
   [(def: .public 
      (Random )
-     (\ ..monad map  ..i64))]
+     (\ ..monad each  ..i64))]
 
   [nat Nat .nat]
   [int Int .int]
@@ -134,13 +134,13 @@
 
 (def: .public frac
   (Random Frac)
-  (\ ..monad map (|>> .i64 f.of_bits) ..nat))
+  (\ ..monad each (|>> .i64 f.of_bits) ..nat))
 
 (def: .public safe_frac
   (Random Frac)
   (let [mantissa_range (.int (i64.left_shifted 53 1))
         mantissa_max (i.frac (-- mantissa_range))]
-    (\ ..monad map
+    (\ ..monad each
        (|>> (i.% mantissa_range)
             i.frac
             (f./ mantissa_max))
@@ -154,7 +154,7 @@
         in_range (: (-> Char Char)
                     (|>> (n.% size) (n.+ start)))]
     (|> ..nat
-        (\ ..monad map in_range)
+        (\ ..monad each in_range)
         (..only (unicode.member? set)))))
 
 (def: .public (text char_gen size)
@@ -164,7 +164,7 @@
     (do ..monad
       [x char_gen
        xs (text char_gen (-- size))]
-      (in (text\compose (text.of_char x) xs)))))
+      (in (text\composite (text.of_char x) xs)))))
 
 (template [ ]
   [(def: .public 
@@ -292,19 +292,19 @@
 
 (def: .public instant
   (Random Instant)
-  (\ ..monad map instant.of_millis ..int))
+  (\ ..monad each instant.of_millis ..int))
 
 (def: .public date
   (Random Date)
-  (\ ..monad map instant.date ..instant))
+  (\ ..monad each instant.date ..instant))
 
 (def: .public time
   (Random Time)
-  (\ ..monad map instant.time ..instant))
+  (\ ..monad each instant.time ..instant))
 
 (def: .public duration
   (Random Duration)
-  (\ ..monad map duration.of_millis ..int))
+  (\ ..monad each duration.of_millis ..int))
 
 (def: .public month
   (Random Month)
diff --git a/stdlib/source/library/lux/meta.lux b/stdlib/source/library/lux/meta.lux
index 13b7d9937..103796a2e 100644
--- a/stdlib/source/library/lux/meta.lux
+++ b/stdlib/source/library/lux/meta.lux
@@ -31,7 +31,7 @@
 (implementation: .public functor
   (Functor Meta)
   
-  (def: (map f fa)
+  (def: (each f fa)
     (function (_ lux)
       (case (fa lux)
         (#try.Failure msg)
@@ -68,7 +68,7 @@
     (function (_ lux)
       (#try.Success [lux x])))
   
-  (def: (join mma)
+  (def: (conjoint mma)
     (function (_ lux)
       (case (mma lux)
         (#try.Failure msg)
@@ -121,7 +121,7 @@
       (#try.Success [lux module])
 
       _
-      (#try.Failure ($_ text\compose "Unknown module: " name)))))
+      (#try.Failure ($_ text\composite "Unknown module: " name)))))
 
 (def: .public current_module_name
   (Meta Text)
@@ -137,8 +137,8 @@
   (Meta Module)
   (let [(^open "\.") ..monad]
     (|> ..current_module_name
-        (\map ..module)
-        \join)))
+        (\each ..module)
+        \conjoint)))
 
 (def: (macro_type? type)
   (-> Type Bit)
@@ -265,7 +265,7 @@
         ((clean_type var_type) lux)
 
         #.None
-        (#try.Failure ($_ text\compose "Unknown variable: " name))))))
+        (#try.Failure ($_ text\composite "Unknown variable: " name))))))
 
 (def: without_lux_runtime
   (-> (List Text) (List Text))
@@ -275,7 +275,7 @@
 
 (def: listing_separator
   Text
-  ($_ text\compose text.new_line "                    "))
+  ($_ text\composite text.new_line "                    "))
 
 (def: module_listing
   (-> (List Text) Text)
@@ -302,28 +302,28 @@
         (let [current_module (|> lux (value@ #.current_module) (maybe.else "???"))
               all_known_modules (|> lux
                                     (value@ #.modules)
-                                    (list\map product.left)
+                                    (list\each product.left)
                                     ..module_listing)]
-          (#try.Failure ($_ text\compose
+          (#try.Failure ($_ text\composite
                             "Unknown definition: " (name\encoded name) text.new_line
                             "    Current module: " current_module text.new_line
                             (case (plist.value current_module (value@ #.modules lux))
                               (#.Some this_module)
                               (let [candidates (|> lux
                                                    (value@ #.modules)
-                                                   (list\map (function (_ [module_name module])
-                                                               (|> module
-                                                                   (value@ #.definitions)
-                                                                   (list.all (function (_ [def_name global])
-                                                                               (case global
-                                                                                 (#.Definition [exported? _ _ _])
-                                                                                 (if (and exported?
-                                                                                          (text\= normal_short def_name))
-                                                                                   (#.Some (name\encoded [module_name def_name]))
-                                                                                   #.None)
-
-                                                                                 (#.Alias _)
-                                                                                 #.None))))))
+                                                   (list\each (function (_ [module_name module])
+                                                                (|> module
+                                                                    (value@ #.definitions)
+                                                                    (list.all (function (_ [def_name global])
+                                                                                (case global
+                                                                                  (#.Definition [exported? _ _ _])
+                                                                                  (if (and exported?
+                                                                                           (text\= normal_short def_name))
+                                                                                    (#.Some (name\encoded [module_name def_name]))
+                                                                                    #.None)
+
+                                                                                  (#.Alias _)
+                                                                                  #.None))))))
                                                    list.together
                                                    (list.sorted text\<)
                                                    (text.interposed ..listing_separator))
@@ -332,10 +332,10 @@
                                                 ..module_listing)
                                     aliases (|> this_module
                                                 (value@ #.module_aliases)
-                                                (list\map (function (_ [alias real]) ($_ text\compose alias " => " real)))
+                                                (list\each (function (_ [alias real]) ($_ text\composite alias " => " real)))
                                                 (list.sorted text\<)
                                                 (text.interposed ..listing_separator))]
-                                ($_ text\compose
+                                ($_ text\composite
                                     "        Candidates: " candidates text.new_line
                                     "           Imports: " imports text.new_line
                                     "           Aliases: " aliases text.new_line))
@@ -350,7 +350,7 @@
     [definition (..definition name)]
     (case definition
       (#.Left de_aliased)
-      (failure ($_ text\compose
+      (failure ($_ text\composite
                    "Aliases are not considered exports: "
                    (name\encoded name)))
       
@@ -358,7 +358,7 @@
       (let [[exported? def_type def_data def_value] definition]
         (if exported?
           (in definition)
-          (failure ($_ text\compose "Definition is not an export: " (name\encoded name))))))))
+          (failure ($_ text\composite "Definition is not an export: " (name\encoded name))))))))
 
 (def: .public (definition_type name)
   (-> Name (Meta Type))
@@ -396,21 +396,21 @@
                    (type_code .Type)
                    (type_code def_type)))
           (in (:as Type def_value))
-          (..failure ($_ text\compose "Definition is not a type: " (name\encoded name))))))))
+          (..failure ($_ text\composite "Definition is not a type: " (name\encoded name))))))))
 
 (def: .public (globals module)
   (-> Text (Meta (List [Text Global])))
   (function (_ lux)
     (case (plist.value module (value@ #.modules lux))
       #.None
-      (#try.Failure ($_ text\compose "Unknown module: " module))
+      (#try.Failure ($_ text\composite "Unknown module: " module))
       
       (#.Some module)
       (#try.Success [lux (value@ #.definitions module)]))))
 
 (def: .public (definitions module)
   (-> Text (Meta (List [Text Definition])))
-  (\ ..monad map
+  (\ ..monad each
      (list.all (function (_ [name global])
                  (case global
                    (#.Left de_aliased)
@@ -479,7 +479,7 @@
 
 (def: .public (imported? import)
   (-> Text (Meta Bit))
-  (\ ..functor map
+  (\ ..functor each
      (|>> (value@ #.imports) (list.any? (text\= import)))
      ..current_module))
 
@@ -495,14 +495,14 @@
       (if (or (text\= this_module_name module)
               (and imported! exported?))
         (in [idx tag_list type])
-        (..failure ($_ text\compose "Cannot access tag: " (name\encoded tag_name) " from module " this_module_name)))
+        (..failure ($_ text\composite "Cannot access tag: " (name\encoded tag_name) " from module " this_module_name)))
 
       _
-      (..failure ($_ text\compose
+      (..failure ($_ text\composite
                      "Unknown tag: " (name\encoded tag_name) text.new_line
                      " Known tags: " (|> =module
                                          (value@ #.tags)
-                                         (list\map (|>> product.left [module] name\encoded (text.prefix text.new_line)))
+                                         (list\each (|>> product.left [module] name\encoded (text.prefix text.new_line)))
                                          text.together)
                      )))))
 
@@ -515,8 +515,8 @@
             (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]))))))
+            (list\each (function (_ [type_name [tag_list exported? type]])
+                         [tag_list type]))))))
 
 (def: .public locals
   (Meta (List (List [Text Type])))
@@ -527,10 +527,10 @@
 
       (#.Some scopes)
       (#try.Success [lux
-                     (list\map (|>> (value@ [#.locals #.mappings])
-                                    (list\map (function (_ [name [type _]])
-                                                [name type])))
-                               scopes)]))))
+                     (list\each (|>> (value@ [#.locals #.mappings])
+                                     (list\each (function (_ [name [type _]])
+                                                  [name type])))
+                                scopes)]))))
 
 (def: .public (de_aliased def_name)
   (-> Name (Meta Name))
@@ -565,6 +565,6 @@
 (def: .public (eval type code)
   (-> Type Code (Meta Any))
   (do {! ..monad}
-    [eval (\ ! map (value@ #.eval)
+    [eval (\ ! each (value@ #.eval)
              ..compiler_state)]
     (eval type code)))
diff --git a/stdlib/source/library/lux/meta/annotation.lux b/stdlib/source/library/lux/meta/annotation.lux
index c73cc9247..292445ea8 100644
--- a/stdlib/source/library/lux/meta/annotation.lux
+++ b/stdlib/source/library/lux/meta/annotation.lux
@@ -71,7 +71,6 @@
 
   [implementation? #.implementation?]
   [recursive_type? #.type_rec?]
-  [interface?      #.interface?]
   )
 
 (def: (text_parser input)
@@ -89,7 +88,7 @@
      (<| (maybe.else (list))
          (do {! maybe.monad}
            [args (..tuple (name_of ) ann)]
-           (monad.map ! ..text_parser args))))]
+           (monad.each ! ..text_parser args))))]
 
   [function_arguments #.func_args]
   [type_arguments     #.type_args]
diff --git a/stdlib/source/library/lux/program.lux b/stdlib/source/library/lux/program.lux
index 87e80b27b..f53788682 100644
--- a/stdlib/source/library/lux/program.lux
+++ b/stdlib/source/library/lux/program.lux
@@ -20,8 +20,9 @@
      ["." code]]]])
 
 (type: Arguments
-  (#Raw Text)
-  (#Parsed (List Code)))
+  (Variant
+   (#Raw Text)
+   (#Parsed (List Code))))
 
 (def: arguments^
   (.Parser Arguments)
diff --git a/stdlib/source/library/lux/static.lux b/stdlib/source/library/lux/static.lux
index 0a506ef2d..a332842ed 100644
--- a/stdlib/source/library/lux/static.lux
+++ b/stdlib/source/library/lux/static.lux
@@ -16,7 +16,7 @@
 
 (template [  ]
   [(syntax: .public ( [expression .any])
-     (\ meta.monad map
+     (\ meta.monad each
         (|>> (:as )  list)
         (meta.eval  expression)))]
 
diff --git a/stdlib/source/library/lux/target/common_lisp.lux b/stdlib/source/library/lux/target/common_lisp.lux
index 3019924da..5a5b10a06 100644
--- a/stdlib/source/library/lux/target/common_lisp.lux
+++ b/stdlib/source/library/lux/target/common_lisp.lux
@@ -60,8 +60,9 @@
     )
 
   (type: .public Lambda
-    {#input Var/*
-     #output (Expression Any)})
+    (Record
+     {#input Var/*
+      #output (Expression Any)}))
 
   (def: .public nil
     Literal
@@ -146,7 +147,7 @@
 
   (def: .public args
     (-> (List Var/1) Var/*)
-    (|>> (list\map ..code)
+    (|>> (list\each ..code)
          (text.interposed " ")
          ..as_form
          :abstraction))
@@ -159,7 +160,7 @@
           
           (#.Item _)
           (|> singles
-              (list\map ..code)
+              (list\each ..code)
               (text.interposed " ")
               (text.suffix " ")))
         (format "&rest " (:representation rest))
@@ -168,7 +169,7 @@
 
   (def: form
     (-> (List (Expression Any)) Expression)
-    (|>> (list\map ..code)
+    (|>> (list\each ..code)
          (text.interposed " ")
          ..as_form
          :abstraction))
@@ -189,9 +190,9 @@
   (def: .public (labels definitions body)
     (-> (List [Var/1 Lambda]) (Expression Any) (Computation Any))
     (..form (list (..var "labels")
-                  (..form (list\map (function (_ [def_name [def_args def_body]])
-                                      (..form (list def_name (:transmutation def_args) def_body)))
-                                    definitions))
+                  (..form (list\each (function (_ [def_name [def_args def_body]])
+                                       (..form (list def_name (:transmutation def_args) def_body)))
+                                     definitions))
                   body)))
 
   (def: .public (destructuring_bind [bindings expression] body)
@@ -349,8 +350,8 @@
        (-> (List [Var/1 (Expression Any)]) (List (Expression Any)) (Computation Any))
        (..form (list& (..var )
                       (|> bindings
-                          (list\map (function (_ [name value])
-                                      (..form (list name value))))
+                          (list\each (function (_ [name value])
+                                       (..form (list name value))))
                           ..form)
                       body)))]
 
@@ -385,19 +386,20 @@
     (..form (list (..var "setf") access value)))
 
   (type: .public Handler
-    {#condition_type (Expression Any)
-     #condition Var/1
-     #body (Expression Any)})
+    (Record
+     {#condition_type (Expression Any)
+      #condition Var/1
+      #body (Expression Any)}))
   
   (def: .public (handler_case handlers body)
     (-> (List Handler) (Expression Any) (Computation Any))
     (..form (list& (..var "handler-case")
                    body
-                   (list\map (function (_ [type condition handler])
-                               (..form (list type
-                                             (:transmutation (..args (list condition)))
-                                             handler)))
-                             handlers))))
+                   (list\each (function (_ [type condition handler])
+                                (..form (list type
+                                              (:transmutation (..args (list condition)))
+                                              handler)))
+                              handlers))))
 
   (template [ ]
     [(def: .public ( conditions expression)
@@ -412,7 +414,7 @@
          
          _
          (:abstraction
-          (format  (|> conditions (list\map ..symbol)
+          (format  (|> conditions (list\each ..symbol)
                                (list& (..symbol "or")) ..form
                                :representation)
                   " " (:representation expression)))))]
@@ -439,10 +441,10 @@
   (def: .public (cond clauses else)
     (-> (List [(Expression Any) (Expression Any)]) (Expression Any) (Computation Any))
     (..form (list& (..var "cond")
-                   (list\compose (list\map (function (_ [test then])
-                                             (..form (list test then)))
-                                           clauses)
-                                 (list (..form (list (..bool true) else)))))))
+                   (list\composite (list\each (function (_ [test then])
+                                                (..form (list test then)))
+                                              clauses)
+                                   (list (..form (list (..bool true) else)))))))
 
   (def: .public tag
     (-> Text Tag)
diff --git a/stdlib/source/library/lux/target/js.lux b/stdlib/source/library/lux/target/js.lux
index b2af12ac2..7a1f5b3bc 100644
--- a/stdlib/source/library/lux/target/js.lux
+++ b/stdlib/source/library/lux/target/js.lux
@@ -119,7 +119,7 @@
 
   (def: .public array
     (-> (List Expression) Computation)
-    (|>> (list\map ..code)
+    (|>> (list\each ..code)
          (text.interposed ..argument_separator)
          ..element
          :abstraction))
@@ -139,7 +139,7 @@
   (def: .public (apply/* function inputs)
     (-> Expression (List Expression) Computation)
     (|> inputs
-        (list\map ..code)
+        (list\each ..code)
         (text.interposed ..argument_separator)
         ..expression
         (format (:representation function))
@@ -151,8 +151,8 @@
 
   (def: .public object
     (-> (List [Text Expression]) Computation)
-    (|>> (list\map (.function (_ [key val])
-                     (format (:representation (..string key)) ..field_separator (:representation val))))
+    (|>> (list\each (.function (_ [key val])
+                      (format (:representation (..string key)) ..field_separator (:representation val))))
          (text.interposed ..argument_separator)
          (text.enclosed ["{" "}"])
          ..expression
@@ -184,7 +184,7 @@
         ..block
         (format "function " (:representation name)
                 (|> inputs
-                    (list\map ..code)
+                    (list\each ..code)
                     (text.interposed ..argument_separator)
                     ..expression)
                 " ")
@@ -203,7 +203,7 @@
         ..block
         (format "function"
                 (|> inputs
-                    (list\map ..code)
+                    (list\each ..code)
                     (text.interposed ..argument_separator)
                     ..expression)
                 " ")
@@ -285,7 +285,7 @@
     (-> Expression (List Expression) Computation)
     (|> (format "new " (:representation constructor)
                 (|> inputs
-                    (list\map ..code)
+                    (list\each ..code)
                     (text.interposed ..argument_separator)
                     ..expression))
         ..expression
@@ -408,11 +408,11 @@
     (-> Expression (List [(List Literal) Statement]) (Maybe Statement) Statement)
     (:abstraction (format "switch (" (:representation input) ") "
                           (|> (format (|> cases
-                                          (list\map (.function (_ [when then])
-                                                      (format (|> when
-                                                                  (list\map (|>> :representation (text.enclosed ["case " ":"])))
-                                                                  (text.interposed text.new_line))
-                                                              (..nested (:representation then)))))
+                                          (list\each (.function (_ [when then])
+                                                       (format (|> when
+                                                                   (list\each (|>> :representation (text.enclosed ["case " ":"])))
+                                                                   (text.interposed text.new_line))
+                                                               (..nested (:representation then)))))
                                           (text.interposed text.new_line))
                                       text.new_line
                                       (case default
diff --git a/stdlib/source/library/lux/target/jvm.lux b/stdlib/source/library/lux/target/jvm.lux
index 1ada0da04..ce273f401 100644
--- a/stdlib/source/library/lux/target/jvm.lux
+++ b/stdlib/source/library/lux/target/jvm.lux
@@ -10,275 +10,304 @@
        ["." category (#+ Primitive Class Value Method)]]]]]])
 
 (type: .public Literal
-  (#Boolean Bit)
-  (#Int Int)
-  (#Long Int)
-  (#Double Frac)
-  (#Char Nat)
-  (#String Text))
+  (Variant
+   (#Boolean Bit)
+   (#Int Int)
+   (#Long Int)
+   (#Double Frac)
+   (#Char Nat)
+   (#String Text)))
 
 (type: .public Constant
-  (#BIPUSH Int)
-  
-  (#SIPUSH Int)
-
-  #ICONST_M1
-  #ICONST_0
-  #ICONST_1
-  #ICONST_2
-  #ICONST_3
-  #ICONST_4
-  #ICONST_5
-
-  #LCONST_0
-  #LCONST_1
-  
-  #FCONST_0
-  #FCONST_1
-  #FCONST_2
-  
-  #DCONST_0
-  #DCONST_1
-  
-  #ACONST_NULL
-
-  (#LDC Literal))
+  (Variant
+   (#BIPUSH Int)
+   
+   (#SIPUSH Int)
+
+   #ICONST_M1
+   #ICONST_0
+   #ICONST_1
+   #ICONST_2
+   #ICONST_3
+   #ICONST_4
+   #ICONST_5
+
+   #LCONST_0
+   #LCONST_1
+   
+   #FCONST_0
+   #FCONST_1
+   #FCONST_2
+   
+   #DCONST_0
+   #DCONST_1
+   
+   #ACONST_NULL
+
+   (#LDC Literal)))
 
 (type: .public Int_Arithmetic
-  #IADD
-  #ISUB
-  #IMUL
-  #IDIV
-  #IREM
-  #INEG)
+  (Variant
+   #IADD
+   #ISUB
+   #IMUL
+   #IDIV
+   #IREM
+   #INEG))
 
 (type: .public Long_Arithmetic
-  #LADD
-  #LSUB
-  #LMUL
-  #LDIV
-  #LREM
-  #LNEG)
+  (Variant
+   #LADD
+   #LSUB
+   #LMUL
+   #LDIV
+   #LREM
+   #LNEG))
 
 (type: .public Float_Arithmetic
-  #FADD
-  #FSUB
-  #FMUL
-  #FDIV
-  #FREM
-  #FNEG)
+  (Variant
+   #FADD
+   #FSUB
+   #FMUL
+   #FDIV
+   #FREM
+   #FNEG))
 
 (type: .public Double_Arithmetic
-  #DADD
-  #DSUB
-  #DMUL
-  #DDIV
-  #DREM
-  #DNEG)
+  (Variant
+   #DADD
+   #DSUB
+   #DMUL
+   #DDIV
+   #DREM
+   #DNEG))
 
 (type: .public Arithmetic
-  (#Int_Arithmetic Int_Arithmetic)
-  (#Long_Arithmetic Long_Arithmetic)
-  (#Float_Arithmetic Float_Arithmetic)
-  (#Double_Arithmetic Double_Arithmetic))
+  (Variant
+   (#Int_Arithmetic Int_Arithmetic)
+   (#Long_Arithmetic Long_Arithmetic)
+   (#Float_Arithmetic Float_Arithmetic)
+   (#Double_Arithmetic Double_Arithmetic)))
 
 (type: .public Int_Bitwise
-  #IOR
-  #IXOR
-  #IAND
-  #ISHL
-  #ISHR
-  #IUSHR)
+  (Variant
+   #IOR
+   #IXOR
+   #IAND
+   #ISHL
+   #ISHR
+   #IUSHR))
 
 (type: .public Long_Bitwise
-  #LOR
-  #LXOR
-  #LAND
-  #LSHL
-  #LSHR
-  #LUSHR)
+  (Variant
+   #LOR
+   #LXOR
+   #LAND
+   #LSHL
+   #LSHR
+   #LUSHR))
 
 (type: .public Bitwise
-  (#Int_Bitwise Int_Bitwise)
-  (#Long_Bitwise Long_Bitwise))
+  (Variant
+   (#Int_Bitwise Int_Bitwise)
+   (#Long_Bitwise Long_Bitwise)))
 
 (type: .public Conversion
-  #I2B
-  #I2S
-  #I2L
-  #I2F
-  #I2D
-  #I2C
-
-  #L2I
-  #L2F
-  #L2D
-
-  #F2I
-  #F2L
-  #F2D
-  
-  #D2I
-  #D2L
-  #D2F)
+  (Variant
+   #I2B
+   #I2S
+   #I2L
+   #I2F
+   #I2D
+   #I2C
+
+   #L2I
+   #L2F
+   #L2D
+
+   #F2I
+   #F2L
+   #F2D
+   
+   #D2I
+   #D2L
+   #D2F))
 
 (type: .public Array
-  #ARRAYLENGTH
+  (Variant
+   #ARRAYLENGTH
 
-  (#NEWARRAY (Type Primitive))
-  (#ANEWARRAY (Type category.Object))
+   (#NEWARRAY (Type Primitive))
+   (#ANEWARRAY (Type category.Object))
 
-  #BALOAD
-  #BASTORE
+   #BALOAD
+   #BASTORE
 
-  #SALOAD
-  #SASTORE
+   #SALOAD
+   #SASTORE
 
-  #IALOAD
-  #IASTORE
+   #IALOAD
+   #IASTORE
 
-  #LALOAD
-  #LASTORE
+   #LALOAD
+   #LASTORE
 
-  #FALOAD
-  #FASTORE
+   #FALOAD
+   #FASTORE
 
-  #DALOAD
-  #DASTORE
-  
-  #CALOAD
-  #CASTORE
+   #DALOAD
+   #DASTORE
+   
+   #CALOAD
+   #CASTORE
 
-  #AALOAD
-  #AASTORE)
+   #AALOAD
+   #AASTORE))
 
 (type: .public Object
-  (#GETSTATIC (Type Class) Text (Type Value))
-  (#PUTSTATIC (Type Class) Text (Type Value))
-
-  (#NEW (Type Class))
-  
-  (#INSTANCEOF (Type Class))
-  (#CHECKCAST (Type category.Object))
-
-  (#GETFIELD (Type Class) Text (Type Value))
-  (#PUTFIELD (Type Class) Text (Type Value))
-  
-  (#INVOKEINTERFACE (Type Class) Text (Type Method))
-  (#INVOKESPECIAL (Type Class) Text (Type Method))
-  (#INVOKESTATIC (Type Class) Text (Type Method))
-  (#INVOKEVIRTUAL (Type Class) Text (Type Method)))
-
-(type: .public Register Nat)
+  (Variant
+   (#GETSTATIC (Type Class) Text (Type Value))
+   (#PUTSTATIC (Type Class) Text (Type Value))
+
+   (#NEW (Type Class))
+   
+   (#INSTANCEOF (Type Class))
+   (#CHECKCAST (Type category.Object))
+
+   (#GETFIELD (Type Class) Text (Type Value))
+   (#PUTFIELD (Type Class) Text (Type Value))
+   
+   (#INVOKEINTERFACE (Type Class) Text (Type Method))
+   (#INVOKESPECIAL (Type Class) Text (Type Method))
+   (#INVOKESTATIC (Type Class) Text (Type Method))
+   (#INVOKEVIRTUAL (Type Class) Text (Type Method))))
+
+(type: .public Register
+  Nat)
 
 (type: .public Local_Int
-  (#ILOAD Register)
-  (#ISTORE Register))
+  (Variant
+   (#ILOAD Register)
+   (#ISTORE Register)))
 
 (type: .public Local_Long
-  (#LLOAD Register)
-  (#LSTORE Register))
+  (Variant
+   (#LLOAD Register)
+   (#LSTORE Register)))
 
 (type: .public Local_Float
-  (#FLOAD Register)
-  (#FSTORE Register))
+  (Variant
+   (#FLOAD Register)
+   (#FSTORE Register)))
 
 (type: .public Local_Double
-  (#DLOAD Register)
-  (#DSTORE Register))
+  (Variant
+   (#DLOAD Register)
+   (#DSTORE Register)))
 
 (type: .public Local_Object
-  (#ALOAD Register)
-  (#ASTORE Register))
+  (Variant
+   (#ALOAD Register)
+   (#ASTORE Register)))
 
 (type: .public Local
-  (#Local_Int Local_Int)
-  (#IINC Register)
-  (#Local_Long Local_Long)
-  (#Local_Float Local_Float)
-  (#Local_Double Local_Double)
-  (#Local_Object Local_Object))
+  (Variant
+   (#Local_Int Local_Int)
+   (#IINC Register)
+   (#Local_Long Local_Long)
+   (#Local_Float Local_Float)
+   (#Local_Double Local_Double)
+   (#Local_Object Local_Object)))
 
 (type: .public Stack
-  #DUP
-  #DUP_X1
-  #DUP_X2
-  #DUP2
-  #DUP2_X1
-  #DUP2_X2
-  #SWAP
-  #POP
-  #POP2)
+  (Variant
+   #DUP
+   #DUP_X1
+   #DUP_X2
+   #DUP2
+   #DUP2_X1
+   #DUP2_X2
+   #SWAP
+   #POP
+   #POP2))
 
 (type: .public Comparison
-  #LCMP
-  
-  #FCMPG
-  #FCMPL
+  (Variant
+   #LCMP
+   
+   #FCMPG
+   #FCMPL
 
-  #DCMPG
-  #DCMPL)
+   #DCMPG
+   #DCMPL))
 
-(type: .public Label Nat)
+(type: .public Label
+  Nat)
 
 (type: .public (Branching label)
-  (#IF_ICMPEQ label)
-  (#IF_ICMPGE label)
-  (#IF_ICMPGT label)
-  (#IF_ICMPLE label)
-  (#IF_ICMPLT label)
-  (#IF_ICMPNE label)
-  (#IFEQ label)
-  (#IFNE label)
-  (#IFGE label)
-  (#IFGT label)
-  (#IFLE label)
-  (#IFLT label)
-
-  (#TABLESWITCH Int Int label (List label))
-  (#LOOKUPSWITCH label (List [Int label]))
-
-  (#IF_ACMPEQ label)
-  (#IF_ACMPNE label)
-  (#IFNONNULL label)
-  (#IFNULL label))
+  (Variant
+   (#IF_ICMPEQ label)
+   (#IF_ICMPGE label)
+   (#IF_ICMPGT label)
+   (#IF_ICMPLE label)
+   (#IF_ICMPLT label)
+   (#IF_ICMPNE label)
+   (#IFEQ label)
+   (#IFNE label)
+   (#IFGE label)
+   (#IFGT label)
+   (#IFLE label)
+   (#IFLT label)
+
+   (#TABLESWITCH Int Int label (List label))
+   (#LOOKUPSWITCH label (List [Int label]))
+
+   (#IF_ACMPEQ label)
+   (#IF_ACMPNE label)
+   (#IFNONNULL label)
+   (#IFNULL label)))
 
 (type: .public (Exception label)
-  (#Try label label label (Type Class))
-  #ATHROW)
+  (Variant
+   (#Try label label label (Type Class))
+   #ATHROW))
 
 (type: .public Concurrency
-  #MONITORENTER
-  #MONITOREXIT)
+  (Variant
+   #MONITORENTER
+   #MONITOREXIT))
 
 (type: .public Return
-  #RETURN
-  #IRETURN
-  #LRETURN
-  #FRETURN
-  #DRETURN
-  #ARETURN)
+  (Variant
+   #RETURN
+   #IRETURN
+   #LRETURN
+   #FRETURN
+   #DRETURN
+   #ARETURN))
 
 (type: .public (Control label)
-  (#GOTO label)
-  (#Branching (Branching label))
-  (#Exception (Exception label))
-  (#Concurrency Concurrency)
-  (#Return Return))
+  (Variant
+   (#GOTO label)
+   (#Branching (Branching label))
+   (#Exception (Exception label))
+   (#Concurrency Concurrency)
+   (#Return Return)))
 
 (type: .public (Instruction embedded label)
-  #NOP
-  (#Constant Constant)
-  (#Arithmetic Arithmetic)
-  (#Bitwise Bitwise)
-  (#Conversion Conversion)
-  (#Array Array)
-  (#Object Object)
-  (#Local Local)
-  (#Stack Stack)
-  (#Comparison Comparison)
-  (#Control (Control label))
-  (#Embedded embedded))
+  (Variant
+   #NOP
+   (#Constant Constant)
+   (#Arithmetic Arithmetic)
+   (#Bitwise Bitwise)
+   (#Conversion Conversion)
+   (#Array Array)
+   (#Object Object)
+   (#Local Local)
+   (#Stack Stack)
+   (#Comparison Comparison)
+   (#Control (Control label))
+   (#Embedded embedded)))
 
 (type: .public (Bytecode embedded label)
   (Row (Instruction embedded label)))
diff --git a/stdlib/source/library/lux/target/jvm/attribute.lux b/stdlib/source/library/lux/target/jvm/attribute.lux
index 1dd3c323e..640ad8683 100644
--- a/stdlib/source/library/lux/target/jvm/attribute.lux
+++ b/stdlib/source/library/lux/target/jvm/attribute.lux
@@ -26,9 +26,10 @@
    ["#." code]])
 
 (type: .public (Info about)
-  {#name (Index UTF8)
-   #length U4
-   #info about})
+  (Record
+   {#name (Index UTF8)
+    #length U4
+    #info about}))
 
 (def: .public (info_equivalence Equivalence)
   (All [about]
@@ -52,8 +53,9 @@
 
 (with_expansions [ (as_is (/code.Code Attribute))]
   (type: .public #rec Attribute
-    (#Constant (Info (Constant Any)))
-    (#Code (Info )))
+    (Variant
+     (#Constant (Info (Constant Any)))
+     (#Code (Info ))))
 
   (type: .public Code
     )
diff --git a/stdlib/source/library/lux/target/jvm/attribute/code.lux b/stdlib/source/library/lux/target/jvm/attribute/code.lux
index 265c951a2..d63057a68 100644
--- a/stdlib/source/library/lux/target/jvm/attribute/code.lux
+++ b/stdlib/source/library/lux/target/jvm/attribute/code.lux
@@ -23,10 +23,11 @@
    ["#." exception (#+ Exception)]])
 
 (type: .public (Code Attribute)
-  {#limit Limit
-   #code Binary
-   #exception_table (Row Exception)
-   #attributes (Row Attribute)})
+  (Record
+   {#limit Limit
+    #code Binary
+    #exception_table (Row Exception)
+    #attributes (Row Attribute)}))
 
 (def: .public (length length code)
   (All [Attribute] (-> (-> Attribute Nat) (Code Attribute) Nat))
@@ -50,7 +51,7 @@
       ... attribute_info attributes[attributes_count];
       (|> code
           (value@ #attributes)
-          (row\map length)
+          (row\each length)
           (row\mix n.+ 0))))
 
 (def: .public (equivalence attribute_equivalence)
@@ -66,7 +67,7 @@
 ... https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.3
 (def: .public (writer writer code)
   (All [Attribute] (-> (Writer Attribute) (Writer (Code Attribute))))
-  ($_ binaryF\compose
+  ($_ binaryF\composite
       ... u2 max_stack;
       ... u2 max_locals;
       (///limit.writer (value@ #limit code))
diff --git a/stdlib/source/library/lux/target/jvm/attribute/code/exception.lux b/stdlib/source/library/lux/target/jvm/attribute/code/exception.lux
index 5ba6db613..a2a4f45c1 100644
--- a/stdlib/source/library/lux/target/jvm/attribute/code/exception.lux
+++ b/stdlib/source/library/lux/target/jvm/attribute/code/exception.lux
@@ -20,10 +20,11 @@
      ["#." unsigned (#+ U2)]]]])
 
 (type: .public Exception
-  {#start Address
-   #end Address
-   #handler Address
-   #catch (Index Class)})
+  (Record
+   {#start Address
+    #end Address
+    #handler Address
+    #catch (Index Class)}))
 
 (def: .public equivalence
   (Equivalence Exception)
diff --git a/stdlib/source/library/lux/target/jvm/bytecode.lux b/stdlib/source/library/lux/target/jvm/bytecode.lux
index 9b16b5be6..7e56004c3 100644
--- a/stdlib/source/library/lux/target/jvm/bytecode.lux
+++ b/stdlib/source/library/lux/target/jvm/bytecode.lux
@@ -51,14 +51,17 @@
      ["." reflection]
      ["." parser]]]])
 
-(type: .public Label Nat)
+(type: .public Label
+  Nat)
 
-(type: .public Resolver (Dictionary Label [Stack (Maybe Address)]))
+(type: .public Resolver
+  (Dictionary Label [Stack (Maybe Address)]))
 
 (type: .public Tracker
-  {#program_counter Address
-   #next Label
-   #known Resolver})
+  (Record
+   {#program_counter Address
+    #next Label
+    #known Resolver}))
 
 (def: fresh
   Tracker
@@ -82,7 +85,7 @@
 
   (def: identity ..relative_identity)
 
-  (def: (compose left right)
+  (def: (composite left right)
     (cond (same? ..relative_identity left)
           right
 
@@ -94,8 +97,8 @@
             (do try.monad
               [[left_exceptions left_instruction] (left resolver)
                [right_exceptions right_instruction] (right resolver)]
-              (in [(\ row.monoid compose left_exceptions right_exceptions)
-                   (_\compose left_instruction right_instruction)]))))))
+              (in [(\ row.monoid composite left_exceptions right_exceptions)
+                   (_\composite left_instruction right_instruction)]))))))
 
 (type: .public (Bytecode a)
   (+State Try [Pool Environment Tracker] (Writer Relative a)))
@@ -687,12 +690,14 @@
    ["Start" (|> @from /address.value //unsigned.value %.nat)]
    ["Target" (|> jump //signed.value %.int)]))
 
-(type: Any_Jump (Either Big_Jump Jump))
+(type: Any_Jump
+  (Either Big_Jump
+          Jump))
 
 (def: (jump @from @to)
   (-> Address Address (Try Any_Jump))
   (do {! try.monad}
-    [jump (\ ! map //signed.value
+    [jump (\ ! each //signed.value
              (/address.jump @from @to))]
     (let [big? (n.> (//unsigned.value //unsigned.maximum/2)
                     (.nat (i.* (if (i.>= +0 jump)
@@ -700,8 +705,8 @@
                                  -1)
                                jump)))]
       (if big?
-        (\ ! map (|>> #.Left) (//signed.s4 jump))
-        (\ ! map (|>> #.Right) (//signed.s2 jump))))))
+        (\ ! each (|>> #.Left) (//signed.s4 jump))
+        (\ ! each (|>> #.Right) (//signed.s2 jump))))))
 
 (exception: .public (unset_label {label Label})
   (exception.report
@@ -857,15 +862,15 @@
                             [@default (|> default get (monad.then ! product.right))
                              @at_minimum (|> at_minimum get (monad.then ! product.right))
                              @afterwards (|> afterwards
-                                             (monad.map ! get)
-                                             (monad.then ! (monad.map ! product.right)))]
+                                             (monad.each ! get)
+                                             (monad.then ! (monad.each ! 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)]
+                        [>default (\ ! each ..big_jump (..jump @from @default))
+                         >at_minimum (\ ! each ..big_jump (..jump @from @at_minimum))
+                         >afterwards (monad.each ! (|>> (..jump @from) (\ ! each ..big_jump))
+                                                 @afterwards)]
                         (in [..no_exceptions (bytecode minimum >default [>at_minimum >afterwards])]))
 
                       #.None
@@ -890,7 +895,7 @@
         (in (let [@from (value@ #program_counter tracker)]
               [[pool
                 environment'
-                (|> (list\mix (..acknowledge_label actual) tracker (list& default (list\map product.right cases)))
+                (|> (list\mix (..acknowledge_label actual) tracker (list& default (list\each product.right cases)))
                     (with@ #program_counter program_counter'))]
                [(function (_ resolver)
                   (let [get (: (-> Label (Maybe [Stack (Maybe Address)]))
@@ -899,15 +904,15 @@
                     (case (do {! maybe.monad}
                             [@default (|> default get (monad.then ! product.right))
                              @cases (|> cases
-                                        (monad.map ! (|>> product.right get))
-                                        (monad.then ! (monad.map ! product.right)))]
+                                        (monad.each ! (|>> product.right get))
+                                        (monad.then ! (monad.each ! product.right)))]
                             (in [@default @cases]))
                       (#.Some [@default @cases])
                       (do {! try.monad}
-                        [>default (\ ! map ..big_jump (..jump @from @default))
+                        [>default (\ ! each ..big_jump (..jump @from @default))
                          >cases (|> @cases
-                                    (monad.map ! (|>> (..jump @from) (\ ! map ..big_jump)))
-                                    (\ ! map (|>> (list.zipped/2 (list\map product.left cases)))))]
+                                    (monad.each ! (|>> (..jump @from) (\ ! each ..big_jump)))
+                                    (\ ! each (|>> (list.zipped/2 (list\each product.left cases)))))]
                         (in [..no_exceptions (bytecode >default >cases)]))
 
                       #.None
@@ -974,7 +979,7 @@
                     {#//constant/pool.name method
                      #//constant/pool.descriptor (type.descriptor type)})
           .let [consumption (|> inputs
-                                (list\map ..type_size)
+                                (list\each ..type_size)
                                 (list\mix n.+ (if  0 1))
                                 //unsigned.u1
                                 try.trusted)
diff --git a/stdlib/source/library/lux/target/jvm/bytecode/address.lux b/stdlib/source/library/lux/target/jvm/bytecode/address.lux
index 669b49548..51ab13080 100644
--- a/stdlib/source/library/lux/target/jvm/bytecode/address.lux
+++ b/stdlib/source/library/lux/target/jvm/bytecode/address.lux
@@ -40,7 +40,7 @@
     (-> U2 (-> Address (Try Address)))
     (|>> :representation
          (///unsigned.+/2 distance)
-         (\ try.functor map (|>> :abstraction))))
+         (\ try.functor each (|>> :abstraction))))
 
   (def: with_sign
     (-> Address (Try S4))
diff --git a/stdlib/source/library/lux/target/jvm/bytecode/environment.lux b/stdlib/source/library/lux/target/jvm/bytecode/environment.lux
index 54c754dc5..ff778621c 100644
--- a/stdlib/source/library/lux/target/jvm/bytecode/environment.lux
+++ b/stdlib/source/library/lux/target/jvm/bytecode/environment.lux
@@ -18,8 +18,9 @@
      [category (#+ Method)]]]])
 
 (type: .public Environment
-  {#limit Limit
-   #stack (Maybe Stack)})
+  (Record
+   {#limit Limit
+    #stack (Maybe Stack)}))
 
 (template [ ]
   [(def: .public ( type)
@@ -41,7 +42,7 @@
 
   (def: identity (|>> #try.Success))
 
-  (def: (compose left right)
+  (def: (composite left right)
     (function (_ environment)
       (do try.monad
         [environment (left environment)]
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 d57c07354..515728d71 100644
--- a/stdlib/source/library/lux/target/jvm/bytecode/environment/limit.lux
+++ b/stdlib/source/library/lux/target/jvm/bytecode/environment/limit.lux
@@ -21,8 +21,9 @@
      [category (#+ Method)]]]])
 
 (type: .public Limit
-  {#stack Stack
-   #registry Registry})
+  (Record
+   {#stack Stack
+    #registry Registry}))
 
 (template [ ]
   [(def: .public ( type)
@@ -52,7 +53,7 @@
 
 (def: .public (writer limit)
   (Writer Limit)
-  ($_ format\compose
+  ($_ format\composite
       (/stack.writer (value@ #stack limit))
       (/registry.writer (value@ #registry limit))
       ))
diff --git a/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/registry.lux b/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/registry.lux
index b1d51e164..04bf00456 100644
--- a/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/registry.lux
+++ b/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/registry.lux
@@ -22,7 +22,8 @@
     [category (#+ Method)]
     ["#/." parser]]])
 
-(type: .public Register U1)
+(type: .public Register
+  U1)
 
 (def: normal 1)
 (def: wide 2)
@@ -40,11 +41,11 @@
     (-> (Type Method) Nat)
     (let [[type_variables inputs output exceptions] (/////type/parser.method type)]
       (|> inputs
-          (list\map (function (_ input)
-                      (if (or (same? /////type.long input)
-                              (same? /////type.double input))
-                        ..wide
-                        ..normal)))
+          (list\each (function (_ input)
+                       (if (or (same? /////type.long input)
+                               (same? /////type.double input))
+                         ..wide
+                         ..normal)))
           (list\mix n.+ 0))))
 
   (template [ ]
@@ -53,7 +54,7 @@
        (|>> ..minimal
             (n.+ )
             /////unsigned.u2
-            (try\map ..registry)))]
+            (try\each ..registry)))]
 
     [0 static]
     [1 virtual]
@@ -61,7 +62,7 @@
 
   (def: .public equivalence
     (Equivalence Registry)
-    (\ equivalence.functor map
+    (\ equivalence.functor each
        (|>> :representation)
        /////unsigned.equivalence))
 
diff --git a/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/stack.lux b/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/stack.lux
index ac3934f87..13d4b5137 100644
--- a/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/stack.lux
+++ b/stdlib/source/library/lux/target/jvm/bytecode/environment/limit/stack.lux
@@ -33,7 +33,7 @@
 
   (def: .public equivalence
     (Equivalence Stack)
-    (\ equivalence.functor map
+    (\ equivalence.functor each
        (|>> :representation)
        /////unsigned.equivalence))
 
@@ -50,7 +50,7 @@
        (-> U2 (-> Stack (Try Stack)))
        (|>> :representation
             ( amount)
-            (\ try.functor map ..stack)))]
+            (\ try.functor each ..stack)))]
 
     [/////unsigned.+/2 push]
     [/////unsigned.-/2 pop]
diff --git a/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux b/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux
index 2e21d2a8e..bba0c67da 100644
--- a/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux
+++ b/stdlib/source/library/lux/target/jvm/bytecode/instruction.lux
@@ -36,7 +36,8 @@
     [type
      [category (#+ Value Method)]]]])
 
-(type: .public Size U2)
+(type: .public Size
+  U2)
 
 (type: .public Estimator
   (-> Address Size))
@@ -56,7 +57,8 @@
   (-> Instruction Specification)
   (function.on format.no_op))
 
-(type: Opcode Nat)
+(type: Opcode
+  Nat)
 
 (template [ ]
   [(def:  Size (|>  ///unsigned.u2 try.trusted))]
@@ -608,7 +610,7 @@
                  tableswitch_size (try.trusted
                                    (do {! try.monad}
                                      [size (///unsigned.u2 size)]
-                                     (\ ! map (|>> estimator ///unsigned.value)
+                                     (\ ! each (|>> estimator ///unsigned.value)
                                         (//address.move size //address.start))))
                  tableswitch_mutation (: Mutation
                                          (function (_ [offset binary])
@@ -672,7 +674,7 @@
                  lookupswitch_size (try.trusted
                                     (do {! try.monad}
                                       [size (///unsigned.u2 size)]
-                                      (\ ! map (|>> estimator ///unsigned.value)
+                                      (\ ! each (|>> estimator ///unsigned.value)
                                          (//address.move size //address.start))))
                  lookupswitch_mutation (: Mutation
                                           (function (_ [offset binary])
@@ -713,5 +715,5 @@
 
   (def: identity ..empty)
 
-  (def: (compose left right)
+  (def: (composite left right)
     (|>> left right)))
diff --git a/stdlib/source/library/lux/target/jvm/bytecode/jump.lux b/stdlib/source/library/lux/target/jvm/bytecode/jump.lux
index 74821d838..4b908d990 100644
--- a/stdlib/source/library/lux/target/jvm/bytecode/jump.lux
+++ b/stdlib/source/library/lux/target/jvm/bytecode/jump.lux
@@ -10,7 +10,8 @@
    [encoding
     ["#." signed (#+ S2 S4)]]])
 
-(type: .public Jump S2)
+(type: .public Jump
+  S2)
 
 (def: .public equivalence
   (Equivalence Jump)
@@ -20,7 +21,8 @@
   (Writer Jump)
   ///signed.writer/2)
 
-(type: .public Big_Jump S4)
+(type: .public Big_Jump
+  S4)
 
 (def: .public lifted
   (-> Jump Big_Jump)
diff --git a/stdlib/source/library/lux/target/jvm/class.lux b/stdlib/source/library/lux/target/jvm/class.lux
index 0b792934b..1280b23c4 100644
--- a/stdlib/source/library/lux/target/jvm/class.lux
+++ b/stdlib/source/library/lux/target/jvm/class.lux
@@ -28,17 +28,18 @@
     ["#/." pool (#+ Pool Resource)]]])
 
 (type: .public #rec Class
-  {#magic Magic
-   #minor_version Minor
-   #major_version Major
-   #constant_pool Pool
-   #modifier (Modifier Class)
-   #this (Index //constant.Class)
-   #super (Index //constant.Class)
-   #interfaces (Row (Index //constant.Class))
-   #fields (Row Field)
-   #methods (Row Method)
-   #attributes (Row Attribute)})
+  (Record
+   {#magic Magic
+    #minor_version Minor
+    #major_version Major
+    #constant_pool Pool
+    #modifier (Modifier Class)
+    #this (Index //constant.Class)
+    #super (Index //constant.Class)
+    #interfaces (Row (Index //constant.Class))
+    #fields (Row Field)
+    #methods (Row Method)
+    #attributes (Row Attribute)}))
 
 (modifiers: Class
   ["0001" public]
@@ -112,7 +113,7 @@
 
 (def: .public (writer class)
   (Writer Class)
-  (`` ($_ binaryF\compose
+  (`` ($_ binaryF\composite
           (~~ (template [ ]
                 [( (value@  class))]
 
diff --git a/stdlib/source/library/lux/target/jvm/constant.lux b/stdlib/source/library/lux/target/jvm/constant.lux
index 5916d245d..c2756715e 100644
--- a/stdlib/source/library/lux/target/jvm/constant.lux
+++ b/stdlib/source/library/lux/target/jvm/constant.lux
@@ -34,7 +34,8 @@
     [encoding
      ["#." unsigned]]]])
 
-(type: .public UTF8 Text)
+(type: .public UTF8
+  Text)
 
 (def: utf8_writer
   (Writer UTF8)
@@ -55,7 +56,7 @@
 
   (def: .public class_equivalence
     (Equivalence Class)
-    (\ equivalence.functor map
+    (\ equivalence.functor each
        ..index
        //index.equivalence))
 
@@ -97,12 +98,13 @@
     (All [kind]
       (-> (Equivalence kind)
           (Equivalence (Value kind))))
-    (\ equivalence.functor map
+    (\ equivalence.functor each
        (|>> :representation)
        Equivalence))
 
   (template [  ]
-    [(type: .public  (Value ))
+    [(type: .public 
+       (Value ))
 
      (def: .public 
        (->  )
@@ -131,12 +133,14 @@
   )
 
 (type: .public (Name_And_Type of)
-  {#name (Index UTF8)
-   #descriptor (Index (Descriptor of))})
+  (Record
+   {#name (Index UTF8)
+    #descriptor (Index (Descriptor of))}))
 
 (type: .public (Reference of)
-  {#class (Index Class)
-   #name_and_type (Index (Name_And_Type of))})
+  (Record
+   {#class (Index Class)
+    #name_and_type (Index (Name_And_Type of))}))
 
 (template [  ]
   [(def: .public 
@@ -156,17 +160,18 @@
   )
 
 (type: .public Constant
-  (#UTF8 UTF8)
-  (#Integer Integer)
-  (#Float Float)
-  (#Long Long)
-  (#Double Double)
-  (#Class Class)
-  (#String String)
-  (#Field (Reference //category.Value))
-  (#Method (Reference //category.Method))
-  (#Interface_Method (Reference //category.Method))
-  (#Name_And_Type (Name_And_Type Any)))
+  (Variant
+   (#UTF8 UTF8)
+   (#Integer Integer)
+   (#Float Float)
+   (#Long Long)
+   (#Double Double)
+   (#Class Class)
+   (#String String)
+   (#Field (Reference //category.Value))
+   (#Method (Reference //category.Method))
+   (#Interface_Method (Reference //category.Method))
+   (#Name_And_Type (Name_And_Type Any))))
 
 (def: .public (size constant)
   (-> Constant Nat)
@@ -244,7 +249,7 @@
       (case value
         (^template [  ]
           [( value)
-           (binaryF\compose (/tag.writer )
-                            ( value))])
+           (binaryF\composite (/tag.writer )
+                              ( value))])
         ()
         ))))
diff --git a/stdlib/source/library/lux/target/jvm/constant/pool.lux b/stdlib/source/library/lux/target/jvm/constant/pool.lux
index 99597756d..50872e835 100644
--- a/stdlib/source/library/lux/target/jvm/constant/pool.lux
+++ b/stdlib/source/library/lux/target/jvm/constant/pool.lux
@@ -35,7 +35,8 @@
      [category (#+ Value Method)]
      ["#." descriptor (#+ Descriptor)]]]])
 
-(type: .public Pool [Index (Row [Index Constant])])
+(type: .public Pool
+  [Index (Row [Index Constant])])
 
 (def: .public equivalence
   (Equivalence Pool)
@@ -75,7 +76,7 @@
                           (|> current
                               //index.value
                               (//unsigned.+/2 @new)
-                              (\ ! map //index.index)))]
+                              (\ ! each //index.index)))]
                  (in [[next
                        (row.suffix [current new] pool)]
                       current]))))))))])
@@ -120,8 +121,9 @@
     (!add #//.UTF8 text.equivalence value)))
 
 (type: .public (Member of)
-  {#name UTF8
-   #descriptor (Descriptor of)})
+  (Record
+   {#name UTF8
+    #descriptor (Descriptor of)}))
 
 (def: .public (name_and_type [name descriptor])
   (All [of]
@@ -148,7 +150,7 @@
   (Writer Pool)
   (function (_ [next pool])
     (row\mix (function (_ [_index post] pre)
-               (specification\compose pre (//.writer post)))
+               (specification\composite pre (//.writer post)))
              (format.bits/16 (!index next))
              pool)))
 
diff --git a/stdlib/source/library/lux/target/jvm/encoding/name.lux b/stdlib/source/library/lux/target/jvm/encoding/name.lux
index 16efc410a..eb232aaba 100644
--- a/stdlib/source/library/lux/target/jvm/encoding/name.lux
+++ b/stdlib/source/library/lux/target/jvm/encoding/name.lux
@@ -10,7 +10,8 @@
 (def: .public internal_separator "/")
 (def: .public external_separator ".")
 
-(type: .public External Text)
+(type: .public External
+  Text)
 
 (abstract: .public Internal
   {}
diff --git a/stdlib/source/library/lux/target/jvm/field.lux b/stdlib/source/library/lux/target/jvm/field.lux
index b8d84170d..4ccaf58c4 100644
--- a/stdlib/source/library/lux/target/jvm/field.lux
+++ b/stdlib/source/library/lux/target/jvm/field.lux
@@ -21,10 +21,11 @@
     [descriptor (#+ Descriptor)]]])
 
 (type: .public #rec Field
-  {#modifier (Modifier Field)
-   #name (Index UTF8)
-   #descriptor (Index (Descriptor Value))
-   #attributes (Row Attribute)})
+  (Record
+   {#modifier (Modifier Field)
+    #name (Index UTF8)
+    #descriptor (Index (Descriptor Value))
+    #attributes (Row Attribute)}))
 
 (modifiers: Field
   ["0001" public]
@@ -48,7 +49,7 @@
 
 (def: .public (writer field)
   (Writer Field)
-  (`` ($_ binaryF\compose
+  (`` ($_ binaryF\composite
           (~~ (template [ ]
                 [( (value@  field))]
 
diff --git a/stdlib/source/library/lux/target/jvm/index.lux b/stdlib/source/library/lux/target/jvm/index.lux
index 66df65314..07ae1e85d 100644
--- a/stdlib/source/library/lux/target/jvm/index.lux
+++ b/stdlib/source/library/lux/target/jvm/index.lux
@@ -30,7 +30,7 @@
 
   (def: .public equivalence
     (All [kind] (Equivalence (Index kind)))
-    (\ equivalence.functor map
+    (\ equivalence.functor each
        ..value
        //unsigned.equivalence))
 
diff --git a/stdlib/source/library/lux/target/jvm/method.lux b/stdlib/source/library/lux/target/jvm/method.lux
index e604eb3c2..38bae94fc 100644
--- a/stdlib/source/library/lux/target/jvm/method.lux
+++ b/stdlib/source/library/lux/target/jvm/method.lux
@@ -27,10 +27,11 @@
     ["#." descriptor (#+ Descriptor)]]])
 
 (type: .public #rec Method
-  {#modifier (Modifier Method)
-   #name (Index UTF8)
-   #descriptor (Index (Descriptor //type/category.Method))
-   #attributes (Row Attribute)})
+  (Record
+   {#modifier (Modifier Method)
+    #name (Index UTF8)
+    #descriptor (Index (Descriptor //type/category.Method))
+    #attributes (Row Attribute)}))
 
 (modifiers: Method
   ["0001" public]
@@ -55,7 +56,7 @@
      @descriptor (//constant/pool.descriptor (//type.descriptor type))
      attributes (|> attributes
                     (monad.all !)
-                    (\ ! map row.of_list))
+                    (\ ! each row.of_list))
      attributes (case code
                   (#.Some code)
                   (do !
@@ -93,7 +94,7 @@
 
 (def: .public (writer field)
   (Writer Method)
-  (`` ($_ format\compose
+  (`` ($_ format\composite
           (~~ (template [ ]
                 [( (value@  field))]
 
diff --git a/stdlib/source/library/lux/target/jvm/modifier.lux b/stdlib/source/library/lux/target/jvm/modifier.lux
index c7eb021b2..64359dea1 100644
--- a/stdlib/source/library/lux/target/jvm/modifier.lux
+++ b/stdlib/source/library/lux/target/jvm/modifier.lux
@@ -64,7 +64,7 @@
     (def: identity
       (!wrap (hex "0000")))
     
-    (def: (compose left right)
+    (def: (composite left right)
       (!wrap (i64.or (!unwrap left) (!unwrap right)))))
 
   (def: .public empty
diff --git a/stdlib/source/library/lux/target/jvm/reflection.lux b/stdlib/source/library/lux/target/jvm/reflection.lux
index f23e3c019..3fdf491bc 100644
--- a/stdlib/source/library/lux/target/jvm/reflection.lux
+++ b/stdlib/source/library/lux/target/jvm/reflection.lux
@@ -175,7 +175,7 @@
               [paramsT (|> reflection
                            java/lang/reflect/ParameterizedType::getActualTypeArguments
                            array.list
-                           (monad.map ! parameter))]
+                           (monad.each ! parameter))]
               (in (/.class (|> raw
                                (:as (java/lang/Class java/lang/Object))
                                java/lang/Class::getName)
@@ -208,7 +208,7 @@
                (#try.Success /.wildcard)
 
                _
-               (\ try.monad map  (..class' parameter bound)))])
+               (\ try.monad each  (..class' parameter bound)))])
           ([[_ (#.Some bound)] /.upper]
            [[(#.Some bound) _] /.lower])
           
@@ -251,7 +251,7 @@
         (|> reflection
             java/lang/reflect/GenericArrayType::getGenericComponentType
             type
-            (\ try.monad map /.array))
+            (\ try.monad each /.array))
         _)
       ... else
       (..parameter reflection)))
@@ -303,8 +303,8 @@
       (if (text\= class_name name)
         (if (n.= num_class_params num_type_params)
           (|> params
-              (list.zipped/2 (list\map (|>> java/lang/reflect/TypeVariable::getName)
-                                       class_params))
+              (list.zipped/2 (list\each (|>> java/lang/reflect/TypeVariable::getName)
+                                        class_params))
               (list\mix (function (_ [name paramT] mapping)
                           (dictionary.has name paramT mapping))
                         /lux.fresh)
@@ -375,8 +375,8 @@
           (|> fieldJ
                      java/lang/reflect/Field::getGenericType
                      ..type
-                     (\ ! map (|>> [(java/lang/reflect/Modifier::isFinal modifiers)
-                                    (..deprecated? (java/lang/reflect/Field::getDeclaredAnnotations fieldJ))])))
+                     (\ ! each (|>> [(java/lang/reflect/Modifier::isFinal modifiers)
+                                     (..deprecated? (java/lang/reflect/Field::getDeclaredAnnotations fieldJ))])))
           (exception.except  [field class]))))]
 
   [static_field ..not_a_static_field #1 #0]
diff --git a/stdlib/source/library/lux/target/jvm/type.lux b/stdlib/source/library/lux/target/jvm/type.lux
index e87838ef1..1eeccbe72 100644
--- a/stdlib/source/library/lux/target/jvm/type.lux
+++ b/stdlib/source/library/lux/target/jvm/type.lux
@@ -37,9 +37,10 @@
     [(Type Value) a])
 
   (type: .public Constraint
-    {#name Text
-     #super_class (Type Class)
-     #super_interfaces (List (Type Class))})
+    (Record
+     {#name Text
+      #super_class (Type Class)
+      #super_interfaces (List (Type Class))}))
   
   (template [