Skip to content

Commit

Permalink
add fiberCanceler (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
safareli authored and natefaubion committed Dec 14, 2018
1 parent f927c62 commit 202a3ea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Effect/Aff.purs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module Effect.Aff
, generalBracket
, nonCanceler
, effectCanceler
, fiberCanceler
, module Exports
) where

Expand Down Expand Up @@ -206,6 +207,10 @@ nonCanceler = Canceler (const (pure unit))
effectCanceler Effect Unit Canceler
effectCanceler = Canceler <<< const <<< liftEffect

-- | A canceler from a Fiber.
fiberCanceler a. Fiber a Canceler
fiberCanceler = Canceler <<< flip killFiber

-- | Forks an `Aff` from an `Effect` context, returning the `Fiber`.
launchAff a. Aff a Effect (Fiber a)
launchAff aff = do
Expand Down

0 comments on commit 202a3ea

Please sign in to comment.