1- module Control.Monad.Aff
1+ module Control.Monad.Aff
22 ( Aff ()
33 , Canceler (..)
44 , PureAff (..)
@@ -12,10 +12,11 @@ module Control.Monad.Aff
1212 , launchAff
1313 , liftEff'
1414 , makeAff
15+ , makeAff'
1516 , nonCanceler
1617 , runAff
1718 )
18- where
19+ where
1920
2021 import Data.Either (Either (..), either )
2122 import Data.Function (Fn2 (), Fn3 (), runFn2 , runFn3 )
@@ -31,7 +32,7 @@ module Control.Monad.Aff
3132 import Control.Monad.Eff.Class
3233 import Control.Monad.Error.Class (MonadError , throwError )
3334
34- -- | A computation with effects `e`. The computation either errors or
35+ -- | A computation with effects `e`. The computation either errors or
3536 -- | produces a value of type `a`.
3637 -- |
3738 -- | This is moral equivalent of `ErrorT (ContT Unit (Eff e)) a`.
@@ -54,24 +55,24 @@ module Control.Monad.Aff
5455 cancelWith :: forall e a. Aff e a -> Canceler e -> Aff e a
5556 cancelWith aff c = runFn3 _cancelWith nonCanceler aff c
5657
57- -- | Converts the asynchronous computation into a synchronous one. All values
58+ -- | Converts the asynchronous computation into a synchronous one. All values
5859 -- | and errors are ignored.
5960 launchAff :: forall e a. Aff e a -> Eff e Unit
6061 launchAff = runAff (const (pure unit)) (const (pure unit))
6162
62- -- | Runs the asynchronous computation. You must supply an error callback and a
63+ -- | Runs the asynchronous computation. You must supply an error callback and a
6364 -- | success callback.
6465 runAff :: forall e a. (Error -> Eff e Unit ) -> (a -> Eff e Unit ) -> Aff e a -> Eff e Unit
6566 runAff ex f aff = runFn3 _runAff ex f aff
6667
67- -- | Creates an asynchronous effect from a function that accepts error and
68+ -- | Creates an asynchronous effect from a function that accepts error and
6869 -- | success callbacks. This function can be used for asynchronous computations
6970 -- | that cannot be canceled.
7071 makeAff :: forall e a. ((Error -> Eff e Unit) -> (a -> Eff e Unit) -> Eff e Unit ) -> Aff e a
7172 makeAff h = makeAff' (\e a -> const nonCanceler <$> h e a )
7273
73- -- | Creates an asynchronous effect from a function that accepts error and
74- -- | success callbacks, and returns a canceler for the computation. This
74+ -- | Creates an asynchronous effect from a function that accepts error and
75+ -- | success callbacks, and returns a canceler for the computation. This
7576 -- | function can be used for asynchronous computations that can be canceled.
7677 makeAff' :: forall e a. ((Error -> Eff e Unit) -> (a -> Eff e Unit) -> Eff e (Canceler e)) -> Aff e a
7778 makeAff' h = _makeAff h
@@ -84,7 +85,7 @@ module Control.Monad.Aff
8485 later' :: forall e a. Number -> Aff e a -> Aff e a
8586 later' n aff = runFn3 _setTimeout nonCanceler n aff
8687
87- -- | Forks the specified asynchronous computation so subsequent monadic binds
88+ -- | Forks the specified asynchronous computation so subsequent monadic binds
8889 -- | will not block on the result of the computation.
8990 forkAff :: forall e a. Aff e a -> Aff e (Canceler e )
9091 forkAff aff = runFn2 _forkAff nonCanceler aff
@@ -128,7 +129,7 @@ module Control.Monad.Aff
128129 instance monadEffAff :: MonadEff e (Aff e ) where
129130 liftEff eff = runFn2 _liftEff nonCanceler eff
130131
131- -- | Allows users to catch and throw errors on the error channel of the
132+ -- | Allows users to catch and throw errors on the error channel of the
132133 -- | asynchronous computation. See documentation in `purescript-transformers`.
133134 instance monadErrorAff :: MonadError Error (Aff e ) where
134135 throwError e = runFn2 _throwError nonCanceler e
@@ -278,7 +279,7 @@ module Control.Monad.Aff
278279 } catch (e) {
279280 error(e);
280281 }
281-
282+
282283 return canceler;
283284 }
284285 }" " " :: forall e a. Fn2 (Canceler e ) a (Aff e a )
@@ -287,7 +288,7 @@ module Control.Monad.Aff
287288 function _throwError(canceler, e) {
288289 return function(success, error) {
289290 error(e);
290-
291+
291292 return canceler;
292293 }
293294 }" " " :: forall e a. Fn2 (Canceler e ) Error (Aff e a )
@@ -309,15 +310,15 @@ module Control.Monad.Aff
309310 function _bind(aff, f) {
310311 return function(success, error) {
311312 var canceler;
312-
313+
313314 canceler = aff(function(v) {
314- try {
315+ try {
315316 canceler = f(v)(success, error);
316317 } catch (e) {
317318 error(e);
318319 }
319320 }, error);
320-
321+
321322 return function(e) {
322323 return function(success, error) {
323324 return canceler(e)(success, error);
@@ -368,7 +369,7 @@ module Control.Monad.Aff
368369 } catch (e) {
369370 error(e);
370371 }
371-
372+
372373 return canceler;
373374 };
374375 }" " " :: forall e a. Fn2 (Canceler e ) (Eff e a ) (Aff e a )
0 commit comments