[GHC] #12438: DeriveDataTypeable - deriving instance Data (Mu (Const ()))

GHC ghc-devs at haskell.org
Tue Jul 26 14:56:43 UTC 2016


#12438: DeriveDataTypeable - deriving instance Data (Mu (Const ()))
-------------------------------------+-------------------------------------
           Reporter:  lspitzner      |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 {{{#!hs
 {-# LANGUAGE DeriveDataTypeable, StandaloneDeriving, PolyKinds #-}
 import qualified Data.Data

 data Mu f = Mu (f (Mu f))
 deriving instance Data.Data.Data (Mu (Const ()))
 }}}

 produces

 {{{
     • No instance for (Data (Const () (Mu (Const ()))))
         arising from a use of ‘k’
     • In the expression: (z Mu `k` a1)
       In an equation for ‘gfoldl’: gfoldl k z (Mu a1) = (z Mu `k` a1)
       When typechecking the code for ‘gfoldl’
         in a derived instance for ‘Data (Mu (Const ()))’:
         To see the code I am typechecking, use -ddump-deriv
       In the instance declaration for ‘Data (Mu (Const ()))’
 }}}

 while other type constructors work, e.g.

 {{{#!hs
 deriving instance Data.Data.Data (Mu [])
 deriving instance Data.Data.Data (Mu ((,) ()))
 }}}

 i am not sure if #10835 is related.

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


More information about the ghc-tickets mailing list