Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

["Bug"] Free foldMap is not stack safe #635

Open
ferranpujolcamins opened this issue Oct 19, 2020 · 2 comments
Open

["Bug"] Free foldMap is not stack safe #635

ferranpujolcamins opened this issue Oct 19, 2020 · 2 comments

Comments

@ferranpujolcamins
Copy link
Contributor

ferranpujolcamins commented Oct 19, 2020

Description

The foldMap is stack safe test found in Arrow's Free is not present in Bow. Furthermore, the test fails if added.

I believe this is caused because the new Free implementation lacks the special flatMap case found in the old one.
A possible solution is to try to generalize the trampoline implementation of #636 as shown in the paper linked below. Then we can make Trampoline<A> = Free<ForFunction0, A> like in Arrow.

Expected outcome

foldMap is stack safe

Observed outcome

foldMap is not stack safe

Code to reproduce the Bug

saferFree branch in my fork.

Bow modules, version, platform

Bow module, master branch.

Tooling

  • Xcode version:
  • Installation method: Carthage / Cocoapods / Swift Package Manager

Other

Some explanation of the issue and possible solution can be found in this paper

@truizlop
Copy link
Member

Is this fixed now? I don't remember if you already addressed it.

@ferranpujolcamins
Copy link
Contributor Author

No, it's not fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants