[GHC] #7783: MultiWayIf should start a new layout

GHC cvs-ghc at haskell.org
Thu Mar 21 15:55:31 CET 2013


#7783: MultiWayIf should start a new layout
-----------------------------+----------------------------------------------
Reporter:  exbb2             |          Owner:                  
    Type:  bug               |         Status:  new             
Priority:  normal            |      Component:  Compiler        
 Version:  7.6.2             |       Keywords:                  
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
 Failure:  None/Unknown      |      Blockedby:                  
Blocking:                    |        Related:  #4359           
-----------------------------+----------------------------------------------
 Currently, MultiWayIf doesn't fully replace old {{{case () of _}}} form.
 This outputs 3:

 {{{
 {-# LANGUAGE MultiWayIf #-}
 x = case () of
     _ | False -> case () of
                 _ | False -> 1
                   | False -> 2
       | True -> 3

 main = print (x :: Int)
 }}}

 but this errors out:

 {{{
 {-# LANGUAGE MultiWayIf #-}
 x = if | False -> if | False -> 1
                      | False -> 2
        | True -> 3

 main = print (x :: Int)
 }}}

 Every other syntax introducing guards starts a layout; MultiWayIf's
 current behavior leads to subtle logic bugs for those unaware that
 MultiWayIf is special.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7783>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list