Closed pendletong closed 3 weeks ago
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
This seems to be fixed
Thank you
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