ormolu icon indicating copy to clipboard operation
ormolu copied to clipboard

Multiline associative operator usage looks strange

Open tysonzero opened this issue 2 years ago • 2 comments

For example parsers:

parser = Foo <$> foo
     <|> Bar <$> baz <*> baz
     <|> Qux <$> tux

parser =
    Foo <$> foo
        <|> Bar <$> bar <*> baz
        <|> Qux <$> qux

Also chained lens updates

update = foo .~ 5
     >>> bar ?~ "new"
     >>> baz %~ (+ 1)

update =
    foo .~ 5
        >>> bar ?~ "new"
        >>> baz %~ (+ 1)

An option to be able keep the former would be fantastic.

Would fix https://github.com/fourmolu/fourmolu/issues/168 once downstreamed.

tysonzero avatar Apr 18 '22 20:04 tysonzero

Why is it strange?

mrkkrp avatar Apr 19 '22 19:04 mrkkrp

I don't see how it could be considered reasonable...

Why should the first field modification be singled out and out of line with all the other field modifications? Likewise for parser options.

tysonzero avatar Apr 19 '22 23:04 tysonzero