elm-lang/elm-platform

multiple lines via backslash

Spenhouet opened this issue · 2 comments

I'm new to elm and therefor reading the elm introduction.

In the section < Core Language - If Expressions > there is this example:

over9000 powerLevel = \
|   if powerLevel > 9000 then "It's over 9000!!!" else "meh"

And the following description:

Using a backslash in the REPL lets us split things on to multiple lines.

I did try that but only got the following error:

-- SYNTAX PROBLEM -------------------------------------------- repl-temp-000.elm

The = operator is reserved for defining variables. Maybe you want == instead? Or
maybe you are defining a variable, but there is whitespace before it?

3|   over9000 powerLevel = \
                         ^
Maybe <http://elm-lang.org/docs/syntax> can help you figure it out.

I'm getting the same error in your REPL online.

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

I think this question is better for http://elmlang.herokuapp.com/ or https://groups.google.com/forum/#!forum/elm-discuss. Maybe you have spaces before the definition, but I'd need more information to know. The folks on Slack and the mailing list are friendly and happy to help out. They can get you going, and if there's something wrong, they can help make an issue on the elm-repl repo