diff options
Diffstat (limited to 'stdlib/source/lux/language/compiler/extension')
4 files changed, 46 insertions, 45 deletions
diff --git a/stdlib/source/lux/language/compiler/extension/analysis.lux b/stdlib/source/lux/language/compiler/extension/analysis.lux index 0f57de1ff..4d78ceb43 100644 --- a/stdlib/source/lux/language/compiler/extension/analysis.lux +++ b/stdlib/source/lux/language/compiler/extension/analysis.lux @@ -2,12 +2,12 @@ [lux #* [data [collection - [dictionary]]]] + ["." dictionary]]]] [/// [analysis (#+ Bundle)]] [/ - [common] - [host]]) + ["." common] + ["." host]]) (def: #export bundle Bundle diff --git a/stdlib/source/lux/language/compiler/extension/analysis/common.lux b/stdlib/source/lux/language/compiler/extension/analysis/common.lux index 9616f2533..0dc405438 100644 --- a/stdlib/source/lux/language/compiler/extension/analysis/common.lux +++ b/stdlib/source/lux/language/compiler/extension/analysis/common.lux @@ -1,31 +1,32 @@ (.module: [lux #* [control - [monad (#+ do)] + ["." monad (#+ do)] ["ex" exception (#+ exception:)] [thread (#+ Box)]] - [concurrency [atom (#+ Atom)]] + [concurrency + [atom (#+ Atom)]] [data ["." text format] [collection - [list ("list/" Functor<List>)] - [array] + ["." list ("list/" Functor<List>)] + ["." array] ["dict" dictionary (#+ Dictionary)]]] ["." language [type ["tc" check]]] [io (#+ IO)]] ["." //// - [analysis (#+ Analysis Bundle) + ["." analysis (#+ Analysis Handler Bundle) [".A" type] [".A" case] [".A" function]]] ["." /// - [bundle]]) + ["." bundle]]) ## [Utils] (def: (simple inputsT+ outputT) - (-> (List Type) Type analysis.Handler) + (-> (List Type) Type Handler) (let [num-expected (list.size inputsT+)] (function (_ extension-name analyse args) (let [num-actual (list.size args)] @@ -41,25 +42,25 @@ (////.throw bundle.incorrect-arity [extension-name num-expected num-actual])))))) (def: #export (nullary valueT) - (-> Type analysis.Handler) + (-> Type Handler) (simple (list) valueT)) (def: #export (unary inputT outputT) - (-> Type Type analysis.Handler) + (-> Type Type Handler) (simple (list inputT) outputT)) (def: #export (binary subjectT paramT outputT) - (-> Type Type Type analysis.Handler) + (-> Type Type Type Handler) (simple (list subjectT paramT) outputT)) (def: #export (trinary subjectT param0T param1T outputT) - (-> Type Type Type Type analysis.Handler) + (-> Type Type Type Type Handler) (simple (list subjectT param0T param1T) outputT)) ## [Analysers] ## "lux is" represents reference/pointer equality. (def: lux::is - analysis.Handler + Handler (function (_ extension-name analyse args) (do ////.Monad<Operation> [[var-id varT] (typeA.with-env tc.var)] @@ -69,7 +70,7 @@ ## "lux try" provides a simple way to interact with the host platform's ## error-handling facilities. (def: lux::try - analysis.Handler + Handler (function (_ extension-name analyse args) (case args (^ (list opC)) @@ -84,7 +85,7 @@ (////.throw bundle.incorrect-arity [extension-name +1 (list.size args)])))) (def: lux::in-module - analysis.Handler + Handler (function (_ extension-name analyse argsC+) (case argsC+ (^ (list [_ (#.Text module-name)] exprC)) @@ -96,7 +97,7 @@ ## (do-template [<name> <type>] ## [(def: <name> -## analysis.Handler +## Handler ## (function (_ extension-name analyse args) ## (case args ## (^ (list typeC valueC)) @@ -114,7 +115,7 @@ ## ) (def: lux::check::type - analysis.Handler + Handler (function (_ extension-name analyse args) (case args (^ (list valueC)) @@ -205,7 +206,7 @@ ))) (def: array::get - analysis.Handler + Handler (function (_ extension-name analyse args) (do ////.Monad<Operation> [[var-id varT] (typeA.with-env tc.var)] @@ -213,7 +214,7 @@ analyse args)))) (def: array::put - analysis.Handler + Handler (function (_ extension-name analyse args) (do ////.Monad<Operation> [[var-id varT] (typeA.with-env tc.var)] @@ -221,7 +222,7 @@ analyse args)))) (def: array::remove - analysis.Handler + Handler (function (_ extension-name analyse args) (do ////.Monad<Operation> [[var-id varT] (typeA.with-env tc.var)] @@ -262,7 +263,7 @@ ))) (def: atom::new - analysis.Handler + Handler (function (_ extension-name analyse args) (case args (^ (list initC)) @@ -277,7 +278,7 @@ (////.throw bundle.incorrect-arity [extension-name +1 (list.size args)])))) (def: atom::read - analysis.Handler + Handler (function (_ extension-name analyse args) (do ////.Monad<Operation> [[var-id varT] (typeA.with-env tc.var)] @@ -285,7 +286,7 @@ analyse args)))) (def: atom::compare-and-swap - analysis.Handler + Handler (function (_ extension-name analyse args) (do ////.Monad<Operation> [[var-id varT] (typeA.with-env tc.var)] @@ -302,7 +303,7 @@ ))) (def: box::new - analysis.Handler + Handler (function (_ extension-name analyse args) (case args (^ (list initC)) @@ -317,7 +318,7 @@ (////.throw bundle.incorrect-arity [extension-name +1 (list.size args)])))) (def: box::read - analysis.Handler + Handler (function (_ extension-name analyse args) (do ////.Monad<Operation> [[thread-id threadT] (typeA.with-env tc.var) @@ -326,7 +327,7 @@ analyse args)))) (def: box::write - analysis.Handler + Handler (function (_ extension-name analyse args) (do ////.Monad<Operation> [[thread-id threadT] (typeA.with-env tc.var) diff --git a/stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux b/stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux index da4d4461b..ef5e9317f 100644 --- a/stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux +++ b/stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux @@ -1,32 +1,32 @@ (.module: [lux (#- char int) [control - [monad (#+ do)] + ["." monad (#+ do)] ["p" parser] ["ex" exception (#+ exception:)] pipe] [data ["e" error] - [maybe] - [product] - [text ("text/" Equivalence<Text>) + ["." maybe] + ["." product] + ["." text ("text/" Equivalence<Text>) format] [collection - [list ("list/" Fold<List> Functor<List> Monoid<List>)] - [array] - [dictionary (#+ Dictionary)]]] + ["." list ("list/" Fold<List> Functor<List> Monoid<List>)] + ["." array] + ["." dictionary (#+ Dictionary)]]] ["." macro ["s" syntax]] [language ["." type - [check]]] - [host]] + ["." check]]] + ["." host]] [// - [common] + ["." common] ["/." // - [bundle] + ["." bundle] ["//." // ("operation/" Monad<Operation>) - [analysis (#+ Analysis Operation Handler Bundle) + ["." analysis (#+ Analysis Operation Handler Bundle) [".A" type] [".A" inference]]]]] ) diff --git a/stdlib/source/lux/language/compiler/extension/bundle.lux b/stdlib/source/lux/language/compiler/extension/bundle.lux index 222ad7f5e..dce95cfb1 100644 --- a/stdlib/source/lux/language/compiler/extension/bundle.lux +++ b/stdlib/source/lux/language/compiler/extension/bundle.lux @@ -9,7 +9,7 @@ [collection [list ("list/" Functor<List>)] ["dict" dictionary (#+ Dictionary)]]]] - [//]) + [// (#+ Handler Bundle)]) (exception: #export (incorrect-arity {name Text} {arity Nat} {args Nat}) (ex.report ["Extension" (%t name)] @@ -21,18 +21,18 @@ ## [Utils] (def: #export empty - //.Bundle + Bundle (dict.new text.Hash<Text>)) (def: #export (install name anonymous) (All [s i o] - (-> Text (//.Handler s i o) - (-> (//.Bundle s i o) (//.Bundle s i o)))) + (-> Text (Handler s i o) + (-> (Bundle s i o) (Bundle s i o)))) (dict.put name anonymous)) (def: #export (prefix prefix) (All [s i o] - (-> Text (-> (//.Bundle s i o) (//.Bundle s i o)))) + (-> Text (-> (Bundle s i o) (Bundle s i o)))) (|>> dict.entries (list/map (function (_ [key val]) [(format prefix " " key) val])) (dict.from-list text.Hash<Text>))) |