You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current Flatten implementation for lists (AFAIK) is not stack-safe. I've experienced stack issues flattening very large datasets -- where I had to write my own flatten method instead. I believe this is because it uses List.concat or @ under the hood, which is not safe, but struggle to read the Bs-Abstract/Belt code.
Methods like this should be rewritten to be safe. In the Scala standard library, this is often done using mutation-based implementations but if we can use tail recursive methods then that's good too!
On the back of this, it might be worth creating new methods for many list functions (e.g. concat) that are stack safe.
This might be fixed by #166 if that's the case, you can close this issue 😸
The text was updated successfully, but these errors were encountered:
This is a legit issue - there are a number of things that aren't stack safe in the library. MonadRec could potentially solve some of the higher-level things, but we'd be happy to accept one-off PRs that fix individual functions like flatten with more optimized or tail-recursive implementations.
We might be able to address some of these over time, but I've been busy with other things the past few months, so I haven't had a ton of time to dedicate to this.
The current Flatten implementation for lists (AFAIK) is not stack-safe. I've experienced stack issues flattening very large datasets -- where I had to write my own flatten method instead. I believe this is because it uses
List.concat
or@
under the hood, which is not safe, but struggle to read the Bs-Abstract/Belt code.Methods like this should be rewritten to be safe. In the Scala standard library, this is often done using mutation-based implementations but if we can use tail recursive methods then that's good too!
On the back of this, it might be worth creating new methods for many list functions (e.g. concat) that are stack safe.
This might be fixed by #166 if that's the case, you can close this issue 😸
The text was updated successfully, but these errors were encountered: