Open gutjuri opened 4 years ago
Sounds related to #290, in that formatting things in do
notation is different that regular code. Here's what Brittany 0.12.1.1 outputs (using --output-on-errors
):
ERROR: brittany pretty printer returned syntactically invalid result.
wnums :: [Double] -> [Double]
wnums nums = do
a <- nums
b <- nums \\ [a]
c <- nums \\ [a, b]
d <- nums \\ [a, b, c]
o1 <- opts
o2 <- opts
o3 <- opts
[ (a `o1` b) `o2` (c `o3` d)
, ((a `o1` b) `o2` c) `o3` d
, a `o1` (b `o2` (c `o3` d))
, (a `o1` (b `o2` c)) `o3` d
, a `o1` ((b `o2` c) `o3` d)
]
As a workaround, you can pass the list to a function like id
. Or you can explicitly build the list using (:)
.
I have the following function:
This function compiles but when i run brittany on the source file then it errors out with
ERROR: brittany pretty printer returned syntactically invalid result.
Without this function the source file can be reformatted just fine.