OK, so here's a weird one.
This works perfectly:
test = do
x <- [1..5]
y <- [1..5]
[x+y, x-y]
But this:
test = do
x <- [1..5]
y <- [1..5]
[
x+y,
x-y
]
fails miserably. GHC utterly refuses to parse this. No matter how I fidget with it, I can't seem to convince GHC to allow me to spread the list across multiple lines. Which is a problem, because if you replace x+y
and x-y
with really big expressions, it quickly becomes hard to read...
Does anybody know why isn't this working, and how can I force it to work? (Or at least do something that looks legible?)