diff options
Diffstat (limited to 'stdlib/source/lux/abstract')
-rw-r--r-- | stdlib/source/lux/abstract/comonad.lux | 4 | ||||
-rw-r--r-- | stdlib/source/lux/abstract/interval.lux | 18 | ||||
-rw-r--r-- | stdlib/source/lux/abstract/monad.lux | 8 | ||||
-rw-r--r-- | stdlib/source/lux/abstract/monad/indexed.lux | 14 |
4 files changed, 22 insertions, 22 deletions
diff --git a/stdlib/source/lux/abstract/comonad.lux b/stdlib/source/lux/abstract/comonad.lux index 0a2b6f65c..fd325759a 100644 --- a/stdlib/source/lux/abstract/comonad.lux +++ b/stdlib/source/lux/abstract/comonad.lux @@ -40,7 +40,7 @@ #.None)) (#.Some [?name comonad bindings body]) (if (|> bindings list.size (n.% 2) (n.= 0)) - (let [[module short] (name-of ..be) + (let [[module short] (name_of ..be) gensym (: (-> Text Code) (|>> ($_ "lux text concat" module " " short " ") [""] #.Identifier [location.dummy])) g!_ (gensym "_") @@ -57,7 +57,7 @@ (` (|> (~ value) (~ g!split) ((~ g!map) (function ((~ g!_) (~ var)) (~ body'))))) )))) body - (list.reverse (list.as-pairs bindings)))] + (list.reverse (list.as_pairs bindings)))] (#.Right [state (list (case ?name (#.Some name) (let [name [location.dummy (#.Identifier ["" name])]] diff --git a/stdlib/source/lux/abstract/interval.lux b/stdlib/source/lux/abstract/interval.lux index b1b026440..fbe3a4c8a 100644 --- a/stdlib/source/lux/abstract/interval.lux +++ b/stdlib/source/lux/abstract/interval.lux @@ -63,14 +63,14 @@ (let [(^open ".") interval] (= <limit> elem)))] - [starts-with? bottom] - [ends-with? top] + [starts_with? bottom] + [ends_with? top] ) (def: #export (borders? interval elem) (All [a] (-> (Interval a) a Bit)) - (or (starts-with? elem interval) - (ends-with? elem interval))) + (or (starts_with? elem interval) + (ends_with? elem interval))) (def: #export (union left right) (All [a] (-> (Interval a) (Interval a) (Interval a))) @@ -125,15 +125,15 @@ (or (meets? reference sample) (meets? sample reference))) -(template [<name> <eq-side> <ineq> <ineq-side>] +(template [<name> <eq_side> <ineq> <ineq_side>] [(def: #export (<name> reference sample) (All [a] (-> (Interval a) (Interval a) Bit)) (let [(^open ",\.") reference] - (and (,\= (\ reference <eq-side>) - (\ sample <eq-side>)) + (and (,\= (\ reference <eq_side>) + (\ sample <eq_side>)) (<ineq> ,\&order - (\ reference <ineq-side>) - (\ sample <ineq-side>)))))] + (\ reference <ineq_side>) + (\ sample <ineq_side>)))))] [starts? ,\bottom order.<= ,\top] [finishes? ,\top order.>= ,\bottom] diff --git a/stdlib/source/lux/abstract/monad.lux b/stdlib/source/lux/abstract/monad.lux index 1d7c67401..900d5cca4 100644 --- a/stdlib/source/lux/abstract/monad.lux +++ b/stdlib/source/lux/abstract/monad.lux @@ -33,11 +33,11 @@ #.Nil xs)) -(def: (as-pairs xs) +(def: (as_pairs xs) (All [a] (-> (List a) (List [a a]))) (case xs (#.Cons x1 (#.Cons x2 xs')) - (#.Cons [x1 x2] (as-pairs xs')) + (#.Cons [x1 x2] (as_pairs xs')) _ #.Nil)) @@ -70,7 +70,7 @@ #.None)) (#.Some [?name monad bindings body]) (if (|> bindings list\size .int ("lux i64 %" +2) ("lux i64 =" +0)) - (let [[module short] (name-of ..do) + (let [[module short] (name_of ..do) gensym (: (-> Text Code) (|>> ($_ "lux text concat" module " " short " ") [""] #.Identifier [location.dummy])) g!_ (gensym "_") @@ -87,7 +87,7 @@ (` (|> (~ value) ((~ g!map) (function ((~ g!_) (~ var)) (~ body'))) (~ g!join))) )))) body - (reverse (as-pairs bindings)))] + (reverse (as_pairs bindings)))] (#.Right [state (list (case ?name (#.Some name) (let [name [location.dummy (#.Identifier ["" name])]] diff --git a/stdlib/source/lux/abstract/monad/indexed.lux b/stdlib/source/lux/abstract/monad/indexed.lux index 4e6f51942..0b79a230e 100644 --- a/stdlib/source/lux/abstract/monad/indexed.lux +++ b/stdlib/source/lux/abstract/monad/indexed.lux @@ -39,27 +39,27 @@ (s.tuple (p.some binding))) binding)) -(def: (pair-list [binding value]) +(def: (pair_list [binding value]) (All [a] (-> [a a] (List a))) (list binding value)) -(def: named-monad +(def: named_monad (Parser [(Maybe Text) Code]) (p.either (s.record (p.and (\ p.monad map (|>> #.Some) - s.local-identifier) + s.local_identifier) s.any)) (\ p.monad map (|>> [#.None]) s.any))) -(syntax: #export (do {[?name monad] ..named-monad} +(syntax: #export (do {[?name monad] ..named_monad} {context (s.tuple (p.some context))} expression) - (meta.with-gensyms [g!_ g!bind] + (meta.with_gensyms [g!_ g!bind] (let [body (list\fold (function (_ context next) (case context (#Let bindings) (` (let [(~+ (|> bindings - (list\map pair-list) + (list\map pair_list) list.concat))] (~ next))) @@ -72,7 +72,7 @@ (list.reverse context))] (wrap (list (case ?name (#.Some name) - (let [name (code.local-identifier name)] + (let [name (code.local_identifier name)] (` (let [(~ name) (~ monad) {#..wrap (~' wrap) #..bind (~ g!bind)} (~ name)] |