File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ The `Control.Monad.Aff.AVar` module contains asynchronous variables, which
212212are very similar to Haskell's ` MVar ` .
213213
214214` AVar ` s represent a value that is either full or empty. Calling ` takeVar ` on
215- an empty ` AVar ` will queue until it is filled by a matching ` putVar ` .
215+ an empty ` AVar ` will queue until it is filled by a ` putVar ` .
216216
217217``` purescript
218218example = do
@@ -230,22 +230,23 @@ example = do
230230> Got a value: hello
231231```
232232
233- Likewise, calling ` putVar ` will queue until it is taken:
233+ Likewise, calling ` putVar ` on a filled ` AVar ` will queue until it is emptied by
234+ a ` takeVar ` .
234235
235236``` purescript
236237example = do
237- var <- makeEmptyVar
238+ var <- makeVar "hello"
238239 _ <- forkAff do
239240 delay (Milliseconds 100.0)
240241 value <- takeVar var
241242 log $ "Got a value: " <> value
242- putVar var "hello "
243- log "Value taken "
243+ putVar var "next "
244+ log "Value put "
244245```
245246```
246247(Waits 100ms)
247- > Value taken
248248> Got a value: hello
249+ > Value put
249250```
250251
251252These combinators (and a few more) can be used as the building blocks for
You can’t perform that action at this time.
0 commit comments