|
|
|
|
|
by the_af
3670 days ago
|
|
Agreed, Elm in these two examples is way nicer! It doesn't add information, but it presents it in a beginner-friendly way, which is commendable. However, I'm left wondering... Elm seems to be using hardcoded knowledge about commonly used types such as strings and numbers in order to improve its error messages (I wonder why Haskell doesn't, by the way). What happens in Elm when an error occurs with more complex, user-defined types and operations? |
|
If you're interested, there were a couple more examples shown elsewhere in this thread:
http://elm-lang.org/blog/compiler-errors-for-humans (an older version it seems)
https://twitter.com/st58/status/732908457217531904
https://twitter.com/GregorySchier/status/732830868562182144
Something I've just found is that the errors can also be output in a nice machine readable format, so the suggested fixes can be read in by your editor plugin.
And finally, this is wonderful, a specific repo for code that causes error messages and a request for people to submit error messages that are confusing: https://github.com/elm-lang/error-message-catalog