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
1919import Promise.Rejection as Rejection
2020
2121-- | 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 )
2323fromAff aff = Promise .new (\succ err -> runAff_ (either (err <<< Rejection .fromError) succ) aff)
2424
2525coerce :: Promise.Rejection -> Error
Original file line number Diff line number Diff line change @@ -84,8 +84,8 @@ main = launchAff_ $ flip runReaderT "" do
8484 res <- Promise .toAffE $ Promise .fromAff $ pure 123
8585 assert " round-trip result for toAffE is 123" $ res == 123
8686 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
8989 shouldEqual " err123" $ either message (const " -" ) res
9090 where
9191 errorCodeCoerce v =
You can’t perform that action at this time.
0 commit comments