@@ -21,6 +21,13 @@ type PureAff a = forall e. Aff e a
21
21
22
22
A pure asynchronous computation, having no effects.
23
23
24
+ #### ` Canceler `
25
+
26
+ ``` purescript
27
+ type Canceler e = Error -> Aff e Boolean
28
+ ```
29
+
30
+
24
31
#### ` launchAff `
25
32
26
33
``` purescript
@@ -46,7 +53,8 @@ makeAff :: forall e a. ((Error -> Eff e Unit) -> (a -> Eff e Unit) -> Eff e Unit
46
53
```
47
54
48
55
Creates an asynchronous effect from a function that accepts error and
49
- success callbacks.
56
+ success callbacks. This function can be used for asynchronous computations
57
+ that cannot be canceled.
50
58
51
59
#### ` later `
52
60
@@ -67,7 +75,7 @@ Runs the asynchronous computation later (off the current execution context).
67
75
#### ` forkAff `
68
76
69
77
``` purescript
70
- forkAff :: forall e a. Aff e a -> Aff e Unit
78
+ forkAff :: forall e a. Aff e a -> Aff e (Canceler e)
71
79
```
72
80
73
81
Forks the specified asynchronous computation so subsequent monadic binds
@@ -97,6 +105,14 @@ liftEff' :: forall e a. Eff (err :: Exception | e) a -> Aff e (Either Error a)
97
105
98
106
Lifts a synchronous computation and makes explicit any failure from exceptions.
99
107
108
+ #### ` nonCanceler `
109
+
110
+ ``` purescript
111
+ nonCanceler :: forall e. Canceler e
112
+ ```
113
+
114
+ A constant function that always returns a pure false value.
115
+
100
116
#### ` semigroupAff `
101
117
102
118
``` purescript
@@ -191,171 +207,171 @@ instance monadPlusAff :: MonadPlus (Aff e)
191
207
192
208
193
209
194
- ## Module Control.Monad.Aff.Class
210
+ ## Module Control.Monad.Aff.AVar
195
211
196
- #### ` MonadAff `
212
+ #### ` AVAR `
197
213
198
214
``` purescript
199
- class MonadAff e m where
200
- liftAff :: forall a. Aff e a -> m a
215
+ data AVAR :: !
201
216
```
202
217
203
218
204
- #### ` monadAffAff `
219
+ #### ` AVar `
205
220
206
221
``` purescript
207
- instance monadAffAff :: MonadAff e (Aff e)
222
+ data AVar :: * -> *
208
223
```
209
224
210
225
211
-
212
- ## Module Control.Monad.Aff.Par
213
-
214
- #### ` Par `
226
+ #### ` AffAVar `
215
227
216
228
``` purescript
217
- newtype Par e a
218
- = Par (AffQueue e a)
229
+ type AffAVar e a = Aff (avar :: AVAR | e) a
219
230
```
220
231
221
232
222
- #### ` runPar `
233
+ #### ` makeVar `
223
234
224
235
``` purescript
225
- runPar :: forall e a. Par e a -> AffQueue e a
236
+ makeVar :: forall e a. AffAVar e (AVar a)
226
237
```
227
238
228
- Extracts the ` Aff ` from the ` Par ` .
239
+ Makes a new asynchronous avar .
229
240
230
- #### ` semigroupPar `
241
+ #### ` makeVar' `
231
242
232
243
``` purescript
233
- instance semigroupPar :: (Semigroup a) => Semigroup (Par e a)
244
+ makeVar' :: forall e a. a -> AffAVar e (AVar a)
234
245
```
235
246
247
+ Makes a avar and sets it to some value.
236
248
237
- #### ` monoidPar `
249
+ #### ` takeVar `
238
250
239
251
``` purescript
240
- instance monoidPar :: (Monoid a) => Monoid (Par e a)
252
+ takeVar :: forall e a. AVar a -> AffAVar e a
241
253
```
242
254
255
+ Takes the next value from the asynchronous avar.
243
256
244
- #### ` functorPar `
257
+ #### ` putVar `
245
258
246
259
``` purescript
247
- instance functorPar :: Functor (Par e)
260
+ putVar :: forall e a. AVar a -> a -> AffAVar e Unit
248
261
```
249
262
263
+ Puts a new value into the asynchronous avar. If the avar has
264
+ been killed, this will result in an error.
250
265
251
- #### ` applyPar `
266
+ #### ` modifyVar `
252
267
253
268
``` purescript
254
- instance applyPar :: Apply (Par e)
269
+ modifyVar :: forall e a. (a -> a) -> AVar a -> AffAVar e Unit
255
270
```
256
271
272
+ Modifies the value at the head of the avar (will suspend until one is available).
257
273
258
- #### ` applicativePar `
274
+ #### ` killVar `
259
275
260
276
``` purescript
261
- instance applicativePar :: Applicative (Par e)
277
+ killVar :: forall e a. AVar a -> Error -> AffAVar e Unit
262
278
```
263
279
280
+ Kills an asynchronous avar.
264
281
265
- #### ` altPar `
282
+
283
+ ## Module Control.Monad.Aff.Class
284
+
285
+ #### ` MonadAff `
266
286
267
287
``` purescript
268
- instance altPar :: Alt (Par e)
288
+ class MonadAff e m where
289
+ liftAff :: forall a. Aff e a -> m a
269
290
```
270
291
271
- Returns the first value, or the first error if both error.
272
292
273
- #### ` plusPar `
293
+ #### ` monadAffAff `
274
294
275
295
``` purescript
276
- instance plusPar :: Plus (Par e)
296
+ instance monadAffAff :: MonadAff e (Aff e)
277
297
```
278
298
279
299
280
- #### ` alternativePar `
281
300
282
- ``` purescript
283
- instance alternativePar :: Alternative (Par e)
284
- ```
301
+ ## Module Control.Monad.Aff.Par
285
302
303
+ #### ` Par `
286
304
305
+ ``` purescript
306
+ newtype Par e a
307
+ = Par (AffAVar e a)
308
+ ```
287
309
288
- ## Module Control.Monad.Aff.Queue
289
310
290
- #### ` QueueFx `
311
+ #### ` runPar `
291
312
292
313
``` purescript
293
- data QueueFx :: !
314
+ runPar :: forall e a. Par e a -> AffAVar e a
294
315
```
295
316
317
+ Extracts the ` Aff ` from the ` Par ` .
296
318
297
- #### ` Queue `
319
+ #### ` semigroupPar `
298
320
299
321
``` purescript
300
- data Queue :: * -> *
322
+ instance semigroupPar :: (Semigroup a) => Semigroup (Par e a)
301
323
```
302
324
303
325
304
- #### ` AffQueue `
326
+ #### ` monoidPar `
305
327
306
328
``` purescript
307
- type AffQueue e a = Aff (queue :: QueueFx | e) a
329
+ instance monoidPar :: (Monoid a) => Monoid (Par e a)
308
330
```
309
331
310
332
311
- #### ` makeQueue `
333
+ #### ` functorPar `
312
334
313
335
``` purescript
314
- makeQueue :: forall e a. AffQueue e (Queue a )
336
+ instance functorPar :: Functor (Par e )
315
337
```
316
338
317
- Makes a new asynchronous queue.
318
339
319
- #### ` makeQueue' `
340
+ #### ` applyPar `
320
341
321
342
``` purescript
322
- makeQueue' :: forall e a. a -> AffQueue e (Queue a )
343
+ instance applyPar :: Apply (Par e )
323
344
```
324
345
325
- Makes a queue and sets it to some value.
326
346
327
- #### ` takeQueue `
347
+ #### ` applicativePar `
328
348
329
349
``` purescript
330
- takeQueue :: forall e a. Queue a -> AffQueue e a
350
+ instance applicativePar :: Applicative (Par e)
331
351
```
332
352
333
- Takes the next value from the asynchronous queue.
334
353
335
- #### ` putQueue `
354
+ #### ` altPar `
336
355
337
356
``` purescript
338
- putQueue :: forall e a. Queue a -> a -> AffQueue e Unit
357
+ instance altPar :: Alt (Par e)
339
358
```
340
359
341
- Puts a new value into the asynchronous queue. If the queue has
342
- been killed, this will result in an error.
360
+ Returns the first value, or the first error if both error.
343
361
344
- #### ` modifyQueue `
362
+ #### ` plusPar `
345
363
346
364
``` purescript
347
- modifyQueue :: forall e a. (a -> a) -> Queue a -> AffQueue e Unit
365
+ instance plusPar :: Plus (Par e)
348
366
```
349
367
350
- Modifies the value at the head of the queue (will suspend until one is available).
351
368
352
- #### ` killQueue `
369
+ #### ` alternativePar `
353
370
354
371
``` purescript
355
- killQueue :: forall e a. Queue a -> Error -> AffQueue e Unit
372
+ instance alternativePar :: Alternative (Par e)
356
373
```
357
374
358
- Kills an asynchronous queue.
359
375
360
376
361
377
## Module Control.Monad.Aff.Unsafe
0 commit comments