aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/tool/compiler
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/tool/compiler.lux18
-rw-r--r--stdlib/source/library/lux/tool/compiler/arity.lux3
-rw-r--r--stdlib/source/library/lux/tool/compiler/default/init.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/default/platform.lux56
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux66
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/directive.lux32
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/generation.lux19
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/function.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/inference.lux10
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux18
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux50
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/directive.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux5
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux528
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lua.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux34
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/ruby.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/scheme.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/bundle.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux22
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux20
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/host.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/common.lux30
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux162
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux26
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/host.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/common.lux30
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/host.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux32
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/host.lux10
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/r/common.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux26
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/host.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/scheme/common.lux14
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/scheme/host.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/case.lux34
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/function.lux14
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/loop.lux16
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/runtime.lux14
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/structure.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/case.lux22
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/function.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/loop.lux20
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux10
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/structure.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux24
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/apply.lux104
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/init.lux14
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/new.lux14
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/reset.lux2
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux34
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/program.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/reference.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux40
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/structure.lux16
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/case.lux32
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/function.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/loop.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/structure.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/case.lux32
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/function.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/loop.lux26
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux14
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/structure.lux10
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux32
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/function.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/loop.lux18
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/structure.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/case.lux22
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/function.lux10
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/loop.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux34
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/host.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/structure.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/reference.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux30
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/function.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/loop.lux14
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/structure.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux20
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/function.lux10
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/loop.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/structure.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis.lux8
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux40
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux82
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/loop.lux58
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux32
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/program.lux14
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux116
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/archive.lux13
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/archive/artifact.lux63
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/archive/descriptor.lux13
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/archive/document.lux7
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/archive/signature.lux5
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux21
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/io/archive.lux112
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/io/context.lux24
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/packager.lux14
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux6
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/packager/scheme.lux12
-rw-r--r--stdlib/source/library/lux/tool/compiler/meta/packager/script.lux10
-rw-r--r--stdlib/source/library/lux/tool/compiler/phase.lux4
-rw-r--r--stdlib/source/library/lux/tool/compiler/reference.lux5
-rw-r--r--stdlib/source/library/lux/tool/compiler/reference/variable.lux5
128 files changed, 1493 insertions, 1454 deletions
diff --git a/stdlib/source/library/lux/tool/compiler.lux b/stdlib/source/library/lux/tool/compiler.lux
index 10ad0d939..b1408854c 100644
--- a/stdlib/source/library/lux/tool/compiler.lux
+++ b/stdlib/source/library/lux/tool/compiler.lux
@@ -25,16 +25,18 @@
Text)
(type: .public Input
- {#module Module
- #file Path
- #hash Nat
- #code Code})
+ (Record
+ {#module Module
+ #file Path
+ #hash Nat
+ #code Code}))
(type: .public (Compilation s d o)
- {#dependencies (List Module)
- #process (-> s Archive
- (Try [s (Either (Compilation s d o)
- [Descriptor (Document d) Output])]))})
+ (Record
+ {#dependencies (List Module)
+ #process (-> s Archive
+ (Try [s (Either (Compilation s d o)
+ [Descriptor (Document d) Output])]))}))
(type: .public (Compiler s d o)
(-> Input (Compilation s d o)))
diff --git a/stdlib/source/library/lux/tool/compiler/arity.lux b/stdlib/source/library/lux/tool/compiler/arity.lux
index e0a3c06aa..5d20220c3 100644
--- a/stdlib/source/library/lux/tool/compiler/arity.lux
+++ b/stdlib/source/library/lux/tool/compiler/arity.lux
@@ -5,7 +5,8 @@
[number
["n" nat]]]]])
-(type: .public Arity Nat)
+(type: .public Arity
+ Nat)
(template [<comparison> <name>]
[(def: .public <name> (-> Arity Bit) (<comparison> 1))]
diff --git a/stdlib/source/library/lux/tool/compiler/default/init.lux b/stdlib/source/library/lux/tool/compiler/default/init.lux
index c01a1f6c1..d7e8ca736 100644
--- a/stdlib/source/library/lux/tool/compiler/default/init.lux
+++ b/stdlib/source/library/lux/tool/compiler/default/init.lux
@@ -130,7 +130,7 @@
(///directive.lifted_analysis
(do {! ///phase.monad}
[_ (module.create hash module)
- _ (monad.map ! module.import dependencies)
+ _ (monad.each ! module.import dependencies)
.let [source (///analysis.source (value@ #///.module input) (value@ #///.code input))]
_ (///analysis.set_source_code source)]
(in [source [///generation.empty_buffer
@@ -259,16 +259,16 @@
(in [state
(#.Right [descriptor
(document.write key analysis_module)
- (row\map (function (_ [artifact_id custom directive])
- [artifact_id custom (write_directive directive)])
- final_buffer)])]))
+ (row\each (function (_ [artifact_id custom directive])
+ [artifact_id custom (write_directive directive)])
+ final_buffer)])]))
(#.Some [source requirements temporary_payload])
(let [[temporary_buffer temporary_registry] temporary_payload]
(in [state
(#.Left {#///.dependencies (|> requirements
(value@ #///directive.imports)
- (list\map product.left))
+ (list\each product.left))
#///.process (function (_ state archive)
(recur (<| (///phase.result' state)
(do {! ///phase.monad}
@@ -282,7 +282,7 @@
(///generation.set_registry temporary_registry))
_ (|> requirements
(value@ #///directive.referrals)
- (monad.map ! (execute! archive)))
+ (monad.each ! (execute! archive)))
temporary_payload (..get_current_payload temporary_payload)]
(..iteration wrapper archive expander module source temporary_payload (..module_aliases analysis_module))))))})]))
)))))}))))
diff --git a/stdlib/source/library/lux/tool/compiler/default/platform.lux b/stdlib/source/library/lux/tool/compiler/default/platform.lux
index 1894359a9..16571b165 100644
--- a/stdlib/source/library/lux/tool/compiler/default/platform.lux
+++ b/stdlib/source/library/lux/tool/compiler/default/platform.lux
@@ -65,12 +65,13 @@
(with_expansions [<type_vars> (as_is anchor expression directive)
<Operation> (as_is ///generation.Operation <type_vars>)]
(type: .public (Platform <type_vars>)
- {#&file_system (file.System Async)
- #host (///generation.Host expression directive)
- #phase (///generation.Phase <type_vars>)
- #runtime (<Operation> [Registry Output])
- #phase_wrapper (-> Archive (<Operation> ///phase.Wrapper))
- #write (-> directive Binary)})
+ (Record
+ {#&file_system (file.System Async)
+ #host (///generation.Host expression directive)
+ #phase (///generation.Phase <type_vars>)
+ #runtime (<Operation> [Registry Output])
+ #phase_wrapper (-> Archive (<Operation> ///phase.Wrapper))
+ #write (-> directive Binary)}))
... TODO: Get rid of this
(type: (Action a)
@@ -103,11 +104,11 @@
_ (for {@.python (|> output
row.list
(list.sub 128)
- (monad.map ! (monad.map ! write_artifact!))
+ (monad.each ! (monad.each ! write_artifact!))
(: (Action (List (List Any)))))}
(|> output
row.list
- (monad.map ..monad write_artifact!)
+ (monad.each ..monad write_artifact!)
(: (Action (List Any)))))
document (\ async.monad in
(document.check $.key document))]
@@ -190,7 +191,7 @@
_ (extension.with extender (:expected directives))]
(in [])))
(///phase.result' state)
- (\ try.monad map product.left)))
+ (\ try.monad each product.left)))
(def: (phase_wrapper archive platform state)
(All [<type_vars>]
@@ -254,8 +255,8 @@
(initialize_state (extender phase_wrapper)
(:expected (..complete_extensions host_directive_bundle phase_wrapper (:expected bundles)))
analysis_state)
- (try\map (|>> (//init.with_default_directives expander host_analysis program anchorT,expressionT,directiveT (extender phase_wrapper))
- [phase_wrapper])))))))]]
+ (try\each (|>> (//init.with_default_directives expander host_analysis program anchorT,expressionT,directiveT (extender phase_wrapper))
+ [phase_wrapper])))))))]]
(if (archive.archived? archive archive.runtime_module)
(do !
[[phase_wrapper state] (with_missing_extensions platform program state)]
@@ -302,8 +303,9 @@
(Dictionary Module (Set Module)))
(type: Dependence
- {#depends_on Mapping
- #depended_by Mapping})
+ (Record
+ {#depends_on Mapping
+ #depended_by Mapping}))
(def: independence
Dependence
@@ -489,14 +491,14 @@
(All [<type_vars>]
(-> Archive <State+> (Try <State+>)))
(do {! try.monad}
- [modules (monad.map ! (function (_ module)
- (do !
- [[descriptor document output] (archive.find module archive)
- lux_module (document.read $.key document)]
- (in [module lux_module])))
- (archive.archived archive))
+ [modules (monad.each ! (function (_ module)
+ (do !
+ [[descriptor document output] (archive.find module archive)
+ lux_module (document.read $.key document)]
+ (in [module lux_module])))
+ (archive.archived archive))
.let [additions (|> modules
- (list\map product.left)
+ (list\each product.left)
(set.of_list text.hash))]]
(in (revised@ [#extension.state
#///directive.analysis
@@ -506,11 +508,11 @@
(|> analysis_state
(:as .Lux)
(revised@ #.modules (function (_ current)
- (list\compose (list.only (|>> product.left
- (set.member? additions)
- not)
- current)
- modules)))
+ (list\composite (list.only (|>> product.left
+ (set.member? additions)
+ not)
+ current)
+ modules)))
:expected))
state))))
@@ -580,10 +582,10 @@
(#.Item _)
(do !
[archive,document+ (|> new_dependencies
- (list\map (import! module))
+ (list\each (import! module))
(monad.all ..monad))
.let [archive (|> archive,document+
- (list\map product.left)
+ (list\each product.left)
(list\mix archive.merged archive))]]
(in [archive (try.trusted
(..updated_state archive state))])))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux
index 6d1f355ba..c8d3e1d9e 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis.lux
@@ -1,6 +1,6 @@
(.module:
[library
- [lux (#- Variant Tuple nat int rev)
+ [lux (#- Tuple Variant nat int rev)
[abstract
[equivalence (#+ Equivalence)]
[hash (#+ Hash)]
@@ -35,22 +35,24 @@
["." reference (#+ Reference)
["." variable (#+ Register Variable)]]]])
-(type: .public #rec Primitive
- #Unit
- (#Bit Bit)
- (#Nat Nat)
- (#Int Int)
- (#Rev Rev)
- (#Frac Frac)
- (#Text Text))
+(type: .public Primitive
+ (.Variant
+ #Unit
+ (#Bit Bit)
+ (#Nat Nat)
+ (#Int Int)
+ (#Rev Rev)
+ (#Frac Frac)
+ (#Text Text)))
(type: .public Tag
Nat)
(type: .public (Variant a)
- {#lefts Nat
- #right? Bit
- #value a})
+ (Record
+ {#lefts Nat
+ #right? Bit
+ #value a}))
(def: .public (tag lefts right?)
(-> Nat Bit Nat)
@@ -74,17 +76,20 @@
(List a))
(type: .public (Composite a)
- (#Variant (Variant a))
- (#Tuple (Tuple a)))
+ (.Variant
+ (#Variant (Variant a))
+ (#Tuple (Tuple a))))
(type: .public #rec Pattern
- (#Simple Primitive)
- (#Complex (Composite Pattern))
- (#Bind Register))
+ (.Variant
+ (#Simple Primitive)
+ (#Complex (Composite Pattern))
+ (#Bind Register)))
(type: .public (Branch' e)
- {#when Pattern
- #then e})
+ (Record
+ {#when Pattern
+ #then e}))
(type: .public (Match' e)
[(Branch' e) (List (Branch' e))])
@@ -93,13 +98,14 @@
(List a))
(type: .public #rec Analysis
- (#Primitive Primitive)
- (#Structure (Composite Analysis))
- (#Reference Reference)
- (#Case Analysis (Match' Analysis))
- (#Function (Environment Analysis) Analysis)
- (#Apply Analysis Analysis)
- (#Extension (Extension Analysis)))
+ (.Variant
+ (#Primitive Primitive)
+ (#Structure (Composite Analysis))
+ (#Reference Reference)
+ (#Case Analysis (Match' Analysis))
+ (#Function (Environment Analysis) Analysis)
+ (#Apply Analysis Analysis)
+ (#Extension (Extension Analysis))))
(type: .public Branch
(Branch' Analysis))
@@ -354,7 +360,7 @@
(#Tuple members)
(|> members
- (list\map %analysis)
+ (list\each %analysis)
(text.interposed " ")
(text.enclosed ["[" "]"])))
@@ -368,7 +374,7 @@
(|> (%analysis body)
(format " ")
(format (|> environment
- (list\map %analysis)
+ (list\each %analysis)
(text.interposed " ")
(text.enclosed ["[" "]"])))
(text.enclosed ["(" ")"]))
@@ -377,13 +383,13 @@
(|> analysis
..application
#.Item
- (list\map %analysis)
+ (list\each %analysis)
(text.interposed " ")
(text.enclosed ["(" ")"]))
(#Extension name parameters)
(|> parameters
- (list\map %analysis)
+ (list\each %analysis)
(text.interposed " ")
(format (%.text name) " ")
(text.enclosed ["(" ")"]))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/directive.lux b/stdlib/source/library/lux/tool/compiler/language/lux/directive.lux
index 5f2770068..fa8525f02 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/directive.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/directive.lux
@@ -21,24 +21,28 @@
[descriptor (#+ Module)]]]]])
(type: .public (Component state phase)
- {#state state
- #phase phase})
+ (Record
+ {#state state
+ #phase phase}))
(type: .public (State anchor expression directive)
- {#analysis (Component analysis.State+
- analysis.Phase)
- #synthesis (Component synthesis.State+
- synthesis.Phase)
- #generation (Component (generation.State+ anchor expression directive)
- (generation.Phase anchor expression directive))})
+ (Record
+ {#analysis (Component analysis.State+
+ analysis.Phase)
+ #synthesis (Component synthesis.State+
+ synthesis.Phase)
+ #generation (Component (generation.State+ anchor expression directive)
+ (generation.Phase anchor expression directive))}))
(type: .public Import
- {#module Module
- #alias Text})
+ (Record
+ {#module Module
+ #alias Text}))
(type: .public Requirements
- {#imports (List Import)
- #referrals (List Code)})
+ (Record
+ {#imports (List Import)
+ #referrals (List Code)}))
(def: .public no_requirements
Requirements
@@ -47,8 +51,8 @@
(def: .public (merge_requirements left right)
(-> Requirements Requirements Requirements)
- {#imports (list\compose (value@ #imports left) (value@ #imports right))
- #referrals (list\compose (value@ #referrals left) (value@ #referrals right))})
+ {#imports (list\composite (value@ #imports left) (value@ #imports right))
+ #referrals (list\composite (value@ #referrals left) (value@ #referrals right))})
(template [<special> <general>]
[(type: .public (<special> anchor expression directive)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux b/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux
index aee61ebc7..aab4af121 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/generation.lux
@@ -65,14 +65,15 @@
re_load))
(type: .public (State anchor expression directive)
- {#module Module
- #anchor (Maybe anchor)
- #host (Host expression directive)
- #buffer (Maybe (Buffer directive))
- #registry artifact.Registry
- #counter Nat
- #context (Maybe artifact.ID)
- #log (Row Text)})
+ (Record
+ {#module Module
+ #anchor (Maybe anchor)
+ #host (Host expression directive)
+ #buffer (Maybe (Buffer directive))
+ #registry artifact.Registry
+ #counter Nat
+ #context (Maybe artifact.ID)
+ #log (Row Text)}))
(template [<special> <general>]
[(type: .public (<special> anchor expression directive)
@@ -176,7 +177,7 @@
(def: .public (identifier prefix)
(All [anchor expression directive]
(-> Text (Operation anchor expression directive Text)))
- (\ phase.monad map (|>> %.nat (format prefix)) ..next))
+ (\ phase.monad each (|>> %.nat (format prefix)) ..next))
(def: .public (enter_module module)
(All [anchor expression directive]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux
index 6c31960e4..d5b6529f0 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case.lux
@@ -130,7 +130,7 @@
(#.Product _)
(|> caseT
type.flat_tuple
- (list\map (re_quantify envs))
+ (list\each (re_quantify envs))
type.tuple
(\ ///.monad in))
@@ -314,12 +314,12 @@
[[inputT inputA] (//type.with_inference
(analyse archive inputC))
outputH (analyse_pattern #.None inputT patternH (analyse archive bodyH))
- outputT (monad.map !
- (function (_ [patternT bodyT])
- (analyse_pattern #.None inputT patternT (analyse archive bodyT)))
- branchesT)
+ outputT (monad.each !
+ (function (_ [patternT bodyT])
+ (analyse_pattern #.None inputT patternT (analyse archive bodyT)))
+ branchesT)
outputHC (|> outputH product.left /coverage.determine)
- outputTC (monad.map ! (|>> product.left /coverage.determine) outputT)
+ outputTC (monad.each ! (|>> product.left /coverage.determine) outputT)
_ (.case (monad.mix try.monad /coverage.merged outputHC outputTC)
(#try.Success coverage)
(///.assertion non_exhaustive_pattern_matching [inputC branches coverage]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux
index 753f6a13e..31ed0f394 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/case/coverage.lux
@@ -78,8 +78,8 @@
(#Variant ?max_cases cases)
(|> cases
dictionary.entries
- (list\map (function (_ [idx coverage])
- (format (%.nat idx) " " (%coverage coverage))))
+ (list\each (function (_ [idx coverage])
+ (format (%.nat idx) " " (%coverage coverage))))
(text.interposed " ")
(text.enclosed ["{" "}"])
(format (%.nat (..cases ?max_cases)) " ")
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/function.lux
index 3589b7224..931e27eeb 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/function.lux
@@ -38,8 +38,8 @@
["Function" (%.code functionC)]
["Arguments" (|> arguments
list.enumeration
- (list\map (.function (_ [idx argC])
- (format (%.nat idx) " " (%.code argC))))
+ (list\each (.function (_ [idx argC])
+ (format (%.nat idx) " " (%.code argC))))
(text.interposed text.new_line))]))
(def: .public (function analyse function_name arg_name archive body)
@@ -88,10 +88,10 @@
(in functionA))))
(#.Function inputT outputT)
- (<| (\ ! map (.function (_ [scope bodyA])
- (#/.Function (list\map (|>> /.variable)
- (//scope.environment scope))
- bodyA)))
+ (<| (\ ! each (.function (_ [scope bodyA])
+ (#/.Function (list\each (|>> /.variable)
+ (//scope.environment scope))
+ bodyA)))
/.with_scope
... Functions have access not only to their argument, but
... also to themselves, through a local variable.
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/inference.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/inference.lux
index 452bf6bc1..36ddce2e2 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/inference.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/inference.lux
@@ -62,7 +62,7 @@
(-> Nat Type Type Type)
(case type
(#.Primitive name params)
- (#.Primitive name (list\map (replace parameter_idx replacement) params))
+ (#.Primitive name (list\each (replace parameter_idx replacement) params))
(^template [<tag>]
[(<tag> left right)
@@ -80,7 +80,7 @@
(^template [<tag>]
[(<tag> env quantified)
- (<tag> (list\map (replace parameter_idx replacement) env)
+ (<tag> (list\each (replace parameter_idx replacement) env)
(replace (n.+ 2 parameter_idx) replacement quantified))])
([#.UnivQ]
[#.ExQ])
@@ -184,7 +184,7 @@
(function (recur base)
(case base
(#.Primitive name parameters)
- (#.Primitive name (list\map recur parameters))
+ (#.Primitive name (list\each recur parameters))
(^template [<tag>]
[(<tag> left right)
@@ -198,7 +198,7 @@
(^template [<tag>]
[(<tag> environment quantified)
- (<tag> (list\map recur environment) quantified)])
+ (<tag> (list\each recur environment) quantified)])
([#.UnivQ] [#.ExQ])
_
@@ -230,7 +230,7 @@
(#.Product _)
(let [[lefts right] (list.split_at (-- record_size) (type.flat_tuple inferT))]
(///\in (|> inferT
- (type.function (list\compose lefts (list (type.tuple right))))
+ (type.function (list\composite lefts (list (type.tuple right))))
(substitute_bound target originalT))))
_
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux
index abe4b8df6..1ffb4f787 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/module.lux
@@ -232,15 +232,15 @@
(-> Text (List Tag) (Operation Any))
(do {! ///.monad}
[bindings (..tags module_name)
- _ (monad.map !
- (function (_ tag)
- (case (plist.value tag bindings)
- #.None
- (in [])
+ _ (monad.each !
+ (function (_ tag)
+ (case (plist.value tag bindings)
+ #.None
+ (in [])
- (#.Some _)
- (/.except ..cannot_declare_tag_twice [module_name tag])))
- tags)]
+ (#.Some _)
+ (/.except ..cannot_declare_tag_twice [module_name tag])))
+ tags)]
(in [])))
(def: .public (declare_tags tags exported? type)
@@ -260,7 +260,7 @@
(function (_ state)
(case (|> state (value@ #.modules) (plist.value self_name))
(#.Some module)
- (let [namespaced_tags (list\map (|>> [self_name]) tags)]
+ (let [namespaced_tags (list\each (|>> [self_name]) tags)]
(#try.Success [(revised@ #.modules
(plist.revised self_name
(|>> (revised@ #.tags (function (_ tag_bindings)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux
index b859c7528..c66a7b13f 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/scope.lux
@@ -40,8 +40,8 @@
(|> scope
(value@ [#.locals #.mappings])
(plist.value name)
- (maybe\map (function (_ [type value])
- [type (#variable.Local value)]))))
+ (maybe\each (function (_ [type value])
+ [type (#variable.Local value)]))))
(def: (captured? name scope)
(-> Text Scope Bit)
@@ -101,7 +101,7 @@
(product.right ref+inner))]))
[init_ref #.End]
(list.reversed inner))
- scopes (list\compose inner' outer)]
+ scopes (list\composite inner' outer)]
(#.Right [(with@ #.scopes scopes state)
(#.Some [ref_type ref])]))
)))))
@@ -205,4 +205,4 @@
(-> Scope (List Variable))
(|> scope
(value@ [#.captured #.mappings])
- (list\map (function (_ [_ [_ ref]]) (ref_variable ref)))))
+ (list\each (function (_ [_ [_ ref]]) (ref_variable ref)))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux
index b23704981..76781c92a 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/analysis/structure.lux
@@ -70,9 +70,9 @@
(template [<name>]
[(exception: .public (<name> {key Name} {record (List [Name Code])})
(ex.report ["Tag" (%.code (code.tag key))]
- ["Record" (%.code (code.record (list\map (function (_ [keyI valC])
- [(code.tag keyI) valC])
- record)))]))]
+ ["Record" (%.code (code.record (list\each (function (_ [keyI valC])
+ [(code.tag keyI) valC])
+ record)))]))]
[cannot_repeat_tag]
)
@@ -86,8 +86,8 @@
["Actual" (%.nat actual)]
["Type" (%.type type)]
["Expression" (%.code (|> record
- (list\map (function (_ [keyI valueC])
- [(code.tag keyI) valueC]))
+ (list\each (function (_ [keyI valueC])
+ [(code.tag keyI) valueC]))
code.record))]))
(def: .public (sum analyse lefts right? archive)
@@ -176,11 +176,11 @@
(case [membersT+ membersC+]
[(#.Item memberT #.End) _]
(//type.with_type memberT
- (\ ! map (|>> list) (analyse archive (code.tuple membersC+))))
+ (\ ! each (|>> list) (analyse archive (code.tuple membersC+))))
[_ (#.Item memberC #.End)]
(//type.with_type (type.tuple membersT+)
- (\ ! map (|>> list) (analyse archive memberC)))
+ (\ ! each (|>> list) (analyse archive memberC)))
[(#.Item memberT membersT+') (#.Item memberC membersC+')]
(do !
@@ -218,12 +218,12 @@
_
... Must do inference...
(do !
- [membersTA (monad.map ! (|>> (analyse archive) //type.with_inference)
- membersC)
+ [membersTA (monad.each ! (|>> (analyse archive) //type.with_inference)
+ membersC)
_ (//type.with_env
(check.check expectedT
- (type.tuple (list\map product.left membersTA))))]
- (in (/.tuple (list\map product.right membersTA))))))
+ (type.tuple (list\each product.left membersTA))))]
+ (in (/.tuple (list\each product.right membersTA))))))
(^template [<tag> <instancer>]
[(<tag> _)
@@ -285,17 +285,17 @@
... canonical form (with their corresponding module identified).
(def: .public (normal record)
(-> (List [Code Code]) (Operation (List [Name Code])))
- (monad.map ///.monad
- (function (_ [key val])
- (case key
- [_ (#.Tag key)]
- (do ///.monad
- [key (///extension.lifted (meta.normal key))]
- (in [key val]))
-
- _
- (/.except ..record_keys_must_be_tags [key record])))
- record))
+ (monad.each ///.monad
+ (function (_ [key val])
+ (case key
+ [_ (#.Tag key)]
+ (do ///.monad
+ [key (///extension.lifted (meta.normal key))]
+ (in [key val]))
+
+ _
+ (/.except ..record_keys_must_be_tags [key record])))
+ record))
... Lux already possesses the means to analyse tuples, so
... re-implementing the same functionality for records makes no sense.
@@ -333,9 +333,9 @@
(: (Dictionary Nat Code)
(dictionary.empty n.hash))
record)
- .let [ordered_tuple (list\map (function (_ idx)
- (maybe.trusted (dictionary.value idx idx->val)))
- tuple_range)]]
+ .let [ordered_tuple (list\each (function (_ idx)
+ (maybe.trusted (dictionary.value idx idx->val)))
+ tuple_range)]]
(in [size_ts ordered_tuple recordT]))
))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/directive.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/directive.lux
index 98163f30d..8db59f655 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/directive.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/directive.lux
@@ -96,12 +96,12 @@
(case expansion
(^ (list& <lux_def_module> referrals))
(|> (recur archive <lux_def_module>)
- (\ ! map (revised@ #/.referrals (list\compose referrals))))
+ (\ ! each (revised@ #/.referrals (list\composite referrals))))
_
(|> expansion
- (monad.map ! (recur archive))
- (\ ! map (list\mix /.merge_requirements /.no_requirements)))))
+ (monad.each ! (recur archive))
+ (\ ! each (list\mix /.merge_requirements /.no_requirements)))))
_
(//.except ..not_a_directive code)))))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux
index 18da2442f..898766876 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux
@@ -51,8 +51,9 @@
(dictionary.empty text.hash))
(type: .public (State s i o)
- {#bundle (Bundle s i o)
- #state s})
+ (Record
+ {#bundle (Bundle s i o)
+ #state s}))
(type: .public (Operation s i o v)
(//.Operation (State s i o) v))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux
index 16a8764d5..22c663250 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/js.lux
@@ -115,7 +115,7 @@
(do {! phase.monad}
[constructorA (analysis/type.with_type Any
(phase archive constructorC))
- inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
+ inputsA (monad.each ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
_ (analysis/type.infer .Any)]
(in (#analysis.Extension extension (list& constructorA inputsA)))))]))
@@ -139,7 +139,7 @@
(do {! phase.monad}
[objectA (analysis/type.with_type Any
(phase archive objectC))
- inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
+ inputsA (monad.each ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
_ (analysis/type.infer .Any)]
(in (#analysis.Extension extension (list& (analysis.text methodC)
objectA
@@ -175,7 +175,7 @@
(do {! phase.monad}
[abstractionA (analysis/type.with_type Any
(phase archive abstractionC))
- inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
+ inputsA (monad.each ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
_ (analysis/type.infer Any)]
(in (#analysis.Extension extension (list& abstractionA inputsA)))))]))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux
index d4ffdbb2b..b1b57e1ff 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux
@@ -231,7 +231,7 @@
["Class" class]
["Method" method]
["Arguments" (exception.listing ..signature inputsJT)]
- ["Hints" (exception.listing %.type (list\map product.left hints))]))]
+ ["Hints" (exception.listing %.type (list\each product.left hints))]))]
[no_candidates]
[too_many_candidates]
@@ -360,7 +360,7 @@
(/////analysis.except ..non_jvm_type luxT))
(^ (#.Primitive (static array.type_name) (list elemT)))
- (phase\map jvm.array (jvm_type elemT))
+ (phase\each jvm.array (jvm_type elemT))
(#.Primitive class parametersT)
(case (dictionary.value class ..boxes)
@@ -375,17 +375,17 @@
#.None
(do {! phase.monad}
[parametersJT (: (Operation (List (Type Parameter)))
- (monad.map !
- (function (_ parameterT)
- (do phase.monad
- [parameterJT (jvm_type parameterT)]
- (case (jvm_parser.parameter? parameterJT)
- (#.Some parameterJT)
- (in parameterJT)
-
- #.None
- (/////analysis.except ..non_parameter parameterT))))
- parametersT))]
+ (monad.each !
+ (function (_ parameterT)
+ (do phase.monad
+ [parameterJT (jvm_type parameterT)]
+ (case (jvm_parser.parameter? parameterJT)
+ (#.Some parameterJT)
+ (in parameterJT)
+
+ #.None
+ (/////analysis.except ..non_parameter parameterT))))
+ parametersT))]
(in (jvm.class class parametersJT))))
(#.Ex _)
@@ -557,7 +557,7 @@
(text.starts_with? descriptor.array_prefix name)
(let [[_ unprefixed] (maybe.trusted (text.split_by descriptor.array_prefix name))]
- (\ phase.monad map jvm.array
+ (\ phase.monad each jvm.array
(check_jvm (#.Primitive unprefixed (list)))))
... else
@@ -567,11 +567,11 @@
(list elementT)))
(|> elementT
check_jvm
- (phase\map jvm.array))
+ (phase\each jvm.array))
(#.Primitive name parameters)
(do {! phase.monad}
- [parameters (monad.map ! check_parameter parameters)]
+ [parameters (monad.each ! check_parameter parameters)]
(phase\in (jvm.class name parameters)))
(#.Named name anonymous)
@@ -597,7 +597,7 @@
(def: (check_object objectT)
(-> .Type (Operation External))
(do {! phase.monad}
- [name (\ ! map ..reflection (check_jvm objectT))]
+ [name (\ ! each ..reflection (check_jvm objectT))]
(if (dictionary.key? ..boxes name)
(/////analysis.except ..primitives_are_not_objects [name])
(phase\in name))))
@@ -864,36 +864,36 @@
(do {! phase.monad}
[source_class (phase.lifted (reflection!.load class_loader source_name))
mapping (phase.lifted (reflection!.correspond source_class fromT))]
- (monad.map !
- (function (_ superJT)
- (do !
- [superJT (phase.lifted (reflection!.type superJT))
- .let [super_name (|> superJT ..reflection)]
- super_class (phase.lifted (reflection!.load class_loader super_name))
- superT (reflection_type mapping superJT)]
- (in [[super_name superT] (java/lang/Class::isAssignableFrom super_class target_class)])))
- (case (java/lang/Class::getGenericSuperclass source_class)
- (#.Some super)
- (list& super (array.list (java/lang/Class::getGenericInterfaces source_class)))
-
- #.None
- (if (java/lang/reflect/Modifier::isInterface (java/lang/Class::getModifiers source_class))
- (#.Item (:as java/lang/reflect/Type (ffi.class_for java/lang/Object))
- (array.list (java/lang/Class::getGenericInterfaces source_class)))
- (array.list (java/lang/Class::getGenericInterfaces source_class)))))))
+ (monad.each !
+ (function (_ superJT)
+ (do !
+ [superJT (phase.lifted (reflection!.type superJT))
+ .let [super_name (|> superJT ..reflection)]
+ super_class (phase.lifted (reflection!.load class_loader super_name))
+ superT (reflection_type mapping superJT)]
+ (in [[super_name superT] (java/lang/Class::isAssignableFrom super_class target_class)])))
+ (case (java/lang/Class::getGenericSuperclass source_class)
+ (#.Some super)
+ (list& super (array.list (java/lang/Class::getGenericInterfaces source_class)))
+
+ #.None
+ (if (java/lang/reflect/Modifier::isInterface (java/lang/Class::getModifiers source_class))
+ (#.Item (:as java/lang/reflect/Type (ffi.class_for java/lang/Object))
+ (array.list (java/lang/Class::getGenericInterfaces source_class)))
+ (array.list (java/lang/Class::getGenericInterfaces source_class)))))))
(def: (inheritance_candidate_parents class_loader fromT target_class toT fromC)
(-> java/lang/ClassLoader .Type (java/lang/Class java/lang/Object) .Type Code (Operation (List [[Text .Type] Bit])))
(case fromT
(^ (#.Primitive _ (list& self_classT super_classT super_interfacesT+)))
- (monad.map phase.monad
- (function (_ superT)
- (do {! phase.monad}
- [super_name (\ ! map ..reflection (check_jvm superT))
- super_class (phase.lifted (reflection!.load class_loader super_name))]
- (in [[super_name superT]
- (java/lang/Class::isAssignableFrom super_class target_class)])))
- (list& super_classT super_interfacesT+))
+ (monad.each phase.monad
+ (function (_ superT)
+ (do {! phase.monad}
+ [super_name (\ ! each ..reflection (check_jvm superT))
+ super_class (phase.lifted (reflection!.load class_loader super_name))]
+ (in [[super_name superT]
+ (java/lang/Class::isAssignableFrom super_class target_class)])))
+ (list& super_classT super_interfacesT+))
_
(/////analysis.except ..cannot_cast [fromT toT fromC])))
@@ -905,10 +905,10 @@
(^ (list fromC))
(do {! phase.monad}
[toT (///.lifted meta.expected_type)
- target_name (\ ! map ..reflection (check_jvm toT))
+ target_name (\ ! each ..reflection (check_jvm toT))
[fromT fromA] (typeA.with_inference
(analyse archive fromC))
- source_name (\ ! map ..reflection (check_jvm fromT))
+ source_name (\ ! each ..reflection (check_jvm fromT))
can_cast? (: (Operation Bit)
(`` (cond (~~ (template [<primitive> <object>]
[(let [=primitive (reflection.reflection <primitive>)]
@@ -951,7 +951,7 @@
(class_candidate_parents class_loader current_name currentT target_name target_class)))]
(case (|> candidate_parents
(list.only product.right)
- (list\map product.left))
+ (list\each product.left))
(#.Item [next_name nextT] _)
(recur [next_name nextT])
@@ -1090,7 +1090,7 @@
(do phase.monad
[parameters (|> (java/lang/reflect/Method::getGenericParameterTypes method)
array.list
- (monad.map try.monad reflection!.type)
+ (monad.each try.monad reflection!.type)
phase.lifted)
.let [modifiers (java/lang/reflect/Method::getModifiers method)
correct_class? (java/lang/Object::equals class (java/lang/reflect/Method::getDeclaringClass method))
@@ -1136,7 +1136,7 @@
(do phase.monad
[parameters (|> (java/lang/reflect/Constructor::getGenericParameterTypes constructor)
array.list
- (monad.map try.monad reflection!.type)
+ (monad.each try.monad reflection!.type)
phase.lifted)]
(in (and (java/lang/Object::equals class (java/lang/reflect/Constructor::getDeclaringClass constructor))
(n.= (list.size inputsJT) (list.size parameters))
@@ -1159,15 +1159,15 @@
(def: (jvm_type_var_mapping owner_tvars method_tvars)
(-> (List Text) (List Text) [(List .Type) Mapping])
- (let [jvm_tvars (list\compose owner_tvars method_tvars)
+ (let [jvm_tvars (list\composite owner_tvars method_tvars)
lux_tvars (|> jvm_tvars
list.reversed
list.enumeration
- (list\map (function (_ [idx name])
- [name (index_parameter idx)]))
+ (list\each (function (_ [idx name])
+ [name (index_parameter idx)]))
list.reversed)
num_owner_tvars (list.size owner_tvars)
- owner_tvarsT (|> lux_tvars (list.first num_owner_tvars) (list\map product.right))
+ owner_tvarsT (|> lux_tvars (list.first num_owner_tvars) (list\each product.right))
mapping (dictionary.of_list text.hash lux_tvars)]
[owner_tvarsT mapping]))
@@ -1181,28 +1181,28 @@
_
(|> (java/lang/Class::getTypeParameters owner)
array.list
- (list\map (|>> java/lang/reflect/TypeVariable::getName))))
+ (list\each (|>> java/lang/reflect/TypeVariable::getName))))
method_tvars (|> (java/lang/reflect/Method::getTypeParameters method)
array.list
- (list\map (|>> java/lang/reflect/TypeVariable::getName)))
+ (list\each (|>> java/lang/reflect/TypeVariable::getName)))
[owner_tvarsT mapping] (jvm_type_var_mapping owner_tvars method_tvars)]
(do {! phase.monad}
[inputsT (|> (java/lang/reflect/Method::getGenericParameterTypes method)
array.list
- (monad.map ! (|>> reflection!.type phase.lifted))
- (phase\map (monad.map ! (..reflection_type mapping)))
- phase\join)
+ (monad.each ! (|>> reflection!.type phase.lifted))
+ (phase\each (monad.each ! (..reflection_type mapping)))
+ phase\conjoint)
outputT (|> method
java/lang/reflect/Method::getGenericReturnType
reflection!.return
phase.lifted
- (phase\map (..reflection_return mapping))
- phase\join)
+ (phase\each (..reflection_return mapping))
+ phase\conjoint)
exceptionsT (|> (java/lang/reflect/Method::getGenericExceptionTypes method)
array.list
- (monad.map ! (|>> reflection!.type phase.lifted))
- (phase\map (monad.map ! (..reflection_type mapping)))
- phase\join)
+ (monad.each ! (|>> reflection!.type phase.lifted))
+ (phase\each (monad.each ! (..reflection_type mapping)))
+ phase\conjoint)
.let [methodT (<| (type.univ_q (dictionary.size mapping))
(type.function (case method_style
#Static
@@ -1221,22 +1221,22 @@
(let [owner (java/lang/reflect/Constructor::getDeclaringClass constructor)
owner_tvars (|> (java/lang/Class::getTypeParameters owner)
array.list
- (list\map (|>> java/lang/reflect/TypeVariable::getName)))
+ (list\each (|>> java/lang/reflect/TypeVariable::getName)))
method_tvars (|> (java/lang/reflect/Constructor::getTypeParameters constructor)
array.list
- (list\map (|>> java/lang/reflect/TypeVariable::getName)))
+ (list\each (|>> java/lang/reflect/TypeVariable::getName)))
[owner_tvarsT mapping] (jvm_type_var_mapping owner_tvars method_tvars)]
(do {! phase.monad}
[inputsT (|> (java/lang/reflect/Constructor::getGenericParameterTypes constructor)
array.list
- (monad.map ! (|>> reflection!.type phase.lifted))
- (phase\map (monad.map ! (reflection_type mapping)))
- phase\join)
+ (monad.each ! (|>> reflection!.type phase.lifted))
+ (phase\each (monad.each ! (reflection_type mapping)))
+ phase\conjoint)
exceptionsT (|> (java/lang/reflect/Constructor::getGenericExceptionTypes constructor)
array.list
- (monad.map ! (|>> reflection!.type phase.lifted))
- (phase\map (monad.map ! (reflection_type mapping)))
- phase\join)
+ (monad.each ! (|>> reflection!.type phase.lifted))
+ (phase\each (monad.each ! (reflection_type mapping)))
+ phase\conjoint)
.let [objectT (#.Primitive (java/lang/Class::getName owner) owner_tvarsT)
constructorT (<| (type.univ_q (dictionary.size mapping))
(type.function inputsT)
@@ -1267,7 +1267,7 @@
(-> <type> (List (Type Var)))
(|>> <method>
array.list
- (list\map (|>> java/lang/reflect/TypeVariable::getName jvm.var))))]
+ (list\each (|>> java/lang/reflect/TypeVariable::getName jvm.var))))]
[class_type_variables (java/lang/Class java/lang/Object) java/lang/Class::getTypeParameters]
[constructor_type_variables (java/lang/reflect/Constructor java/lang/Object) java/lang/reflect/Constructor::getTypeParameters]
@@ -1276,8 +1276,8 @@
(def: (aliasing expected actual)
(-> (List (Type Var)) (List (Type Var)) Aliasing)
- (|> (list.zipped/2 (list\map jvm_parser.name actual)
- (list\map jvm_parser.name expected))
+ (|> (list.zipped/2 (list\each jvm_parser.name actual)
+ (list\each jvm_parser.name expected))
(dictionary.of_list text.hash)))
(def: (method_candidate class_loader actual_class_tvars class_name actual_method_tvars method_name method_style inputsJT)
@@ -1289,17 +1289,17 @@
java/lang/Class::getDeclaredMethods
array.list
(list.only (|>> java/lang/reflect/Method::getName (text\= method_name)))
- (monad.map ! (: (-> java/lang/reflect/Method (Operation Evaluation))
- (function (_ method)
- (do !
- [.let [expected_method_tvars (method_type_variables method)
- aliasing (dictionary.merged (..aliasing expected_class_tvars actual_class_tvars)
- (..aliasing expected_method_tvars actual_method_tvars))]
- passes? (check_method aliasing class method_name method_style inputsJT method)]
- (\ ! map (if passes?
- (|>> #Pass)
- (|>> #Hint))
- (method_signature method_style method)))))))]
+ (monad.each ! (: (-> java/lang/reflect/Method (Operation Evaluation))
+ (function (_ method)
+ (do !
+ [.let [expected_method_tvars (method_type_variables method)
+ aliasing (dictionary.merged (..aliasing expected_class_tvars actual_class_tvars)
+ (..aliasing expected_method_tvars actual_method_tvars))]
+ passes? (check_method aliasing class method_name method_style inputsJT method)]
+ (\ ! each (if passes?
+ (|>> #Pass)
+ (|>> #Hint))
+ (method_signature method_style method)))))))]
(case (list.all pass! candidates)
(#.Item method #.End)
(in method)
@@ -1321,15 +1321,15 @@
candidates (|> class
java/lang/Class::getConstructors
array.list
- (monad.map ! (function (_ constructor)
- (do !
- [.let [expected_method_tvars (constructor_type_variables constructor)
- aliasing (dictionary.merged (..aliasing expected_class_tvars actual_class_tvars)
- (..aliasing expected_method_tvars actual_method_tvars))]
- passes? (check_constructor aliasing class inputsJT constructor)]
- (\ ! map
- (if passes? (|>> #Pass) (|>> #Hint))
- (constructor_signature constructor))))))]
+ (monad.each ! (function (_ constructor)
+ (do !
+ [.let [expected_method_tvars (constructor_type_variables constructor)
+ aliasing (dictionary.merged (..aliasing expected_class_tvars actual_class_tvars)
+ (..aliasing expected_method_tvars actual_method_tvars))]
+ passes? (check_constructor aliasing class inputsJT constructor)]
+ (\ ! each
+ (if passes? (|>> #Pass) (|>> #Hint))
+ (constructor_signature constructor))))))]
(case (list.all pass! candidates)
(#.Item constructor #.End)
(in constructor)
@@ -1358,9 +1358,9 @@
(def: (decorate_inputs typesT inputsA)
(-> (List (Type Value)) (List Analysis) (List Analysis))
(|> inputsA
- (list.zipped/2 (list\map (|>> ..signature /////analysis.text) typesT))
- (list\map (function (_ [type value])
- (/////analysis.tuple (list type value))))))
+ (list.zipped/2 (list\each (|>> ..signature /////analysis.text) typesT))
+ (list\each (function (_ [type value])
+ (/////analysis.tuple (list type value))))))
(def: type_vars
(<code>.tuple (<>.some ..var)))
@@ -1372,11 +1372,11 @@
(function (_ extension_name analyse archive [class_tvars [class method] method_tvars argsTC])
(do phase.monad
[_ (..ensure_fresh_class! class_loader class)
- .let [argsT (list\map product.left argsTC)]
+ .let [argsT (list\each product.left argsTC)]
[methodT deprecated? exceptionsT] (..method_candidate class_loader class_tvars class method_tvars method #Static argsT)
_ (phase.assertion ..deprecated_method [class method methodT]
(not deprecated?))
- [outputT argsA] (inferenceA.general archive analyse methodT (list\map product.right argsTC))
+ [outputT argsA] (inferenceA.general archive analyse methodT (list\each product.right argsTC))
outputJT (check_return outputT)]
(in (#/////analysis.Extension extension_name (list& (/////analysis.text (..signature (jvm.class class (list))))
(/////analysis.text method)
@@ -1390,11 +1390,11 @@
(function (_ extension_name analyse archive [class_tvars [class method] method_tvars objectC argsTC])
(do phase.monad
[_ (..ensure_fresh_class! class_loader class)
- .let [argsT (list\map product.left argsTC)]
+ .let [argsT (list\each product.left argsTC)]
[methodT deprecated? exceptionsT] (..method_candidate class_loader class_tvars class method_tvars method #Virtual argsT)
_ (phase.assertion ..deprecated_method [class method methodT]
(not deprecated?))
- [outputT allA] (inferenceA.general archive analyse methodT (list& objectC (list\map product.right argsTC)))
+ [outputT allA] (inferenceA.general archive analyse methodT (list& objectC (list\each product.right argsTC)))
.let [[objectA argsA] (case allA
(#.Item objectA argsA)
[objectA argsA]
@@ -1415,11 +1415,11 @@
(function (_ extension_name analyse archive [class_tvars [class method] method_tvars objectC argsTC])
(do phase.monad
[_ (..ensure_fresh_class! class_loader class)
- .let [argsT (list\map product.left argsTC)]
+ .let [argsT (list\each product.left argsTC)]
[methodT deprecated? exceptionsT] (..method_candidate class_loader class_tvars class method_tvars method #Special argsT)
_ (phase.assertion ..deprecated_method [class method methodT]
(not deprecated?))
- [outputT argsA] (inferenceA.general archive analyse methodT (list& objectC (list\map product.right argsTC)))
+ [outputT argsA] (inferenceA.general archive analyse methodT (list& objectC (list\each product.right argsTC)))
outputJT (check_return outputT)]
(in (#/////analysis.Extension extension_name (list& (/////analysis.text (..signature (jvm.class class (list))))
(/////analysis.text method)
@@ -1433,14 +1433,14 @@
(function (_ extension_name analyse archive [class_tvars [class_name method] method_tvars objectC argsTC])
(do phase.monad
[_ (..ensure_fresh_class! class_loader class_name)
- .let [argsT (list\map product.left argsTC)]
+ .let [argsT (list\each product.left argsTC)]
class (phase.lifted (reflection!.load class_loader class_name))
_ (phase.assertion non_interface class_name
(java/lang/reflect/Modifier::isInterface (java/lang/Class::getModifiers class)))
[methodT deprecated? exceptionsT] (..method_candidate class_loader class_tvars class_name method_tvars method #Interface argsT)
_ (phase.assertion ..deprecated_method [class_name method methodT]
(not deprecated?))
- [outputT allA] (inferenceA.general archive analyse methodT (list& objectC (list\map product.right argsTC)))
+ [outputT allA] (inferenceA.general archive analyse methodT (list& objectC (list\each product.right argsTC)))
.let [[objectA argsA] (case allA
(#.Item objectA argsA)
[objectA argsA]
@@ -1462,11 +1462,11 @@
(function (_ extension_name analyse archive [class_tvars class method_tvars argsTC])
(do phase.monad
[_ (..ensure_fresh_class! class_loader class)
- .let [argsT (list\map product.left argsTC)]
+ .let [argsT (list\each product.left argsTC)]
[methodT deprecated? exceptionsT] (..constructor_candidate class_loader class_tvars class method_tvars argsT)
_ (phase.assertion ..deprecated_method [class ..constructor_method methodT]
(not deprecated?))
- [outputT argsA] (inferenceA.general archive analyse methodT (list\map product.right argsTC))]
+ [outputT argsA] (inferenceA.general archive analyse methodT (list\each product.right argsTC))]
(in (#/////analysis.Extension extension_name (list& (/////analysis.text (..signature (jvm.class class (list))))
(decorate_inputs argsT argsA))))))]))
@@ -1517,7 +1517,7 @@
(def: (annotation_analysis [name parameters])
(-> (Annotation Analysis) Analysis)
(/////analysis.tuple (list& (/////analysis.text name)
- (list\map annotation_parameter_analysis parameters))))
+ (list\each annotation_parameter_analysis parameters))))
(template [<name> <category>]
[(def: <name>
@@ -1547,24 +1547,24 @@
(|>> java/lang/Class::getDeclaredMethods
array.list
<only>
- (monad.map try.monad
- (function (_ method)
- (do {! try.monad}
- [.let [type_variables (|> (java/lang/reflect/Method::getTypeParameters method)
- array.list
- (list\map (|>> java/lang/reflect/TypeVariable::getName
- jvm.var)))]
- inputs (|> (java/lang/reflect/Method::getGenericParameterTypes method)
- array.list
- (monad.map ! reflection!.type))
- return (|> method
- java/lang/reflect/Method::getGenericReturnType
- reflection!.return)
- exceptions (|> (java/lang/reflect/Method::getGenericExceptionTypes method)
- array.list
- (monad.map ! reflection!.class))]
- (in [(java/lang/reflect/Method::getName method)
- (jvm.method [type_variables inputs return exceptions])]))))))]
+ (monad.each try.monad
+ (function (_ method)
+ (do {! try.monad}
+ [.let [type_variables (|> (java/lang/reflect/Method::getTypeParameters method)
+ array.list
+ (list\each (|>> java/lang/reflect/TypeVariable::getName
+ jvm.var)))]
+ inputs (|> (java/lang/reflect/Method::getGenericParameterTypes method)
+ array.list
+ (monad.each ! reflection!.type))
+ return (|> method
+ java/lang/reflect/Method::getGenericReturnType
+ reflection!.return)
+ exceptions (|> (java/lang/reflect/Method::getGenericExceptionTypes method)
+ array.list
+ (monad.each ! reflection!.class))]
+ (in [(java/lang/reflect/Method::getName method)
+ (jvm.method [type_variables inputs return exceptions])]))))))]
[abstract_methods (list.only (|>> java/lang/reflect/Method::getModifiers java/lang/reflect/Modifier::isAbstract))]
[methods (<|)]
@@ -1575,10 +1575,10 @@
(template [<name> <methods>]
[(def: (<name> class_loader)
(-> java/lang/ClassLoader (List (Type Class)) (Try (List [Text (Type Method)])))
- (|>> (monad.map try.monad (|>> ..reflection (reflection!.load class_loader)))
- (try\map (monad.map try.monad <methods>))
- try\join
- (try\map list\join)))]
+ (|>> (monad.each try.monad (|>> ..reflection (reflection!.load class_loader)))
+ (try\each (monad.each try.monad <methods>))
+ try\conjoint
+ (try\each list\conjoint)))]
[all_abstract_methods ..abstract_methods]
[all_methods ..methods]
@@ -1660,28 +1660,28 @@
annotations vars exceptions
self_name arguments super_arguments body] method]
(do {! phase.monad}
- [annotationsA (monad.map ! (function (_ [name parameters])
- (do !
- [parametersA (monad.map ! (function (_ [name value])
- (do !
- [valueA (analyse archive value)]
- (in [name valueA])))
- parameters)]
- (in [name parametersA])))
- annotations)
- super_arguments (monad.map ! (function (_ [jvmT super_argC])
- (do !
- [luxT (reflection_type mapping jvmT)
- super_argA (typeA.with_type luxT
- (analyse archive super_argC))]
- (in [jvmT super_argA])))
- super_arguments)
- arguments' (monad.map !
- (function (_ [name jvmT])
- (do !
- [luxT (boxed_reflection_type mapping jvmT)]
- (in [name luxT])))
- arguments)
+ [annotationsA (monad.each ! (function (_ [name parameters])
+ (do !
+ [parametersA (monad.each ! (function (_ [name value])
+ (do !
+ [valueA (analyse archive value)]
+ (in [name valueA])))
+ parameters)]
+ (in [name parametersA])))
+ annotations)
+ super_arguments (monad.each ! (function (_ [jvmT super_argC])
+ (do !
+ [luxT (reflection_type mapping jvmT)
+ super_argA (typeA.with_type luxT
+ (analyse archive super_argC))]
+ (in [jvmT super_argA])))
+ super_arguments)
+ arguments' (monad.each !
+ (function (_ [name jvmT])
+ (do !
+ [luxT (boxed_reflection_type mapping jvmT)]
+ (in [name luxT])))
+ arguments)
[scope bodyA] (|> arguments'
(#.Item [self_name selfT])
list.reversed
@@ -1691,15 +1691,15 @@
(in (/////analysis.tuple (list (/////analysis.text ..constructor_tag)
(visibility_analysis visibility)
(/////analysis.bit strict_fp?)
- (/////analysis.tuple (list\map annotation_analysis annotationsA))
- (/////analysis.tuple (list\map var_analysis vars))
+ (/////analysis.tuple (list\each annotation_analysis annotationsA))
+ (/////analysis.tuple (list\each var_analysis vars))
(/////analysis.text self_name)
- (/////analysis.tuple (list\map ..argument_analysis arguments))
- (/////analysis.tuple (list\map class_analysis exceptions))
- (/////analysis.tuple (list\map typed_analysis super_arguments))
+ (/////analysis.tuple (list\each ..argument_analysis arguments))
+ (/////analysis.tuple (list\each class_analysis exceptions))
+ (/////analysis.tuple (list\each typed_analysis super_arguments))
(#/////analysis.Function
- (list\map (|>> /////analysis.variable)
- (scope.environment scope))
+ (list\each (|>> /////analysis.variable)
+ (scope.environment scope))
(/////analysis.tuple (list bodyA)))
))))))
@@ -1742,22 +1742,22 @@
self_name arguments return exceptions
body] method]
(do {! phase.monad}
- [annotationsA (monad.map ! (function (_ [name parameters])
- (do !
- [parametersA (monad.map ! (function (_ [name value])
- (do !
- [valueA (analyse archive value)]
- (in [name valueA])))
- parameters)]
- (in [name parametersA])))
- annotations)
+ [annotationsA (monad.each ! (function (_ [name parameters])
+ (do !
+ [parametersA (monad.each ! (function (_ [name value])
+ (do !
+ [valueA (analyse archive value)]
+ (in [name valueA])))
+ parameters)]
+ (in [name parametersA])))
+ annotations)
returnT (reflection_return mapping return)
- arguments' (monad.map !
- (function (_ [name jvmT])
- (do !
- [luxT (boxed_reflection_type mapping jvmT)]
- (in [name luxT])))
- arguments)
+ arguments' (monad.each !
+ (function (_ [name jvmT])
+ (do !
+ [luxT (boxed_reflection_type mapping jvmT)]
+ (in [name luxT])))
+ arguments)
[scope bodyA] (|> arguments'
(#.Item [self_name selfT])
list.reversed
@@ -1769,15 +1769,15 @@
(visibility_analysis visibility)
(/////analysis.bit final?)
(/////analysis.bit strict_fp?)
- (/////analysis.tuple (list\map annotation_analysis annotationsA))
- (/////analysis.tuple (list\map var_analysis vars))
+ (/////analysis.tuple (list\each annotation_analysis annotationsA))
+ (/////analysis.tuple (list\each var_analysis vars))
(/////analysis.text self_name)
- (/////analysis.tuple (list\map ..argument_analysis arguments))
+ (/////analysis.tuple (list\each ..argument_analysis arguments))
(return_analysis return)
- (/////analysis.tuple (list\map class_analysis exceptions))
+ (/////analysis.tuple (list\each class_analysis exceptions))
(#/////analysis.Function
- (list\map (|>> /////analysis.variable)
- (scope.environment scope))
+ (list\each (|>> /////analysis.variable)
+ (scope.environment scope))
(/////analysis.tuple (list bodyA)))
))))))
@@ -1816,22 +1816,22 @@
arguments return
body] method]
(do {! phase.monad}
- [annotationsA (monad.map ! (function (_ [name parameters])
- (do !
- [parametersA (monad.map ! (function (_ [name value])
- (do !
- [valueA (analyse archive value)]
- (in [name valueA])))
- parameters)]
- (in [name parametersA])))
- annotations)
+ [annotationsA (monad.each ! (function (_ [name parameters])
+ (do !
+ [parametersA (monad.each ! (function (_ [name value])
+ (do !
+ [valueA (analyse archive value)]
+ (in [name valueA])))
+ parameters)]
+ (in [name parametersA])))
+ annotations)
returnT (reflection_return mapping return)
- arguments' (monad.map !
- (function (_ [name jvmT])
- (do !
- [luxT (boxed_reflection_type mapping jvmT)]
- (in [name luxT])))
- arguments)
+ arguments' (monad.each !
+ (function (_ [name jvmT])
+ (do !
+ [luxT (boxed_reflection_type mapping jvmT)]
+ (in [name luxT])))
+ arguments)
[scope bodyA] (|> arguments'
list.reversed
(list\mix scope.with_local (analyse archive body))
@@ -1841,15 +1841,15 @@
(/////analysis.text method_name)
(visibility_analysis visibility)
(/////analysis.bit strict_fp?)
- (/////analysis.tuple (list\map annotation_analysis annotationsA))
- (/////analysis.tuple (list\map var_analysis vars))
- (/////analysis.tuple (list\map ..argument_analysis arguments))
+ (/////analysis.tuple (list\each annotation_analysis annotationsA))
+ (/////analysis.tuple (list\each var_analysis vars))
+ (/////analysis.tuple (list\each ..argument_analysis arguments))
(return_analysis return)
- (/////analysis.tuple (list\map class_analysis
- exceptions))
+ (/////analysis.tuple (list\each class_analysis
+ exceptions))
(#/////analysis.Function
- (list\map (|>> /////analysis.variable)
- (scope.environment scope))
+ (list\each (|>> /////analysis.variable)
+ (scope.environment scope))
(/////analysis.tuple (list bodyA)))
))))))
@@ -1910,12 +1910,12 @@
(if (n.= expected_count actual_count)
(do {! phase.monad}
[parent_parameters (|> parent_parameters
- (monad.map maybe.monad jvm_parser.var?)
+ (monad.each maybe.monad jvm_parser.var?)
try.of_maybe
phase.lifted)]
(|> super_parameters
- (monad.map ! (..reflection_type mapping))
- (\ ! map (|>> (list.zipped/2 parent_parameters)))))
+ (monad.each ! (..reflection_type mapping))
+ (\ ! each (|>> (list.zipped/2 parent_parameters)))))
(phase.lifted (exception.except ..mismatched_super_parameters [parent_name expected_count actual_count]))))
#.None
@@ -1924,12 +1924,12 @@
(def: .public (with_fresh_type_vars vars mapping)
(-> (List (Type Var)) Mapping (Operation Mapping))
(do {! phase.monad}
- [pairings (monad.map ! (function (_ var)
- (do !
- [[_ exT] (typeA.with_env
- check.existential)]
- (in [var exT])))
- vars)]
+ [pairings (monad.each ! (function (_ var)
+ (do !
+ [[_ exT] (typeA.with_env
+ check.existential)]
+ (in [var exT])))
+ vars)]
(in (list\mix (function (_ [varJ varT] mapping)
(dictionary.has (jvm_parser.name varJ) varT mapping))
mapping
@@ -1967,7 +1967,7 @@
(#/////analysis.Complex
(#/////analysis.Tuple (|> arity
list.indices
- (list\map (|>> (n.+ 2) #/////analysis.Bind)))))
+ (list\each (|>> (n.+ 2) #/////analysis.Bind)))))
#/////analysis.then
bodyA}
@@ -1982,21 +1982,21 @@
(do {! phase.monad}
[mapping (..with_override_mapping supers parent_type mapping)
mapping (..with_fresh_type_vars vars mapping)
- annotationsA (monad.map ! (function (_ [name parameters])
- (do !
- [parametersA (monad.map ! (function (_ [name value])
- (do !
- [valueA (analyse archive value)]
- (in [name valueA])))
- parameters)]
- (in [name parametersA])))
- annotations)
- arguments' (monad.map !
- (function (_ [name jvmT])
- (do !
- [luxT (boxed_reflection_type mapping jvmT)]
- (in [name luxT])))
- arguments)
+ annotationsA (monad.each ! (function (_ [name parameters])
+ (do !
+ [parametersA (monad.each ! (function (_ [name value])
+ (do !
+ [valueA (analyse archive value)]
+ (in [name valueA])))
+ parameters)]
+ (in [name parametersA])))
+ annotations)
+ arguments' (monad.each !
+ (function (_ [name jvmT])
+ (do !
+ [luxT (boxed_reflection_type mapping jvmT)]
+ (in [name luxT])))
+ arguments)
returnT (boxed_reflection_return mapping return)
[scope bodyA] (|> arguments'
(#.Item [self_name selfT])
@@ -2008,16 +2008,16 @@
(class_analysis parent_type)
(/////analysis.text method_name)
(/////analysis.bit strict_fp?)
- (/////analysis.tuple (list\map annotation_analysis annotationsA))
- (/////analysis.tuple (list\map var_analysis vars))
+ (/////analysis.tuple (list\each annotation_analysis annotationsA))
+ (/////analysis.tuple (list\each var_analysis vars))
(/////analysis.text self_name)
- (/////analysis.tuple (list\map ..argument_analysis arguments))
+ (/////analysis.tuple (list\each ..argument_analysis arguments))
(return_analysis return)
- (/////analysis.tuple (list\map class_analysis
- exceptions))
+ (/////analysis.tuple (list\each class_analysis
+ exceptions))
(#/////analysis.Function
- (list\map (|>> /////analysis.variable)
- (scope.environment scope))
+ (list\each (|>> /////analysis.variable)
+ (scope.environment scope))
(..hide_method_body (list.size arguments) bodyA))
))))))
@@ -2026,11 +2026,11 @@
(def: .public parameter_types
(-> (List (Type Var)) (Check (List [(Type Var) .Type])))
- (monad.map check.monad
- (function (_ parameterJ)
- (do check.monad
- [[_ parameterT] check.existential]
- (in [parameterJ parameterT])))))
+ (monad.each check.monad
+ (function (_ parameterJ)
+ (do check.monad
+ [[_ parameterT] check.existential]
+ (in [parameterJ parameterT])))))
(def: (mismatched_methods super_set sub_set)
(-> (List [Text (Type Method)])
@@ -2061,7 +2061,7 @@
class (phase.lifted (reflection!.load class_loader name))
.let [expected_parameters (|> (java/lang/Class::getTypeParameters class)
array.list
- (list\map (|>> java/lang/reflect/TypeVariable::getName)))]
+ (list\each (|>> java/lang/reflect/TypeVariable::getName)))]
_ (phase.assertion ..class_parameter_mismatch [expected_parameters actual_parameters]
(n.= (list.size expected_parameters)
(list.size actual_parameters)))]
@@ -2086,18 +2086,18 @@
(do {! phase.monad}
[required_abstract_methods (phase.lifted (all_abstract_methods class_loader supers))
available_methods (phase.lifted (all_methods class_loader supers))
- overriden_methods (monad.map ! (function (_ [parent_type method_name
- strict_fp? annotations type_vars
- self_name arguments return exceptions
- body])
- (do !
- [aliasing (super_aliasing class_loader parent_type)]
- (in [method_name (|> (jvm.method [type_vars
- (list\map product.right arguments)
- return
- exceptions])
- (jvm_alias.method aliasing))])))
- methods)
+ overriden_methods (monad.each ! (function (_ [parent_type method_name
+ strict_fp? annotations type_vars
+ self_name arguments return exceptions
+ body])
+ (do !
+ [aliasing (super_aliasing class_loader parent_type)]
+ (in [method_name (|> (jvm.method [type_vars
+ (list\each product.right arguments)
+ return
+ exceptions])
+ (jvm_alias.method aliasing))])))
+ methods)
.let [missing_abstract_methods (mismatched_methods overriden_methods required_abstract_methods)
invalid_overriden_methods (mismatched_methods available_methods overriden_methods)]
_ (phase.assertion ..missing_abstract_methods missing_abstract_methods
@@ -2122,7 +2122,7 @@
methods])
(do {! phase.monad}
[_ (..ensure_fresh_class! class_loader (..reflection super_class))
- _ (monad.map ! (|>> ..reflection (..ensure_fresh_class! class_loader)) super_interfaces)
+ _ (monad.each ! (|>> ..reflection (..ensure_fresh_class! class_loader)) super_interfaces)
parameters (typeA.with_env
(..parameter_types parameters))
.let [mapping (list\mix (function (_ [parameterJ parameterT] mapping)
@@ -2134,9 +2134,9 @@
super_classT (typeA.with_env
(luxT.check (luxT.class mapping) (..signature super_class)))
super_interfaceT+ (typeA.with_env
- (monad.map check.monad
- (|>> ..signature (luxT.check (luxT.class mapping)))
- super_interfaces))
+ (monad.each check.monad
+ (|>> ..signature (luxT.check (luxT.class mapping)))
+ super_interfaces))
selfT (///.lifted (do meta.monad
[where meta.current_module_name
id meta.seed]
@@ -2144,20 +2144,20 @@
super_classT
super_interfaceT+))))
_ (typeA.infer selfT)
- constructor_argsA+ (monad.map ! (function (_ [type term])
- (do !
- [argT (reflection_type mapping type)
- termA (typeA.with_type argT
- (analyse archive term))]
- (in [type termA])))
- constructor_args)
+ constructor_argsA+ (monad.each ! (function (_ [type term])
+ (do !
+ [argT (reflection_type mapping type)
+ termA (typeA.with_type argT
+ (analyse archive term))]
+ (in [type termA])))
+ constructor_args)
.let [supers (#.Item super_class super_interfaces)]
_ (..require_complete_method_concretion class_loader supers methods)
- methodsA (monad.map ! (analyse_overriden_method analyse archive selfT mapping supers) methods)]
+ methodsA (monad.each ! (analyse_overriden_method analyse archive selfT mapping supers) methods)]
(in (#/////analysis.Extension extension_name
(list (class_analysis super_class)
- (/////analysis.tuple (list\map class_analysis super_interfaces))
- (/////analysis.tuple (list\map typed_analysis constructor_argsA+))
+ (/////analysis.tuple (list\each class_analysis super_interfaces))
+ (/////analysis.tuple (list\each typed_analysis constructor_argsA+))
(/////analysis.tuple methodsA))))))]))
(def: (bundle::class class_loader)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lua.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lua.lux
index 9428404aa..7cfd9eed6 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lua.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lua.lux
@@ -139,7 +139,7 @@
(do {! phase.monad}
[objectA (analysis/type.with_type ..Object
(phase archive objectC))
- inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
+ inputsA (monad.each ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
_ (analysis/type.infer .Any)]
(in (#analysis.Extension extension (list& (analysis.text methodC)
objectA
@@ -196,7 +196,7 @@
(do {! phase.monad}
[abstractionA (analysis/type.with_type ..Function
(phase archive abstractionC))
- inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
+ inputsA (monad.each ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
_ (analysis/type.infer Any)]
(in (#analysis.Extension extension (list& abstractionA inputsA)))))]))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux
index e56a48572..827edf300 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/lux.lux
@@ -55,11 +55,11 @@
(if (n.= num_expected num_actual)
(do {! ////.monad}
[_ (typeA.infer outputT)
- argsA (monad.map !
- (function (_ [argT argC])
- (typeA.with_type argT
- (analyse archive argC)))
- (list.zipped/2 inputsT+ args))]
+ argsA (monad.each !
+ (function (_ [argT argC])
+ (typeA.with_type argT
+ (analyse archive argC)))
+ (list.zipped/2 inputsT+ args))]
(in (#////analysis.Extension extension_name argsA)))
(////analysis.except ///.incorrect_arity [extension_name num_expected num_actual]))))))
@@ -105,19 +105,19 @@
[input (typeA.with_type text.Char
(phase archive input))
expectedT (///.lifted meta.expected_type)
- conditionals (monad.map ! (function (_ [cases branch])
- (do !
- [branch (typeA.with_type expectedT
- (phase archive branch))]
- (in [cases branch])))
- conditionals)
+ conditionals (monad.each ! (function (_ [cases branch])
+ (do !
+ [branch (typeA.with_type expectedT
+ (phase archive branch))]
+ (in [cases branch])))
+ conditionals)
else (typeA.with_type expectedT
(phase archive else))]
(in (|> conditionals
- (list\map (function (_ [cases branch])
- (////analysis.tuple
- (list (////analysis.tuple (list\map (|>> ////analysis.nat) cases))
- branch))))
+ (list\each (function (_ [cases branch])
+ (////analysis.tuple
+ (list (////analysis.tuple (list\each (|>> ////analysis.nat) cases))
+ branch))))
(list& input else)
(#////analysis.Extension extension_name)))))])))
@@ -164,7 +164,7 @@
(case args
(^ (list typeC valueC))
(do {! ////.monad}
- [actualT (\ ! map (|>> (:as Type))
+ [actualT (\ ! each (|>> (:as Type))
(eval archive Type typeC))
_ (typeA.infer actualT)]
(typeA.with_type actualT
@@ -179,7 +179,7 @@
(case args
(^ (list typeC valueC))
(do {! ////.monad}
- [actualT (\ ! map (|>> (:as Type))
+ [actualT (\ ! each (|>> (:as Type))
(eval archive Type typeC))
_ (typeA.infer actualT)
[valueT valueA] (typeA.with_inference
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux
index 306eb960e..02cb8bbb7 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux
@@ -125,7 +125,7 @@
[($_ <>.and <c>.text (<>.some <c>.any))
(function (_ extension phase archive [constructor inputsC])
(do {! phase.monad}
- [inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
+ [inputsA (monad.each ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
_ (analysis/type.infer .Any)]
(in (#analysis.Extension extension (list& (analysis.text constructor) inputsA)))))]))
@@ -149,7 +149,7 @@
(do {! phase.monad}
[objectA (analysis/type.with_type ..Object
(phase archive objectC))
- inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
+ inputsA (monad.each ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
_ (analysis/type.infer .Any)]
(in (#analysis.Extension extension (list& (analysis.text methodC)
objectA
@@ -183,7 +183,7 @@
(do {! phase.monad}
[abstractionA (analysis/type.with_type ..Function
(phase archive abstractionC))
- inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
+ inputsA (monad.each ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
_ (analysis/type.infer Any)]
(in (#analysis.Extension extension (list& abstractionA inputsA)))))]))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux
index 5fb859b4a..85b9124ce 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux
@@ -144,7 +144,7 @@
(do {! phase.monad}
[objectA (analysis/type.with_type ..Object
(phase archive objectC))
- inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
+ inputsA (monad.each ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
_ (analysis/type.infer .Any)]
(in (#analysis.Extension extension (list& (analysis.text methodC)
objectA
@@ -186,7 +186,7 @@
(do {! phase.monad}
[abstractionA (analysis/type.with_type ..Function
(phase archive abstractionC))
- inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
+ inputsA (monad.each ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
_ (analysis/type.infer Any)]
(in (#analysis.Extension extension (list& abstractionA inputsA)))))]))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/ruby.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/ruby.lux
index 1cc151f14..2f5ef9cbb 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/ruby.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/ruby.lux
@@ -139,7 +139,7 @@
(do {! phase.monad}
[objectA (analysis/type.with_type ..Object
(phase archive objectC))
- inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
+ inputsA (monad.each ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
_ (analysis/type.infer .Any)]
(in (#analysis.Extension extension (list& (analysis.text methodC)
objectA
@@ -172,7 +172,7 @@
(do {! phase.monad}
[abstractionA (analysis/type.with_type ..Function
(phase archive abstractionC))
- inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
+ inputsA (monad.each ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
_ (analysis/type.infer Any)]
(in (#analysis.Extension extension (list& abstractionA inputsA)))))]))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/scheme.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/scheme.lux
index 2d729e701..e29c99177 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/scheme.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/scheme.lux
@@ -141,7 +141,7 @@
(do {! phase.monad}
[abstractionA (analysis/type.with_type ..Function
(phase archive abstractionC))
- inputsA (monad.map ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
+ inputsA (monad.each ! (|>> (phase archive) (analysis/type.with_type Any)) inputsC)
_ (analysis/type.infer Any)]
(in (#analysis.Extension extension (list& abstractionA inputsA)))))]))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/bundle.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/bundle.lux
index 3e6c7a0ef..d9621c994 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/bundle.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/bundle.lux
@@ -25,5 +25,5 @@
(All [s i o]
(-> Text (-> (Bundle s i o) (Bundle s i o))))
(|>> dictionary.entries
- (list\map (function (_ [key val]) [(format prefix " " key) val]))
+ (list\each (function (_ [key val]) [(format prefix " " key) val]))
(dictionary.of_list text.hash)))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux
index 29de45227..02037b6b0 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/jvm.lux
@@ -177,7 +177,7 @@
(def: constant::modifier
(Modifier field.Field)
- ($_ modifier\compose
+ ($_ modifier\composite
field.public
field.static
field.final))
@@ -211,7 +211,7 @@
... TODO: Handle annotations.
(#Variable [name visibility state annotations type])
- (field.field (modifier\compose visibility state)
+ (field.field (modifier\composite visibility state)
name type (row.row))))
(def: (method_definition [mapping selfT] [analyse synthesize generate])
@@ -272,26 +272,26 @@
(luxT.check (luxT.class mapping) (..signature super_class))))
super_interfaceT+ (directive.lifted_analysis
(typeA.with_env
- (monad.map check.monad
- (|>> ..signature (luxT.check (luxT.class mapping)))
- super_interfaces)))
- .let [selfT (jvm.inheritance_relationship_type (#.Primitive name (list\map product.right parameters))
+ (monad.each check.monad
+ (|>> ..signature (luxT.check (luxT.class mapping)))
+ super_interfaces)))
+ .let [selfT (jvm.inheritance_relationship_type (#.Primitive name (list\each product.right parameters))
super_classT
super_interfaceT+)]
state (extension.lifted phase.get_state)
.let [analyse (value@ [#directive.analysis #directive.phase] state)
synthesize (value@ [#directive.synthesis #directive.phase] state)
generate (value@ [#directive.generation #directive.phase] state)]
- methods (monad.map ! (..method_definition [mapping selfT] [analyse synthesize generate])
- methods)
+ methods (monad.each ! (..method_definition [mapping selfT] [analyse synthesize generate])
+ methods)
... _ (directive.lifted_generation
... (generation.save! true ["" name]
... [name
... (class.class version.v6_0
- ... (modifier\compose class.public inheritance)
- ... (name.internal name) (list\map (|>> product.left parser.name ..constraint) parameters)
+ ... (modifier\composite class.public inheritance)
+ ... (name.internal name) (list\each (|>> product.left parser.name ..constraint) parameters)
... super_class super_interfaces
- ... (list\map ..field_definition fields)
+ ... (list\each ..field_definition fields)
... (list) ... TODO: Add methods
... (row.row))]))
_ (directive.lifted_generation
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux
index c5f410370..7a3ccaf26 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux
@@ -240,9 +240,9 @@
(All [anchor expression directive]
(-> (List Text) Type (Operation anchor expression directive (List Any))))
(/////directive.lifted_generation
- (monad.map phase.monad (function (_ tag)
- (/////generation.log! (format "#" tag " : Tag of " (%.type owner))))
- tags)))
+ (monad.each phase.monad (function (_ tag)
+ (/////generation.log! (format "#" tag " : Tag of " (%.type owner))))
+ tags)))
(def: (def::type_tagged expander host_analysis)
(-> Expander /////analysis.Bundle Handler)
@@ -283,13 +283,13 @@
.let [annotationsV (:as Code annotationsV)]
_ (/////directive.lifted_analysis
(do !
- [_ (monad.map ! (function (_ [module alias])
- (do !
- [_ (module.import module)]
- (case alias
- "" (in [])
- _ (module.alias alias module))))
- imports)]
+ [_ (monad.each ! (function (_ [module alias])
+ (do !
+ [_ (module.import module)]
+ (case alias
+ "" (in [])
+ _ (module.alias alias module))))
+ imports)]
(module.set_annotations annotationsV)))]
(in {#/////directive.imports imports
#/////directive.referrals (list)})))]))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux
index 49b696138..bebec6929 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/common_lisp/common.lux
@@ -64,14 +64,14 @@
... <s>.any))))
... (function (_ extension_name phase archive [input else conditionals])
... (do {! /////.monad}
-... [@input (\ ! map _.var (generation.identifier "input"))
+... [@input (\ ! each _.var (generation.identifier "input"))
... inputG (phase archive input)
... elseG (phase archive else)
... conditionalsG (: (Operation (List [Expression Expression]))
-... (monad.map ! (function (_ [chars branch])
+... (monad.each ! (function (_ [chars branch])
... (do !
... [branchG (phase archive branch)]
-... (in [(|> chars (list\map (|>> .int _.int (_.=/2 @input))) _.or)
+... (in [(|> chars (list\each (|>> .int _.int (_.=/2 @input))) _.or)
... branchG])))
... conditionals))]
... (in (_.let (list [@input inputG])
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux
index 50b60d954..00da05b89 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/common.lux
@@ -105,12 +105,12 @@
elseG (phase archive else)
conditionalsG (: (Operation (List [(List Literal)
Statement]))
- (monad.map ! (function (_ [chars branch])
- (do !
- [branchG (phase archive branch)]
- (in [(list\map (|>> .int _.int) chars)
- (_.return branchG)])))
- conditionals))]
+ (monad.each ! (function (_ [chars branch])
+ (do !
+ [branchG (phase archive branch)]
+ (in [(list\each (|>> .int _.int) chars)
+ (_.return branchG)])))
+ conditionals))]
(in (_.apply/* (_.closure (list)
(_.switch (_.the //runtime.i64_low_field inputG)
conditionalsG
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/host.lux
index 9e681c65d..546085ce4 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/host.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/js/host.lux
@@ -68,7 +68,7 @@
(function (_ extension phase archive [constructorS inputsS])
(do {! ////////phase.monad}
[constructorG (phase archive constructorS)
- inputsG (monad.map ! (phase archive) inputsS)]
+ inputsG (monad.each ! (phase archive) inputsS)]
(in (_.new constructorG inputsG))))]))
(def: object::get
@@ -87,7 +87,7 @@
(function (_ extension phase archive [methodS objectS inputsS])
(do {! ////////phase.monad}
[objectG (phase archive objectS)
- inputsG (monad.map ! (phase archive) inputsS)]
+ inputsG (monad.each ! (phase archive) inputsS)]
(in (_.do methodS inputsG objectG))))]))
(template [<!> <?> <unit>]
@@ -123,7 +123,7 @@
(function (_ extension phase archive [abstractionS inputsS])
(do {! ////////phase.monad}
[abstractionG (phase archive abstractionS)
- inputsG (monad.map ! (phase archive) inputsS)]
+ inputsG (monad.each ! (phase archive) inputsS)]
(in (_.apply/* abstractionG inputsG))))]))
(def: js::function
@@ -134,9 +134,9 @@
[abstractionG (phase archive abstractionS)
.let [variable (: (-> Text (Operation Var))
(|>> generation.identifier
- (\ ! map _.var)))]
- g!inputs (monad.map ! (function (_ _) (variable "input"))
- (list.repeated (.nat arity) []))
+ (\ ! each _.var)))]
+ g!inputs (monad.each ! (function (_ _) (variable "input"))
+ (list.repeated (.nat arity) []))
g!abstraction (variable "abstraction")]
(in (_.closure g!inputs
($_ _.then
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/common.lux
index e18b6d356..759b2ad63 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/common.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/common.lux
@@ -111,23 +111,23 @@
elseG (phase archive elseS)
conditionalsG+ (: (Operation (List [(List [S4 Label])
(Bytecode Any)]))
- (monad.map ! (function (_ [chars branch])
- (do !
- [branchG (phase archive branch)
- @branch ///runtime.forge_label]
- (in [(list\map (function (_ char)
- [(try.trusted (signed.s4 (.int char))) @branch])
- chars)
- ($_ _.composite
- (_.set_label @branch)
- branchG
- (_.goto @end))])))
- conditionalsS))
+ (monad.each ! (function (_ [chars branch])
+ (do !
+ [branchG (phase archive branch)
+ @branch ///runtime.forge_label]
+ (in [(list\each (function (_ char)
+ [(try.trusted (signed.s4 (.int char))) @branch])
+ chars)
+ ($_ _.composite
+ (_.set_label @branch)
+ branchG
+ (_.goto @end))])))
+ conditionalsS))
.let [table (|> conditionalsG+
- (list\map product.left)
- list\join)
+ (list\each product.left)
+ list\conjoint)
conditionalsG (|> conditionalsG+
- (list\map product.right)
+ (list\each product.right)
(monad.all _.monad))]]
(in (do _.monad
[@else _.new_label]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux
index be90b8876..e176bcda7 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/jvm/host.lux
@@ -752,10 +752,10 @@
[($_ <>.and ..class <s>.text ..return (<>.some ..input))
(function (_ extension_name generate archive [class method outputT inputsTS])
(do {! //////.monad}
- [inputsTG (monad.map ! (generate_input generate archive) inputsTS)]
+ [inputsTG (monad.each ! (generate_input generate archive) inputsTS)]
(in ($_ _.composite
- (monad.map _.monad product.right inputsTG)
- (_.invokestatic class method (type.method [(list\map product.left inputsTG) outputT (list)]))
+ (monad.each _.monad product.right inputsTG)
+ (_.invokestatic class method (type.method [(list\each product.left inputsTG) outputT (list)]))
(prepare_output outputT)))))]))
(template [<name> <invoke>]
@@ -766,12 +766,12 @@
(function (_ extension_name generate archive [class method outputT objectS inputsTS])
(do {! //////.monad}
[objectG (generate archive objectS)
- inputsTG (monad.map ! (generate_input generate archive) inputsTS)]
+ inputsTG (monad.each ! (generate_input generate archive) inputsTS)]
(in ($_ _.composite
objectG
(_.checkcast class)
- (monad.map _.monad product.right inputsTG)
- (<invoke> class method (type.method [(list\map product.left inputsTG) outputT (list)]))
+ (monad.each _.monad product.right inputsTG)
+ (<invoke> class method (type.method [(list\each product.left inputsTG) outputT (list)]))
(prepare_output outputT)))))]))]
[invoke::virtual _.invokevirtual]
@@ -785,12 +785,12 @@
[($_ <>.and ..class (<>.some ..input))
(function (_ extension_name generate archive [class inputsTS])
(do {! //////.monad}
- [inputsTG (monad.map ! (generate_input generate archive) inputsTS)]
+ [inputsTG (monad.each ! (generate_input generate archive) inputsTS)]
(in ($_ _.composite
(_.new class)
_.dup
- (monad.map _.monad product.right inputsTG)
- (_.invokespecial class "<init>" (type.method [(list\map product.left inputsTG) type.void (list)]))))))]))
+ (monad.each _.monad product.right inputsTG)
+ (_.invokespecial class "<init>" (type.method [(list\each product.left inputsTG) type.void (list)]))))))]))
(def: bundle::member
Bundle
@@ -884,7 +884,7 @@
(//////synthesis.variant [lefts right? (recur sub)])
(^ (//////synthesis.tuple members))
- (//////synthesis.tuple (list\map recur members))
+ (//////synthesis.tuple (list\each recur members))
(^ (//////synthesis.variable var))
(|> mapping
@@ -905,31 +905,31 @@
(//////synthesis.branch/get [path (recur recordS)])
(^ (//////synthesis.loop/scope [offset initsS+ bodyS]))
- (//////synthesis.loop/scope [offset (list\map recur initsS+) (recur bodyS)])
+ (//////synthesis.loop/scope [offset (list\each recur initsS+) (recur bodyS)])
(^ (//////synthesis.loop/recur updatesS+))
- (//////synthesis.loop/recur (list\map recur updatesS+))
+ (//////synthesis.loop/recur (list\each recur updatesS+))
(^ (//////synthesis.function/abstraction [environment arity bodyS]))
- (//////synthesis.function/abstraction [(list\map (function (_ local)
- (case local
- (^ (//////synthesis.variable local))
- (|> mapping
- (dictionary.value local)
- (maybe.else local)
- //////synthesis.variable)
-
- _
- local))
- environment)
+ (//////synthesis.function/abstraction [(list\each (function (_ local)
+ (case local
+ (^ (//////synthesis.variable local))
+ (|> mapping
+ (dictionary.value local)
+ (maybe.else local)
+ //////synthesis.variable)
+
+ _
+ local))
+ environment)
arity
bodyS])
(^ (//////synthesis.function/apply [functionS inputsS+]))
- (//////synthesis.function/apply [(recur functionS) (list\map recur inputsS+)])
+ (//////synthesis.function/apply [(recur functionS) (list\each recur inputsS+)])
(#//////synthesis.Extension [name inputsS+])
- (#//////synthesis.Extension [name (list\map recur inputsS+)]))))
+ (#//////synthesis.Extension [name (list\each recur inputsS+)]))))
(def: $Object
(type.class "java.lang.Object" (list)))
@@ -945,24 +945,24 @@
(let [store_capturedG (|> env
list.size
list.indices
- (monad.map _.monad (.function (_ register)
- ($_ _.composite
- (_.aload 0)
- (_.aload (++ register))
- (_.putfield class (///reference.foreign_name register) $Object)))))]
+ (monad.each _.monad (.function (_ register)
+ ($_ _.composite
+ (_.aload 0)
+ (_.aload (++ register))
+ (_.putfield class (///reference.foreign_name register) $Object)))))]
(method.method method.public "<init>" (anonymous_init_method env)
(list)
(#.Some ($_ _.composite
(_.aload 0)
- (monad.map _.monad product.right inputsTG)
- (_.invokespecial super_class "<init>" (type.method [(list\map product.left inputsTG) type.void (list)]))
+ (monad.each _.monad product.right inputsTG)
+ (_.invokespecial super_class "<init>" (type.method [(list\each product.left inputsTG) type.void (list)]))
store_capturedG
_.return)))))
(def: (anonymous_instance generate archive class env)
(-> Phase Archive (Type category.Class) (Environment Synthesis) (Operation (Bytecode Any)))
(do {! //////.monad}
- [captureG+ (monad.map ! (generate archive) env)]
+ [captureG+ (monad.each ! (generate archive) env)]
(in ($_ _.composite
(_.new class)
_.dup
@@ -1017,65 +1017,65 @@
class (type.class anonymous_class_name (list))
total_environment (|> overriden_methods
... Get all the environments.
- (list\map product.left)
+ (list\each product.left)
... Combine them.
- list\join
+ list\conjoint
... Remove duplicates.
(set.from_list //////synthesis.hash)
set.list)
global_mapping (|> total_environment
... Give them names as "foreign" variables.
list.enumeration
- (list\map (function (_ [id capture])
- [capture (#//////variable.Foreign id)]))
+ (list\each (function (_ [id capture])
+ [capture (#//////variable.Foreign id)]))
(dictionary.from_list //////variable.hash))
- normalized_methods (list\map (function (_ [environment
- [ownerT name
- strict_fp? annotations vars
- self_name arguments returnT exceptionsT
- body]])
- (let [local_mapping (|> environment
- list.enumeration
- (list\map (function (_ [foreign_id capture])
- [(#//////variable.Foreign foreign_id)
- (|> global_mapping
- (dictionary.value capture)
- maybe.trusted)]))
- (dictionary.from_list //////variable.hash))]
- [ownerT name
- strict_fp? annotations vars
- self_name arguments returnT exceptionsT
- (normalize_method_body local_mapping body)]))
- overriden_methods)]
- inputsTI (monad.map ! (generate_input generate archive) inputsTS)
- method_definitions (monad.map ! (function (_ [ownerT name
- strict_fp? annotations vars
- self_name arguments returnT exceptionsT
- bodyS])
- (do !
- [bodyG (//////generation.with_context artifact_id
- (generate archive bodyS))]
- (in (method.method ($_ modifier\compose
- method.public
- method.final
- (if strict_fp?
- method.strict
- modifier\identity))
- name
- (type.method [(list\map product.right arguments)
- returnT
- exceptionsT])
- (list)
- (#.Some ($_ _.composite
- bodyG
- (returnG returnT)))))))
- normalized_methods)
- bytecode (<| (\ ! map (format.result class.writer))
+ normalized_methods (list\each (function (_ [environment
+ [ownerT name
+ strict_fp? annotations vars
+ self_name arguments returnT exceptionsT
+ body]])
+ (let [local_mapping (|> environment
+ list.enumeration
+ (list\each (function (_ [foreign_id capture])
+ [(#//////variable.Foreign foreign_id)
+ (|> global_mapping
+ (dictionary.value capture)
+ maybe.trusted)]))
+ (dictionary.from_list //////variable.hash))]
+ [ownerT name
+ strict_fp? annotations vars
+ self_name arguments returnT exceptionsT
+ (normalize_method_body local_mapping body)]))
+ overriden_methods)]
+ inputsTI (monad.each ! (generate_input generate archive) inputsTS)
+ method_definitions (monad.each ! (function (_ [ownerT name
+ strict_fp? annotations vars
+ self_name arguments returnT exceptionsT
+ bodyS])
+ (do !
+ [bodyG (//////generation.with_context artifact_id
+ (generate archive bodyS))]
+ (in (method.method ($_ modifier\composite
+ method.public
+ method.final
+ (if strict_fp?
+ method.strict
+ modifier\identity))
+ name
+ (type.method [(list\each product.right arguments)
+ returnT
+ exceptionsT])
+ (list)
+ (#.Some ($_ _.composite
+ bodyG
+ (returnG returnT)))))))
+ normalized_methods)
+ bytecode (<| (\ ! each (format.result class.writer))
//////.lifted
- (class.class version.v6_0 ($_ modifier\compose class.public class.final)
+ (class.class version.v6_0 ($_ modifier\composite class.public class.final)
(name.internal anonymous_class_name)
(name.internal (..reflection super_class))
- (list\map (|>> ..reflection name.internal) super_interfaces)
+ (list\each (|>> ..reflection name.internal) super_interfaces)
(foreign.variables total_environment)
(list& (..with_anonymous_init class total_environment super_class inputsTI)
method_definitions)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux
index 142691489..11605c1d5 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/common.lux
@@ -63,20 +63,20 @@
(do {! /////.monad}
[inputG (phase archive input)
elseG (phase archive else)
- @input (\ ! map _.var (generation.identifier "input"))
+ @input (\ ! each _.var (generation.identifier "input"))
conditionalsG (: (Operation (List [Expression Expression]))
- (monad.map ! (function (_ [chars branch])
- (do !
- [branchG (phase archive branch)]
- (in [(|> chars
- (list\map (|>> .int _.int (_.= @input)))
- (list\mix (function (_ clause total)
- (if (same? _.nil total)
- clause
- (_.or clause total)))
- _.nil))
- branchG])))
- conditionals))
+ (monad.each ! (function (_ [chars branch])
+ (do !
+ [branchG (phase archive branch)]
+ (in [(|> chars
+ (list\each (|>> .int _.int (_.= @input)))
+ (list\mix (function (_ clause total)
+ (if (same? _.nil total)
+ clause
+ (_.or clause total)))
+ _.nil))
+ branchG])))
+ conditionals))
.let [closure (_.closure (list @input)
(list\mix (function (_ [test then] else)
(_.if test (_.return then) else))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/host.lux
index f3525e411..a1bffe3cf 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/host.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/lua/host.lux
@@ -80,7 +80,7 @@
(function (_ extension phase archive [methodS objectS inputsS])
(do {! ////////phase.monad}
[objectG (phase archive objectS)
- inputsG (monad.map ! (phase archive) inputsS)]
+ inputsG (monad.each ! (phase archive) inputsS)]
(in (_.do methodS inputsG objectG))))]))
(template [<!> <?> <unit>]
@@ -145,7 +145,7 @@
(function (_ extension phase archive [abstractionS inputsS])
(do {! ////////phase.monad}
[abstractionG (phase archive abstractionS)
- inputsG (monad.map ! (phase archive) inputsS)]
+ inputsG (monad.each ! (phase archive) inputsS)]
(in (_.apply/* inputsG abstractionG))))]))
(def: lua::power
@@ -172,10 +172,10 @@
[abstractionG (phase archive abstractionS)
.let [variable (: (-> Text (Operation Var))
(|>> generation.identifier
- (\ ! map _.var)))]
- g!inputs (monad.map ! (function (_ _)
- (variable "input"))
- (list.repeated (.nat arity) []))]
+ (\ ! each _.var)))]
+ g!inputs (monad.each ! (function (_ _)
+ (variable "input"))
+ (list.repeated (.nat arity) []))]
(in (<| (_.closure g!inputs)
_.statement
(case (.nat arity)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/common.lux
index 3acac79be..f22dc34f1 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/common.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/common.lux
@@ -67,28 +67,28 @@
[inputG (phase archive input)
[[context_module context_artifact] elseG] (generation.with_new_context archive
(phase archive else))
- @input (\ ! map _.var (generation.identifier "input"))
+ @input (\ ! each _.var (generation.identifier "input"))
conditionalsG (: (Operation (List [Expression Expression]))
- (monad.map ! (function (_ [chars branch])
- (do !
- [branchG (phase archive branch)]
- (in [(|> chars
- (list\map (|>> .int _.int (_.=== @input)))
- (list\mix (function (_ clause total)
- (if (same? _.null total)
- clause
- (_.or clause total)))
- _.null))
- branchG])))
- conditionals))
+ (monad.each ! (function (_ [chars branch])
+ (do !
+ [branchG (phase archive branch)]
+ (in [(|> chars
+ (list\each (|>> .int _.int (_.=== @input)))
+ (list\mix (function (_ clause total)
+ (if (same? _.null total)
+ clause
+ (_.or clause total)))
+ _.null))
+ branchG])))
+ conditionals))
.let [foreigns (|> conditionals
- (list\map (|>> product.right synthesis.path/then //case.dependencies))
+ (list\each (|>> product.right synthesis.path/then //case.dependencies))
(list& (//case.dependencies (synthesis.path/then else)))
list.together
(set.of_list _.hash)
set.list)
@expression (_.constant (reference.artifact [context_module context_artifact]))
- directive (_.define_function @expression (list& (_.parameter @input) (list\map _.reference foreigns))
+ directive (_.define_function @expression (list& (_.parameter @input) (list\each _.reference foreigns))
(list\mix (function (_ [test then] else)
(_.if test (_.return then) else))
(_.return elseG)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/host.lux
index 3a294d06e..e391dba46 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/host.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/php/host.lux
@@ -65,7 +65,7 @@
[($_ <>.and <s>.text (<>.some <s>.any))
(function (_ extension phase archive [constructor inputsS])
(do {! ////////phase.monad}
- [inputsG (monad.map ! (phase archive) inputsS)]
+ [inputsG (monad.each ! (phase archive) inputsS)]
(in (_.new (_.constant constructor) inputsG))))]))
(def: object::get
@@ -84,7 +84,7 @@
(function (_ extension phase archive [methodS objectS inputsS])
(do {! ////////phase.monad}
[objectG (phase archive objectS)
- inputsG (monad.map ! (phase archive) inputsS)]
+ inputsG (monad.each ! (phase archive) inputsS)]
(in (_.do methodS inputsG objectG))))]))
(template [<!> <?> <unit>]
@@ -117,7 +117,7 @@
(function (_ extension phase archive [abstractionS inputsS])
(do {! ////////phase.monad}
[abstractionG (phase archive abstractionS)
- inputsG (monad.map ! (phase archive) inputsS)]
+ inputsG (monad.each ! (phase archive) inputsS)]
(in (_.apply/* inputsG abstractionG))))]))
(def: php::pack
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux
index 6f51e40f1..78e4d7a4a 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/common.lux
@@ -54,7 +54,7 @@
(^template [<tag>]
[(^ (<tag> value))
- (/////\map _.return (expression archive synthesis))])
+ (/////\each _.return (expression archive synthesis))])
([synthesis.bit]
[synthesis.i64]
[synthesis.f64]
@@ -78,7 +78,7 @@
[synthesis.loop/recur //loop.recur!])
(^ (synthesis.function/abstraction abstraction))
- (/////\map _.return (//function.function statement expression archive abstraction))
+ (/////\each _.return (//function.function statement expression archive abstraction))
))
(def: .public (custom [parser handler])
@@ -106,26 +106,26 @@
(do {! /////.monad}
[inputG (phase archive input)
else! (..statement phase archive else)
- @input (\ ! map _.var (generation.identifier "input"))
+ @input (\ ! each _.var (generation.identifier "input"))
conditionals! (: (Operation (List [(Expression Any)
(Statement Any)]))
- (monad.map ! (function (_ [chars branch])
- (do !
- [branch! (..statement phase archive branch)]
- (in [(|> chars
- (list\map (|>> .int _.int (_.= @input)))
- (list\mix (function (_ clause total)
- (if (same? _.none total)
- clause
- (_.or clause total)))
- _.none))
- branch!])))
- conditionals))
+ (monad.each ! (function (_ [chars branch])
+ (do !
+ [branch! (..statement phase archive branch)]
+ (in [(|> chars
+ (list\each (|>> .int _.int (_.= @input)))
+ (list\mix (function (_ clause total)
+ (if (same? _.none total)
+ clause
+ (_.or clause total)))
+ _.none))
+ branch!])))
+ conditionals))
... .let [dependencies (//case.dependencies (list\mix (function (_ right left)
... (synthesis.path/seq left right))
... (synthesis.path/then input)
... (#.Item (synthesis.path/then else)
- ... (list\map (|>> product.right
+ ... (list\each (|>> product.right
... synthesis.path/then)
... conditionals))))
... @closure (_.var (reference.artifact artifact_id))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/host.lux
index 8db4b2ffd..c5b2d8abf 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/host.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/python/host.lux
@@ -79,7 +79,7 @@
(function (_ extension phase archive [methodS objectS inputsS])
(do {! ////////phase.monad}
[objectG (phase archive objectS)
- inputsG (monad.map ! (phase archive) inputsS)]
+ inputsG (monad.each ! (phase archive) inputsS)]
(in (_.do methodS inputsG objectG))))]))
(template [<!> <?> <unit>]
@@ -121,7 +121,7 @@
(function (_ extension phase archive [abstractionS inputsS])
(do {! ////////phase.monad}
[abstractionG (phase archive abstractionS)
- inputsG (monad.map ! (phase archive) inputsS)]
+ inputsG (monad.each ! (phase archive) inputsS)]
(in (_.apply/* abstractionG inputsG))))]))
(def: python::function
@@ -132,9 +132,9 @@
[abstractionG (phase archive abstractionS)
.let [variable (: (-> Text (Operation SVar))
(|>> generation.identifier
- (\ ! map _.var)))]
- g!inputs (monad.map ! (function (_ _) (variable "input"))
- (list.repeated (.nat arity) []))]
+ (\ ! each _.var)))]
+ g!inputs (monad.each ! (function (_ _) (variable "input"))
+ (list.repeated (.nat arity) []))]
(in (_.lambda g!inputs
(case (.nat arity)
0 (_.apply/1 abstractionG //runtime.unit)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/r/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/r/common.lux
index 3cc7cf91c..1593d7a25 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/r/common.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/r/common.lux
@@ -64,14 +64,14 @@
... ... <s>.any))))
... ... (function (_ extension_name phase archive [input else conditionals])
... ... (do {! /////.monad}
-... ... [@input (\ ! map _.var (generation.identifier "input"))
+... ... [@input (\ ! each _.var (generation.identifier "input"))
... ... inputG (phase archive input)
... ... elseG (phase archive else)
... ... conditionalsG (: (Operation (List [Expression Expression]))
-... ... (monad.map ! (function (_ [chars branch])
+... ... (monad.each ! (function (_ [chars branch])
... ... (do !
... ... [branchG (phase archive branch)]
-... ... (in [(|> chars (list\map (|>> .int _.int (_.=/2 @input))) _.or)
+... ... (in [(|> chars (list\each (|>> .int _.int (_.=/2 @input))) _.or)
... ... branchG])))
... ... conditionals))]
... ... (in (_.let (list [@input inputG])
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux
index 253b342e8..83791324e 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/common.lux
@@ -60,20 +60,20 @@
(do {! /////.monad}
[inputG (phase archive input)
elseG (phase archive else)
- @input (\ ! map _.local (generation.identifier "input"))
+ @input (\ ! each _.local (generation.identifier "input"))
conditionalsG (: (Operation (List [Expression Expression]))
- (monad.map ! (function (_ [chars branch])
- (do !
- [branchG (phase archive branch)]
- (in [(|> chars
- (list\map (|>> .int _.int (_.= @input)))
- (list\mix (function (_ clause total)
- (if (same? _.nil total)
- clause
- (_.or clause total)))
- _.nil))
- branchG])))
- conditionals))
+ (monad.each ! (function (_ [chars branch])
+ (do !
+ [branchG (phase archive branch)]
+ (in [(|> chars
+ (list\each (|>> .int _.int (_.= @input)))
+ (list\mix (function (_ clause total)
+ (if (same? _.nil total)
+ clause
+ (_.or clause total)))
+ _.nil))
+ branchG])))
+ conditionals))
.let [closure (_.lambda #.None (list @input)
(list\mix (function (_ [test then] else)
(_.if test (_.return then) else))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/host.lux
index 25d29d1a8..98edb6d30 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/host.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/ruby/host.lux
@@ -80,7 +80,7 @@
(function (_ extension phase archive [methodS objectS inputsS])
(do {! ////////phase.monad}
[objectG (phase archive objectS)
- inputsG (monad.map ! (phase archive) inputsS)]
+ inputsG (monad.each ! (phase archive) inputsS)]
(in (_.do methodS inputsG objectG))))]))
(template [<!> <?> <unit>]
@@ -112,7 +112,7 @@
(function (_ extension phase archive [abstractionS inputsS])
(do {! ////////phase.monad}
[abstractionG (phase archive abstractionS)
- inputsG (monad.map ! (phase archive) inputsS)]
+ inputsG (monad.each ! (phase archive) inputsS)]
(in (_.apply/* inputsG abstractionG))))]))
(def: ruby::import
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/scheme/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/scheme/common.lux
index 79c3cce7b..3b3e87e30 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/scheme/common.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/scheme/common.lux
@@ -64,16 +64,16 @@
<s>.any))))
(function (_ extension_name phase archive [input else conditionals])
(do {! /////.monad}
- [@input (\ ! map _.var (generation.identifier "input"))
+ [@input (\ ! each _.var (generation.identifier "input"))
inputG (phase archive input)
elseG (phase archive else)
conditionalsG (: (Operation (List [Expression Expression]))
- (monad.map ! (function (_ [chars branch])
- (do !
- [branchG (phase archive branch)]
- (in [(|> chars (list\map (|>> .int _.int (_.=/2 @input))) _.or)
- branchG])))
- conditionals))]
+ (monad.each ! (function (_ [chars branch])
+ (do !
+ [branchG (phase archive branch)]
+ (in [(|> chars (list\each (|>> .int _.int (_.=/2 @input))) _.or)
+ branchG])))
+ conditionals))]
(in (_.let (list [@input inputG])
(list\mix (function (_ [test then] else)
(_.if test then else))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/scheme/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/scheme/host.lux
index 680cec039..cd2b46e13 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/scheme/host.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/generation/scheme/host.lux
@@ -93,7 +93,7 @@
(function (_ extension phase archive [abstractionS inputsS])
(do {! ////////phase.monad}
[abstractionG (phase archive abstractionS)
- inputsG (monad.map ! (phase archive) inputsS)]
+ inputsG (monad.each ! (phase archive) inputsS)]
(in (_.apply/* inputsG abstractionG))))]))
(def: .public bundle
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/case.lux
index 982b48475..8577bb82a 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/case.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/case.lux
@@ -129,7 +129,7 @@
(def: (alternation @otherwise pre! post!)
(-> _.Tag (Expression Any) (Expression Any) (Expression Any))
- (_.tagbody ($_ list\compose
+ (_.tagbody ($_ list\composite
(list ..save!
pre!
@otherwise)
@@ -141,7 +141,7 @@
(function (recur [$output @done @fail pathP])
(.case pathP
(^ (/////synthesis.path/then bodyS))
- (\ ///////phase.monad map
+ (\ ///////phase.monad each
(function (_ outputV)
(_.progn (list (_.setq $output outputV)
(_.go @done))))
@@ -173,13 +173,13 @@
(^template [<tag> <format> <=>]
[(<tag> item)
(do {! ///////phase.monad}
- [clauses (monad.map ! (function (_ [match then])
- (do !
- [then! (recur [$output @done @fail then])]
- (in [(<=> [(|> match <format>)
- ..peek])
- then!])))
- (#.Item item))]
+ [clauses (monad.each ! (function (_ [match then])
+ (do !
+ [then! (recur [$output @done @fail then])]
+ (in [(<=> [(|> match <format>)
+ ..peek])
+ then!])))
+ (#.Item item))]
(in (list\mix (function (_ [when then] else)
(_.if when then else))
(_.go @fail)
@@ -195,7 +195,7 @@
(^ (<simple> idx nextP))
(|> nextP
[$output @done @fail] recur
- (\ ///////phase.monad map (|>> #.Some (<choice> @fail true idx))))])
+ (\ ///////phase.monad each (|>> #.Some (<choice> @fail true idx))))])
([/////synthesis.side/left /////synthesis.simple_left_side ..left_choice]
[/////synthesis.side/right /////synthesis.simple_right_side ..right_choice])
@@ -217,7 +217,7 @@
(^ (/////synthesis.path/alt preP postP))
(do {! ///////phase.monad}
- [@otherwise (\ ! map (|>> %.nat (format "lux_case_otherwise") _.tag) /////generation.next)
+ [@otherwise (\ ! each (|>> %.nat (format "lux_case_otherwise") _.tag) /////generation.next)
pre! (recur [$output @done @otherwise preP])
post! (recur [$output @done @fail postP])]
(in (..alternation @otherwise pre! post!)))
@@ -231,8 +231,8 @@
(def: (pattern_matching $output expression archive pathP)
(-> Var/1 (Generator Path))
(do {! ///////phase.monad}
- [@done (\ ! map (|>> %.nat (format "lux_case_done") _.tag) /////generation.next)
- @fail (\ ! map (|>> %.nat (format "lux_case_fail") _.tag) /////generation.next)
+ [@done (\ ! each (|>> %.nat (format "lux_case_done") _.tag) /////generation.next)
+ @fail (\ ! each (|>> %.nat (format "lux_case_fail") _.tag) /////generation.next)
pattern_matching! (pattern_matching' expression archive [$output @done @fail pathP])]
(in (_.tagbody
(list pattern_matching!
@@ -244,15 +244,15 @@
(Generator [Synthesis Path])
(do {! ///////phase.monad}
[initG (expression archive valueS)
- $output (\ ! map (|>> %.nat (format "lux_case_output") _.var) /////generation.next)
+ $output (\ ! each (|>> %.nat (format "lux_case_output") _.var) /////generation.next)
pattern_matching! (pattern_matching $output expression archive pathP)
.let [storage (|> pathP
////synthesis/case.storage
(value@ #////synthesis/case.bindings)
set.list
- (list\map (function (_ register)
- [(..register register)
- _.nil])))]]
+ (list\each (function (_ register)
+ [(..register register)
+ _.nil])))]]
(in (_.let (list& [@cursor (_.list/* (list initG))]
[@savepoint (_.list/* (list))]
[@temp _.nil]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/function.lux
index c54bae779..9a2b543d9 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/function.lux
@@ -33,7 +33,7 @@
(Generator (Application Synthesis))
(do {! ///////phase.monad}
[functionG (expression archive functionS)
- argsG+ (monad.map ! (expression archive) argsS+)]
+ argsG+ (monad.each ! (expression archive) argsS+)]
(in (_.funcall/+ [functionG argsG+]))))
(def: capture
@@ -48,9 +48,9 @@
_
(do {! ///////phase.monad}
- [@closure (\ ! map _.var (/////generation.identifier "closure"))]
+ [@closure (\ ! each _.var (/////generation.identifier "closure"))]
(in (_.labels (list [@closure [(|> (list.enumeration inits)
- (list\map (|>> product.left ..capture))
+ (list\each (|>> product.left ..capture))
_.args)
function_definition]])
(_.funcall/+ [(_.function/1 @closure) inits]))))))
@@ -61,12 +61,12 @@
(def: .public (function expression archive [environment arity bodyS])
(Generator (Abstraction Synthesis))
(do {! ///////phase.monad}
- [@scope (\ ! map (|>> %.nat (format "function_scope") _.tag) /////generation.next)
- @output (\ ! map (|>> %.nat (format "loop_output") _.var) /////generation.next)
+ [@scope (\ ! each (|>> %.nat (format "function_scope") _.tag) /////generation.next)
+ @output (\ ! each (|>> %.nat (format "loop_output") _.var) /////generation.next)
[function_name bodyG] (/////generation.with_new_context archive
(/////generation.with_anchor [@scope 1]
(expression archive bodyS)))
- closureG+ (monad.map ! (expression archive) environment)
+ closureG+ (monad.each ! (expression archive) environment)
.let [@curried (_.var "curried")
@missing (_.var "missing")
arityG (|> arity .int _.int)
@@ -74,7 +74,7 @@
@self (_.var (///reference.artifact function_name))
initialize_self! [(//case.register 0) (_.function/1 @self)]
initialize! [(|> (list.indices arity)
- (list\map ..input)
+ (list\each ..input)
_.args)
@curried]]]
(with_closure closureG+
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/loop.lux
index 7258dc416..592733e5e 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/loop.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/loop.lux
@@ -42,16 +42,16 @@
... true loop
_
(do {! ///////phase.monad}
- [@scope (\ ! map (|>> %.nat (format "loop_scope") _.tag) /////generation.next)
- @output (\ ! map (|>> %.nat (format "loop_output") _.var) /////generation.next)
- initsG+ (monad.map ! (expression archive) initsS+)
+ [@scope (\ ! each (|>> %.nat (format "loop_scope") _.tag) /////generation.next)
+ @output (\ ! each (|>> %.nat (format "loop_output") _.var) /////generation.next)
+ initsG+ (monad.each ! (expression archive) initsS+)
bodyG (/////generation.with_anchor [@scope start]
(expression archive bodyS))]
(in (_.let (|> initsG+
list.enumeration
- (list\map (function (_ [idx init])
- [(|> idx (n.+ start) //case.register)
- init]))
+ (list\each (function (_ [idx init])
+ [(|> idx (n.+ start) //case.register)
+ init]))
(list& [@output _.nil]))
(list (_.tagbody (list @scope
(_.setq @output bodyG)))
@@ -61,10 +61,10 @@
(Generator (List Synthesis))
(do {! ///////phase.monad}
[[tag offset] /////generation.anchor
- argsO+ (monad.map ! (expression archive) argsS+)
+ argsO+ (monad.each ! (expression archive) argsS+)
.let [bindings (|> argsO+
list.enumeration
- (list\map (|>> product.left (n.+ offset) //case.register))
+ (list\each (|>> product.left (n.+ offset) //case.register))
_.args)]]
(in (_.progn (list (_.multiple_value_setq bindings (_.values/* argsO+))
(_.go tag))))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/runtime.lux
index 0b2328715..c478118de 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/runtime.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/runtime.lux
@@ -93,9 +93,9 @@
[ids (monad.all ! (list.repeated (list.size vars) meta.seed))]
(in (list (` (let [(~+ (|> vars
(list.zipped/2 ids)
- (list\map (function (_ [id var])
- (list (code.local_identifier var)
- (` (_.var (~ (code.text (format "v" (%.nat id)))))))))
+ (list\each (function (_ [id var])
+ (list (code.local_identifier var)
+ (` (_.var (~ (code.text (format "v" (%.nat id)))))))))
list.together))]
(~ body)))))))
@@ -124,9 +124,9 @@
(let [g!name (code.local_identifier name)
code_nameC (code.local_identifier (format "@" name))
- inputsC (list\map code.local_identifier inputs)
- inputs_typesC (list\map (function.constant (` (_.Expression Any)))
- inputs)]
+ inputsC (list\each code.local_identifier inputs)
+ inputs_typesC (list\each (function.constant (` (_.Expression Any)))
+ inputs)]
(in (list (` (def: .public ((~ g!name) (~+ inputsC))
(-> (~+ inputs_typesC) (_.Computation Any))
(_.call/* (~ runtime_name) (list (~+ inputsC)))))
@@ -272,7 +272,7 @@
(list @io//exit))
(def: runtime
- (_.progn ($_ list\compose
+ (_.progn ($_ list\composite
runtime//adt
runtime//lux
runtime//i64
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/structure.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/structure.lux
index 6755b8f33..c8f9230a3 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/structure.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/common_lisp/structure.lux
@@ -25,13 +25,13 @@
_
(|> elemsS+
- (monad.map ///////phase.monad (expression archive))
- (///////phase\map _.vector/*))))
+ (monad.each ///////phase.monad (expression archive))
+ (///////phase\each _.vector/*))))
(def: .public (variant expression archive [lefts right? valueS])
(Generator (Variant Synthesis))
(let [tag (if right?
(++ lefts)
lefts)]
- (///////phase\map (|>> [tag right?] //runtime.variant)
- (expression archive valueS))))
+ (///////phase\each (|>> [tag right?] //runtime.variant)
+ (expression archive valueS))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux
index 3802776c8..c7b2eba9d 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/extension.lux
@@ -46,8 +46,8 @@
(^ (list (~+ g!input+)))
(do ///.monad
[(~+ (|> g!input+
- (list\map (function (_ g!input)
- (list g!input (` ((~ g!phase) (~ g!archive) (~ g!input))))))
+ (list\each (function (_ g!input)
+ (list g!input (` ((~ g!phase) (~ g!archive) (~ g!input))))))
list.together))]
((~' in) ((~ g!extension) [(~+ g!input+)])))
@@ -65,5 +65,5 @@
(function (_ extension_name)
(function (_ phase archive inputsS)
(do {! ///.monad}
- [inputsI (monad.map ! (phase archive) inputsS)]
+ [inputsI (monad.each ! (phase archive) inputsS)]
(in (extension inputsI))))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js.lux
index 608217f8f..61119e473 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js.lux
@@ -32,7 +32,7 @@
(case synthesis
(^template [<tag>]
[(^ (<tag> value))
- (//////phase\map _.return (expression archive synthesis))])
+ (//////phase\each _.return (expression archive synthesis))])
([synthesis.bit]
[synthesis.i64]
[synthesis.f64]
@@ -60,7 +60,7 @@
(/loop.recur! statement expression archive updates)
(^ (synthesis.function/abstraction abstraction))
- (//////phase\map _.return (/function.function statement expression archive abstraction))
+ (//////phase\each _.return (/function.function statement expression archive abstraction))
))
(exception: .public cannot_recur_as_an_expression)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/case.lux
index edce73735..2b80bcc35 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/case.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/case.lux
@@ -166,7 +166,7 @@
[(^ (<simple> idx nextP))
(|> nextP
recur
- (\ ///////phase.monad map (|>> (_.then (<choice> true idx)) #.Some)))])
+ (\ ///////phase.monad each (|>> (_.then (<choice> true idx)) #.Some)))])
([/////synthesis.simple_left_side ..left_choice]
[/////synthesis.simple_right_side ..right_choice])
@@ -254,21 +254,21 @@
(#/////synthesis.I64_Fork item)
(do {! ///////phase.monad}
- [clauses (monad.map ! (function (_ [match then])
- (do !
- [then! (recur then)]
- (in [(//runtime.i64//= (//primitive.i64 (.int match))
- ..peek_cursor)
- then!])))
- (#.Item item))]
+ [clauses (monad.each ! (function (_ [match then])
+ (do !
+ [then! (recur then)]
+ (in [(//runtime.i64//= (//primitive.i64 (.int match))
+ ..peek_cursor)
+ then!])))
+ (#.Item item))]
(in (_.cond clauses ..fail_pm!)))
(^template [<tag> <format>]
[(<tag> item)
(do {! ///////phase.monad}
- [cases (monad.map ! (function (_ [match then])
- (\ ! map (|>> [(list (<format> match))]) (recur then)))
- (#.Item item))]
+ [cases (monad.each ! (function (_ [match then])
+ (\ ! each (|>> [(list (<format> match))]) (recur then)))
+ (#.Item item))]
(in (_.switch ..peek_cursor
cases
(#.Some ..fail_pm!))))])
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/function.lux
index 90f1cca9a..078cc797d 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/function.lux
@@ -31,7 +31,7 @@
(Generator (Application Synthesis))
(do {! ///////phase.monad}
[functionO (expression archive functionS)
- argsO+ (monad.map ! (expression archive) argsS+)]
+ argsO+ (monad.each ! (expression archive) argsS+)]
(in (_.apply/* functionO argsO+))))
(def: capture
@@ -48,7 +48,7 @@
_
[(_.function! @self
(|> (list.enumeration inits)
- (list\map (|>> product.left ..capture)))
+ (list\each (|>> product.left ..capture)))
(_.return (_.function @self (list) body!)))
(_.apply/* @self inits)]))
@@ -70,7 +70,7 @@
(do {! ///////phase.monad}
[[function_name body!] (/////generation.with_new_context archive
(do !
- [scope (\ ! map ..@scope
+ [scope (\ ! each ..@scope
(/////generation.context archive))]
(/////generation.with_anchor [1 scope]
(statement expression archive bodyS))))
@@ -87,7 +87,7 @@
(_.define (..input post) (_.at (_.i32 (.int post)) @@arguments))))
initialize_self!
(list.indices arity))]
- environment (monad.map ! (expression archive) environment)
+ environment (monad.each ! (expression archive) environment)
.let [[definition instantiation] (with_closure @self environment
($_ _.then
(_.define @num_args (_.the "length" @@arguments))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/loop.lux
index 8c3762238..7946e7b12 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/loop.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/loop.lux
@@ -33,11 +33,11 @@
(-> Bit Register (List Expression) Statement Statement)
(|> bindings
list.enumeration
- (list\map (function (_ [register value])
- (let [variable (//case.register (n.+ offset register))]
- (if initial?
- (_.define variable value)
- (_.set variable value)))))
+ (list\each (function (_ [register value])
+ (let [variable (//case.register (n.+ offset register))]
+ (if initial?
+ (_.define variable value)
+ (_.set variable value)))))
list.reversed
(list\mix _.then body)))
@@ -51,8 +51,8 @@
... true loop
_
(do {! ///////phase.monad}
- [@scope (\ ! map ..@scope /////generation.next)
- initsO+ (monad.map ! (expression archive) initsS+)
+ [@scope (\ ! each ..@scope /////generation.next)
+ initsO+ (monad.each ! (expression archive) initsS+)
body! (/////generation.with_anchor [start @scope]
(statement expression archive bodyS))]
(in (..setup true start initsO+
@@ -80,12 +80,12 @@
(Generator! (List Synthesis))
(do {! ///////phase.monad}
[[offset @scope] /////generation.anchor
- argsO+ (monad.map ! (expression archive) argsS+)]
+ argsO+ (monad.each ! (expression archive) argsS+)]
(in ($_ _.then
(_.define @temp (_.array argsO+))
(..setup false offset
(|> argsO+
list.enumeration
- (list\map (function (_ [idx _])
- (_.at (_.i32 (.int idx)) @temp))))
+ (list\each (function (_ [idx _])
+ (_.at (_.i32 (.int idx)) @temp))))
(_.continue_at (_.label @scope)))))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux
index 3ea974987..6579de615 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/runtime.lux
@@ -91,9 +91,9 @@
[ids (monad.all ! (list.repeated (list.size vars) meta.seed))]
(in (list (` (let [(~+ (|> vars
(list.zipped/2 ids)
- (list\map (function (_ [id var])
- (list (code.local_identifier var)
- (` (_.var (~ (code.text (format "v" (%.nat id)))))))))
+ (list\each (function (_ [id var])
+ (list (code.local_identifier var)
+ (` (_.var (~ (code.text (format "v" (%.nat id)))))))))
list.together))]
(~ body)))))))
@@ -118,8 +118,8 @@
(#.Right [name inputs])
(let [g!name (code.local_identifier name)
- inputsC (list\map code.local_identifier inputs)
- inputs_typesC (list\map (function.constant (` _.Expression)) inputs)]
+ inputsC (list\each code.local_identifier inputs)
+ inputs_typesC (list\each (function.constant (` _.Expression)) inputs)]
(in (list (` (def: .public ((~ g!name) (~+ inputsC))
(-> (~+ inputs_typesC) Computation)
(_.apply/* (~ runtime_name) (list (~+ inputsC)))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/structure.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/structure.lux
index 6253b38b5..3788b7f6d 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/structure.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/js/structure.lux
@@ -25,7 +25,7 @@
_
(do {! ///////phase.monad}
- [elemsT+ (monad.map ! (generate archive) elemsS+)]
+ [elemsT+ (monad.each ! (generate archive) elemsS+)]
(in (_.array elemsT+)))))
(def: .public (variant generate archive [lefts right? valueS])
@@ -33,6 +33,6 @@
(let [tag (if right?
(++ lefts)
lefts)]
- (///////phase\map (//runtime.variant (_.i32 (.int tag))
- (//runtime.flag right?))
- (generate archive valueS))))
+ (///////phase\each (//runtime.variant (_.i32 (.int tag))
+ (//runtime.flag right?))
+ (generate archive valueS))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux
index 5eafc6556..afa615823 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function.lux
@@ -66,15 +66,15 @@
(let [classT (type.class class (list))
fields (: (List (Resource Field))
(list& /arity.constant
- (list\compose (/foreign.variables environment)
- (/partial.variables arity))))
+ (list\composite (/foreign.variables environment)
+ (/partial.variables arity))))
methods (: (List (Resource Method))
(list& (/init.method classT environment arity)
(/reset.method classT environment arity)
(if (arity.multiary? arity)
(|> (n.min arity /arity.maximum)
list.indices
- (list\map (|>> ++ (/apply.method classT environment arity @begin body)))
+ (list\each (|>> ++ (/apply.method classT environment arity @begin body)))
(list& (/implementation.method arity @begin body)))
(list (/implementation.method' //runtime.apply::name arity @begin body)))))]
(do phase.monad
@@ -83,7 +83,7 @@
(def: modifier
(Modifier Class)
- ($_ modifier\compose
+ ($_ modifier\composite
class.public
class.final))
@@ -120,16 +120,16 @@
(Generator Apply)
(do {! phase.monad}
[abstractionG (generate archive abstractionS)
- inputsG (monad.map ! (generate archive) inputsS)]
+ inputsG (monad.each ! (generate archive) inputsS)]
(in ($_ _.composite
abstractionG
(|> inputsG
(list.sub /arity.maximum)
- (monad.map _.monad
- (function (_ batchG)
- ($_ _.composite
- (_.checkcast /abstract.class)
- (monad.all _.monad batchG)
- (_.invokevirtual /abstract.class //runtime.apply::name (//runtime.apply::type (list.size batchG)))
- ))))
+ (monad.each _.monad
+ (function (_ batchG)
+ ($_ _.composite
+ (_.checkcast /abstract.class)
+ (monad.all _.monad batchG)
+ (_.invokevirtual /abstract.class //runtime.apply::name (//runtime.apply::type (list.size batchG)))
+ ))))
))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant.lux
index 53d058584..47ab7df90 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/constant.lux
@@ -15,7 +15,7 @@
(def: modifier
(Modifier Field)
- ($_ modifier\compose
+ ($_ modifier\composite
field.public
field.static
field.final
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable.lux
index ba69187b8..b843aa13a 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/field/variable.lux
@@ -39,7 +39,7 @@
(def: modifier
(Modifier Field)
- ($_ modifier\compose
+ ($_ modifier\composite
field.private
field.final
))
@@ -52,5 +52,5 @@
(-> (-> Register Text) Nat (List (Resource Field)))
(|> amount
list.indices
- (list\map (function (_ register)
- (..variable (naming register) ..type)))))
+ (list\each (function (_ register)
+ (..variable (naming register) ..type)))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method.lux
index 4dbadacb0..802592b0d 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method.lux
@@ -8,7 +8,7 @@
(def: .public modifier
(Modifier Method)
- ($_ modifier\compose
+ ($_ modifier\composite
method.public
method.strict
))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/apply.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/apply.lux
index 1addefe99..0114ef23c 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/apply.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/apply.lux
@@ -58,7 +58,7 @@
($_ _.composite
(|> amount
list.indices
- (monad.map _.monad (|>> (n.+ offset) _.aload)))
+ (monad.each _.monad (|>> (n.+ offset) _.aload)))
(_\in [])
))
@@ -97,59 +97,59 @@
@labelsT (|> _.new_label
(list.repeated (-- num_partials))
(monad.all _.monad))
- .let [cases (|> (list\compose (#.Item [@labelsH @labelsT])
- (list @default))
+ .let [cases (|> (list\composite (#.Item [@labelsH @labelsT])
+ (list @default))
list.enumeration
- (list\map (function (_ [stage @case])
- (let [current_partials (|> (list.indices stage)
- (list\map (///partial.get class))
- (monad.all _.monad))
- already_partial? (n.> 0 stage)
- exact_match? (i.= over_extent (.int stage))
- has_more_than_necessary? (i.> over_extent (.int stage))]
- ($_ _.composite
- (_.set_label @case)
- (cond exact_match?
- ($_ _.composite
- ////reference.this
- (if already_partial?
- (_.invokevirtual class //reset.name (//reset.type class))
- (_\in []))
- current_partials
- (..inputs ..this_offset apply_arity)
- (_.invokevirtual class //implementation.name (//implementation.type function_arity))
- _.areturn)
-
- has_more_than_necessary?
- (let [arity_inputs (|> function_arity (n.- stage))
- additional_inputs (|> apply_arity (n.- arity_inputs))]
- ($_ _.composite
- ////reference.this
- (_.invokevirtual class //reset.name (//reset.type class))
- current_partials
- (..inputs ..this_offset arity_inputs)
- (_.invokevirtual class //implementation.name (//implementation.type function_arity))
- (apply (n.+ ..this_offset arity_inputs) additional_inputs)
- _.areturn))
+ (list\each (function (_ [stage @case])
+ (let [current_partials (|> (list.indices stage)
+ (list\each (///partial.get class))
+ (monad.all _.monad))
+ already_partial? (n.> 0 stage)
+ exact_match? (i.= over_extent (.int stage))
+ has_more_than_necessary? (i.> over_extent (.int stage))]
+ ($_ _.composite
+ (_.set_label @case)
+ (cond exact_match?
+ ($_ _.composite
+ ////reference.this
+ (if already_partial?
+ (_.invokevirtual class //reset.name (//reset.type class))
+ (_\in []))
+ current_partials
+ (..inputs ..this_offset apply_arity)
+ (_.invokevirtual class //implementation.name (//implementation.type function_arity))
+ _.areturn)
+
+ has_more_than_necessary?
+ (let [arity_inputs (|> function_arity (n.- stage))
+ additional_inputs (|> apply_arity (n.- arity_inputs))]
+ ($_ _.composite
+ ////reference.this
+ (_.invokevirtual class //reset.name (//reset.type class))
+ current_partials
+ (..inputs ..this_offset arity_inputs)
+ (_.invokevirtual class //implementation.name (//implementation.type function_arity))
+ (apply (n.+ ..this_offset arity_inputs) additional_inputs)
+ _.areturn))
- ... (i.< over_extent (.int stage))
- (let [current_environment (|> (list.indices (list.size environment))
- (list\map (///foreign.get class))
- (monad.all _.monad))
- missing_partials (|> _.aconst_null
- (list.repeated (|> num_partials (n.- apply_arity) (n.- stage)))
- (monad.all _.monad))]
- ($_ _.composite
- (_.new class)
- _.dup
- current_environment
- ///partial/count.value
- (..increment apply_arity)
- current_partials
- (..inputs ..this_offset apply_arity)
- missing_partials
- (_.invokevirtual class //init.name (//init.type environment function_arity))
- _.areturn)))))))
+ ... (i.< over_extent (.int stage))
+ (let [current_environment (|> (list.indices (list.size environment))
+ (list\each (///foreign.get class))
+ (monad.all _.monad))
+ missing_partials (|> _.aconst_null
+ (list.repeated (|> num_partials (n.- apply_arity) (n.- stage)))
+ (monad.all _.monad))]
+ ($_ _.composite
+ (_.new class)
+ _.dup
+ current_environment
+ ///partial/count.value
+ (..increment apply_arity)
+ current_partials
+ (..inputs ..this_offset apply_arity)
+ missing_partials
+ (_.invokevirtual class //init.name (//init.type environment function_arity))
+ _.areturn)))))))
(monad.all _.monad))]]
($_ _.composite
///partial/count.value
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/init.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/init.lux
index 3c1922063..a9dc55525 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/init.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/init.lux
@@ -49,10 +49,10 @@
(def: .public (type environment arity)
(-> (Environment Synthesis) Arity (Type category.Method))
- (type.method [(list\compose (///foreign.closure environment)
- (if (arity.multiary? arity)
- (list& ///arity.type (..partials arity))
- (list)))
+ (type.method [(list\composite (///foreign.closure environment)
+ (if (arity.multiary? arity)
+ (list& ///arity.type (..partials arity))
+ (list)))
type.void
(list)]))
@@ -77,9 +77,9 @@
(-> Register Register)
(Bytecode Any))
(|> (list.indices amount)
- (list\map (function (_ register)
- (put register
- (_.aload (offset register)))))
+ (list\each (function (_ register)
+ (put register
+ (_.aload (offset register)))))
(monad.all _.monad)))
(def: .public (method class environment arity)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/new.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/new.lux
index c126f0296..e155c518b 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/new.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/new.lux
@@ -54,7 +54,7 @@
(def: .public (instance generate archive class environment arity)
(-> Phase Archive (Type Class) (Environment Synthesis) Arity (Operation (Bytecode Any)))
(do {! phase.monad}
- [foreign* (monad.map ! (generate archive) environment)]
+ [foreign* (monad.each ! (generate archive) environment)]
(in (instance' foreign* class environment arity))))
(def: .public (method class environment arity)
@@ -72,10 +72,10 @@
(#.Some ($_ _.composite
////reference.this
(//init.super environment_size arity)
- (monad.map _.monad (function (_ register)
- (///foreign.put class register (_.aload (after_this register))))
- (list.indices environment_size))
- (monad.map _.monad (function (_ register)
- (///partial.put class register (_.aload (after_arity register))))
- (list.indices (n.- ///arity.minimum arity)))
+ (monad.each _.monad (function (_ register)
+ (///foreign.put class register (_.aload (after_this register))))
+ (list.indices environment_size))
+ (monad.each _.monad (function (_ register)
+ (///partial.put class register (_.aload (after_arity register))))
+ (list.indices (n.- ///arity.minimum arity)))
_.areturn)))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/reset.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/reset.lux
index d787bf16e..ea526c674 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/reset.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/function/method/reset.lux
@@ -36,7 +36,7 @@
(-> (Type Class) (Environment Synthesis) (List (Bytecode Any)))
(|>> list.size
list.indices
- (list\map (///foreign.get class))))
+ (list\each (///foreign.get class))))
(def: .public (method class environment arity)
(-> (Type Class) (Environment Synthesis) Arity (Resource Method))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux
index 4915e010a..832fce239 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/host.lux
@@ -55,10 +55,10 @@
(def: value::field "value")
(def: value::type (type.class "java.lang.Object" (list)))
-(def: value::modifier ($_ modifier\compose field.public field.final field.static))
+(def: value::modifier ($_ modifier\composite field.public field.final field.static))
(def: init::type (type.method [(list) type.void (list)]))
-(def: init::modifier ($_ modifier\compose method.public method.static method.strict))
+(def: init::modifier ($_ modifier\composite method.public method.static method.strict))
(exception: .public (cannot_load {class Text} {error Text})
(exception.report
@@ -114,7 +114,7 @@
_.return))))
(row.row))]
(io.run! (do {! (try.with io.monad)}
- [bytecode (\ ! map (format.result class.writer)
+ [bytecode (\ ! each (format.result class.writer)
(io.io bytecode))
_ (loader.store eval_class bytecode library)
class (loader.load eval_class loader)
@@ -126,8 +126,8 @@
(-> Library java/lang/ClassLoader Text Definition (Try Any))
(io.run! (do (try.with io.monad)
[existing_class? (|> (atom.read! library)
- (\ io.monad map (function (_ library)
- (dictionary.key? library class_name)))
+ (\ io.monad each (function (_ library)
+ (dictionary.key? library class_name)))
(try.lifted io.monad)
(: (IO (Try Bit))))
_ (if existing_class?
@@ -152,7 +152,7 @@
(implementation
(def: (evaluate! temp_label valueG)
(let [eval_class (|> temp_label name.normal (text.replaced " " "$"))]
- (\ try.monad map product.left
+ (\ try.monad each product.left
(..evaluate! library loader eval_class valueG))))
(def: execute!
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux
index 9b69ffbae..b7e934447 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/loop.lux
@@ -43,16 +43,16 @@
[[@begin offset] generation.anchor
updatesG (|> updatesS
list.enumeration
- (list\map (function (_ [index updateS])
- [(n.+ offset index) updateS]))
- (monad.map ! (function (_ [register updateS])
- (if (invariant? register updateS)
- (in [..no_op
- ..no_op])
- (do !
- [fetchG (translate archive updateS)
- .let [storeG (_.astore register)]]
- (in [fetchG storeG]))))))]
+ (list\each (function (_ [index updateS])
+ [(n.+ offset index) updateS]))
+ (monad.each ! (function (_ [register updateS])
+ (if (invariant? register updateS)
+ (in [..no_op
+ ..no_op])
+ (do !
+ [fetchG (translate archive updateS)
+ .let [storeG (_.astore register)]]
+ (in [fetchG storeG]))))))]
(in ($_ _.composite
... It may look weird that first I fetch all the values separately,
... and then I store them all.
@@ -63,11 +63,11 @@
... will refer to the new value of X, instead of the old value, as
... should be the case.
(|> updatesG
- (list\map product.left)
+ (list\each product.left)
(monad.all _.monad))
(|> updatesG
list.reversed
- (list\map product.right)
+ (list\each product.right)
(monad.all _.monad))
(_.goto @begin)))))
@@ -75,14 +75,14 @@
(Generator [Nat (List Synthesis) Synthesis])
(do {! phase.monad}
[@begin //runtime.forge_label
- initsI+ (monad.map ! (translate archive) initsS+)
+ initsI+ (monad.each ! (translate archive) initsS+)
iterationG (generation.with_anchor [@begin offset]
(translate archive iterationS))
.let [initializationG (|> (list.enumeration initsI+)
- (list\map (function (_ [index initG])
- ($_ _.composite
- initG
- (_.astore (n.+ offset index)))))
+ (list\each (function (_ [index initG])
+ ($_ _.composite
+ initG
+ (_.astore (n.+ offset index)))))
(monad.all _.monad))]]
(in ($_ _.composite
initializationG
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/program.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/program.lux
index 419c4eac9..3b1a602da 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/program.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/program.lux
@@ -41,7 +41,7 @@
(def: main::modifier
(Modifier Method)
- ($_ modifier\compose
+ ($_ modifier\composite
method.public
method.static
method.strict
@@ -49,7 +49,7 @@
(def: program::modifier
(Modifier Class)
- ($_ modifier\compose
+ ($_ modifier\composite
class.public
class.final
))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/reference.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/reference.lux
index 3dafea811..fb134924a 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/reference.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/reference.lux
@@ -42,7 +42,7 @@
(def: (foreign archive variable)
(-> Archive Register (Operation (Bytecode Any)))
(do {! ////.monad}
- [bytecode_name (\ ! map //runtime.class_name
+ [bytecode_name (\ ! each //runtime.class_name
(generation.context archive))]
(in ($_ _.composite
..this
@@ -62,6 +62,6 @@
(def: .public (constant archive name)
(-> Archive Name (Operation (Bytecode Any)))
(do {! ////.monad}
- [bytecode_name (\ ! map //runtime.class_name
+ [bytecode_name (\ ! each //runtime.class_name
(generation.remember archive name))]
(in (_.getstatic (type.class bytecode_name (list)) //value.field //type.value))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux
index 1d414ab77..469ab0e89 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux
@@ -103,7 +103,7 @@
(def: modifier
(Modifier Method)
- ($_ modifier\compose
+ ($_ modifier\composite
method.public
method.static
method.strict
@@ -514,7 +514,7 @@
(Operation Any)
(let [class (..reflection ..class)
modifier (: (Modifier Class)
- ($_ modifier\compose
+ ($_ modifier\composite
class.public
class.final))
bytecode (<| (format.result class.writer)
@@ -546,21 +546,21 @@
(let [apply::method+ (|> (enum.range n.enum
(++ //function/arity.minimum)
//function/arity.maximum)
- (list\map (function (_ arity)
- (method.method method.public ..apply::name (..apply::type arity)
- (list)
- (#.Some
- (let [previous_inputs (|> arity
- list.indices
- (monad.map _.monad _.aload))]
- ($_ _.composite
- previous_inputs
- (_.invokevirtual //function.class ..apply::name (..apply::type (-- arity)))
- (_.checkcast //function.class)
- (_.aload arity)
- (_.invokevirtual //function.class ..apply::name (..apply::type //function/arity.minimum))
- _.areturn))))))
- (list& (method.method (modifier\compose method.public method.abstract)
+ (list\each (function (_ arity)
+ (method.method method.public ..apply::name (..apply::type arity)
+ (list)
+ (#.Some
+ (let [previous_inputs (|> arity
+ list.indices
+ (monad.each _.monad _.aload))]
+ ($_ _.composite
+ previous_inputs
+ (_.invokevirtual //function.class ..apply::name (..apply::type (-- arity)))
+ (_.checkcast //function.class)
+ (_.aload arity)
+ (_.invokevirtual //function.class ..apply::name (..apply::type //function/arity.minimum))
+ _.areturn))))))
+ (list& (method.method (modifier\composite method.public method.abstract)
..apply::name (..apply::type //function/arity.minimum)
(list)
#.None)))
@@ -576,12 +576,12 @@
(_.putfield //function.class //function/count.field //function/count.type)
_.return))))
modifier (: (Modifier Class)
- ($_ modifier\compose
+ ($_ modifier\composite
class.public
class.abstract))
class (..reflection //function.class)
partial_count (: (Resource Field)
- (field.field (modifier\compose field.public field.final)
+ (field.field (modifier\composite field.public field.final)
//function/count.field
//function/count.type
(row.row)))
@@ -610,4 +610,4 @@
... This shift is done to avoid the possibility of forged labels
... to be in the range of the labels that are generated automatically
... during the evaluation of Bytecode expressions.
- (\ ////.monad map (i64.left_shifted shift) generation.next)))
+ (\ ////.monad each (i64.left_shifted shift) generation.next)))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/structure.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/structure.lux
index 815c4fca0..d260cca20 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/structure.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/structure.lux
@@ -39,14 +39,14 @@
(do {! phase.monad}
[membersI (|> membersS
list.enumeration
- (monad.map ! (function (_ [idx member])
- (do !
- [memberI (generate archive member)]
- (in (do _.monad
- [_ _.dup
- _ (_.int (.i64 idx))
- _ memberI]
- _.aastore))))))]
+ (monad.each ! (function (_ [idx member])
+ (do !
+ [memberI (generate archive member)]
+ (in (do _.monad
+ [_ _.dup
+ _ (_.int (.i64 idx))
+ _ memberI]
+ _.aastore))))))]
(in (do {! _.monad}
[_ (_.int (.i64 (list.size membersS)))
_ (_.anewarray $Object)]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua.lux
index 56860a588..59dc82f3c 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua.lux
@@ -32,7 +32,7 @@
(case synthesis
(^template [<tag>]
[(^ (<tag> value))
- (//////phase\map _.return (expression archive synthesis))])
+ (//////phase\each _.return (expression archive synthesis))])
([synthesis.bit]
[synthesis.i64]
[synthesis.f64]
@@ -62,7 +62,7 @@
(/loop.recur! statement expression archive updates)
(^ (synthesis.function/abstraction abstraction))
- (//////phase\map _.return (/function.function statement expression archive abstraction))
+ (//////phase\each _.return (/function.function statement expression archive abstraction))
))
(exception: .public cannot_recur_as_an_expression)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/case.lux
index 67c156db0..c894606cf 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/case.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/case.lux
@@ -192,13 +192,13 @@
(^template [<tag> <format>]
[(<tag> item)
(do {! ///////phase.monad}
- [clauses (monad.map ! (function (_ [match then])
- (do !
- [then! (recur then)]
- (in [(_.= (|> match <format>)
- ..peek)
- then!])))
- (#.Item item))]
+ [clauses (monad.each ! (function (_ [match then])
+ (do !
+ [then! (recur then)]
+ (in [(_.= (|> match <format>)
+ ..peek)
+ then!])))
+ (#.Item item))]
(in (_.cond clauses ..fail!)))])
([#/////synthesis.I64_Fork (<| _.int .int)]
[#/////synthesis.F64_Fork _.float]
@@ -209,7 +209,7 @@
(///////phase\in (<choice> false idx))
(^ (<simple> idx nextP))
- (///////phase\map (_.then (<choice> true idx)) (recur nextP))])
+ (///////phase\each (_.then (<choice> true idx)) (recur nextP))])
([/////synthesis.side/left /////synthesis.simple_left_side ..left_choice]
[/////synthesis.side/right /////synthesis.simple_right_side ..right_choice])
@@ -252,13 +252,13 @@
(|>> ////synthesis/case.storage
(value@ #////synthesis/case.dependencies)
set.list
- (list\map (function (_ variable)
- (.case variable
- (#///////variable.Local register)
- (..register register)
-
- (#///////variable.Foreign register)
- (..capture register))))))
+ (list\each (function (_ variable)
+ (.case variable
+ (#///////variable.Local register)
+ (..register register)
+
+ (#///////variable.Foreign register)
+ (..capture register))))))
(def: .public (case! statement expression archive [valueS pathP])
(Generator! [Synthesis Path])
@@ -275,6 +275,6 @@
(-> Phase! (Generator [Synthesis Path]))
(|> [valueS pathP]
(..case! statement expression archive)
- (\ ///////phase.monad map
+ (\ ///////phase.monad each
(|>> (_.closure (list))
(_.apply/* (list))))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/function.lux
index 88f59675d..0d96c3150 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/function.lux
@@ -33,7 +33,7 @@
(Generator (Application Synthesis))
(do {! ///////phase.monad}
[functionO (expression archive functionS)
- argsO+ (monad.map ! (expression archive) argsS+)]
+ argsO+ (monad.each ! (expression archive) argsS+)]
(in (_.apply/* argsO+ functionO))))
(def: capture
@@ -49,7 +49,7 @@
_
(let [@inits (|> (list.enumeration inits)
- (list\map (|>> product.left ..capture)))]
+ (list\each (|>> product.left ..capture)))]
[(_.function @self @inits
($_ _.then
(_.local_function @self @args body!)
@@ -68,11 +68,11 @@
(do {! ///////phase.monad}
[[function_name body!] (/////generation.with_new_context archive
(do !
- [@scope (\ ! map ..@scope
+ [@scope (\ ! each ..@scope
(/////generation.context archive))]
(/////generation.with_anchor [1 @scope]
(statement expression archive bodyS))))
- closureO+ (monad.map ! (expression archive) environment)
+ closureO+ (monad.each ! (expression archive) environment)
.let [@curried (_.var "curried")
arityO (|> arity .int _.int)
@num_args (_.var "num_args")
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/loop.lux
index ddc716045..eb8ff0322 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/loop.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/loop.lux
@@ -38,7 +38,7 @@
(-> Bit Register (List Expression) Bit Statement Statement)
(let [variables (|> bindings
list.enumeration
- (list\map (|>> product.left (n.+ offset) //case.register)))]
+ (list\each (|>> product.left (n.+ offset) //case.register)))]
(if as_expression?
body
($_ _.then
@@ -56,13 +56,13 @@
#.End
(|> bodyS
(statement expression archive)
- (\ ///////phase.monad map (|>> [(list)])))
+ (\ ///////phase.monad each (|>> [(list)])))
... true loop
_
(do {! ///////phase.monad}
- [@scope (\ ! map ..@scope /////generation.next)
- initsO+ (monad.map ! (expression archive) initsS+)
+ [@scope (\ ! each ..@scope /////generation.next)
+ initsO+ (monad.each ! (expression archive) initsS+)
body! (/////generation.with_anchor [start @scope]
(statement expression archive bodyS))]
(in [initsO+
@@ -86,7 +86,7 @@
.let [@loop (_.var (///reference.artifact [artifact_module artifact_id]))
locals (|> initsO+
list.enumeration
- (list\map (|>> product.left (n.+ start) //case.register)))
+ (list\each (|>> product.left (n.+ start) //case.register)))
[directive instantiation] (: [Statement Expression]
(case (|> (synthesis.path/then bodyS)
//case.dependencies
@@ -115,5 +115,5 @@
(Generator! (List Synthesis))
(do {! ///////phase.monad}
[[offset @scope] /////generation.anchor
- argsO+ (monad.map ! (expression archive) argsS+)]
+ argsO+ (monad.each ! (expression archive) argsS+)]
(in (..setup false offset argsO+ false (_.go_to @scope)))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux
index 997030d05..0a8cbd859 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/runtime.lux
@@ -108,9 +108,9 @@
[ids (monad.all ! (list.repeated (list.size vars) meta.seed))]
(in (list (` (let [(~+ (|> vars
(list.zipped/2 ids)
- (list\map (function (_ [id var])
- (list (code.local_identifier var)
- (` (_.var (~ (code.text (format "v" (%.nat id)))))))))
+ (list\each (function (_ [id var])
+ (list (code.local_identifier var)
+ (` (_.var (~ (code.text (format "v" (%.nat id)))))))))
list.together))]
(~ body)))))))
@@ -143,9 +143,9 @@
(#.Right [name inputs])
(macro.with_identifiers [g!_]
(let [g!name (code.local_identifier name)
- inputsC (list\map code.local_identifier inputs)
- inputs_typesC (list\map (function.constant (` _.Expression))
- inputs)]
+ inputsC (list\each code.local_identifier inputs)
+ inputs_typesC (list\each (function.constant (` _.Expression))
+ inputs)]
(in (list (` (def: .public ((~ g!name) (~+ inputsC))
(-> (~+ inputs_typesC) Computation)
(_.apply/* (list (~+ inputsC)) (~ runtime_name))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/structure.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/structure.lux
index 6bbd167eb..59d70ae69 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/structure.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/lua/structure.lux
@@ -25,13 +25,13 @@
_
(|> elemsS+
- (monad.map ///////phase.monad (generate archive))
- (///////phase\map _.array))))
+ (monad.each ///////phase.monad (generate archive))
+ (///////phase\each _.array))))
(def: .public (variant generate archive [lefts right? valueS])
(Generator (Variant Synthesis))
(let [tag (if right?
(++ lefts)
lefts)]
- (///////phase\map (//runtime.variant tag right?)
- (generate archive valueS))))
+ (///////phase\each (//runtime.variant tag right?)
+ (generate archive valueS))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php.lux
index 1366ae632..4364995c7 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php.lux
@@ -32,7 +32,7 @@
(case synthesis
(^template [<tag>]
[(^ (<tag> value))
- (//////phase\map _.return (expression archive synthesis))])
+ (//////phase\each _.return (expression archive synthesis))])
([////synthesis.bit]
[////synthesis.i64]
[////synthesis.f64]
@@ -56,7 +56,7 @@
[////synthesis.loop/recur /loop.recur!])
(^ (////synthesis.function/abstraction abstraction))
- (//////phase\map _.return (/function.function statement expression archive abstraction))
+ (//////phase\each _.return (/function.function statement expression archive abstraction))
))
(exception: .public cannot_recur_as_an_expression)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/case.lux
index ccea519f2..dcd9a3c12 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/case.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/case.lux
@@ -192,13 +192,13 @@
(^template [<tag> <format>]
[(<tag> item)
(do {! ///////phase.monad}
- [clauses (monad.map ! (function (_ [match then])
- (do !
- [then! (recur then)]
- (in [(_.=== (|> match <format>)
- ..peek)
- then!])))
- (#.Item item))]
+ [clauses (monad.each ! (function (_ [match then])
+ (do !
+ [then! (recur then)]
+ (in [(_.=== (|> match <format>)
+ ..peek)
+ then!])))
+ (#.Item item))]
(in (_.cond clauses ..fail!)))])
([#/////synthesis.I64_Fork //primitive.i64]
[#/////synthesis.F64_Fork //primitive.f64]
@@ -211,7 +211,7 @@
(^ (<simple> idx nextP))
(|> nextP
recur
- (\ ///////phase.monad map (_.then (<choice> true idx))))])
+ (\ ///////phase.monad each (_.then (<choice> true idx))))])
([/////synthesis.side/left /////synthesis.simple_left_side ..left_choice]
[/////synthesis.side/right /////synthesis.simple_right_side ..right_choice])
@@ -262,13 +262,13 @@
(|>> ////synthesis/case.storage
(value@ #////synthesis/case.dependencies)
set.list
- (list\map (function (_ variable)
- (.case variable
- (#///////variable.Local register)
- (..register register)
-
- (#///////variable.Foreign register)
- (..capture register))))))
+ (list\each (function (_ variable)
+ (.case variable
+ (#///////variable.Local register)
+ (..register register)
+
+ (#///////variable.Foreign register)
+ (..capture register))))))
(def: .public (case! statement expression archive [valueS pathP])
(Generator! [Synthesis Path])
@@ -288,7 +288,7 @@
.let [@case (_.constant (///reference.artifact [case_module case_artifact]))
@dependencies+ (..dependencies (/////synthesis.path/seq (/////synthesis.path/then valueS)
pathP))
- directive (_.define_function @case (list\map _.parameter @dependencies+) case!)]
+ directive (_.define_function @case (list\each _.parameter @dependencies+) case!)]
_ (/////generation.execute! directive)
_ (/////generation.save! case_artifact directive)]
(in (_.apply/* @dependencies+ @case))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/function.lux
index c749c30f2..b68f9a404 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/function.lux
@@ -33,7 +33,7 @@
(Generator (Application Synthesis))
(do {! ///////phase.monad}
[functionG (expression archive functionS)
- argsG+ (monad.map ! (expression archive) argsS+)]
+ argsG+ (monad.each ! (expression archive) argsS+)]
(in (_.apply/*' argsG+ functionG))))
(def: capture
@@ -58,10 +58,10 @@
_
(let [@inits (|> (list.enumeration inits)
- (list\map (|>> product.left ..capture)))]
- [(_.set! @selfG (_.closure (list) (list\map _.parameter @inits)
+ (list\each (|>> product.left ..capture)))]
+ [(_.set! @selfG (_.closure (list) (list\each _.parameter @inits)
($_ _.then
- (_.set! @selfL (_.closure (list& (_.reference @selfL) (list\map _.reference @inits))
+ (_.set! @selfL (_.closure (list& (_.reference @selfL) (list\each _.reference @inits))
(list)
body!))
(_.return @selfL))))
@@ -72,11 +72,11 @@
(do {! ///////phase.monad}
[[function_name body!] (/////generation.with_new_context archive
(do !
- [@scope (\ ! map ..@scope
+ [@scope (\ ! each ..@scope
(/////generation.context archive))]
(/////generation.with_anchor [1 @scope]
(statement expression archive bodyS))))
- closureG+ (monad.map ! (expression archive) environment)
+ closureG+ (monad.each ! (expression archive) environment)
.let [@curried (_.var "curried")
arityG (|> arity .int _.int)
@num_args (_.var "num_args")
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/loop.lux
index 8baa09008..e513411b3 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/loop.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/loop.lux
@@ -41,9 +41,9 @@
(-> Register (List Expression) Statement Statement)
(|> bindings
list.enumeration
- (list\map (function (_ [register value])
- (let [variable (//case.register (n.+ offset register))]
- (_.set! variable value))))
+ (list\each (function (_ [register value])
+ (let [variable (//case.register (n.+ offset register))]
+ (_.set! variable value))))
list.reversed
(list\mix _.then body)))
@@ -57,8 +57,8 @@
... true loop
_
(do {! ///////phase.monad}
- [@scope (\ ! map ..@scope /////generation.next)
- initsO+ (monad.map ! (expression archive) initsS+)
+ [@scope (\ ! each ..@scope /////generation.next)
+ initsO+ (monad.each ! (expression archive) initsS+)
body! (/////generation.with_anchor [start @scope]
(statement expression archive bodyS))]
(in (..setup start initsO+
@@ -80,15 +80,15 @@
(..scope! statement expression archive [start initsS+ bodyS]))
.let [locals (|> initsS+
list.enumeration
- (list\map (|>> product.left (n.+ start) //case.register _.parameter)))
+ (list\each (|>> product.left (n.+ start) //case.register _.parameter)))
@loop (_.constant (///reference.artifact [loop_module loop_artifact]))
- loop_variables (set.of_list _.hash (list\map product.right locals))
+ loop_variables (set.of_list _.hash (list\each product.right locals))
referenced_variables (: (-> Synthesis (Set Var))
(|>> synthesis.path/then
//case.dependencies
(set.of_list _.hash)))
[directive instantiation] (: [Statement Expression]
- (case (|> (list\map referenced_variables initsS+)
+ (case (|> (list\each referenced_variables initsS+)
(list\mix set.union (referenced_variables bodyS))
(set.difference loop_variables)
set.list)
@@ -97,8 +97,8 @@
@loop]
foreigns
- [(<| (_.define_function @loop (list\map _.parameter foreigns))
- (_.return (_.closure (list\map _.parameter foreigns) (list) scope!)))
+ [(<| (_.define_function @loop (list\each _.parameter foreigns))
+ (_.return (_.closure (list\each _.parameter foreigns) (list) scope!)))
(_.apply/* foreigns @loop)]))]
_ (/////generation.execute! directive)
_ (/////generation.save! loop_artifact directive)]
@@ -111,12 +111,12 @@
(Generator! (List Synthesis))
(do {! ///////phase.monad}
[[offset @scope] /////generation.anchor
- argsO+ (monad.map ! (expression archive) argsS+)]
+ argsO+ (monad.each ! (expression archive) argsS+)]
(in ($_ _.then
(_.set! @temp (_.array/* argsO+))
(..setup offset
(|> argsO+
list.enumeration
- (list\map (function (_ [idx _])
- (_.item (_.int (.int idx)) @temp))))
+ (list\each (function (_ [idx _])
+ (_.item (_.int (.int idx)) @temp))))
(_.go_to @scope))))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux
index 8dfb51dd7..f5bde1d64 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux
@@ -76,9 +76,9 @@
[ids (monad.all ! (list.repeated (list.size vars) meta.seed))]
(in (list (` (let [(~+ (|> vars
(list.zipped/2 ids)
- (list\map (function (_ [id var])
- (list (code.local_identifier var)
- (` (_.var (~ (code.text (format "v" (%.nat id)))))))))
+ (list\each (function (_ [id var])
+ (list (code.local_identifier var)
+ (` (_.var (~ (code.text (format "v" (%.nat id)))))))))
list.together))]
(~ body)))))))
@@ -111,9 +111,9 @@
(#.Right [name inputs])
(macro.with_identifiers [g!_]
(let [g!name (code.local_identifier name)
- inputsC (list\map code.local_identifier inputs)
- inputs_typesC (list\map (function.constant (` _.Expression))
- inputs)]
+ inputsC (list\each code.local_identifier inputs)
+ inputs_typesC (list\each (function.constant (` _.Expression))
+ inputs)]
(in (list (` (def: .public ((~ g!name) (~+ inputsC))
(-> (~+ inputs_typesC) Computation)
(_.apply/* (list (~+ inputsC)) (~ runtime_name))))
@@ -124,7 +124,7 @@
(function ((~ g!_) (~ g!_))
(..with_vars [(~+ inputsC)]
(_.define_function (~ g!_)
- (list (~+ (list\map (|>> (~) [false] (`)) inputsC)))
+ (list (~+ (list\each (|>> (~) [false] (`)) inputsC)))
(~ code))))))))))))))))
(runtime: (io//log! message)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/structure.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/structure.lux
index a7fe22f6d..4d73dcec5 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/structure.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/php/structure.lux
@@ -29,14 +29,14 @@
_
(let [size (_.int (.int (list.size elemsS+)))]
(|> elemsS+
- (monad.map ///////phase.monad (expression archive))
- (///////phase\map (|>> _.array/*
- (//runtime.tuple//make size)))))))
+ (monad.each ///////phase.monad (expression archive))
+ (///////phase\each (|>> _.array/*
+ (//runtime.tuple//make size)))))))
(def: .public (variant expression archive [lefts right? valueS])
(Generator (Variant Synthesis))
(let [tag (if right?
(++ lefts)
lefts)]
- (///////phase\map (//runtime.variant tag right?)
- (expression archive valueS))))
+ (///////phase\each (//runtime.variant tag right?)
+ (expression archive valueS))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux
index 6262f0104..e0385c419 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/case.lux
@@ -36,8 +36,8 @@
(def: .public (identifier prefix)
(-> Text (Operation SVar))
- (///////phase\map (|>> %.nat (format prefix) _.var)
- /////generation.next))
+ (///////phase\each (|>> %.nat (format prefix) _.var)
+ /////generation.next))
(def: .public register
(-> Register SVar)
@@ -199,12 +199,12 @@
(^template [<tag> <format>]
[(<tag> item)
(do {! ///////phase.monad}
- [clauses (monad.map ! (function (_ [match then])
- (\ ! map
- (|>> [(_.= (|> match <format>)
- ..peek)])
- (recur then)))
- (#.Item item))]
+ [clauses (monad.each ! (function (_ [match then])
+ (\ ! each
+ (|>> [(_.= (|> match <format>)
+ ..peek)])
+ (recur then)))
+ (#.Item item))]
(in (#.Some (_.cond clauses
..fail_pm!))))])
([#/////synthesis.I64_Fork (<| //primitive.i64 .int)]
@@ -241,7 +241,7 @@
(^ (<simple> idx nextP))
(|> nextP
recur
- (///////phase\map (_.then (<choice> true idx))))])
+ (///////phase\each (_.then (<choice> true idx))))])
([/////synthesis.side/left /////synthesis.simple_left_side ..left_choice]
[/////synthesis.side/right /////synthesis.simple_right_side ..right_choice])
@@ -300,13 +300,13 @@
(|>> case.storage
(value@ #case.dependencies)
set.list
- (list\map (function (_ variable)
- (.case variable
- (#///////variable.Local register)
- (..register register)
-
- (#///////variable.Foreign register)
- (..capture register))))))
+ (list\each (function (_ variable)
+ (.case variable
+ (#///////variable.Local register)
+ (..register register)
+
+ (#///////variable.Foreign register)
+ (..capture register))))))
(def: .public (case! in_closure? statement expression archive [valueS pathP])
(-> Bit (Generator! [Synthesis Path]))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/function.lux
index f4b31f61d..bd8bd4047 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/function.lux
@@ -35,7 +35,7 @@
(Generator (Application Synthesis))
(do {! ///////phase.monad}
[functionO (expression archive functionS)
- argsO+ (monad.map ! (expression archive) argsS+)]
+ argsO+ (monad.each ! (expression archive) argsS+)]
(in (_.apply/* functionO argsO+))))
(def: .public capture
@@ -55,7 +55,7 @@
(do {! ///////phase.monad}
[.let [directive (_.def @function
(|> (list.enumeration inits)
- (list\map (|>> product.left ..capture)))
+ (list\each (|>> product.left ..capture)))
($_ _.then
function_definition
(_.return @function)))]
@@ -72,7 +72,7 @@
[[[function_module function_artifact] body!] (/////generation.with_new_context archive
(/////generation.with_anchor 1
(statement expression archive bodyS)))
- environment (monad.map ! (expression archive) environment)
+ environment (monad.each ! (expression archive) environment)
.let [@curried (_.var "curried")
arityO (|> arity .int _.int)
@num_args (_.var "num_args")
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/loop.lux
index 50469f64e..670480f8e 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/loop.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/loop.lux
@@ -35,9 +35,9 @@
(-> Register (List (Expression Any)) (Statement Any) (Statement Any))
(|> bindings
list.enumeration
- (list\map (function (_ [register value])
- (_.set (list (//case.register (n.+ offset register)))
- value)))
+ (list\each (function (_ [register value])
+ (_.set (list (//case.register (n.+ offset register)))
+ value)))
list.reversed
(list\mix _.then body)))
@@ -57,7 +57,7 @@
... true loop
_
(do {! ///////phase.monad}
- [initsO+ (monad.map ! (expression archive) initsS+)
+ [initsO+ (monad.each ! (expression archive) initsS+)
body! (/////generation.with_anchor start
(statement expression archive bodyS))]
(in (<| (..setup start initsO+)
@@ -74,14 +74,14 @@
... true loop
_
(do {! ///////phase.monad}
- [initsO+ (monad.map ! (expression archive) initsS+)
+ [initsO+ (monad.each ! (expression archive) initsS+)
[[loop_module loop_artifact] body!] (/////generation.with_new_context archive
(/////generation.with_anchor start
(statement expression archive bodyS)))
.let [@loop (_.var (///reference.artifact [loop_module loop_artifact]))
locals (|> initsS+
list.enumeration
- (list\map (|>> product.left (n.+ start) //case.register)))
+ (list\each (|>> product.left (n.+ start) //case.register)))
actual_loop (<| (_.def @loop locals)
..set_scope
body!)
@@ -111,11 +111,11 @@
(do {! ///////phase.monad}
[offset /////generation.anchor
@temp (//case.identifier "lux_recur_values")
- argsO+ (monad.map ! (expression archive) argsS+)
+ argsO+ (monad.each ! (expression archive) argsS+)
.let [re_binds (|> argsO+
list.enumeration
- (list\map (function (_ [idx _])
- (_.item (_.int (.int idx)) @temp))))]]
+ (list\each (function (_ [idx _])
+ (_.item (_.int (.int idx)) @temp))))]]
(in ($_ _.then
(_.set (list @temp) (_.list argsO+))
(..setup offset re_binds
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux
index 9952ea02d..fafc59235 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/runtime.lux
@@ -115,9 +115,9 @@
[ids (monad.all ! (list.repeated (list.size vars) meta.seed))]
(in (list (` (let [(~+ (|> vars
(list.zipped/2 ids)
- (list\map (function (_ [id var])
- (list (code.local_identifier var)
- (` (_.var (~ (code.text (format "v" (%.nat id)))))))))
+ (list\each (function (_ [id var])
+ (list (code.local_identifier var)
+ (` (_.var (~ (code.text (format "v" (%.nat id)))))))))
list.together))]
(~ body)))))))
@@ -143,9 +143,9 @@
(let [nameC (code.local_identifier name)
code_nameC (code.local_identifier (format "@" name))
runtime_nameC (` (runtime_name (~ (code.text name))))
- inputsC (list\map code.local_identifier inputs)
- inputs_typesC (list\map (function.constant (` (_.Expression Any)))
- inputs)]
+ inputsC (list\each code.local_identifier inputs)
+ inputs_typesC (list\each (function.constant (` (_.Expression Any)))
+ inputs)]
(in (list (` (def: .public ((~ nameC) (~+ inputsC))
(-> (~+ inputs_typesC) (Computation Any))
(_.apply/* (~ runtime_nameC) (list (~+ inputsC)))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/structure.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/structure.lux
index 756e3f00d..85dc6218c 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/structure.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/python/structure.lux
@@ -25,13 +25,13 @@
_
(|> elemsS+
- (monad.map ///////phase.monad (generate archive))
- (///////phase\map _.list))))
+ (monad.each ///////phase.monad (generate archive))
+ (///////phase\each _.list))))
(def: .public (variant generate archive [lefts right? valueS])
(Generator (Variant Synthesis))
(let [tag (if right?
(++ lefts)
lefts)]
- (///////phase\map (//runtime.variant tag right?)
- (generate archive valueS))))
+ (///////phase\each (//runtime.variant tag right?)
+ (generate archive valueS))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/case.lux
index e751e412b..86f376beb 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/case.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/case.lux
@@ -164,13 +164,13 @@
(^template [<tag> <format> <=>]
[(<tag> item)
(do {! ///////phase.monad}
- [clauses (monad.map ! (function (_ [match then])
- (do !
- [then! (recur then)]
- (in [(<=> (|> match <format>)
- ..peek)
- then!])))
- (#.Item item))]
+ [clauses (monad.each ! (function (_ [match then])
+ (do !
+ [then! (recur then)]
+ (in [(<=> (|> match <format>)
+ ..peek)
+ then!])))
+ (#.Item item))]
(in (list\mix (function (_ [when then] else)
(_.if when then else))
..fail!
@@ -233,8 +233,8 @@
(Generator [Synthesis Path])
(do {! ///////phase.monad}
[valueO (expression archive valueS)]
- (<| (\ ! map (|>> ($_ _.then
- (_.set! $cursor (_.list (list valueO)))
- (_.set! $savepoint (_.list (list))))
- _.block))
+ (<| (\ ! each (|>> ($_ _.then
+ (_.set! $cursor (_.list (list valueO)))
+ (_.set! $savepoint (_.list (list))))
+ _.block))
(pattern_matching expression archive pathP))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/function.lux
index f2335374c..5a4914c31 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/function.lux
@@ -36,7 +36,7 @@
(Generator (Application Synthesis))
(do {! ///////phase.monad}
[functionO (expression archive functionS)
- argsO+ (monad.map ! (expression archive) argsS+)]
+ argsO+ (monad.each ! (expression archive) argsS+)]
(in (_.apply argsO+ functionO))))
(def: (with_closure function_id $function inits function_definition)
@@ -55,7 +55,7 @@
(_.function (|> inits
list.size
list.indices
- (list\map //case.capture))
+ (list\each //case.capture))
($_ _.then
function_definition
$function)))]
@@ -76,11 +76,11 @@
(do {! ///////phase.monad}
[[[function_module function_artifact] bodyO] (/////generation.with_new_context archive
(do !
- [$self (\ ! map (|>> ///reference.artifact _.var)
+ [$self (\ ! each (|>> ///reference.artifact _.var)
(/////generation.context archive))]
(/////generation.with_anchor $self
(expression archive bodyS))))
- closureO+ (monad.map ! (expression archive) environment)
+ closureO+ (monad.each ! (expression archive) environment)
.let [arityO (|> arity .int _.int)
$num_args (_.var "num_args")
$self (_.var (///reference.artifact [function_module function_artifact]))
@@ -96,7 +96,7 @@
(_.set! (//case.register 0) $self)
(|> arity
list.indices
- (list\map input_declaration)
+ (list\each input_declaration)
(list\mix _.then bodyO)))]
[(|> $num_args (_.> arityO))
(let [arity_args (_.slice (_.int +1) arityO $curried)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/loop.lux
index 28ac47ffb..82b97c26a 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/loop.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/loop.lux
@@ -43,8 +43,8 @@
... true loop
_
(do {! ///////phase.monad}
- [$scope (\ ! map _.var (/////generation.identifier "loop_scope"))
- initsO+ (monad.map ! (expression archive) initsS+)
+ [$scope (\ ! each _.var (/////generation.identifier "loop_scope"))
+ initsO+ (monad.each ! (expression archive) initsS+)
bodyO (/////generation.with_anchor $scope
(expression archive bodyS))]
(in (_.block
@@ -53,7 +53,7 @@
(_.function (|> initsS+
list.size
list.indices
- (list\map (|>> (n.+ offset) //case.register)))
+ (list\each (|>> (n.+ offset) //case.register)))
bodyO))
(_.apply initsO+ $scope)))))))
@@ -61,5 +61,5 @@
(Generator (List Synthesis))
(do {! ///////phase.monad}
[$scope /////generation.anchor
- argsO+ (monad.map ! (expression archive) argsS+)]
+ argsO+ (monad.each ! (expression archive) argsS+)]
(in (_.apply argsO+ $scope))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux
index 624826639..e528b33a0 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/common.lux
@@ -54,7 +54,7 @@
(-> Text Bundle Bundle)
(|> bundle
dict.entries
- (list/map (function (_ [key val]) [(format prefix " " key) val]))
+ (list/each (function (_ [key val]) [(format prefix " " key) val]))
(dict.from_list text.Hash<Text>)))
(def: (wrong_arity proc expected actual)
@@ -69,21 +69,21 @@
(do {@ macro.monad}
[g!input+ (monad.all @ (list.repeated arity (macro.identifier "input")))]
(in (list (` (def: .public ((~ (code.local_identifier name)) (~ g!proc))
- (-> (-> (..Vector (~ (code.nat arity)) Expression) Expression)
- (-> Text ..Proc))
- (function ((~ g!_) (~ g!name))
- (function ((~ g!_) (~ g!translate) (~ g!inputs))
- (case (~ g!inputs)
- (^ (list (~+ g!input+)))
- (do macro.Monad<Meta>
- [(~+ (|> g!input+
- (list/map (function (_ g!input)
- (list g!input (` ((~ g!translate) (~ g!input))))))
- list.together))]
- ((~' in) ((~ g!proc) [(~+ g!input+)])))
-
- (~' _)
- (macro.failure (wrong_arity (~ g!name) +1 (list.size (~ g!inputs))))))))))))))
+ (-> (-> (..Vector (~ (code.nat arity)) Expression) Expression)
+ (-> Text ..Proc))
+ (function ((~ g!_) (~ g!name))
+ (function ((~ g!_) (~ g!translate) (~ g!inputs))
+ (case (~ g!inputs)
+ (^ (list (~+ g!input+)))
+ (do macro.Monad<Meta>
+ [(~+ (|> g!input+
+ (list/each (function (_ g!input)
+ (list g!input (` ((~ g!translate) (~ g!input))))))
+ list.together))]
+ ((~' in) ((~ g!proc) [(~+ g!input+)])))
+
+ (~' _)
+ (macro.failure (wrong_arity (~ g!name) +1 (list.size (~ g!inputs))))))))))))))
(arity: nullary +0)
(arity: unary +1)
@@ -95,7 +95,7 @@
(function (_ proc_name)
(function (_ translate inputsS)
(do {@ macro.Monad<Meta>}
- [inputsI (monad.map @ translate inputsS)]
+ [inputsI (monad.each @ translate inputsS)]
(in (proc inputsI))))))
... [Procedures]
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/host.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/host.lux
index db45a04fc..b810862e2 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/host.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/procedure/host.lux
@@ -39,7 +39,7 @@
... (^ (list& functionS argsS+))
... (do {@ macro.Monad<Meta>}
... [functionO (translate functionS)
-... argsO+ (monad.map @ translate argsS+)]
+... argsO+ (monad.each @ translate argsS+)]
... (in (lua.apply functionO argsO+)))
... _
@@ -59,7 +59,7 @@
... (^ (list& tableS [_ (#.Text field)] argsS+))
... (do {@ macro.Monad<Meta>}
... [tableO (translate tableS)
-... argsO+ (monad.map @ translate argsS+)]
+... argsO+ (monad.each @ translate argsS+)]
... (in (lua.method field tableO argsO+)))
... _
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux
index f0ea2c3fb..5d91dbde7 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/runtime.lux
@@ -82,9 +82,9 @@
[ids (monad.all ! (list.repeated (list.size vars) meta.seed))]
(in (list (` (let [(~+ (|> vars
(list.zipped/2 ids)
- (list\map (function (_ [id var])
- (list (code.local_identifier var)
- (` (_.var (~ (code.text (format "v" (%.nat id)))))))))
+ (list\each (function (_ [id var])
+ (list (code.local_identifier var)
+ (` (_.var (~ (code.text (format "v" (%.nat id)))))))))
list.together))]
(~ body)))))))
@@ -110,9 +110,9 @@
(#.Right [name inputs])
(let [g!name (code.local_identifier name)
- inputsC (list\map code.local_identifier inputs)
- inputs_typesC (list\map (function.constant (` _.Expression))
- inputs)]
+ inputsC (list\each code.local_identifier inputs)
+ inputs_typesC (list\each (function.constant (` _.Expression))
+ inputs)]
(in (list (` (def: .public ((~ g!name) (~+ inputsC))
(-> (~+ inputs_typesC) _.Expression)
(_.apply (list (~+ inputsC)) (~ runtime_name))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/structure.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/structure.lux
index 748f56955..2a69cfb08 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/structure.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/r/structure.lux
@@ -28,13 +28,13 @@
_
(|> elemsS+
- (monad.map ///////phase.monad (expression archive))
- (///////phase\map _.list))))
+ (monad.each ///////phase.monad (expression archive))
+ (///////phase\each _.list))))
(def: .public (variant expression archive [lefts right? valueS])
(Generator (Variant Synthesis))
(let [tag (if right?
(++ lefts)
lefts)]
- (///////phase\map (|>> (//runtime.variant tag right?))
- (expression archive valueS))))
+ (///////phase\each (|>> (//runtime.variant tag right?))
+ (expression archive valueS))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/reference.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/reference.lux
index 26ccf116d..9259c0ef1 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/reference.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/reference.lux
@@ -54,8 +54,8 @@
(All [anchor expression directive]
(-> (System expression) Archive Name
(////generation.Operation anchor expression directive expression)))
- (phase\map (|>> ..artifact (\ system constant))
- (////generation.remember archive name)))
+ (phase\each (|>> ..artifact (\ system constant))
+ (////generation.remember archive name)))
(template [<sigil> <name>]
[(def: .public (<name> system)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby.lux
index 0c56f55b1..e963dad17 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby.lux
@@ -32,7 +32,7 @@
(case synthesis
(^template [<tag>]
[(^ (<tag> value))
- (//////phase\map _.return (expression archive synthesis))])
+ (//////phase\each _.return (expression archive synthesis))])
([////synthesis.bit]
[////synthesis.i64]
[////synthesis.f64]
@@ -56,7 +56,7 @@
[////synthesis.loop/recur /loop.recur!])
(^ (////synthesis.function/abstraction abstraction))
- (//////phase\map _.return (/function.function statement expression archive abstraction))
+ (//////phase\each _.return (/function.function statement expression archive abstraction))
))
(exception: .public cannot_recur_as_an_expression)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux
index df08d8a21..276716fef 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux
@@ -38,7 +38,7 @@
(def: .public (identifier prefix)
(-> Text (Operation LVar))
- (///////phase\map (|>> %.nat (format prefix) _.local) /////generation.next))
+ (///////phase\each (|>> %.nat (format prefix) _.local) /////generation.next))
(def: .public register
(-> Register LVar)
@@ -208,12 +208,12 @@
(^template [<tag> <format>]
[(<tag> item)
(do {! ///////phase.monad}
- [clauses (monad.map ! (function (_ [match then])
- (\ ! map
- (|>> [(_.= (|> match <format>)
- ..peek)])
- (recur then)))
- (#.Item item))]
+ [clauses (monad.each ! (function (_ [match then])
+ (\ ! each
+ (|>> [(_.= (|> match <format>)
+ ..peek)])
+ (recur then)))
+ (#.Item item))]
(in (#.Some (_.cond clauses
..fail!))))])
([#/////synthesis.I64_Fork (<| //primitive.i64 .int)]
@@ -263,12 +263,12 @@
(^template [<tag> <format>]
[(<tag> item)
(do {! ///////phase.monad}
- [clauses (monad.map ! (function (_ [match then])
- (\ ! map
- (|>> [(_.= (|> match <format>)
- ..peek)])
- (recur then)))
- (#.Item item))]
+ [clauses (monad.each ! (function (_ [match then])
+ (\ ! each
+ (|>> [(_.= (|> match <format>)
+ ..peek)])
+ (recur then)))
+ (#.Item item))]
(in (_.cond clauses
..fail!)))])
([#/////synthesis.I64_Fork (<| //primitive.i64 .int)]
@@ -282,7 +282,7 @@
(^ (<simple> idx nextP))
(|> nextP
recur
- (///////phase\map (_.then (<choice> true idx))))])
+ (///////phase\each (_.then (<choice> true idx))))])
([/////synthesis.side/left /////synthesis.simple_left_side ..left_choice]
[/////synthesis.side/right /////synthesis.simple_right_side ..right_choice])
@@ -355,6 +355,6 @@
(-> Phase! (Generator [Synthesis Path]))
(|> case
(case! true statement expression archive)
- (\ ///////phase.monad map
+ (\ ///////phase.monad each
(|>> (_.lambda #.None (list))
(_.apply_lambda/* (list))))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/function.lux
index efc132065..768d4a928 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/function.lux
@@ -35,7 +35,7 @@
(Generator (Application Synthesis))
(do {! ///////phase.monad}
[functionO (expression archive functionS)
- argsO+ (monad.map ! (expression archive) argsS+)]
+ argsO+ (monad.each ! (expression archive) argsS+)]
(in (_.apply_lambda/* argsO+ functionO))))
(def: .public capture
@@ -54,7 +54,7 @@
(let [@self (_.local self)]
[(_.function @self
(|> (list.enumeration inits)
- (list\map (|>> product.left ..capture)))
+ (list\each (|>> product.left ..capture)))
($_ _.then
(_.set (list @self) function_definition)
(_.return @self)))
@@ -69,7 +69,7 @@
[[[function_module function_artifact] body!] (/////generation.with_new_context archive
(/////generation.with_anchor 1
(statement expression archive bodyS)))
- closureO+ (monad.map ! (expression archive) environment)
+ closureO+ (monad.each ! (expression archive) environment)
.let [function_name (///reference.artifact [function_module function_artifact])
@curried (_.local "curried")
arityO (|> arity .int _.int)
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/loop.lux
index caf3afb78..2c6f7dbe9 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/loop.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/loop.lux
@@ -35,9 +35,9 @@
(-> Register (List Expression) Statement Statement)
(|> bindings
list.enumeration
- (list\map (function (_ [register value])
- (_.set (list (//case.register (n.+ offset register)))
- value)))
+ (list\each (function (_ [register value])
+ (_.set (list (//case.register (n.+ offset register)))
+ value)))
list.reversed
(list\mix _.then body)))
@@ -58,7 +58,7 @@
... true loop
_
(do {! ///////phase.monad}
- [initsO+ (monad.map ! (expression archive) initsS+)
+ [initsO+ (monad.each ! (expression archive) initsS+)
body! (/////generation.with_anchor start
(statement expression archive bodyS))]
(in (<| (..setup start initsO+)
@@ -85,11 +85,11 @@
(do {! ///////phase.monad}
[offset /////generation.anchor
@temp (//case.identifier "lux_recur_values")
- argsO+ (monad.map ! (expression archive) argsS+)
+ argsO+ (monad.each ! (expression archive) argsS+)
.let [re_binds (|> argsO+
list.enumeration
- (list\map (function (_ [idx _])
- (_.item (_.int (.int idx)) @temp))))]]
+ (list\each (function (_ [idx _])
+ (_.item (_.int (.int idx)) @temp))))]]
(in ($_ _.then
(_.set (list @temp) (_.array argsO+))
(..setup offset re_binds
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux
index b083c0a67..c4d57ef09 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/runtime.lux
@@ -77,9 +77,9 @@
[ids (monad.all ! (list.repeated (list.size vars) meta.seed))]
(in (list (` (let [(~+ (|> vars
(list.zipped/2 ids)
- (list\map (function (_ [id var])
- (list (code.local_identifier var)
- (` (_.local (~ (code.text (format "v" (%.nat id)))))))))
+ (list\each (function (_ [id var])
+ (list (code.local_identifier var)
+ (` (_.local (~ (code.text (format "v" (%.nat id)))))))))
list.together))]
(~ body)))))))
@@ -109,9 +109,9 @@
(#.Right [name inputs])
(macro.with_identifiers [g!_]
(let [g!name (code.local_identifier name)
- inputsC (list\map code.local_identifier inputs)
- inputs_typesC (list\map (function.constant (` _.Expression))
- inputs)]
+ inputsC (list\each code.local_identifier inputs)
+ inputs_typesC (list\each (function.constant (` _.Expression))
+ inputs)]
(in (list (` (def: .public ((~ g!name) (~+ inputsC))
(-> (~+ inputs_typesC) Computation)
(_.apply/* (list (~+ inputsC)) (~ runtime_name))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/structure.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/structure.lux
index 57861f7d4..a5ac11d83 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/structure.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/structure.lux
@@ -25,13 +25,13 @@
_
(|> elemsS+
- (monad.map ///////phase.monad (generate archive))
- (///////phase\map _.array))))
+ (monad.each ///////phase.monad (generate archive))
+ (///////phase\each _.array))))
(def: .public (variant generate archive [lefts right? valueS])
(Generator (Variant Synthesis))
(let [tag (if right?
(++ lefts)
lefts)]
- (///////phase\map (//runtime.variant tag right?)
- (generate archive valueS))))
+ (///////phase\each (//runtime.variant tag right?)
+ (generate archive valueS))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux
index e68b23464..de65969b2 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/case.lux
@@ -158,13 +158,13 @@
(^template [<tag> <format> <=>]
[(<tag> item)
(do {! ///////phase.monad}
- [clauses (monad.map ! (function (_ [match then])
- (do !
- [then! (recur then)]
- (in [(<=> (|> match <format>)
- ..peek)
- then!])))
- (#.Item item))]
+ [clauses (monad.each ! (function (_ [match then])
+ (do !
+ [then! (recur then)]
+ (in [(<=> (|> match <format>)
+ ..peek)
+ then!])))
+ (#.Item item))]
(in (list\mix (function (_ [when then] else)
(_.if when then else))
..fail!
@@ -210,7 +210,7 @@
(def: (pattern_matching expression archive pathP)
(Generator Path)
- (\ ///////phase.monad map
+ (\ ///////phase.monad each
(try_pm (_.raise/1 (_.string "Invalid expression for pattern-matching.")))
(pattern_matching' expression archive pathP)))
@@ -218,6 +218,6 @@
(Generator [Synthesis Path])
(do {! ///////phase.monad}
[valueO (expression archive valueS)]
- (<| (\ ! map (_.let (list [@cursor (_.list/* (list valueO))]
- [@savepoint (_.list/* (list))])))
+ (<| (\ ! each (_.let (list [@cursor (_.list/* (list valueO))]
+ [@savepoint (_.list/* (list))])))
(pattern_matching expression archive pathP))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux
index dc3c75d98..b46b2e0b5 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/extension/common.lux
@@ -51,8 +51,8 @@
(^ (list (~+ g!input+)))
(do /////.monad
[(~+ (|> g!input+
- (list\map (function (_ g!input)
- (list g!input (` ((~ g!phase) (~ g!input))))))
+ (list\each (function (_ g!input)
+ (list g!input (` ((~ g!phase) (~ g!input))))))
list.together))]
((~' in) ((~ g!extension) [(~+ g!input+)])))
@@ -69,7 +69,7 @@
(function (_ extension_name)
(function (_ phase inputsS)
(do {! /////.monad}
- [inputsI (monad.map ! phase inputsS)]
+ [inputsI (monad.each ! phase inputsS)]
(in (extension inputsI))))))
(def: bundle::lux
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/function.lux
index cfb345097..c7d8dbcd4 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/function.lux
@@ -33,7 +33,7 @@
(Generator (Application Synthesis))
(do {! ///////phase.monad}
[functionO (expression archive functionS)
- argsO+ (monad.map ! (expression archive) argsS+)]
+ argsO+ (monad.each ! (expression archive) argsS+)]
(in (_.apply/* argsO+ functionO))))
(def: capture
@@ -50,7 +50,7 @@
_
(|> function_definition
(_.lambda [(|> (list.enumeration inits)
- (list\map (|>> product.left ..capture)))
+ (list\each (|>> product.left ..capture)))
#.None])
(_.apply/* inits)))))
@@ -65,11 +65,11 @@
(do {! ///////phase.monad}
[[function_name bodyO] (/////generation.with_new_context archive
(do !
- [@self (\ ! map (|>> ///reference.artifact _.var)
+ [@self (\ ! each (|>> ///reference.artifact _.var)
(/////generation.context archive))]
(/////generation.with_anchor @self
(expression archive bodyS))))
- closureO+ (monad.map ! (expression archive) environment)
+ closureO+ (monad.each ! (expression archive) environment)
.let [arityO (|> arity .int _.int)
apply_poly (.function (_ args func)
(_.apply/2 (_.var "apply") func args))
@@ -81,7 +81,7 @@
(<| (_.if (|> @num_args (_.=/2 arityO))
(<| (_.let (list [(//case.register 0) @self]))
(_.let_values (list [[(|> (list.indices arity)
- (list\map ..input))
+ (list\each ..input))
#.None]
(_.apply/2 (_.var "apply") (_.var "values") @curried)]))
bodyO))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/loop.lux
index 87ddc4929..d0610fdfa 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/loop.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/loop.lux
@@ -46,12 +46,12 @@
... true loop
_
(do {! ///////phase.monad}
- [initsO+ (monad.map ! (expression archive) initsS+)
+ [initsO+ (monad.each ! (expression archive) initsS+)
bodyO (/////generation.with_anchor @scope
(expression archive bodyS))]
(in (_.letrec (list [@scope (_.lambda [(|> initsS+
list.enumeration
- (list\map (|>> product.left (n.+ start) //case.register)))
+ (list\each (|>> product.left (n.+ start) //case.register)))
#.None]
bodyO)])
(_.apply/* initsO+ @scope))))))
@@ -60,5 +60,5 @@
(Generator (List Synthesis))
(do {! ///////phase.monad}
[@scope /////generation.anchor
- argsO+ (monad.map ! (expression archive) argsS+)]
+ argsO+ (monad.each ! (expression archive) argsS+)]
(in (_.apply/* argsO+ @scope))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux
index 221ee6d88..fefd850ce 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/runtime.lux
@@ -64,9 +64,9 @@
[ids (monad.all ! (list.repeated (list.size vars) meta.seed))]
(in (list (` (let [(~+ (|> vars
(list.zipped/2 ids)
- (list\map (function (_ [id var])
- (list (code.local_identifier var)
- (` (_.var (~ (code.text (format "v" (%.nat id)))))))))
+ (list\each (function (_ [id var])
+ (list (code.local_identifier var)
+ (` (_.var (~ (code.text (format "v" (%.nat id)))))))))
list.together))]
(~ body)))))))
@@ -92,9 +92,9 @@
(#.Right [name inputs])
(let [g!name (code.local_identifier name)
- inputsC (list\map code.local_identifier inputs)
- inputs_typesC (list\map (function.constant (` _.Expression))
- inputs)]
+ inputsC (list\each code.local_identifier inputs)
+ inputs_typesC (list\each (function.constant (` _.Expression))
+ inputs)]
(in (list (` (def: .public ((~ g!name) (~+ inputsC))
(-> (~+ inputs_typesC) _.Computation)
(_.apply/* (list (~+ inputsC)) (~ runtime_name))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/structure.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/structure.lux
index 3c21b5e17..0e5d70dbf 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/structure.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/scheme/structure.lux
@@ -28,13 +28,13 @@
_
(|> elemsS+
- (monad.map ///////phase.monad (expression archive))
- (///////phase\map _.vector/*))))
+ (monad.each ///////phase.monad (expression archive))
+ (///////phase\each _.vector/*))))
(def: .public (variant expression archive [lefts right? valueS])
(Generator (Variant Synthesis))
(let [tag (if right?
(++ lefts)
lefts)]
- (///////phase\map (|>> [tag right?] //runtime.variant)
- (expression archive valueS))))
+ (///////phase\each (|>> [tag right?] //runtime.variant)
+ (expression archive valueS))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis.lux
index 9e80130aa..f71e89b0c 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis.lux
@@ -64,8 +64,8 @@
(#///analysis.Tuple tuple)
(|> tuple
- (monad.map phase.monad optimization')
- (phase\map (|>> /.tuple)))))
+ (monad.each phase.monad optimization')
+ (phase\each (|>> /.tuple)))))
(#///analysis.Case inputA branchesAB+)
(/.with_currying? false
@@ -91,8 +91,8 @@
(#try.Failure _)
(|> args
- (monad.map phase.monad optimization')
- (phase\map (|>> [name] #/.Extension))
+ (monad.each phase.monad optimization')
+ (phase\each (|>> [name] #/.Extension))
(phase.result' state))))))
)))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux
index d2bf439da..75e27d5bf 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux
@@ -42,15 +42,15 @@
thenC
(#///analysis.Bit when)
- (///\map (function (_ then)
- (#/.Bit_Fork when then #.None))
- thenC)
+ (///\each (function (_ then)
+ (#/.Bit_Fork when then #.None))
+ thenC)
(^template [<from> <to> <conversion>]
[(<from> test)
- (///\map (function (_ then)
- (<to> [(<conversion> test) then] (list)))
- thenC)])
+ (///\each (function (_ then)
+ (<to> [(<conversion> test) then] (list)))
+ thenC)])
([#///analysis.Nat #/.I64_Fork .i64]
[#///analysis.Int #/.I64_Fork .i64]
[#///analysis.Rev #/.I64_Fork .i64]
@@ -58,16 +58,16 @@
[#///analysis.Text #/.Text_Fork |>]))
(#///analysis.Bind register)
- (<| (\ ///.monad map (|>> (#/.Seq (#/.Bind register))))
+ (<| (\ ///.monad each (|>> (#/.Seq (#/.Bind register))))
/.with_new_local
thenC)
(#///analysis.Complex (#///analysis.Variant [lefts right? value_pattern]))
- (<| (///\map (|>> (#/.Seq (#/.Access (#/.Side (if right?
- (#.Right lefts)
- (#.Left lefts)))))))
+ (<| (///\each (|>> (#/.Seq (#/.Access (#/.Side (if right?
+ (#.Right lefts)
+ (#.Left lefts)))))))
(path' value_pattern end?)
- (when> [(new> (not end?) [])] [(///\map ..clean_up)])
+ (when> [(new> (not end?) [])] [(///\each ..clean_up)])
thenC)
(#///analysis.Complex (#///analysis.Tuple tuple))
@@ -80,11 +80,11 @@
_
(let [right? (n.= tuple::last tuple::lefts)
end?' (and end? right?)]
- (<| (///\map (|>> (#/.Seq (#/.Access (#/.Member (if right?
- (#.Right (-- tuple::lefts))
- (#.Left tuple::lefts)))))))
+ (<| (///\each (|>> (#/.Seq (#/.Access (#/.Member (if right?
+ (#.Right (-- tuple::lefts))
+ (#.Left tuple::lefts)))))))
(path' tuple::member end?')
- (when> [(new> (not end?') [])] [(///\map ..clean_up)])
+ (when> [(new> (not end?') [])] [(///\each ..clean_up)])
nextC))))
thenC
(list.reversed (list.enumeration tuple))))
@@ -92,7 +92,7 @@
(def: (path archive synthesize pattern bodyA)
(-> Archive Phase Pattern Analysis (Operation Path))
- (path' pattern true (///\map (|>> #/.Then) (synthesize archive bodyA))))
+ (path' pattern true (///\each (|>> #/.Then) (synthesize archive bodyA))))
(def: (weave_branch weave equivalence [new_test new_then] [[old_test old_then] old_tail])
(All [a] (-> (-> Path Path Path) (Equivalence a) [a Path] (/.Fork a Path)
@@ -227,7 +227,7 @@
(-> Phase Archive Synthesis Match (Operation Synthesis))
(do {! ///.monad}
[headSP (path archive synthesize headP headA)
- tailSP+ (monad.map ! (product.uncurried (path archive synthesize)) tailPA+)]
+ tailSP+ (monad.each ! (product.uncurried (path archive synthesize)) tailPA+)]
(in (/.branch/case [input (list\mix weave headSP tailSP+)]))))
(template: (!masking <variable> <output>)
@@ -269,7 +269,7 @@
path
(case input
(^ (/.branch/get [sub_path sub_input]))
- (///\in (/.branch/get [(list\compose path sub_path) sub_input]))
+ (///\in (/.branch/get [(list\composite path sub_path) sub_input]))
_
(///\in (/.branch/get [path input])))))
@@ -357,7 +357,7 @@
(#/.F64_Fork forks)
(#/.Text_Fork forks))
(|> (#.Item forks)
- (list\map product.right)
+ (list\each product.right)
(list\mix for_path path_storage))
(^or (^ (/.path/seq left right))
@@ -413,7 +413,7 @@
(set.union (|> synthesis_storage
(revised@ #bindings (set.union (|> initsS+
list.enumeration
- (list\map (|>> product.left (n.+ start)))
+ (list\each (|>> product.left (n.+ start)))
(set.of_list n.hash))))
(for_synthesis iterationS)
(value@ #dependencies)))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux
index 2aeacc78d..84d91d48d 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/function.lux
@@ -36,7 +36,7 @@
(-> Arity (List Synthesis))
(|>> --
(enum.range n.enum 1)
- (list\map (|>> /.variable/local))))
+ (list\each (|>> /.variable/local))))
(template: .public (self_reference)
[(/.variable/local 0)])
@@ -51,7 +51,7 @@
(let [[funcA argsA] (////analysis.application exprA)]
(do {! phase.monad}
[funcS (phase archive funcA)
- argsS (monad.map ! (phase archive) argsA)]
+ argsS (monad.each ! (phase archive) argsA)]
(with_expansions [<apply> (as_is (/.function/apply [funcS argsS]))]
(case funcS
(^ (/.function/abstraction functionS))
@@ -61,22 +61,22 @@
[locals /.locals]
(in (|> functionS
(//loop.optimization true locals argsS)
- (maybe\map (: (-> [Nat (List Synthesis) Synthesis] Synthesis)
- (function (_ [start inits iteration])
- (case iteration
- (^ (/.loop/scope [start' inits' output]))
- (if (and (n.= start start')
- (list.empty? inits'))
- (/.loop/scope [start inits output])
- (/.loop/scope [start inits iteration]))
+ (maybe\each (: (-> [Nat (List Synthesis) Synthesis] Synthesis)
+ (function (_ [start inits iteration])
+ (case iteration
+ (^ (/.loop/scope [start' inits' output]))
+ (if (and (n.= start start')
+ (list.empty? inits'))
+ (/.loop/scope [start inits output])
+ (/.loop/scope [start inits iteration]))
- _
- (/.loop/scope [start inits iteration])))))
+ _
+ (/.loop/scope [start inits iteration])))))
(maybe.else <apply>))))
(in <apply>))
(^ (/.function/apply [funcS' argsS']))
- (in (/.function/apply [funcS' (list\compose argsS' argsS)]))
+ (in (/.function/apply [funcS' (list\composite argsS' argsS)]))
_
(in <apply>)))))))
@@ -109,7 +109,7 @@
[then (grow_path grow then)
else (case else
(#.Some else)
- (\ ! map (|>> #.Some) (grow_path grow else))
+ (\ ! each (|>> #.Some) (grow_path grow else))
#.None
(in #.None))]
@@ -119,11 +119,11 @@
[(<tag> [[test then] elses])
(do {! phase.monad}
[then (grow_path grow then)
- elses (monad.map ! (function (_ [else_test else_then])
- (do !
- [else_then (grow_path grow else_then)]
- (in [else_test else_then])))
- elses)]
+ elses (monad.each ! (function (_ [else_test else_then])
+ (do !
+ [else_then (grow_path grow else_then)]
+ (in [else_test else_then])))
+ elses)]
(in (<tag> [[test then] elses])))])
([#/.I64_Fork]
[#/.F64_Fork]
@@ -132,7 +132,7 @@
(#/.Then thenS)
(|> thenS
grow
- (phase\map (|>> #/.Then)))
+ (phase\each (|>> #/.Then)))
_
(phase\in path)))
@@ -145,12 +145,12 @@
(#////analysis.Variant [lefts right? subS])
(|> subS
(grow environment)
- (phase\map (|>> [lefts right?] /.variant)))
+ (phase\each (|>> [lefts right?] /.variant)))
(#////analysis.Tuple membersS+)
(|> membersS+
- (monad.map phase.monad (grow environment))
- (phase\map (|>> /.tuple))))
+ (monad.each phase.monad (grow environment))
+ (phase\each (|>> /.tuple))))
(^ (..self_reference))
(phase\in (/.function/apply [expression (list (/.variable/local 1))]))
@@ -200,36 +200,36 @@
(case loop
(#/.Scope [start initsS+ iterationS])
(do {! phase.monad}
- [initsS+' (monad.map ! (grow environment) initsS+)
+ [initsS+' (monad.each ! (grow environment) initsS+)
iterationS' (grow environment iterationS)]
(in (/.loop/scope [(++ start) initsS+' iterationS'])))
(#/.Recur argumentsS+)
(|> argumentsS+
- (monad.map phase.monad (grow environment))
- (phase\map (|>> /.loop/recur))))
+ (monad.each phase.monad (grow environment))
+ (phase\each (|>> /.loop/recur))))
(#/.Function function)
(case function
(#/.Abstraction [_env _arity _body])
(do {! phase.monad}
- [_env' (monad.map !
- (|>> (case> (#/.Reference (#////reference.Variable (#////reference/variable.Foreign register)))
- (..find_foreign environment register)
+ [_env' (monad.each !
+ (|>> (case> (#/.Reference (#////reference.Variable (#////reference/variable.Foreign register)))
+ (..find_foreign environment register)
- captured
- (grow environment captured)))
- _env)]
+ captured
+ (grow environment captured)))
+ _env)]
(in (/.function/abstraction [_env' _arity _body])))
(#/.Apply funcS argsS+)
(do {! phase.monad}
[funcS (grow environment funcS)
- argsS+ (monad.map ! (grow environment) argsS+)]
+ argsS+ (monad.each ! (grow environment) argsS+)]
(in (/.function/apply (case funcS
(^ (/.function/apply [(..self_reference) pre_argsS+]))
[(..self_reference)
- (list\compose pre_argsS+ argsS+)]
+ (list\composite pre_argsS+ argsS+)]
_
[funcS
@@ -237,8 +237,8 @@
(#/.Extension name argumentsS+)
(|> argumentsS+
- (monad.map phase.monad (grow environment))
- (phase\map (|>> (#/.Extension name))))
+ (monad.each phase.monad (grow environment))
+ (phase\each (|>> (#/.Extension name))))
(#/.Primitive _)
(phase\in expression)))
@@ -247,7 +247,7 @@
(-> Phase (Environment Analysis) Phase)
(do {! phase.monad}
[currying? /.currying?
- environment (monad.map ! (phase archive) environment)
+ environment (monad.each ! (phase archive) environment)
bodyS (/.with_currying? true
(/.with_locals 2
(phase archive bodyA)))
@@ -256,10 +256,10 @@
(^ (/.function/abstraction [env' down_arity' bodyS']))
(|> bodyS'
(grow env')
- (\ ! map (function (_ body)
- {#/.environment environment
- #/.arity (++ down_arity')
- #/.body body})))
+ (\ ! each (function (_ body)
+ {#/.environment environment
+ #/.arity (++ down_arity')
+ #/.body body})))
_
(in {#/.environment environment
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/loop.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/loop.lux
index bba61a90f..882a8c5d6 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/loop.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/loop.lux
@@ -46,7 +46,7 @@
[then (recur then)
else (case else
(#.Some else)
- (\ ! map (|>> #.Some) (recur else))
+ (\ ! each (|>> #.Some) (recur else))
#.None
(in #.None))]
@@ -56,11 +56,11 @@
[(<tag> [[test then] elses])
(do {! maybe.monad}
[then (recur then)
- elses (monad.map ! (function (_ [else_test else_then])
- (do !
- [else_then (recur else_then)]
- (in [else_test else_then])))
- elses)]
+ elses (monad.each ! (function (_ [else_test else_then])
+ (do !
+ [else_then (recur else_then)]
+ (in [else_test else_then])))
+ elses)]
(in (<tag> [[test then] elses])))])
([#/.I64_Fork]
[#/.F64_Fork]
@@ -69,7 +69,7 @@
(#/.Then body)
(|> body
body_optimization
- (maybe\map (|>> #/.Then)))
+ (maybe\each (|>> #/.Then)))
_
(#.Some path))))
@@ -93,8 +93,8 @@
(#analysis.Tuple tuple)
(|> tuple
- (monad.map maybe.monad (recur false))
- (maybe\map (|>> /.tuple))))
+ (monad.each maybe.monad (recur false))
+ (maybe\each (|>> /.tuple))))
(#/.Reference reference)
(case reference
@@ -142,7 +142,7 @@
(do {! maybe.monad}
[inits' (|> scope
(value@ #/.inits)
- (monad.map ! (recur false)))
+ (monad.each ! (recur false)))
iteration' (recur return? (value@ #/.iteration scope))]
(in (/.loop/scope {#/.start (|> scope (value@ #/.start) (register_optimization offset))
#/.inits inits'
@@ -150,17 +150,17 @@
(^ (/.loop/recur args))
(|> args
- (monad.map maybe.monad (recur false))
- (maybe\map (|>> /.loop/recur)))
+ (monad.each maybe.monad (recur false))
+ (maybe\each (|>> /.loop/recur)))
(^ (/.function/abstraction [environment arity body]))
(do {! maybe.monad}
- [environment' (monad.map ! (recur false) environment)]
+ [environment' (monad.each ! (recur false) environment)]
(in (/.function/abstraction [environment' arity body])))
(^ (/.function/apply [abstraction arguments]))
(do {! maybe.monad}
- [arguments' (monad.map ! (recur false) arguments)]
+ [arguments' (monad.each ! (recur false) arguments)]
(with_expansions [<application> (as_is (do !
[abstraction' (recur false abstraction)]
(in (/.function/apply [abstraction' arguments']))))]
@@ -181,29 +181,29 @@
(if return?
(do {! maybe.monad}
[input (recur false input)
- matches (monad.map !
- (function (_ match)
- (case match
- (^ (#/.Structure (#analysis.Tuple (list when then))))
- (do !
- [when (recur false when)
- then (recur return? then)]
- (in (#/.Structure (#analysis.Tuple (list when then)))))
-
- _
- (recur false match)))
- matches)
+ matches (monad.each !
+ (function (_ match)
+ (case match
+ (^ (#/.Structure (#analysis.Tuple (list when then))))
+ (do !
+ [when (recur false when)
+ then (recur return? then)]
+ (in (#/.Structure (#analysis.Tuple (list when then)))))
+
+ _
+ (recur false match)))
+ matches)
else (recur return? else)]
(in (#/.Extension ["lux syntax char case!" (list& input else matches)])))
#.None)
(#/.Extension [name args])
(|> args
- (monad.map maybe.monad (recur false))
- (maybe\map (|>> [name] #/.Extension))))))
+ (monad.each maybe.monad (recur false))
+ (maybe\each (|>> [name] #/.Extension))))))
(def: .public (optimization true_loop? offset inits functionS)
(-> Bit Register (List Synthesis) Abstraction (Maybe [Register (List Synthesis) Synthesis]))
(|> (value@ #/.body functionS)
(body_optimization true_loop? offset (value@ #/.environment functionS) (value@ #/.arity functionS))
- (maybe\map (|>> [offset inits]))))
+ (maybe\each (|>> [offset inits]))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux
index 88b2d3f1f..212a2a0a2 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux
@@ -71,14 +71,14 @@
[#/.Alt])
(#/.Bit_Fork when then else)
- (#/.Bit_Fork when (recur then) (maybe\map recur else))
+ (#/.Bit_Fork when (recur then) (maybe\each recur else))
(^template [<tag>]
[(<tag> [[test then] tail])
(<tag> [[test (recur then)]
- (list\map (function (_ [test' then'])
- [test' (recur then')])
- tail)])])
+ (list\each (function (_ [test' then'])
+ [test' (recur then')])
+ tail)])])
([#/.I64_Fork]
[#/.F64_Fork]
[#/.Text_Fork])
@@ -116,7 +116,7 @@
(#analysis.Variant [lefts right (recur value)])
(#analysis.Tuple tuple)
- (#analysis.Tuple (list\map recur tuple))))
+ (#analysis.Tuple (list\each recur tuple))))
(#/.Reference reference)
(case reference
@@ -148,24 +148,24 @@
(#/.Loop (case loop
(#/.Scope [start inits iteration])
(#/.Scope [(..prune redundant start)
- (list\map recur inits)
+ (list\each recur inits)
(recur iteration)])
(#/.Recur resets)
- (#/.Recur (list\map recur resets))))
+ (#/.Recur (list\each recur resets))))
(#/.Function function)
(#/.Function (case function
(#/.Abstraction [environment arity body])
- (#/.Abstraction [(list\map recur environment)
+ (#/.Abstraction [(list\each recur environment)
arity
body])
(#/.Apply abstraction inputs)
- (#/.Apply (recur abstraction) (list\map recur inputs))))))
+ (#/.Apply (recur abstraction) (list\each recur inputs))))))
(#/.Extension name inputs)
- (#/.Extension name (list\map recur inputs)))))
+ (#/.Extension name (list\each recur inputs)))))
(type: Redundancy
(Dictionary Register Bit))
@@ -179,7 +179,7 @@
(def: (extended offset amount redundancy)
(-> Register Nat Redundancy [(List Register) Redundancy])
- (let [extension (|> amount list.indices (list\map (n.+ offset)))]
+ (let [extension (|> amount list.indices (list\each (n.+ offset)))]
[extension
(list\mix (function (_ register redundancy)
(dictionary.has register ..necessary! redundancy))
@@ -239,8 +239,8 @@
(%.Format Redundancy)
(|> redundancy
dictionary.entries
- (list\map (function (_ [register redundant?])
- (%.format (%.nat register) ": " (%.bit redundant?))))
+ (list\each (function (_ [register redundant?])
+ (%.format (%.nat register) ": " (%.bit redundant?))))
(text.interposed ", ")))
(def: (path_optimization optimization)
@@ -257,7 +257,7 @@
[[redundancy then] (recur [redundancy then])
[redundancy else] (case else
(#.Some else)
- (\ ! map
+ (\ ! each
(function (_ [redundancy else])
[redundancy (#.Some else)])
(recur [redundancy else]))
@@ -309,7 +309,7 @@
(list.only (function (_ [register redundant?])
(and (set.member? bindings register)
redundant?)))
- (list\map product.left))]]
+ (list\each product.left))]]
(in [(list\mix dictionary.lacks redundancy (set.list bindings))
(|> redundants
(list.sorted n.>)
@@ -440,4 +440,4 @@
(-> Synthesis (Try Synthesis))
(|>> [..initial]
optimization'
- (\ try.monad map product.right)))
+ (\ try.monad each product.right)))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/program.lux b/stdlib/source/library/lux/tool/compiler/language/lux/program.lux
index f181fd077..047565e77 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/program.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/program.lux
@@ -37,12 +37,12 @@
(do {! try.monad}
[registries (|> archive
archive.archived
- (monad.map !
- (function (_ module)
- (do !
- [id (archive.id module archive)
- [descriptor document] (archive.find module archive)]
- (in [[module id] (value@ #descriptor.registry descriptor)])))))]
+ (monad.each !
+ (function (_ module)
+ (do !
+ [id (archive.id module archive)
+ [descriptor document] (archive.find module archive)]
+ (in [[module id] (value@ #descriptor.registry descriptor)])))))]
(case (list.one (function (_ [[module module_id] registry])
(do maybe.monad
[program_id (artifact.remember ..name registry)]
@@ -53,5 +53,5 @@
#.None
(|> registries
- (list\map (|>> product.left product.left))
+ (list\each (|>> product.left product.left))
(exception.except ..cannot_find_program)))))
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux
index 7f7d205c3..dc555b85d 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux
@@ -38,9 +38,10 @@
(Dictionary Variable Variable))
(type: .public State
- {#locals Nat
- ... https://en.wikipedia.org/wiki/Currying
- #currying? Bit})
+ (Record
+ {#locals Nat
+ ... https://en.wikipedia.org/wiki/Currying
+ #currying? Bit}))
(def: .public fresh_resolver
Resolver
@@ -52,10 +53,11 @@
#currying? false})
(type: .public Primitive
- (#Bit Bit)
- (#I64 (I64 Any))
- (#F64 Frac)
- (#Text Text))
+ (Variant
+ (#Bit Bit)
+ (#I64 (I64 Any))
+ (#F64 Frac)
+ (#Text Text)))
(type: .public Side
(Either Nat Nat))
@@ -64,63 +66,73 @@
(Either Nat Nat))
(type: .public Access
- (#Side Side)
- (#Member Member))
+ (Variant
+ (#Side Side)
+ (#Member Member)))
(type: .public (Fork value next)
[[value next] (List [value next])])
(type: .public (Path' s)
- #Pop
- (#Access Access)
- (#Bind Register)
- (#Bit_Fork Bit (Path' s) (Maybe (Path' s)))
- (#I64_Fork (Fork (I64 Any) (Path' s)))
- (#F64_Fork (Fork Frac (Path' s)))
- (#Text_Fork (Fork Text (Path' s)))
- (#Alt (Path' s) (Path' s))
- (#Seq (Path' s) (Path' s))
- (#Then s))
+ (Variant
+ #Pop
+ (#Access Access)
+ (#Bind Register)
+ (#Bit_Fork Bit (Path' s) (Maybe (Path' s)))
+ (#I64_Fork (Fork (I64 Any) (Path' s)))
+ (#F64_Fork (Fork Frac (Path' s)))
+ (#Text_Fork (Fork Text (Path' s)))
+ (#Alt (Path' s) (Path' s))
+ (#Seq (Path' s) (Path' s))
+ (#Then s)))
(type: .public (Abstraction' s)
- {#environment (Environment s)
- #arity Arity
- #body s})
+ (Record
+ {#environment (Environment s)
+ #arity Arity
+ #body s}))
(type: .public (Apply' s)
- {#function s
- #arguments (List s)})
+ (Record
+ {#function s
+ #arguments (List s)}))
(type: .public (Branch s)
- (#Let s Register s)
- (#If s s s)
- (#Get (List Member) s)
- (#Case s (Path' s)))
+ (Variant
+ (#Let s Register s)
+ (#If s s s)
+ (#Get (List Member) s)
+ (#Case s (Path' s))))
(type: .public (Scope s)
- {#start Register
- #inits (List s)
- #iteration s})
+ (Record
+ {#start Register
+ #inits (List s)
+ #iteration s}))
(type: .public (Loop s)
- (#Scope (Scope s))
- (#Recur (List s)))
+ (Variant
+ (#Scope (Scope s))
+ (#Recur (List s))))
(type: .public (Function s)
- (#Abstraction (Abstraction' s))
- (#Apply s (List s)))
+ (Variant
+ (#Abstraction (Abstraction' s))
+ (#Apply s (List s))))
(type: .public (Control s)
- (#Branch (Branch s))
- (#Loop (Loop s))
- (#Function (Function s)))
+ (Variant
+ (#Branch (Branch s))
+ (#Loop (Loop s))
+ (#Function (Function s))))
(type: .public #rec Synthesis
- (#Primitive Primitive)
- (#Structure (Composite Synthesis))
- (#Reference Reference)
- (#Control (Control Synthesis))
- (#Extension (Extension Synthesis)))
+ (Variant
+ (#Primitive Primitive)
+ (#Structure (Composite Synthesis))
+ (#Reference Reference)
+ (#Control (Control Synthesis))
+ (#Extension (Extension Synthesis))))
(template [<special> <general>]
[(type: .public <special>
@@ -277,8 +289,8 @@
(^template [<tag> <format>]
[(<tag> item)
(|> (#.Item item)
- (list\map (function (_ [test then])
- (format (<format> test) " " (%path' %then then))))
+ (list\each (function (_ [test then])
+ (format (<format> test) " " (%path' %then then))))
(text.interposed " ")
(text.enclosed ["(? " ")"]))])
([#I64_Fork (|>> .int %.int)]
@@ -340,7 +352,7 @@
(#analysis.Tuple members)
(|> members
- (list\map %synthesis)
+ (list\each %synthesis)
(text.interposed " ")
(text.enclosed ["[" "]"])))
@@ -353,7 +365,7 @@
(case function
(#Abstraction [environment arity body])
(let [environment' (|> environment
- (list\map %synthesis)
+ (list\each %synthesis)
(text.interposed " ")
(text.enclosed ["[" "]"]))]
(|> (format environment' " " (%.nat arity) " " (%synthesis body))
@@ -361,7 +373,7 @@
(#Apply func args)
(|> args
- (list\map %synthesis)
+ (list\each %synthesis)
(text.interposed " ")
(format (%synthesis func) " ")
(text.enclosed ["(" ")"])))
@@ -378,7 +390,7 @@
(#Get members record)
(|> (format (%.list (%path' %synthesis)
- (list\map (|>> #Member #Access) members))
+ (list\each (|>> #Member #Access) members))
" " (%synthesis record))
(text.enclosed ["(#get " ")"]))
@@ -391,7 +403,7 @@
(#Scope scope)
(|> (format (%.nat (value@ #start scope))
" " (|> (value@ #inits scope)
- (list\map %synthesis)
+ (list\each %synthesis)
(text.interposed " ")
(text.enclosed ["[" "]"]))
" " (%synthesis (value@ #iteration scope)))
@@ -399,12 +411,12 @@
(#Recur args)
(|> args
- (list\map %synthesis)
+ (list\each %synthesis)
(text.interposed " ")
(text.enclosed ["(#recur " ")"]))))
(#Extension [name args])
- (|> (list\map %synthesis args)
+ (|> (list\each %synthesis args)
(text.interposed " ")
(format (%.text name) " ")
(text.enclosed ["(" ")"]))))
diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive.lux b/stdlib/source/library/lux/tool/compiler/meta/archive.lux
index e1ea19e37..d326a2bbb 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/archive.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/archive.lux
@@ -77,8 +77,9 @@
(abstract: .public Archive
{}
- {#next ID
- #resolver (Dictionary Module [ID (Maybe [Descriptor (Document Any) Output])])}
+ (Record
+ {#next ID
+ #resolver (Dictionary Module [ID (Maybe [Descriptor (Document Any) Output])])})
(def: next
(-> Archive ID)
@@ -188,8 +189,8 @@
(|>> :representation
(value@ #resolver)
dictionary.entries
- (list\map (function (_ [module [id _]])
- [module id]))))
+ (list\each (function (_ [module [id _]])
+ [module id]))))
(def: .public (merged additions archive)
(-> Archive Archive Archive)
@@ -252,7 +253,7 @@
(-> (List Reservation) Bit)
(n.= (list.size reservations)
(|> reservations
- (list\map product.left)
+ (list\each product.left)
(set.of_list text.hash)
set.size)))
@@ -260,7 +261,7 @@
(-> (List Reservation) Bit)
(n.= (list.size reservations)
(|> reservations
- (list\map product.right)
+ (list\each product.right)
(set.of_list n.hash)
set.size)))
diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/artifact.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/artifact.lux
index af69bbdc9..7a2d25b1a 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/archive/artifact.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/archive/artifact.lux
@@ -25,23 +25,26 @@
Nat)
(type: .public Category
- #Anonymous
- (#Definition Text)
- (#Analyser Text)
- (#Synthesizer Text)
- (#Generator Text)
- (#Directive Text)
- (#Custom Text))
+ (Variant
+ #Anonymous
+ (#Definition Text)
+ (#Analyser Text)
+ (#Synthesizer Text)
+ (#Generator Text)
+ (#Directive Text)
+ (#Custom Text)))
(type: .public Artifact
- {#id ID
- #category Category})
+ (Record
+ {#id ID
+ #category Category}))
(abstract: .public Registry
{}
- {#artifacts (Row Artifact)
- #resolver (Dictionary Text ID)}
+ (Record
+ {#artifacts (Row Artifact)
+ #resolver (Dictionary Text ID)})
(def: .public empty
Registry
@@ -120,7 +123,7 @@
(binary.row/64 category))]
(|>> :representation
(value@ #artifacts)
- (row\map (value@ #category))
+ (row\each (value@ #category))
artifacts)))
(exception: .public (invalid_category {tag Nat})
@@ -134,7 +137,7 @@
[tag <binary>.nat]
(case tag
(^template [<nat> <tag> <parser>]
- [<nat> (\ ! map (|>> <tag>) <parser>)])
+ [<nat> (\ ! each (|>> <tag>) <parser>)])
([0 #Anonymous <binary>.any]
[1 #Definition <binary>.text]
[2 #Analyser <binary>.text]
@@ -145,21 +148,21 @@
_ (<>.failure (exception.error ..invalid_category [tag])))))]
(|> (<binary>.row/64 category)
- (\ <>.monad map (row\mix (function (_ artifact registry)
- (product.right
- (case artifact
- #Anonymous
- (..resource registry)
-
- (^template [<tag> <create>]
- [(<tag> name)
- (<create> name registry)])
- ([#Definition ..definition]
- [#Analyser ..analyser]
- [#Synthesizer ..synthesizer]
- [#Generator ..generator]
- [#Directive ..directive]
- [#Custom ..custom])
- )))
- ..empty)))))
+ (\ <>.monad each (row\mix (function (_ artifact registry)
+ (product.right
+ (case artifact
+ #Anonymous
+ (..resource registry)
+
+ (^template [<tag> <create>]
+ [(<tag> name)
+ (<create> name registry)])
+ ([#Definition ..definition]
+ [#Analyser ..analyser]
+ [#Synthesizer ..synthesizer]
+ [#Generator ..generator]
+ [#Directive ..directive]
+ [#Custom ..custom])
+ )))
+ ..empty)))))
)
diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/descriptor.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/descriptor.lux
index 59f1981bc..5a30c2c50 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/archive/descriptor.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/archive/descriptor.lux
@@ -19,12 +19,13 @@
Text)
(type: .public Descriptor
- {#name Module
- #file Path
- #hash Nat
- #state Module_State
- #references (Set Module)
- #registry Registry})
+ (Record
+ {#name Module
+ #file Path
+ #hash Nat
+ #state Module_State
+ #references (Set Module)
+ #registry Registry}))
(def: .public writer
(Writer Descriptor)
diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/document.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/document.lux
index a14d708d5..8858eefa3 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/archive/document.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/archive/document.lux
@@ -28,8 +28,9 @@
(abstract: .public (Document d)
{}
- {#signature Signature
- #content d}
+ (Record
+ {#signature Signature
+ #content d})
(def: .public (read key document)
(All [d] (-> (Key d) (Document Any) (Try d)))
@@ -70,5 +71,5 @@
(def: .public parser
(All [d] (-> (Parser d) (Parser (Document d))))
(|>> (<>.and signature.parser)
- (\ <>.monad map (|>> :abstraction))))
+ (\ <>.monad each (|>> :abstraction))))
)
diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/signature.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/signature.lux
index 8b4dfedb8..ebe18755a 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/archive/signature.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/archive/signature.lux
@@ -20,8 +20,9 @@
[version (#+ Version)]])
(type: .public Signature
- {#name Name
- #version Version})
+ (Record
+ {#name Name
+ #version Version}))
(def: .public equivalence
(Equivalence Signature)
diff --git a/stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux b/stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux
index e2a3ef238..9796bdcfb 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/cache/dependency.lux
@@ -41,8 +41,9 @@
dictionary.keys)
(type: Dependency
- {#module Module
- #imports Ancestry})
+ (Record
+ {#module Module
+ #imports Ancestry}))
(def: .public graph
(-> (List Dependency) Graph)
@@ -61,7 +62,7 @@
(#try.Failure error)
..fresh)]
- ancestors (monad.map ! recur (set.list parents))]
+ ancestors (monad.each ! recur (set.list parents))]
(in (list\mix set.union parents ancestors)))))
ancestry (memo.open memo)]
(list\mix (function (_ module memory)
@@ -88,10 +89,10 @@
(|> ancestry
dictionary.keys
(list.sorted (..dependency? ancestry))
- (monad.map try.monad
- (function (_ module)
- (do try.monad
- [module_id (archive.id module archive)
- [descriptor document output] (archive.find module archive)
- document (document.check key document)]
- (in [module [module_id [descriptor document output]]])))))))
+ (monad.each try.monad
+ (function (_ module)
+ (do try.monad
+ [module_id (archive.id module archive)
+ [descriptor document output] (archive.find module archive)
+ document (document.check key document)]
+ (in [module [module_id [descriptor document output]]])))))))
diff --git a/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux b/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux
index 45f489e8b..efb13c9e8 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/io/archive.lux
@@ -110,13 +110,13 @@
_ (ensure_directory fs (..versioned_lux_archive fs static))]
(|> module
(\ fs make_directory)
- (\ ! map (|>> (case> (#try.Success output)
- (#try.Success [])
+ (\ ! each (|>> (case> (#try.Success output)
+ (#try.Success [])
- (#try.Failure error)
- (exception.except ..cannot_prepare [(..archive fs static)
- module_id
- error])))))))))
+ (#try.Failure error)
+ (exception.except ..cannot_prepare [(..archive fs static)
+ module_id
+ error])))))))))
(def: .public (write fs static module_id artifact_id content)
(-> (file.System Async) Static archive.ID artifact.ID Binary (Async (Try Any)))
@@ -168,12 +168,12 @@
(-> Target Archive (Try .Lux))
(do {! try.monad}
[modules (: (Try (List [Module .Module]))
- (monad.map ! (function (_ module)
- (do !
- [[descriptor document output] (archive.find module archive)
- content (document.read $.key document)]
- (in [module content])))
- (archive.archived archive)))]
+ (monad.each ! (function (_ module)
+ (do !
+ [[descriptor document output] (archive.find module archive)
+ content (document.read $.key document)]
+ (in [module content])))
+ (archive.archived archive)))]
(in (with@ #.modules modules (fresh_analysis_state host)))))
(def: (cached_artifacts fs static module_id)
@@ -181,15 +181,15 @@
(let [! (try.with async.monad)]
(|> (..module fs static module_id)
(\ fs directory_files)
- (\ ! map (|>> (list\map (function (_ file)
- [(file.name fs file) file]))
- (list.only (|>> product.left (text\= ..module_descriptor_file) not))
- (monad.map ! (function (_ [name path])
- (|> path
- (\ fs read)
- (\ ! map (|>> [name])))))
- (\ ! map (dictionary.of_list text.hash))))
- (\ ! join))))
+ (\ ! each (|>> (list\each (function (_ file)
+ [(file.name fs file) file]))
+ (list.only (|>> product.left (text\= ..module_descriptor_file) not))
+ (monad.each ! (function (_ [name path])
+ (|> path
+ (\ fs read)
+ (\ ! each (|>> [name])))))
+ (\ ! each (dictionary.of_list text.hash))))
+ (\ ! conjoint))))
(type: Definitions (Dictionary Text Any))
(type: Analysers (Dictionary Text analysis.Handler))
@@ -321,19 +321,19 @@
#.End
(#try.Success [definitions bundles output])))))
content (document.read $.key document)
- definitions (monad.map ! (function (_ [def_name def_global])
- (case def_global
- (#.Alias alias)
- (in [def_name (#.Alias alias)])
-
- (#.Definition [exported? type annotations _])
- (|> definitions
- (dictionary.value def_name)
- try.of_maybe
- (\ ! map (|>> [exported? type annotations]
- #.Definition
- [def_name])))))
- (value@ #.definitions content))]
+ definitions (monad.each ! (function (_ [def_name def_global])
+ (case def_global
+ (#.Alias alias)
+ (in [def_name (#.Alias alias)])
+
+ (#.Definition [exported? type annotations _])
+ (|> definitions
+ (dictionary.value def_name)
+ try.of_maybe
+ (\ ! each (|>> [exported? type annotations]
+ #.Definition
+ [def_name])))))
+ (value@ #.definitions content))]
(in [(document.write $.key (with@ #.definitions definitions content))
bundles])))
@@ -355,8 +355,8 @@
[.let [cache (..module fs static module_id)]
_ (|> cache
(\ fs directory_files)
- (\ ! map (monad.map ! (\ fs delete)))
- (\ ! join))]
+ (\ ! each (monad.each ! (\ fs delete)))
+ (\ ! conjoint))]
(\ fs delete cache)))
(def: (valid_cache? expected actual)
@@ -409,37 +409,37 @@
(do {! (try.with async.monad)}
[pre_loaded_caches (|> archive
archive.reservations
- (monad.map ! (function (_ [module_name module_id])
- (do !
- [data (..read_module_descriptor fs static module_id)
- [descriptor document] (async\in (<binary>.result ..parser data))]
- (if (text\= archive.runtime_module module_name)
- (in [true
- [module_name [module_id [descriptor document]]]])
- (do !
- [input (//context.read fs ..pseudo_module import contexts (value@ #static.host_module_extension static) module_name)]
- (in [(..valid_cache? descriptor input)
- [module_name [module_id [descriptor document]]]])))))))
+ (monad.each ! (function (_ [module_name module_id])
+ (do !
+ [data (..read_module_descriptor fs static module_id)
+ [descriptor document] (async\in (<binary>.result ..parser data))]
+ (if (text\= archive.runtime_module module_name)
+ (in [true
+ [module_name [module_id [descriptor document]]]])
+ (do !
+ [input (//context.read fs ..pseudo_module import contexts (value@ #static.host_module_extension static) module_name)]
+ (in [(..valid_cache? descriptor input)
+ [module_name [module_id [descriptor document]]]])))))))
load_order (|> pre_loaded_caches
- (list\map product.right)
+ (list\each product.right)
(monad.mix try.monad
(function (_ [module [module_id [descriptor document]]] archive)
(archive.has module [descriptor document (: Output row.empty)] archive))
archive)
- (\ try.monad map (dependency.load_order $.key))
- (\ try.monad join)
+ (\ try.monad each (dependency.load_order $.key))
+ (\ try.monad conjoint)
async\in)
.let [purge (..full_purge pre_loaded_caches load_order)]
_ (|> purge
dictionary.entries
- (monad.map ! (..purge! fs static)))
+ (monad.each ! (..purge! fs static)))
loaded_caches (|> load_order
(list.only (|>> product.left (dictionary.key? purge) not))
- (monad.map ! (function (_ [module_name [module_id [descriptor document _]]])
- (do !
- [[descriptor,document,output bundles] (..load_definitions fs static module_id host_environment descriptor document)]
- (in [[module_name descriptor,document,output]
- bundles])))))]
+ (monad.each ! (function (_ [module_name [module_id [descriptor document _]]])
+ (do !
+ [[descriptor,document,output bundles] (..load_definitions fs static module_id host_environment descriptor document)]
+ (in [[module_name descriptor,document,output]
+ bundles])))))]
(async\in
(do {! try.monad}
[archive (monad.mix !
diff --git a/stdlib/source/library/lux/tool/compiler/meta/io/context.lux b/stdlib/source/library/lux/tool/compiler/meta/io/context.lux
index 74d5aab33..fe83f0fb3 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/io/context.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/io/context.lux
@@ -83,14 +83,14 @@
(#try.Success path)
(|> path
(\ fs read)
- (\ (try.with !) map (|>> [path])))
+ (\ (try.with !) each (|>> [path])))
(#try.Failure _)
(do {! (try.with !)}
[path (..find_source_file fs importer contexts module ..lux_extension)]
(|> path
(\ fs read)
- (\ ! map (|>> [path])))))))
+ (\ ! each (|>> [path])))))))
(def: (find_library_source_file importer import partial_host_extension module)
(-> Module Import Extension Module (Try [file.Path Binary]))
@@ -145,18 +145,18 @@
(do {! (try.with async.monad)}
[enumeration (|> directory
(\ fs directory_files)
- (\ ! map (monad.mix ! (function (_ file enumeration)
- (if (text.ends_with? ..lux_extension file)
- (do !
- [source_code (\ fs read file)]
- (async\in (dictionary.has' (text.replaced context "" file) source_code enumeration)))
- (in enumeration)))
- enumeration))
- (\ ! join))]
+ (\ ! each (monad.mix ! (function (_ file enumeration)
+ (if (text.ends_with? ..lux_extension file)
+ (do !
+ [source_code (\ fs read file)]
+ (async\in (dictionary.has' (text.replaced context "" file) source_code enumeration)))
+ (in enumeration)))
+ enumeration))
+ (\ ! conjoint))]
(|> directory
(\ fs sub_directories)
- (\ ! map (monad.mix ! (context_listing fs context) enumeration))
- (\ ! join))))
+ (\ ! each (monad.mix ! (context_listing fs context) enumeration))
+ (\ ! conjoint))))
(def: Action
(type (All [a] (Async (Try a)))))
diff --git a/stdlib/source/library/lux/tool/compiler/meta/packager.lux b/stdlib/source/library/lux/tool/compiler/meta/packager.lux
index 744d0ecb9..f846a28a8 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/packager.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/packager.lux
@@ -33,10 +33,10 @@
(def: .public order
(-> dependency.Order Order)
- (list\map (function (_ [module [module_id [descriptor document]]])
- (|> descriptor
- (value@ #descriptor.registry)
- artifact.artifacts
- row.list
- (list\map (|>> (value@ #artifact.id)))
- [module_id]))))
+ (list\each (function (_ [module [module_id [descriptor document]]])
+ (|> descriptor
+ (value@ #descriptor.registry)
+ artifact.artifacts
+ row.list
+ (list\each (|>> (value@ #artifact.id)))
+ [module_id]))))
diff --git a/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux b/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux
index ffee37de6..832c6f8f6 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/packager/jvm.lux
@@ -141,7 +141,7 @@
(-> Static archive.ID artifact.ID (Maybe Text) Binary java/util/jar/JarOutputStream
(Try java/util/jar/JarOutputStream))
(let [class_path (|> custom
- (maybe\map (|>> name.internal name.read))
+ (maybe\each (|>> name.internal name.read))
(maybe.else (runtime.class_name [module artifact]))
(text.suffix (value@ #static.artifact_extension static)))]
(do try.monad
@@ -249,8 +249,8 @@
[order (dependency.load_order $.key archive)
.let [buffer (java/io/ByteArrayOutputStream::new (.int ..mebi_byte))]
sink (|> order
- (list\map (function (_ [module [module_id [descriptor document output]]])
- [module_id output]))
+ (list\each (function (_ [module [module_id [descriptor document output]]])
+ [module_id output]))
(monad.mix ! (..write_module static)
(java/util/jar/JarOutputStream::new buffer (..manifest program))))
[entries duplicates sink] (|> host_dependencies
diff --git a/stdlib/source/library/lux/tool/compiler/meta/packager/scheme.lux b/stdlib/source/library/lux/tool/compiler/meta/packager/scheme.lux
index f888e6975..c1fdd9d5d 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/packager/scheme.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/packager/scheme.lux
@@ -57,12 +57,12 @@
(def: bundle_module
(-> Output (Try _.Expression))
(|>> row.list
- (list\map product.right)
+ (list\each product.right)
(monad.mix try.monad
(function (_ content so_far)
(|> content
(\ encoding.utf8 decoded)
- (\ try.monad map
+ (\ try.monad each
(|>> :expected
(:sharing [directive]
directive
@@ -107,7 +107,7 @@
(value@ #descriptor.references)
set.list
(list.all (function (_ module) (dictionary.value module mapping)))
- (list\map (|>> ..module_file _.string _.load_relative/1))
+ (list\each (|>> ..module_file _.string _.load_relative/1))
(list\mix ..then bundle)
(: _.Expression)
_.code
@@ -122,11 +122,11 @@
(do {! try.monad}
[order (dependency.load_order $.key archive)
.let [mapping (|> order
- (list\map (function (_ [module [module_id [descriptor document output]]])
- [module module_id]))
+ (list\each (function (_ [module [module_id [descriptor document output]]])
+ [module module_id]))
(dictionary.of_list text.hash)
(: (Dictionary Module archive.ID)))]
- entries (monad.map ! (..write_module now mapping) order)]
+ entries (monad.each ! (..write_module now mapping) order)]
(in (|> entries
row.of_list
(binary.result tar.writer))))))
diff --git a/stdlib/source/library/lux/tool/compiler/meta/packager/script.lux b/stdlib/source/library/lux/tool/compiler/meta/packager/script.lux
index 9b49232e3..0beeffa1c 100644
--- a/stdlib/source/library/lux/tool/compiler/meta/packager/script.lux
+++ b/stdlib/source/library/lux/tool/compiler/meta/packager/script.lux
@@ -39,12 +39,12 @@
(Try directive)))
(|> output
row.list
- (list\map (|>> product.right product.right))
+ (list\each (|>> product.right product.right))
(monad.mix try.monad
(function (_ content so_far)
(|> content
(\ utf8.codec decoded)
- (\ try.monad map
+ (\ try.monad each
(|>> :expected
(:sharing [directive]
directive
@@ -65,7 +65,7 @@
(do {! try.monad}
[order (dependency.load_order $.key archive)]
(|> order
- (list\map (function (_ [module [module_id [descriptor document output]]])
- [module_id output]))
+ (list\each (function (_ [module [module_id [descriptor document output]]])
+ [module_id output]))
(monad.mix ! (..write_module sequence) header)
- (\ ! map (|>> scope code (\ utf8.codec encoded)))))))
+ (\ ! each (|>> scope code (\ utf8.codec encoded)))))))
diff --git a/stdlib/source/library/lux/tool/compiler/phase.lux b/stdlib/source/library/lux/tool/compiler/phase.lux
index 7e137387e..22362318a 100644
--- a/stdlib/source/library/lux/tool/compiler/phase.lux
+++ b/stdlib/source/library/lux/tool/compiler/phase.lux
@@ -47,7 +47,7 @@
(-> s (Operation s o) (Try o)))
(|> state
operation
- (\ try.monad map product.right)))
+ (\ try.monad each product.right)))
(def: .public get_state
(All [s o]
@@ -82,7 +82,7 @@
(def: .public (lifted error)
(All [s a] (-> (Try a) (Operation s a)))
(function (_ state)
- (try\map (|>> [state]) error)))
+ (try\each (|>> [state]) error)))
(syntax: .public (assertion [exception <code>.any
message <code>.any
diff --git a/stdlib/source/library/lux/tool/compiler/reference.lux b/stdlib/source/library/lux/tool/compiler/reference.lux
index e8714bb2a..c90aa41f6 100644
--- a/stdlib/source/library/lux/tool/compiler/reference.lux
+++ b/stdlib/source/library/lux/tool/compiler/reference.lux
@@ -20,8 +20,9 @@
Name)
(type: .public Reference
- (#Variable Variable)
- (#Constant Constant))
+ (Variant
+ (#Variable Variable)
+ (#Constant Constant)))
(implementation: .public equivalence
(Equivalence Reference)
diff --git a/stdlib/source/library/lux/tool/compiler/reference/variable.lux b/stdlib/source/library/lux/tool/compiler/reference/variable.lux
index c45c5239b..0c0eaad22 100644
--- a/stdlib/source/library/lux/tool/compiler/reference/variable.lux
+++ b/stdlib/source/library/lux/tool/compiler/reference/variable.lux
@@ -18,8 +18,9 @@
Nat)
(type: .public Variable
- (#Local Register)
- (#Foreign Register))
+ (Variant
+ (#Local Register)
+ (#Foreign Register)))
(implementation: .public equivalence
(Equivalence Variable)