Skip to content

Indentation of non-parallel list comprehensions is wrong. #14

Closed
@bremner

Description

@bremner

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:

allCards :: CardUniverse -> [CardValue]
allCards (CardUniverse s free) = free ++ suited
    where suited = [cv | suit <- s,
                         (cv, _) <- elems (suitCards suit)]

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:

-- | 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)]

I verified that this behaviour still exists with 2.8.0 and turn-on-haskell-indentation

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions