Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Invalid recursive values should be a compiler error, not a runtime exception #873
Right now, Elm will not yell at you for writing invalid recursive values like
Right now, invalid code like this leads to a runtime exception. In some ways that is better than infinite looping forever, and these exceptions happen very reliably. It is not conditional on anything, you just need to evaluate the code. So it's not awful, but it is also something that beginners run into a decent amount.
Only permit recursion when there is at least one lambda between the definition and the usage. So