diff options
author | Eduardo Julian | 2019-04-16 17:43:39 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-04-16 17:43:39 -0400 |
commit | afddac31e065ae1df0c7c78cc2ce6d13b01896c6 (patch) | |
tree | 6260d669e7660af5c78fffc7ef72679f8f1b17a4 /stdlib | |
parent | 8455fe12d89ce4c159101d6913bec5224941ed98 (diff) |
Small import fixes for the sake of tags.
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/source/lux/abstract/codec.lux | 3 | ||||
-rw-r--r-- | stdlib/source/lux/abstract/enum.lux | 1 | ||||
-rw-r--r-- | stdlib/source/lux/abstract/monad.lux | 42 | ||||
-rw-r--r-- | stdlib/source/lux/control/concurrency/atom.lux | 10 | ||||
-rw-r--r-- | stdlib/source/lux/control/parser.lux | 1 | ||||
-rw-r--r-- | stdlib/source/lux/data/name.lux | 1 | ||||
-rw-r--r-- | stdlib/source/lux/data/product.lux | 1 | ||||
-rw-r--r-- | stdlib/source/lux/data/text.lux | 6 |
8 files changed, 35 insertions, 30 deletions
diff --git a/stdlib/source/lux/abstract/codec.lux b/stdlib/source/lux/abstract/codec.lux index abe80ba4a..f0056f176 100644 --- a/stdlib/source/lux/abstract/codec.lux +++ b/stdlib/source/lux/abstract/codec.lux @@ -3,7 +3,8 @@ [data ["." error (#+ Error)]]] [// - monad]) + [monad (#+ do)] + ["." functor]]) (signature: #export (Codec m a) {#.doc "A way to move back-and-forth between a type and an alternative representation for it."} diff --git a/stdlib/source/lux/abstract/enum.lux b/stdlib/source/lux/abstract/enum.lux index 5bbb7df38..07d7f0ec5 100644 --- a/stdlib/source/lux/abstract/enum.lux +++ b/stdlib/source/lux/abstract/enum.lux @@ -1,6 +1,7 @@ (.module: [lux #*] [// + [equivalence (#+)] ["." order]]) (signature: #export (Enum e) diff --git a/stdlib/source/lux/abstract/monad.lux b/stdlib/source/lux/abstract/monad.lux index 0e509c64e..0772d8c98 100644 --- a/stdlib/source/lux/abstract/monad.lux +++ b/stdlib/source/lux/abstract/monad.lux @@ -3,7 +3,7 @@ [// ["." functor (#+ Functor)]]) -(def: (list;fold f init xs) +(def: (list@fold f init xs) (All [a b] (-> (-> b a a) a (List b) a)) (case xs @@ -11,9 +11,9 @@ init (#.Cons x xs') - (list;fold f (f x init) xs'))) + (list@fold f (f x init) xs'))) -(def: (list;size xs) +(def: (list@size xs) (All [a] (-> (List a) Nat)) (loop [counter 0 xs xs] @@ -27,7 +27,7 @@ (def: (reverse xs) (All [a] (-> (List a) (List a))) - (list;fold (function (_ head tail) (#.Cons head tail)) + (list@fold (function (_ head tail) (#.Cons head tail)) #.Nil xs)) @@ -60,11 +60,11 @@ (wrap (f3 z))))} (case tokens (#.Cons monad (#.Cons [_ (#.Tuple bindings)] (#.Cons body #.Nil))) - (if (|> bindings list;size (n/% 2) (n/= 0)) + (if (|> bindings list@size (n/% 2) (n/= 0)) (let [g!_ (: Code [_cursor (#.Identifier ["" " _ "])]) g!map (: Code [_cursor (#.Identifier ["" " map "])]) g!join (: Code [_cursor (#.Identifier ["" " join "])]) - body' (list;fold (: (-> [Code Code] Code Code) + body' (list@fold (: (-> [Code Code] Code Code) (function (_ binding body') (let [[var value] binding] (case var @@ -94,55 +94,55 @@ (All [M a] (-> (Monad M) (List (M a)) (M (List a)))) - (let [(^open "!;.") monad] + (let [(^open "!@.") monad] (function (recur xs) (case xs #.Nil - (!;wrap #.Nil) + (!@wrap #.Nil) (#.Cons x xs') (|> x - (!;map (function (_ _x) - (!;map (|>> (#.Cons _x)) (recur xs')))) - !;join))))) + (!@map (function (_ _x) + (!@map (|>> (#.Cons _x)) (recur xs')))) + !@join))))) (def: #export (map monad f) {#.doc "Apply a monadic function to all values in a list."} (All [M a b] (-> (Monad M) (-> a (M b)) (List a) (M (List b)))) - (let [(^open "!;.") monad] + (let [(^open "!@.") monad] (function (recur xs) (case xs #.Nil - (!;wrap #.Nil) + (!@wrap #.Nil) (#.Cons x xs') (|> (f x) - (!;map (function (_ _x) - (!;map (|>> (#.Cons _x)) (recur xs')))) - !;join))))) + (!@map (function (_ _x) + (!@map (|>> (#.Cons _x)) (recur xs')))) + !@join))))) (def: #export (filter Monad<!> f) {#.doc "Filter the values in a list with a monadic function."} (All [! a b] (-> (Monad !) (-> a (! Bit)) (List a) (! (List a)))) - (let [(^open "!;.") Monad<!>] + (let [(^open "!@.") Monad<!>] (function (recur xs) (case xs #.Nil - (!;wrap #.Nil) + (!@wrap #.Nil) (#.Cons head xs') (|> (f head) - (!;map (function (_ verdict) - (!;map (function (_ tail) + (!@map (function (_ verdict) + (!@map (function (_ tail) (if verdict (#.Cons head tail) tail)) (recur xs')))) - !;join))))) + !@join))))) (def: #export (fold monad f init xs) {#.doc "Fold a list with a monadic function."} diff --git a/stdlib/source/lux/control/concurrency/atom.lux b/stdlib/source/lux/control/concurrency/atom.lux index 6ef8c8466..c93c224ce 100644 --- a/stdlib/source/lux/control/concurrency/atom.lux +++ b/stdlib/source/lux/control/concurrency/atom.lux @@ -13,7 +13,7 @@ [host (#+ import:)]]) (`` (for {(~~ (static host.jvm)) - (import: (java/util/concurrent/atomic/AtomicReference a) + (import: #long (java/util/concurrent/atomic/AtomicReference a) (new [a]) (get [] a) (compareAndSet [a a] boolean))})) @@ -22,23 +22,23 @@ {#.doc "Atomic references that are safe to mutate concurrently."} (for {(~~ (static host.jvm)) - (AtomicReference a)}) + (java/util/concurrent/atomic/AtomicReference a)}) (def: #export (atom value) (All [a] (-> a (Atom a))) (:abstraction (for {(~~ (static host.jvm)) - (AtomicReference::new value)}))) + (java/util/concurrent/atomic/AtomicReference::new value)}))) (def: #export (read atom) (All [a] (-> (Atom a) (IO a))) (io (for {(~~ (static host.jvm)) - (AtomicReference::get (:representation atom))}))) + (java/util/concurrent/atomic/AtomicReference::get (:representation atom))}))) (def: #export (compare-and-swap current new atom) {#.doc (doc "Only mutates an atom if you can present it's current value." "That guarantees that atom was not updated since you last read from it.")} (All [a] (-> a a (Atom a) (IO Bit))) - (io (AtomicReference::compareAndSet current new (:representation atom)))) + (io (java/util/concurrent/atomic/AtomicReference::compareAndSet current new (:representation atom)))) )) (def: #export (update f atom) diff --git a/stdlib/source/lux/control/parser.lux b/stdlib/source/lux/control/parser.lux index 84f63c548..0db1d625b 100644 --- a/stdlib/source/lux/control/parser.lux +++ b/stdlib/source/lux/control/parser.lux @@ -1,6 +1,7 @@ (.module: [lux (#- or and not) [abstract + [monoid (#+)] [functor (#+ Functor)] [apply (#+ Apply)] [monad (#+ Monad do)] diff --git a/stdlib/source/lux/data/name.lux b/stdlib/source/lux/data/name.lux index bd4b80c69..b54988169 100644 --- a/stdlib/source/lux/data/name.lux +++ b/stdlib/source/lux/data/name.lux @@ -1,6 +1,7 @@ (.module: [lux #* [abstract + [monoid (#+)] [equivalence (#+ Equivalence)] [codec (#+ Codec)] hash] diff --git a/stdlib/source/lux/data/product.lux b/stdlib/source/lux/data/product.lux index baa78dd45..bb3191e24 100644 --- a/stdlib/source/lux/data/product.lux +++ b/stdlib/source/lux/data/product.lux @@ -2,7 +2,6 @@ {#.doc "Functionality for working with tuples (particularly 2-tuples)."} lux) -## [Functions] (template [<name> <type> <output>] [(def: #export (<name> xy) (All [a b] (-> [a b] <type>)) diff --git a/stdlib/source/lux/data/text.lux b/stdlib/source/lux/data/text.lux index bf40c3ef7..720968ba9 100644 --- a/stdlib/source/lux/data/text.lux +++ b/stdlib/source/lux/data/text.lux @@ -1,12 +1,14 @@ (.module: [lux #* [abstract + [fold (#+)] + [functor (#+)] + hash [monoid (#+ Monoid)] [equivalence (#+ Equivalence)] [order (#+ Order)] [monad (#+ Monad do)] - [codec (#+ Codec)] - hash] + [codec (#+ Codec)]] [data ["." maybe] [number |