You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
]
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: