
#12950: unnecessarily complicated left-hand side causing RULE left-hand side too complicated to desugar -------------------------------------+------------------------------------- Reporter: nfrisby | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 (Type checker) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Incorrect Unknown/Multiple | error/warning at compile-time Test Case: | Blocked By: Blocking: | Related Tickets: #10555,#12074 Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- GHC 7.10.2 rejects the `SPECIALIZE` pragma in the following snippet with "RULE left-hand side too complicated to desugar". {{{#!hs class C a where type TF a; m :: a -> TF a instance C Int where type TF Int = String; m = show overloaded :: C a => a -> (a,TF a) {-# INLINABLE overloaded #-} overloaded a = (a,m a) {-# SPECIALIZE overloaded :: Int -> (Int,TF Int) #-} }}} This use case is so simple/basic/prevalent that it seems inappropriate to reject it. The actual message is {{{ RULE left-hand side too complicated to desugar Optimised lhs: case cobox_awc of _ [Occ=Dead] { GHC.Types.Eq# cobox -> overloaded @ Int $dC_awb } Orig lhs: case cobox_awc of cobox_awc { GHC.Types.Eq# cobox -> overloaded @ Int $dC_awb } }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12950 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler