elm / error-message-catalog

A catalog of broken Elm programs / data to improve error messages
BSD 3-Clause "New" or "Revised" License
173 stars 17 forks source link

better guidance for stack overflows #353

Open dandrake opened 2 years ago

dandrake commented 2 years ago

This is from https://discourse.elm-lang.org/t/avoiding-rangeerror-maximum-call-stack-size-exceeded/8023: I wrote a program with a recursive function that seemed like it ought to be tail-recursive, but it wasn't, and when running it, I would get RangeError: Maximum call stack size exceeded -- or, sometimes in the browser, simply nothing would happen (this was in Firefox, compiled with elm 0.19).

See the above discussion for details. As a newbie Elm user, it would be nice to get an error message that mentioned excessive recursion, tail recursion, and so on. I do understand the connection between the call stack and recursive functions, but being a little more explicit about the connection would have led me to a solution/workaround faster.