The real announcement of Elm 0.18 was getting a bit too long, so this page splits out some concrete examples that highlight the error message improvements.
x = x + 1
And the link at the end, points to this comprehensive explanation of what is going wrong. This is probably the most important bug fix in this release. As you can see in the meta issue, many people were tripped up by this!
type Msg = Increment | Decrement
type alias Model = { count : Int }
update : Msg -> Model -> Model
update msg model =
case msg of
Increment ->
{ model | count = model.count + 1 }
Decrement ->
{ model | count = model.countt - 1 }
This comes directly from issue #148 in the error message catalog. It was already best practice to add type annotations, but now there is a very concrete reward for doing it! More examples in the meta issue about this.
import String
fooBlah =
"foo" ++ String.join "blah"
This comes directly from issue #137 in the error message catalog.
This comes directly from issue #131 in the error message catalog.