diff options
Diffstat (limited to 'stdlib/source/library/lux/control')
22 files changed, 112 insertions, 112 deletions
diff --git a/stdlib/source/library/lux/control/concurrency/async.lux b/stdlib/source/library/lux/control/concurrency/async.lux index e8edda452..82184402f 100644 --- a/stdlib/source/library/lux/control/concurrency/async.lux +++ b/stdlib/source/library/lux/control/concurrency/async.lux @@ -115,7 +115,7 @@ (implementation: .public apply (Apply Async) - (def: &functor ..functor) + (def: functor ..functor) (def: (on fa ff) (let [[fb resolve] (sharing [a b] @@ -133,7 +133,7 @@ (implementation: .public monad (Monad Async) - (def: &functor ..functor) + (def: functor ..functor) (def: in ..resolved) diff --git a/stdlib/source/library/lux/control/concurrency/frp.lux b/stdlib/source/library/lux/control/concurrency/frp.lux index 92aab2a89..ee7054786 100644 --- a/stdlib/source/library/lux/control/concurrency/frp.lux +++ b/stdlib/source/library/lux/control/concurrency/frp.lux @@ -103,7 +103,7 @@ (implementation: .public apply (Apply Channel) - (def: &functor ..functor) + (def: functor ..functor) (def: (on fa ff) (do async.monad @@ -124,7 +124,7 @@ (implementation: .public monad (Monad Channel) - (def: &functor ..functor) + (def: functor ..functor) (def: (in a) (async.resolved {.#Some [(variance.write a) ..empty]})) diff --git a/stdlib/source/library/lux/control/concurrency/stm.lux b/stdlib/source/library/lux/control/concurrency/stm.lux index 918283f70..0e4c75e6e 100644 --- a/stdlib/source/library/lux/control/concurrency/stm.lux +++ b/stdlib/source/library/lux/control/concurrency/stm.lux @@ -169,7 +169,7 @@ (implementation: .public apply (Apply STM) - (def: &functor ..functor) + (def: functor ..functor) (def: (on fa ff) (function (_ tx) @@ -180,7 +180,7 @@ (implementation: .public monad (Monad STM) - (def: &functor ..functor) + (def: functor ..functor) (def: (in a) (function (_ tx) diff --git a/stdlib/source/library/lux/control/continuation.lux b/stdlib/source/library/lux/control/continuation.lux index ba6b618de..2f67178bf 100644 --- a/stdlib/source/library/lux/control/continuation.lux +++ b/stdlib/source/library/lux/control/continuation.lux @@ -1,17 +1,17 @@ (.using - [library - [lux "*" - [abstract - [functor {"+" Functor}] - [apply {"+" Apply}] - [monad {"+" Monad do}]] - [control - ["[0]" function] - [parser - ["<[0]>" code]]] - [macro {"+" with_symbols} - [syntax {"+" syntax:}] - ["[0]" code]]]]) + [library + [lux "*" + [abstract + [functor {"+" Functor}] + [apply {"+" Apply}] + [monad {"+" Monad do}]] + [control + ["[0]" function] + [parser + ["<[0]>" code]]] + [macro {"+" with_symbols} + [syntax {"+" syntax:}] + ["[0]" code]]]]) (type: .public (Cont i o) (-> (-> i o) o)) @@ -61,7 +61,7 @@ (implementation: .public apply (All (_ o) (Apply (All (_ i) (Cont i o)))) - (def: &functor ..functor) + (def: functor ..functor) (def: (on fv ff) (function (_ k) @@ -72,7 +72,7 @@ (implementation: .public monad (All (_ o) (Monad (All (_ i) (Cont i o)))) - (def: &functor ..functor) + (def: functor ..functor) (def: (in value) (function (_ k) (k value))) diff --git a/stdlib/source/library/lux/control/function/mutual.lux b/stdlib/source/library/lux/control/function/mutual.lux index 69f1bdf40..1c75c9f07 100644 --- a/stdlib/source/library/lux/control/function/mutual.lux +++ b/stdlib/source/library/lux/control/function/mutual.lux @@ -136,22 +136,22 @@ (..macro g!context g!name)]) (list.zipped_2 hidden_names functions)))] - (in (list& (` (.def: (~ g!context) - [(~+ (list#each (the [#mutual #type]) functions))] - (.let [(~ g!context) (is (Rec (~ g!context) - [(~+ context_types)]) - [(~+ definitions)]) - [(~+ user_names)] (~ g!context)] - [(~+ (list#each (function (_ g!name) - (` ((~ g!name) (~ g!context)))) - user_names))]))) - g!pop - (list#each (function (_ mutual) - (.let [g!name (|> mutual (the [#mutual #declaration declaration.#name]) code.local)] - (` (.def: - (~ (the #export_policy mutual)) - (~ g!name) - (~ (the [#mutual #type] mutual)) - (.let [[(~+ user_names)] (~ g!context)] - (~ g!name)))))) - functions))))))) + (in (partial_list (` (.def: (~ g!context) + [(~+ (list#each (the [#mutual #type]) functions))] + (.let [(~ g!context) (is (Rec (~ g!context) + [(~+ context_types)]) + [(~+ definitions)]) + [(~+ user_names)] (~ g!context)] + [(~+ (list#each (function (_ g!name) + (` ((~ g!name) (~ g!context)))) + user_names))]))) + g!pop + (list#each (function (_ mutual) + (.let [g!name (|> mutual (the [#mutual #declaration declaration.#name]) code.local)] + (` (.def: + (~ (the #export_policy mutual)) + (~ g!name) + (~ (the [#mutual #type] mutual)) + (.let [[(~+ user_names)] (~ g!context)] + (~ g!name)))))) + functions))))))) diff --git a/stdlib/source/library/lux/control/io.lux b/stdlib/source/library/lux/control/io.lux index 3edf5e3ee..9ea2818d3 100644 --- a/stdlib/source/library/lux/control/io.lux +++ b/stdlib/source/library/lux/control/io.lux @@ -49,7 +49,7 @@ (implementation: .public apply (Apply IO) - (def: &functor ..functor) + (def: functor ..functor) (def: (on fa ff) (!io ((..run!' ff) (..run!' fa))))) @@ -57,7 +57,7 @@ (implementation: .public monad (Monad IO) - (def: &functor ..functor) + (def: functor ..functor) (def: in (|>> !io)) diff --git a/stdlib/source/library/lux/control/lazy.lux b/stdlib/source/library/lux/control/lazy.lux index 27131e570..4d13538c0 100644 --- a/stdlib/source/library/lux/control/lazy.lux +++ b/stdlib/source/library/lux/control/lazy.lux @@ -63,13 +63,13 @@ (implementation: .public apply (Apply Lazy) - (def: &functor ..functor) + (def: functor ..functor) (def: (on fa ff) (lazy ((value ff) (value fa))))) (implementation: .public monad (Monad Lazy) - (def: &functor ..functor) + (def: functor ..functor) (def: in (|>> lazy)) (def: conjoint ..value)) diff --git a/stdlib/source/library/lux/control/maybe.lux b/stdlib/source/library/lux/control/maybe.lux index d9c15e307..ecf814d21 100644 --- a/stdlib/source/library/lux/control/maybe.lux +++ b/stdlib/source/library/lux/control/maybe.lux @@ -44,7 +44,7 @@ (implementation: .public apply (Apply Maybe) - (def: &functor ..functor) + (def: functor ..functor) (def: (on fa ff) (case [ff fa] @@ -57,7 +57,7 @@ (implementation: .public monad (Monad Maybe) - (def: &functor ..functor) + (def: functor ..functor) (def: (in x) {.#Some x}) @@ -88,8 +88,8 @@ (implementation: .public (hash super) (All (_ a) (-> (Hash a) (Hash (Maybe a)))) - (def: &equivalence - (..equivalence (# super &equivalence))) + (def: equivalence + (..equivalence (# super equivalence))) (def: (hash value) (case value @@ -102,8 +102,8 @@ (implementation: .public (with monad) (All (_ M) (-> (Monad M) (Monad (All (_ a) (M (Maybe a)))))) - (def: &functor - (functor.composite (the monad.&functor monad) + (def: functor + (functor.composite (the monad.functor monad) ..functor)) (def: in diff --git a/stdlib/source/library/lux/control/parser.lux b/stdlib/source/library/lux/control/parser.lux index 2b189b912..4b9735560 100644 --- a/stdlib/source/library/lux/control/parser.lux +++ b/stdlib/source/library/lux/control/parser.lux @@ -1,20 +1,20 @@ (.using - [library - [lux {"-" or and not} - [abstract - [functor {"+" Functor}] - [apply {"+" Apply}] - [monad {"+" Monad do}] - [codec {"+" Codec}]] - [control - ["[0]" try {"+" Try}]] - [data - ["[0]" product] - [collection - ["[0]" list ("[1]#[0]" functor monoid)]]] - [math - [number - ["n" nat]]]]]) + [library + [lux {"-" or and not} + [abstract + [functor {"+" Functor}] + [apply {"+" Apply}] + [monad {"+" Monad do}] + [codec {"+" Codec}]] + [control + ["[0]" try {"+" Try}]] + [data + ["[0]" product] + [collection + ["[0]" list ("[1]#[0]" functor monoid)]]] + [math + [number + ["n" nat]]]]]) (type: .public (Parser s a) (-> s (Try [s a]))) @@ -34,7 +34,7 @@ (implementation: .public apply (All (_ s) (Apply (Parser s))) - (def: &functor ..functor) + (def: functor ..functor) (def: (on fa ff) (function (_ input) @@ -53,7 +53,7 @@ (implementation: .public monad (All (_ s) (Monad (Parser s))) - (def: &functor ..functor) + (def: functor ..functor) (def: (in x) (function (_ input) @@ -134,7 +134,7 @@ {try.#Success [input (list)]} {try.#Success [input' head]} - (..result (# ..monad each (|>> (list& head)) + (..result (# ..monad each (|>> (partial_list head)) (some parser)) input')))) diff --git a/stdlib/source/library/lux/control/parser/analysis.lux b/stdlib/source/library/lux/control/parser/analysis.lux index 078fedb7e..26d74c274 100644 --- a/stdlib/source/library/lux/control/parser/analysis.lux +++ b/stdlib/source/library/lux/control/parser/analysis.lux @@ -93,7 +93,7 @@ (Parser <type>) (function (_ input) (case input - (pattern (list& (<tag> x) input')) + (pattern (partial_list (<tag> x) input')) {try.#Success [input' x]} _ @@ -103,7 +103,7 @@ (-> <type> (Parser Any)) (function (_ input) (case input - (pattern (list& (<tag> actual) input')) + (pattern (partial_list (<tag> actual) input')) (if (# <eq> = expected actual) {try.#Success [input' []]} (exception.except ..cannot_parse input)) @@ -126,7 +126,7 @@ (All (_ a) (-> (Parser a) (Parser a))) (function (_ input) (case input - (pattern (list& (/.tuple head) tail)) + (pattern (partial_list (/.tuple head) tail)) (do try.monad [output (..result parser head)] {try.#Success [tail output]}) diff --git a/stdlib/source/library/lux/control/parser/code.lux b/stdlib/source/library/lux/control/parser/code.lux index 554ad21e9..516e6ff2e 100644 --- a/stdlib/source/library/lux/control/parser/code.lux +++ b/stdlib/source/library/lux/control/parser/code.lux @@ -26,7 +26,7 @@ (All (_ a) (-> (List [a a]) (List a))) (case pairs {.#End} {.#End} - {.#Item [[x y] pairs']} (list& x y (un_paired pairs')))) + {.#Item [[x y] pairs']} (partial_list x y (un_paired pairs')))) (type: .public Parser (//.Parser (List Code))) diff --git a/stdlib/source/library/lux/control/parser/json.lux b/stdlib/source/library/lux/control/parser/json.lux index 130c04815..4064ed450 100644 --- a/stdlib/source/library/lux/control/parser/json.lux +++ b/stdlib/source/library/lux/control/parser/json.lux @@ -169,7 +169,7 @@ (All (_ a) (-> Text (Parser a) (Parser a))) (function (again inputs) (case inputs - (pattern (list& {/.#String key} value inputs')) + (pattern (partial_list {/.#String key} value inputs')) (if (text#= key field_name) (case (//.result parser (list value)) {try.#Success [{.#End} output]} @@ -182,7 +182,7 @@ {try.#Failure error}) (do try.monad [[inputs'' output] (again inputs')] - (in [(list& {/.#String key} value inputs'') + (in [(partial_list {/.#String key} value inputs'') output]))) {.#End} diff --git a/stdlib/source/library/lux/control/parser/synthesis.lux b/stdlib/source/library/lux/control/parser/synthesis.lux index e45f311da..f457e13fb 100644 --- a/stdlib/source/library/lux/control/parser/synthesis.lux +++ b/stdlib/source/library/lux/control/parser/synthesis.lux @@ -92,7 +92,7 @@ (Parser <type>) (.function (_ input) (case input - (pattern (list& (<tag> x) input')) + (pattern (partial_list (<tag> x) input')) {try.#Success [input' x]} _ @@ -102,7 +102,7 @@ (-> <type> (Parser Any)) (.function (_ input) (case input - (pattern (list& (<tag> actual) input')) + (pattern (partial_list (<tag> actual) input')) (if (# <eq> = expected actual) {try.#Success [input' []]} (exception.except ..cannot_parse input)) @@ -123,7 +123,7 @@ (All (_ a) (-> (Parser a) (Parser a))) (.function (_ input) (case input - (pattern (list& (/.tuple head) tail)) + (pattern (partial_list (/.tuple head) tail)) (do try.monad [output (..result parser head)] {try.#Success [tail output]}) @@ -135,7 +135,7 @@ (All (_ a) (-> Arity (Parser a) (Parser [(Environment Synthesis) a]))) (.function (_ input) (case input - (pattern (list& (/.function/abstraction [environment actual body]) tail)) + (pattern (partial_list (/.function/abstraction [environment actual body]) tail)) (if (n.= expected actual) (do try.monad [output (..result parser (list body))] @@ -149,7 +149,7 @@ (All (_ a b) (-> (Parser a) (Parser b) (Parser [Register a b]))) (.function (_ input) (case input - (pattern (list& (/.loop/scope [start inits iteration]) tail)) + (pattern (partial_list (/.loop/scope [start inits iteration]) tail)) (do try.monad [inits (..result init_parsers inits) iteration (..result iteration_parser (list iteration))] diff --git a/stdlib/source/library/lux/control/parser/type.lux b/stdlib/source/library/lux/control/parser/type.lux index 714810217..3b837d8a9 100644 --- a/stdlib/source/library/lux/control/parser/type.lux +++ b/stdlib/source/library/lux/control/parser/type.lux @@ -342,7 +342,7 @@ [env ..env [funcT argsT] (..applied (//.and any (//.many any))) _ (local (list funcT) (..this_parameter 0)) - allC (let [allT (list& funcT argsT)] + allC (let [allT (partial_list funcT argsT)] (|> allT (monad.each ! (function.constant ..parameter)) (local allT)))] diff --git a/stdlib/source/library/lux/control/pipe.lux b/stdlib/source/library/lux/control/pipe.lux index 3b136f771..476664344 100644 --- a/stdlib/source/library/lux/control/pipe.lux +++ b/stdlib/source/library/lux/control/pipe.lux @@ -81,7 +81,7 @@ prev <code>.any]) (with_symbols [g!temp] (.case (list.reversed steps) - (pattern (list& last_step prev_steps)) + (pattern (partial_list last_step prev_steps)) (.let [step_bindings (monad.do list.monad [step (list.reversed prev_steps)] (list g!temp (` (|> (~ g!temp) (~+ step)))))] diff --git a/stdlib/source/library/lux/control/reader.lux b/stdlib/source/library/lux/control/reader.lux index 6a81806ac..95cbe91b9 100644 --- a/stdlib/source/library/lux/control/reader.lux +++ b/stdlib/source/library/lux/control/reader.lux @@ -32,7 +32,7 @@ (implementation: .public apply (All (_ r) (Apply (Reader r))) - (def: &functor ..functor) + (def: functor ..functor) (def: (on fa ff) (function (_ env) @@ -41,7 +41,7 @@ (implementation: .public monad (All (_ r) (Monad (Reader r))) - (def: &functor ..functor) + (def: functor ..functor) (def: (in x) (function (_ env) x)) @@ -53,8 +53,8 @@ (implementation: .public (with monad) (All (_ !) (-> (Monad !) (All (_ e) (Monad (All (_ a) (Reader e (! a))))))) - (def: &functor - (functor.composite ..functor (the monad.&functor monad))) + (def: functor + (functor.composite ..functor (the monad.functor monad))) (def: in (|>> (# monad in) diff --git a/stdlib/source/library/lux/control/region.lux b/stdlib/source/library/lux/control/region.lux index 0aa7d8939..2296de83f 100644 --- a/stdlib/source/library/lux/control/region.lux +++ b/stdlib/source/library/lux/control/region.lux @@ -92,8 +92,8 @@ (-> (Monad !) (All (_ r) (Apply (Region r !))))) - (def: &functor - (..functor (the monad.&functor super))) + (def: functor + (..functor (the monad.functor super))) (def: (on fa ff) (function (_ [region cleaners]) @@ -117,8 +117,8 @@ (-> (Monad !) (All (_ r) (Monad (Region r !))))) - (def: &functor - (..functor (the monad.&functor super))) + (def: functor + (..functor (the monad.functor super))) (def: (in value) (function (_ [region cleaners]) diff --git a/stdlib/source/library/lux/control/security/policy.lux b/stdlib/source/library/lux/control/security/policy.lux index d3165f0c6..3e6bb2e0c 100644 --- a/stdlib/source/library/lux/control/security/policy.lux +++ b/stdlib/source/library/lux/control/security/policy.lux @@ -63,7 +63,7 @@ (implementation: .public apply (~ (..of_policy Apply)) - (def: &functor ..functor) + (def: functor ..functor) (def: (on fa ff) (abstraction ((representation ff) (representation fa))))) @@ -71,7 +71,7 @@ (implementation: .public monad (~ (..of_policy Monad)) - (def: &functor ..functor) + (def: functor ..functor) (def: in (|>> abstraction)) (def: conjoint (|>> representation))) ) diff --git a/stdlib/source/library/lux/control/state.lux b/stdlib/source/library/lux/control/state.lux index fdc247660..d1d587861 100644 --- a/stdlib/source/library/lux/control/state.lux +++ b/stdlib/source/library/lux/control/state.lux @@ -1,10 +1,10 @@ (.using - [library - [lux {"-" local} - [abstract - [functor {"+" Functor}] - [apply {"+" Apply}] - [monad {"+" Monad do}]]]]) + [library + [lux {"-" local} + [abstract + [functor {"+" Functor}] + [apply {"+" Apply}] + [monad {"+" Monad do}]]]]) (type: .public (State s a) (-> s [s a])) @@ -50,7 +50,7 @@ (implementation: .public apply (All (_ s) (Apply (State s))) - (def: &functor ..functor) + (def: functor ..functor) (def: (on fa ff) (function (_ state) @@ -61,7 +61,7 @@ (implementation: .public monad (All (_ s) (Monad (State s))) - (def: &functor ..functor) + (def: functor ..functor) (def: (in a) (function (_ state) @@ -99,7 +99,7 @@ (implementation: (with//apply monad) (All (_ M s) (-> (Monad M) (Apply (All (_ a) (-> s (M [s a])))))) - (def: &functor (with//functor (# monad &functor))) + (def: functor (with//functor (# monad functor))) (def: (on sFa sFf) (function (_ state) @@ -118,7 +118,7 @@ (implementation: .public (with monad) (All (_ M s) (-> (Monad M) (Monad (+State M s)))) - (def: &functor (with//functor (# monad &functor))) + (def: functor (with//functor (# monad functor))) (def: (in a) (function (_ state) diff --git a/stdlib/source/library/lux/control/thread.lux b/stdlib/source/library/lux/control/thread.lux index 6a65b2650..2192c1824 100644 --- a/stdlib/source/library/lux/control/thread.lux +++ b/stdlib/source/library/lux/control/thread.lux @@ -75,7 +75,7 @@ (implementation: .public apply (All (_ !) (Apply (Thread !))) - (def: &functor ..functor) + (def: functor ..functor) (def: (on fa ff) (function (_ !) @@ -84,7 +84,7 @@ (implementation: .public monad (All (_ !) (Monad (Thread !))) - (def: &functor ..functor) + (def: functor ..functor) (def: (in value) (function (_ !) diff --git a/stdlib/source/library/lux/control/try.lux b/stdlib/source/library/lux/control/try.lux index d00d15d28..b2c5b02fc 100644 --- a/stdlib/source/library/lux/control/try.lux +++ b/stdlib/source/library/lux/control/try.lux @@ -30,7 +30,7 @@ (implementation: .public apply (Apply Try) - (def: &functor ..functor) + (def: functor ..functor) (def: (on fa ff) (case ff @@ -50,7 +50,7 @@ (implementation: .public monad (Monad Try) - (def: &functor ..functor) + (def: functor ..functor) (def: (in a) {#Success a}) @@ -68,8 +68,8 @@ ... TODO: Replace (All (_ a) (! (Try a))) with (functor.Then ! Try) (All (_ !) (-> (Monad !) (Monad (All (_ a) (! (Try a)))))) - (def: &functor - (functor.composite (the monad.&functor monad) + (def: functor + (functor.composite (the monad.functor monad) ..functor)) (def: in diff --git a/stdlib/source/library/lux/control/writer.lux b/stdlib/source/library/lux/control/writer.lux index bfbf6183e..b8326b542 100644 --- a/stdlib/source/library/lux/control/writer.lux +++ b/stdlib/source/library/lux/control/writer.lux @@ -29,7 +29,7 @@ (All (_ l) (-> (Monoid l) (Apply (Writer l)))) - (def: &functor ..functor) + (def: functor ..functor) (def: (on fa ff) (let [[log1 f] ff @@ -40,7 +40,7 @@ (All (_ l) (-> (Monoid l) (Monad (Writer l)))) - (def: &functor ..functor) + (def: functor ..functor) (def: in (|>> [(# monoid identity)])) @@ -52,8 +52,8 @@ (implementation: .public (with monoid monad) (All (_ l M) (-> (Monoid l) (Monad M) (Monad (All (_ a) (M (Writer l a)))))) - (def: &functor - (functor.composite (the monad.&functor monad) + (def: functor + (functor.composite (the monad.functor monad) ..functor)) (def: in |