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
90
90
later' :: forall e a. Number -> Aff e a -> Aff e a
91
91
later' n aff = runFn3 _setTimeout nonCanceler n aff
92
92
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
+
93
100
-- | Forks the specified asynchronous computation so subsequent computations
94
101
-- | will not block on the result of the computation.
95
102
-- |
@@ -106,13 +113,6 @@ module Control.Monad.Aff
106
113
apathize :: forall e a. Aff e a -> Aff e Unit
107
114
apathize a = const unit <$> attempt a
108
115
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
-
116
116
-- | Lifts a synchronous computation and makes explicit any failure from exceptions.
117
117
liftEff' :: forall e a. Eff (err :: Exception | e ) a -> Aff e (Either Error a )
118
118
liftEff' eff = attempt (_unsafeInterleaveAff (runFn2 _liftEff nonCanceler eff))
You can’t perform that action at this time.
0 commit comments