Are there line breaks in Elm?

105 views Asked by At

I'm calling a function in Elm and some of the variable names I'm passing as parameters are kind of long, so I'd rather not put it all on 1 line. But I'm having trouble figuring out how to do that.

Normally, from experience with other languages, I'd imagine it might look something like this:

result =
    Dict.foldr \
        dataTransformationFunction \
        0 \
        initialStateDict

That obviously didn't work though. I tried using |> and <|, but I couldnt get anything using those to compile (since 0 and the other parameters arent functions that takes arguments, I couldn't pipe).

Am I doing something wrong here, or is there no way to add a line break in Elm code?

1

There are 1 answers

2
ConfusedPerson On BEST ANSWER

Looks like I forgot to try the simplest option; you don't need a special character/operator to do a line break if none of your parameters require any (more) arguments.

This is perfectly legal:

result =
    Dict.foldr
        (myFunction)
        0
        initialStateDict