
#10708: Rejection of constant functions defined using conditional pattern matching -------------------------------------+------------------------------------- Reporter: HubertGaravel | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 Resolution: invalid | Keywords: Operating System: Linux | Architecture: x86 Type of failure: GHC rejects | Test Case: valid program | Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => closed * resolution: => invalid Comment: I believe you mean the code to say this: {{{ data Nat = D0 | Succ Nat deriving (Show, Eq, Ord) d1 :: Nat d2 :: Nat d3 :: Nat d1 = (Succ D0) d2 | D0 == D0 = D0 d3 | D0 /= D0 = D0 | (Succ D0) == D0 = D0 | (Succ D0) /= D0 = (Succ D0) main = do print d1 print d2 print d3 }}} The name of a defined symbol is not repeated in the different branches. Thanks for reporting, however! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10708#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler