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

Make sure infix operator application properly indents righthand multiline expressions #18

Closed
avh4 opened this issue Oct 20, 2015 · 3 comments
Assignees

Comments

@avh4
Copy link
Owner

avh4 commented Oct 20, 2015

The following is incorrect: Nothing is indented too far.

        div [ id "page" ]
            <| case model.currentDoc of
                   Nothing ->
                       []

Also, what happens if the infix operator is more or less than 2 characters?

@rtfeldman
Copy link

What I'd done in the past is to put <| on the previous line to indicate "I want to continue this on the next line", like how \ is used in multiline strings in some languages:

div [ id "page" ] <|
    case model.currentDoc of
        Nothing ->
            []

However, we pretty clearly want the opposite rule for other operators (especially |>) - which is to say that the operator always begins the line. Tough one...

@rtfeldman
Copy link

Actually #10 (comment) has a working answer for this too: when faced with multiline, just put the operator on its own line.

div [ id "page" ]
    <|
    case model.currentDoc of
        Nothing ->
            []

Not the most beautiful, but plenty readable!

@avh4
Copy link
Owner Author

avh4 commented Oct 28, 2015

Fixed for now in 782635f. More thorough opinions are still welcome (please open a new issue).

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

2 participants