The official style guide is located on the homepage and generally goes for:
This means that, for example, this:
homeDirectory : String
homeDirectory =
"/root/files"
evaluate : Boolean -> Bool
evaluate boolean =
case boolean of
Literal bool ->
bool
Not b ->
not (evaluate b)
And b b' ->
evaluate b && evaluate b'
Or b b' ->
evaluate b || evaluate b'
is considered better than:
homeDirectory = "/root/files"
eval boolean = case boolean of
Literal bool -> bool
Not b -> not (eval b)
And b b' -> eval b && eval b'
Or b b' -> eval b || eval b'
The tool elm-format helps by formatting your source code for you automatically (typically on save), in a similar vein to Go language's gofmt. Again, the underlying value is having one consistent style and saving arguments and flamewars about various issues like tabs vs. spaces or indentation length.
You can install elm-format
following the instructions on the Github repo. Then configure your editor to format the Elm files automatically or run elm-format FILE_OR_DIR --yes
manually.