Type inference and incorrect compiler message

Is Elm supposed to support coding without type annotations?

If yes, you can close this issue.

If no, you can remove line 29 here and then hit compile to see an interesting compiler message:

Yes. Elm has solid type inference capabilities.

The error you see if you remove line 29 has to do with the border of Elm. You have to have an explicit type for the program.

If you add a valid type signature for main (e.g. main : Program () Model Msg) you can leave out the type declaration on line 29. The type of init will be inferred.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.