[GHC] #10807: PatternGuards and MultiWayIf layout rules

GHC ghc-devs at haskell.org
Sat Sep 10 15:39:35 UTC 2016


#10807: PatternGuards and MultiWayIf layout rules
-------------------------------------+-------------------------------------
        Reporter:  htebalaka         |                Owner:
            Type:  bug               |               Status:  new
        Priority:  lowest            |            Milestone:
       Component:  Compiler          |              Version:  7.10.2
  (Parser)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Documentation     |  Unknown/Multiple
  bug                                |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #7783             |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by osa1):

 I agree that this is a parser bug. For another example, in this program
 `f1` and `f3` work but `f2` fails:

 {{{#!haskell
 {-# LANGUAGE MultiWayIf #-}

 f1 x = case () of
          _ | even x
            , notZero x
            -> True
            | otherwise
            -> False

 f2 x = if | even x
            , notZero x
            -> True
           | otherwise
            -> False

 f3 x = if { | even x
             , notZero x
             -> True
           ; | otherwise
             -> False
           }

 notZero = (/=) 0
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10807#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list