aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/control/concurrency/async.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/control/concurrency/async.lux')
-rw-r--r--stdlib/source/library/lux/control/concurrency/async.lux26
1 files changed, 13 insertions, 13 deletions
diff --git a/stdlib/source/library/lux/control/concurrency/async.lux b/stdlib/source/library/lux/control/concurrency/async.lux
index c996e1dcc..90229a9f5 100644
--- a/stdlib/source/library/lux/control/concurrency/async.lux
+++ b/stdlib/source/library/lux/control/concurrency/async.lux
@@ -27,7 +27,7 @@
... Sets an async's value if it has not been done yet.
(def: (resolver async)
- (All [a] (-> (Async a) (Resolver a)))
+ (All (_ a) (-> (Async a) (Resolver a)))
(function (resolve value)
(let [async (:representation async)]
(do {! io.monad}
@@ -48,22 +48,22 @@
(resolve value))))))))
(def: .public (resolved value)
- (All [a] (-> a (Async a)))
+ (All (_ a) (-> a (Async a)))
(:abstraction (atom [(#.Some value) (list)])))
(def: .public (async _)
- (All [a] (-> Any [(Async a) (Resolver a)]))
+ (All (_ a) (-> Any [(Async a) (Resolver a)]))
(let [async (:abstraction (atom [#.None (list)]))]
[async (..resolver async)]))
(def: .public value
- (All [a] (-> (Async a) (IO (Maybe a))))
+ (All (_ a) (-> (Async a) (IO (Maybe a))))
(|>> :representation
atom.read!
(\ io.functor each product.left)))
(def: .public (upon! f async)
- (All [a] (-> (-> a (IO Any)) (Async a) (IO Any)))
+ (All (_ a) (-> (-> a (IO Any)) (Async a) (IO Any)))
(do {! io.monad}
[.let [async (:representation async)]
(^@ old [_value _observers]) (atom.read! async)]
@@ -81,7 +81,7 @@
)
(def: .public resolved?
- (All [a] (-> (Async a) (IO Bit)))
+ (All (_ a) (-> (Async a) (IO Bit)))
(|>> ..value
(\ io.functor each
(|>> (case> #.None
@@ -126,7 +126,7 @@
ma))))
(def: .public (and left right)
- (All [a b] (-> (Async a) (Async b) (Async [a b])))
+ (All (_ a b) (-> (Async a) (Async b) (Async [a b])))
(let [[read! write!] (:sharing [a b]
[(Async a) (Async b)]
[left right]
@@ -142,7 +142,7 @@
read!))
(def: .public (or left right)
- (All [a b] (-> (Async a) (Async b) (Async (Or a b))))
+ (All (_ a b) (-> (Async a) (Async b) (Async (Or a b))))
(let [[a|b resolve] (..async [])]
(with_expansions
[<sides> (template [<async> <tag>]
@@ -156,7 +156,7 @@
a|b))))
(def: .public (either left right)
- (All [a] (-> (Async a) (Async a) (Async a)))
+ (All (_ a) (-> (Async a) (Async a) (Async a)))
(let [[left||right resolve] (..async [])]
(`` (exec
(~~ (template [<async>]
@@ -167,7 +167,7 @@
left||right))))
(def: .public (schedule! milli_seconds computation)
- (All [a] (-> Nat (IO a) (Async a)))
+ (All (_ a) (-> Nat (IO a) (Async a)))
(let [[!out resolve] (..async [])]
(exec
(|> (do io.monad
@@ -178,11 +178,11 @@
!out)))
(def: .public future
- (All [a] (-> (IO a) (Async a)))
+ (All (_ a) (-> (IO a) (Async a)))
(..schedule! 0))
(def: .public (after milli_seconds value)
- (All [a] (-> Nat a (Async a)))
+ (All (_ a) (-> Nat a (Async a)))
(..schedule! milli_seconds (io value)))
(def: .public (delay milli_seconds)
@@ -190,6 +190,6 @@
(..after milli_seconds []))
(def: .public (within milli_seconds async)
- (All [a] (-> Nat (Async a) (Async (Maybe a))))
+ (All (_ a) (-> Nat (Async a) (Async (Maybe a))))
(..or (..delay milli_seconds)
async))