I'm trying to find more information about stack safety and fp-ts. It would be helpful if a section appeared in the documentation somewhere. In particular I'd like to find whether there is a trampolining implementation in the library?
I'm looking exactly for the same content right now... My specific case is about sequence/traverse.
I'm trying to convert Array<IO<Result>> to IO<Array<Result>> but if the array is too big I get a stack overflow error (on nodejs).
I had this problem too some time ago and I "solved" it just by chunking the array. IO right now is not stack safe and there is no trampolining implementation.
This might help someone.
I discovered a functional style trampolining type class someone had written. It's not with fp-ts but it uses functional programming principles.
https://gist.github.com/tusharmath/f1eaa6e0bdb3cc2c37835497a85c0b60
Most helpful comment
I had this problem too some time ago and I "solved" it just by chunking the array.
IOright now is not stack safe and there is no trampolining implementation.