stdlib
stdlib copied to clipboard
Iterator try_fold will exceed call stack size in javascript target
Running the following on the Gleam language tour results in 'too much recursion' error
`import gleam/iterator
pub fn main() { iterator.range(1,6000) |> iterator.try_fold(0, fn(acc, i) { Ok(acc+i) }) } `
Changing to use list.range and list.try_fold works, presumably because list.try_fold is tail recursive unlike iterator.try_fold