Skip to content
This repository was archived by the owner on Aug 4, 2023. It is now read-only.

Add promise flattening and lazy boxing #8

Merged

Conversation

robertdp
Copy link
Collaborator

@robertdp robertdp commented Dec 12, 2020

For #2 and #3

Short summary:

  • the FFI types become more polymorphic (and unsafe)
  • a new Flatten class models how promises automatically flatten
  • LazyPromise now has all values wrapped in a new Box container
  • added LazyPromise.new

@thomashoneyman thomashoneyman added the purs-0.14 A reminder to address this issue or merge this PR before we release PureScript v0.14.0 label Dec 12, 2020
@thomashoneyman
Copy link
Contributor

Thanks for taking this on, @robertdp! I'll have a little time to review this soon, though I would also appreciate a look from @natefaubion, who originally raised this issue.

@natefaubion
Copy link
Contributor

I think this looks really good. The only question I had was whether we need to export resolve from Web.Promise with a Flatten constraint.

@robertdp
Copy link
Collaborator Author

Ah yes, good catch. The changes to the FFI types make it too permissive to export as-is.

I'll push a fix shortly.

@thomashoneyman thomashoneyman merged commit 841c3c7 into purescript-deprecated:master Dec 16, 2020
@robertdp robertdp deleted the handle-flattening branch December 16, 2020 04:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
purs-0.14 A reminder to address this issue or merge this PR before we release PureScript v0.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants