Closed robx closed 3 years ago
EDIT This is incorrect.
With #728 (but still with --unsafe
),
{-# LANGUAGE Arrows #-}
bar f = proc (a, b) ->
do
x <- f a -< b
>-> (\y -> f b >- a)
is formatted into
{-# LANGUAGE Arrows #-}
bar f = proc (a, b) ->
do
x <- f a -< b
>->
(\y -> a -< f b)
which is better, but still not correct, as the first argument of >->
in the original snippet is proc (a, b) -> do x <- f a -< b
and not just do x <- f a -< b
.
I will look into this.
With #728 (but still with --unsafe
),
{-# LANGUAGE Arrows #-}
bar f = proc (a, b) ->
do
x <- f a -< b
>-> (\y -> f b >- a)
is formatted into
{-# LANGUAGE Arrows #-}
bar f = proc (a, b) ->
do
x <- f a -< b
>->
(\y -> a -< f b)
which has differing AST, but only due to f b >- a
vs. a -< f b
. So this is another instance of #737, closing as a duplicate.
Describe the bug
ormolu moves a leading operator in arrow do notation to the end of the previous line, breaking some code.
To Reproduce
Expected behavior
The code should be formatted to parseable code (with the same AST).
Environment
current master on macos
Additional context
+
as is in