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

No -- comments above module: isn't so clear for a beginner? #359

Open
badlydrawnrob opened this issue Jan 7, 2024 · 0 comments
Open

No -- comments above module: isn't so clear for a beginner? #359

badlydrawnrob opened this issue Jan 7, 2024 · 0 comments

Comments

@badlydrawnrob
Copy link

It took me a while to find out why this error message was complaining, working my way through Elm In Action:

-- RESERVED WORD  /elm-in-action/02/src/PhotoGroove.elm

I was not expecting to run into the `module` keyword here:

21| module PhotoGroove exposing (main)
    ^^^^^^
It is a reserved word. Try changing the name to something else?

Also took me a while to find this thread comment on no comments allowed above the module statement:

{-| Beginning our Elm app:
    Photo Groove!
-}

-- #1
module PhotoGroove exposing (main)

I don't think Python or Racket lang have this restriction and it may not be clear enough for complete beginners that it isn't allowed. I'm used to doing this in HTML/CSS also!

So please make the error message more helpful, and introduce documenting guidelines in the Elm guide on modules etc, I couldn't find this document easily:

The module documentation comes after the module declaration, but before the imports. This is so the first thing in the file is the module name and the second is how to use it.

Perhaps that could be worded a little better? `"comments must be written after the module declaration" or something.

Thanks.

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

No branches or pull requests

1 participant