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.


<https://lh3.googleusercontent.com/-5ANRPGNOLGc/WP2v_3hYCOI/AAAAAAAAAYc/Bpc749stJ-sUj1DCUj6cYxN9T07YYn4cgCLcB/s1600/localhost_2017-04-24_13-19-42.png>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to