Skip to content

Commit 5320f7e

Browse files
committed
Add never Aff.
1 parent 3391938 commit 5320f7e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Control/Monad/Aff.purs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module Control.Monad.Aff
1717
, bracket
1818
, generalBracket
1919
, delay
20+
, never
2021
, finally
2122
, atomically
2223
, killFiber
@@ -226,6 +227,10 @@ spawnSuspendedAff = liftEff <<< launchSuspendedAff
226227
delay eff. Milliseconds Aff eff Unit
227228
delay (Milliseconds n) = Fn.runFn2 _delay Right n
228229

230+
-- | An async computation which does not resolve.
231+
never eff a. Aff eff a
232+
never = makeAff \_ → pure mempty
233+
229234
-- | All `Eff` exceptions are implicitly caught within an `Aff` context, but
230235
-- | standard `liftEff` won't remove the effect label.
231236
liftEff' eff a. Eff (exception EXCEPTION | eff) a Aff eff a
@@ -271,7 +276,9 @@ type BracketConditions eff a =
271276
, completed a Aff eff Unit
272277
}
273278

274-
-- | A general purpose bracket
279+
-- | A general purpose bracket which lets you observe the status of the
280+
-- | bracketed action. The bracketed action may have been killed with an
281+
-- | exception, thrown an exception, or completed successfully.
275282
foreign import generalBracket eff a b. Aff eff a BracketConditions eff a (a Aff eff b) Aff eff b
276283

277284
-- | Constructs an `Aff` from low-level `Eff` effects using a callback. A

0 commit comments

Comments
 (0)