-
Notifications
You must be signed in to change notification settings - Fork 347
Indentation of non-parallel list comprehensions is wrong. #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
btw, if you follow the leading-comma Haskell convention for list-like structures, e.g. as in -- | Returns a list of all the cards in the universe; this will be a
-- set if the universe is well-formed.
allCards :: CardUniverse -> [CardValue]
allCards (CardUniverse s free) = free ++ suited
where suited = [cv | suit <- s
, (cv, _) <- elems (suitCards suit)
] does it work as espected? |
yes, that indentation looks reasonable to me in the leading-comma case. |
Ah, I have noticed this problem all the time, but just kept pushing it to the back of my mind. It would be nice to fix it. |
@pheaver btw there's a related problem occurring even when using the leading-comma convention: when using |
Gonna close in one month unless someone owns this. |
As Chris mentioned back in 2013, he was going to close this in a month. I confirmed hi2-mode still has this same behavior but the recommended indentation works correctly as this: allCards :: CardUniverse -> [CardValue]
allCards (CardUniverse s free) = free ++ suited
where suited = [ cv | suit <- s
, (cv, _) <- elems (suitCards suit)
] |
forwarding http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=343248
Daniel Burrows writes:
haskell-mode indents parallel list comprehensions (the GHC extension)
just fine, but it seems to have trouble with non-parallel ones. For
instance, consider this code fragment:
haskell-mode wants me to indent the last line to either the level of
"s" or the level of "cv" in the previous line; for instance:
I verified that this behaviour still exists with 2.8.0 and
turn-on-haskell-indentation
The text was updated successfully, but these errors were encountered: