aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/control/concurrency/stm.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/control/concurrency/stm.lux')
-rw-r--r--stdlib/source/library/lux/control/concurrency/stm.lux37
1 files changed, 19 insertions, 18 deletions
diff --git a/stdlib/source/library/lux/control/concurrency/stm.lux b/stdlib/source/library/lux/control/concurrency/stm.lux
index 5e9759bdb..cb6a1e702 100644
--- a/stdlib/source/library/lux/control/concurrency/stm.lux
+++ b/stdlib/source/library/lux/control/concurrency/stm.lux
@@ -52,16 +52,16 @@
succeeded? (atom.compare_and_swap! old [new_value observers] var')]
(if succeeded?
(do !
- [_ (monad.map ! (function (_ sink)
- (do !
- [result (\ sink feed new_value)]
- (case result
- (#try.Success _)
- (in [])
-
- (#try.Failure _)
- (un_follow! sink var))))
- observers)]
+ [_ (monad.each ! (function (_ sink)
+ (do !
+ [result (\ sink feed new_value)]
+ (case result
+ (#try.Success _)
+ (in [])
+
+ (#try.Failure _)
+ (un_follow! sink var))))
+ observers)]
(in []))
(write! new_value var))))
@@ -76,9 +76,10 @@
)
(type: (Tx_Frame a)
- {#var (Var a)
- #original a
- #current a})
+ (Record
+ {#var (Var a)
+ #original a
+ #current a}))
(type: Tx
(List (Ex [a] (Tx_Frame a))))
@@ -92,8 +93,8 @@
(list.example (function (_ [_var _original _current])
(same? (:as (Var Any) var)
(:as (Var Any) _var))))
- (\ maybe.monad map (function (_ [_var _original _current])
- _current))
+ (\ maybe.monad each (function (_ [_var _original _current])
+ _current))
:expected))
(def: .public (read var)
@@ -141,7 +142,7 @@
(implementation: .public functor
(Functor STM)
- (def: (map f fa)
+ (def: (each f fa)
(function (_ tx)
(let [[tx' a] (fa tx)]
[tx' (f a)]))))
@@ -166,7 +167,7 @@
(function (_ tx)
[tx a]))
- (def: (join mma)
+ (def: (conjoint mma)
(function (_ tx)
(let [[tx' ma] (mma tx)]
(ma tx')))))
@@ -233,7 +234,7 @@
[finished_tx value] (stm_proc fresh_tx)]
(if (can_commit? finished_tx)
(do {! io.monad}
- [_ (monad.map ! ..commit_var! finished_tx)]
+ [_ (monad.each ! ..commit_var! finished_tx)]
(resolve value))
(..issue_commit! commit))))