Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove module declaration from buttons example #834

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

j-maas
Copy link
Contributor

@j-maas j-maas commented Jan 16, 2020

All other examples omit the module declaration. The buttons example is the only one with such a line.

I suggested Elm to some friends, and one asked me what this line was doing since he had not yet been introduced to modules and thus this was new syntax for him. Therefore omitting this unnecessary line simplifies the example and is in line with the reason behind the module declaration being optional:

Note: If you forget to add a module declaration, Elm will use this one instead:

 module Main exposing (..)

This makes things easier for beginners working in just one file. They should not be confronted with the module system on their first day!

-- https://guide.elm-lang.org/webapps/modules.html

All other examples omit the module declaration. It can confuse newcomers, since they might look at the examples before having read about modules.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant