aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/control/concurrency/semaphore.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/control/concurrency/semaphore.lux')
-rw-r--r--stdlib/source/lux/control/concurrency/semaphore.lux9
1 files changed, 6 insertions, 3 deletions
diff --git a/stdlib/source/lux/control/concurrency/semaphore.lux b/stdlib/source/lux/control/concurrency/semaphore.lux
index fab5d4498..ade45984e 100644
--- a/stdlib/source/lux/control/concurrency/semaphore.lux
+++ b/stdlib/source/lux/control/concurrency/semaphore.lux
@@ -2,6 +2,9 @@
[lux #*
[abstract
[monad (#+ do)]]
+ [data
+ [number
+ ["n" nat]]]
[control
["." io (#+ IO)]]
[type
@@ -100,7 +103,7 @@
(wrap output)))
)
-(def: #export limit (refinement.refinement (n/> 0)))
+(def: #export limit (refinement.refinement (n.> 0)))
(`` (type: #export Limit (~~ (refinement.type limit))))
(abstract: #export Barrier
@@ -121,7 +124,7 @@
(def: (un-block times turnstile)
(-> Nat Semaphore (Promise Any))
(loop [step 0]
- (if (n/< times step)
+ (if (n.< times step)
(do promise.monad
[_ (signal turnstile)]
(recur (inc step)))
@@ -134,7 +137,7 @@
[#let [limit (refinement.un-refine (get@ #limit barrier))
goal <goal>
count (io.run (atom.update <update> (get@ #count barrier)))]
- _ (if (n/= goal count)
+ _ (if (n.= goal count)
(un-block limit (get@ <turnstile> barrier))
(wrap []))]
(wait (get@ <turnstile> barrier))))]