aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/control/concurrency/actor.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/control/concurrency/actor.lux26
1 files changed, 13 insertions, 13 deletions
diff --git a/stdlib/source/library/lux/control/concurrency/actor.lux b/stdlib/source/library/lux/control/concurrency/actor.lux
index 40bc65ec2..e67bb3f2b 100644
--- a/stdlib/source/library/lux/control/concurrency/actor.lux
+++ b/stdlib/source/library/lux/control/concurrency/actor.lux
@@ -31,7 +31,7 @@
[(Rec Mailbox
[(Async [(<Mail> Actor s) Mailbox])
(Resolver [(<Mail> Actor s) Mailbox])])])]
- (these (def: (pending [read write])
+ (these (def (pending [read write])
(All (_ a)
(-> (Rec Mailbox
[(Async [a Mailbox])
@@ -62,7 +62,7 @@
(type: .public (Behavior s)
(-> (Mail s) s (Actor s) (Async (Try s))))
- (def: .public (spawn! behavior init)
+ (def .public (spawn! behavior init)
(All (_ s) (-> (Behavior s) s (IO (Actor s))))
(io (let [self (sharing [s]
(is (Behavior s)
@@ -88,7 +88,7 @@
(again state' tail))))]
self)))
- (def: .public (alive? actor)
+ (def .public (alive? actor)
(All (_ s) (-> (Actor s) (IO Bit)))
(let [[obituary _] (the #obituary (representation actor))]
(|> obituary
@@ -101,18 +101,18 @@
_
bit.no))))))
- (def: .public (obituary' actor)
+ (def .public (obituary' actor)
(All (_ s) (-> (Actor s) (IO (Maybe (Obituary s)))))
(let [[obituary _] (the #obituary (representation actor))]
(async.value obituary)))
- (def: .public obituary
+ (def .public obituary
(All (_ s) (-> (Actor s) (Async (Obituary s))))
(|>> representation
(the #obituary)
product.left))
- (def: .public (mail! mail actor)
+ (def .public (mail! mail actor)
(All (_ s) (-> (Mail s) (Actor s) (IO (Try Any))))
(do [! io.monad]
[alive? (..alive? actor)]
@@ -140,7 +140,7 @@
(type: .public (Message s o)
(-> s (Actor s) (Async (Try [s o]))))
- (def: (mail message)
+ (def (mail message)
(All (_ s o) (-> (Message s o) [(Async (Try o)) (Mail s)]))
(let [[async resolve] (sharing [s o]
(is (Message s o)
@@ -163,7 +163,7 @@
(io.run! (resolve {try.#Failure error}))
(async.resolved {try.#Failure error})))))]))
- (def: .public (tell! message actor)
+ (def .public (tell! message actor)
(All (_ s o) (-> (Message s o) (Actor s) (Async (Try o))))
(let [[async mail] (..mail message)]
(do async.monad
@@ -176,12 +176,12 @@
(in {try.#Failure error})))))
)))
-(def: .public default
+(def .public default
Behavior
(function (_ mail state self)
(mail state self)))
-(def: .public (poison! actor)
+(def .public (poison! actor)
(All (_ s) (-> (Actor s) (IO (Try Any))))
(..mail! (function (_ state self)
(async.resolved (exception.except ..poisoned [])))
@@ -190,10 +190,10 @@
(type: .public Stop
(IO Any))
-(def: continue! true)
-(def: stop! false)
+(def continue! true)
+(def stop! false)
-(def: .public (observe! action channel actor)
+(def .public (observe! action channel actor)
(All (_ r w s) (-> (-> r Stop (Mail s)) (Channel' r w) (Actor s) (IO Any)))
(let [signal (is (Atom Bit)
(atom.atom ..continue!))