File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import Promise as Promise
19
19
import Promise.Rejection as Rejection
20
20
21
21
-- | Convert an Aff into a Promise.
22
- fromAff :: forall a . Promise.Flatten a a => Aff a -> Effect (Promise.Promise a )
22
+ fromAff :: forall a b . Promise.Flatten a b => Aff a -> Effect (Promise.Promise b )
23
23
fromAff aff = Promise .new (\succ err -> runAff_ (either (err <<< Rejection .fromError) succ) aff)
24
24
25
25
coerce :: Promise.Rejection -> Error
Original file line number Diff line number Diff line change @@ -84,8 +84,8 @@ main = launchAff_ $ flip runReaderT "" do
84
84
res <- Promise .toAffE $ Promise .fromAff $ pure 123
85
85
assert " round-trip result for toAffE is 123" $ res == 123
86
86
test " error" do
87
- promise <- liftEffect $ Promise .fromAff (throwError (error " err123" ))
88
- res <- attempt $ Promise .toAff ( promise :: Promise Unit )
87
+ promise <- liftEffect $ Promise .fromAff (throwError (error " err123" ) :: Aff Unit )
88
+ res <- attempt $ Promise .toAff promise
89
89
shouldEqual " err123" $ either message (const " -" ) res
90
90
where
91
91
errorCodeCoerce v =
You can’t perform that action at this time.
0 commit comments