Discussion:
[elm-discuss] Error Messages can they be made more intuitive?
Jiggneshh Gohel
2017-04-24 08:10:11 UTC
Permalink
I have just started programming in elm-lang because of the positive
responses I noticed on Twitter and various channels.

One of the selling points I have noticed is the intuitive error messages
Elm compiler generates while parsing code. Inline with this I would like to
share my experience about this w.r.t the behavior I encountered while I am
trying to follow the tutorial at https://www.elm-tutorial.org/en/

Attached is the error message which was reported. At first glance I was
unable to figure out what was the issue because comparing the code I wrote
with the one shown in the tutorial was looking identical. Then I noticed
that in tutorial it is *MouseMsg Mouse.Position *and I typed

*MouseMsg Mouse.position (notice the small-case p in Position). *I then
checked the documentation
<http://package.elm-lang.org/packages/elm-lang/mouse/1.0.1/Mouse#Position>
and found that Position is a type-alias for a record. This made me think
that wouldn't it be great if in the list of items shown by

*I am looking for one of the following things: *

included *Position *because I was trying to access a type-alias defined in
the Mouse module*. *In other words if I am trying to access something part
of the library and I mistyped in my code then the error message should
consider that possibility too.

To convey my point I would like to use an analogy of Object-Oriented
Programming's Class, Properties and Methods concepts. In present case Class
is Mouse and Position can be considered as a Property or a Method or even a
Nested-Class too.

I really have no idea what it would take to get this behavior but wanted to
share my thoughts on this when I am seeing a lot of people being amazed by
the elm-compiler's generated intuitive errors.

Thanks.


<Loading Image...>
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Richard Feldman
2017-04-25 06:32:39 UTC
Permalink
This is perfect for the error message catalog
<https://github.com/elm-lang/error-message-catalog/issues> - if you have a
sec, would you mind reposting as an issue there?

Welcome to Elm! :D
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jiggneshh Gohel
2017-04-25 08:28:48 UTC
Permalink
Sure Richard. Please find it posted at
https://github.com/elm-lang/error-message-catalog/issues/216.

And Thanks for making me aware about the error-message-catalog
<https://github.com/elm-lang/error-message-catalog> repo.

Thanks.
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...