Skip to content

Commit 898cc1c

Browse files
committed
Relax Flatten constraint
1 parent 76d8055 commit 898cc1c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Control/Promise.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import Promise as Promise
1919
import 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)
2323
fromAff aff = Promise.new (\succ err -> runAff_ (either (err <<< Rejection.fromError) succ) aff)
2424

2525
coerce :: Promise.Rejection -> Error

test/Main.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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 =

0 commit comments

Comments
 (0)