Fp-ts: Stack Safety

Created on 13 Jul 2019  路  3Comments  路  Source: gcanti/fp-ts

馃摉 Documentation

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?

Most helpful comment

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.

All 3 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

steida picture steida  路  4Comments

mattgrande picture mattgrande  路  3Comments

steida picture steida  路  4Comments

josete89 picture josete89  路  3Comments

vicrac picture vicrac  路  4Comments