> For example, when writing an Elm program I might at some point decide that users should have an admin flag. I will then try to use that flag in a function at which point the compiler will tell me that I have failed to add it to the User model. I will add it to the model at which point the compiler will tell me that I have failed to account for it in my main update function.<p>This beautifully explains why types are so useful. I don't know if the number of bugs goes down, but it sure is useful to have an assistant check <i>all</i> the implications of a change I want to make, and does that in a second.
It's refreshing to see a piece written by someone who's new to functional programming, discovering the beauty of types and pure functions for the first time.<p>I very much agree with the author; learning functional programming idioms have had a profound impact on my ability to model problems in code, regardless of the language I'm using.<p>I admire Elm so much for putting an emphasis on the user experience, recognizing that it has been one of the biggest blockers to making functional programming mainstream.
At first glance, Elm's type system looks like it borrows heavily from Haskell [0]. Learning Haskell's type system is a great mental exercise, even if you don't even up coding in the language.<p>[0] Basics: <a href="http://learnyouahaskell.com/types-and-typeclasses" rel="nofollow">http://learnyouahaskell.com/types-and-typeclasses</a>
> Elm was my introduction to using a static, strong type system.<p>I think I am now officially feeling old. A language I never heard of is the introduction to programmers to static typing??
> A big gotcha for me was understanding the -> syntax. How can a function that accepts two arguments possibly have a type annotation like this?<p><pre><code> connectWords : String -> String -> String
</code></pre>
This is one of the most maddening things for me about Haskell-like languages. I can never remember if -> is left or right associative. I mean there is only one way that makes sense:<p><pre><code> # String -> (String -> String)
</code></pre>
But it could also be<p><pre><code> # (String -> String) -> String
</code></pre>
Of course you get used to it after a while, but a nagging feeling remains. I would really prefer a bit of syntactic sugar.
Any suggestions on where to start with Elm?<p>Learn You an Elm examples don't compile on the try-it-live console.<p>Official examples do, but fail to compile on a local install (after setting up elm package install etc).<p>Any suggestions on where to start troubleshooting?<p>It's failing to find modules that are in the core standard lib.
the elm debugger seems also impressive<p><a href="http://debug.elm-lang.org/" rel="nofollow">http://debug.elm-lang.org/</a>