File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,13 @@ module Control.Monad.Aff
9090 later' :: forall e a. Number -> Aff e a -> Aff e a
9191 later' n aff = runFn3 _setTimeout nonCanceler n aff
9292
93+ -- | Compute `aff1`, followed by `aff2` regardless of whether `aff1` terminated successfully.
94+ finally :: forall e a b. Aff e a -> Aff e b -> Aff e a
95+ finally aff1 aff2 = do
96+ x <- attempt aff1
97+ aff2
98+ either throwError pure x
99+
93100 -- | Forks the specified asynchronous computation so subsequent computations
94101 -- | will not block on the result of the computation.
95102 -- |
@@ -106,13 +113,6 @@ module Control.Monad.Aff
106113 apathize :: forall e a. Aff e a -> Aff e Unit
107114 apathize a = const unit <$> attempt a
108115
109- -- | Compute `aff1`, followed by `aff2` regardless of whether `aff1` terminated successfully.
110- finally :: forall e a b. Aff e a -> Aff e b -> Aff e a
111- finally aff1 aff2 = do
112- x <- attempt aff1
113- aff2
114- either throwError pure x
115-
116116 -- | Lifts a synchronous computation and makes explicit any failure from exceptions.
117117 liftEff' :: forall e a. Eff (err :: Exception | e ) a -> Aff e (Either Error a )
118118 liftEff' eff = attempt (_unsafeInterleaveAff (runFn2 _liftEff nonCanceler eff))
You can’t perform that action at this time.
0 commit comments