Skip to content

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

@badlydrawnrob

Description

@badlydrawnrob

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions