diff options
Diffstat (limited to 'stdlib/source/lux/tool/compiler/phase/synthesis/expression.lux')
-rw-r--r-- | stdlib/source/lux/tool/compiler/phase/synthesis/expression.lux | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/stdlib/source/lux/tool/compiler/phase/synthesis/expression.lux b/stdlib/source/lux/tool/compiler/phase/synthesis/expression.lux deleted file mode 100644 index 29fe623ba..000000000 --- a/stdlib/source/lux/tool/compiler/phase/synthesis/expression.lux +++ /dev/null @@ -1,89 +0,0 @@ -(.module: - [lux (#- primitive) - [control - ["." monad (#+ do)] - [pipe (#+ case>)]] - [data - ["." maybe] - ["." error] - [collection - ["." list ("#/." functor)] - ["." dictionary (#+ Dictionary)]]]] - ["." // (#+ Synthesis Phase) - ["." function] - ["." case] - ["/." // ("#/." monad) - ["." extension] - [// - ["." reference] - ["." analysis (#+ Analysis)]]]]) - -(def: (primitive analysis) - (-> analysis.Primitive //.Primitive) - (case analysis - #analysis.Unit - (#//.Text //.unit) - - (^template [<analysis> <synthesis>] - (<analysis> value) - (<synthesis> value)) - ([#analysis.Bit #//.Bit] - [#analysis.Frac #//.F64] - [#analysis.Text #//.Text]) - - (^template [<analysis> <synthesis>] - (<analysis> value) - (<synthesis> (.i64 value))) - ([#analysis.Nat #//.I64] - [#analysis.Int #//.I64] - [#analysis.Rev #//.I64]))) - -(def: #export (phase analysis) - Phase - (case analysis - (#analysis.Primitive analysis') - (////wrap (#//.Primitive (..primitive analysis'))) - - (#analysis.Structure structure) - (case structure - (#analysis.Variant variant) - (do ///.monad - [valueS (phase (get@ #analysis.value variant))] - (wrap (//.variant (set@ #analysis.value valueS variant)))) - - (#analysis.Tuple tuple) - (|> tuple - (monad.map ///.monad phase) - (////map (|>> //.tuple)))) - - (#analysis.Reference reference) - (////wrap (#//.Reference reference)) - - (#analysis.Case inputA branchesAB+) - (case.synthesize phase inputA branchesAB+) - - (^ (analysis.no-op value)) - (phase value) - - (#analysis.Apply _) - (function.apply phase analysis) - - (#analysis.Function environmentA bodyA) - (function.abstraction phase environmentA bodyA) - - (#analysis.Extension name args) - (function (_ state) - (|> (extension.apply phase [name args]) - (///.run' state) - (case> (#error.Success output) - (#error.Success output) - - (#error.Failure error) - (<| (///.run' state) - (do ///.monad - [argsS+ (monad.map @ phase args)] - (wrap (#//.Extension [name argsS+]))))))) - - _ - (////wrap (undefined)) - )) |