Ticket #23 (new defect)

Opened 4 years ago

Case statement, pattern guard, comma indentation

Reported by: heatsink Owned by: Baughn
Priority: major Component: haskell-indentation
Version: Keywords: pattern guard, case, comma
Cc:

Description

Commas in pattern guards inside case statements produce parse errors that prevent indentation. On the other hand, commas in pattern guards on function definitions don't cause the error. Using version 2.8.0.

-- Parse error after comma
foo maybex maybey =
  case maybex
  of Just x
       | Just y <- maybey,
         y > 0 ->
           x + y

-- No error after comma
foo x maybey
  | Just y <- maybey,
    y > 0 =
      x + y
Note: See TracTickets for help on using tickets.