[GHC] #8560: undeducable Typeable error with data kinds when deriving Data for GADT in GHC version 7.7.20131122

GHC ghc-devs at haskell.org
Tue Nov 18 02:47:18 UTC 2014


#8560: undeducable Typeable error with data kinds when deriving Data for GADT in
GHC version 7.7.20131122
-------------------------------------+-------------------------------------
              Reporter:  carter      |            Owner:
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:
             Component:  Compiler    |          Version:  7.7
  (Type checker)                     |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
Changes (by thomie):

 * component:  Compiler => Compiler (Type checker)


Comment:

 With HEAD the error is now:
 {{{
 $ ghc-7.9.20141115 test.hs
 ...
     Could not deduce (Data a) arising from a use of ‘k’
     from the context (Typeable (Shape n a))
       bound by the instance declaration at test.hs:33:1-34
     or from (n ~ 'S r)
       bound by a pattern with constructor
                  :* :: forall a (r :: Nat). a -> Shape r a -> Shape ('S r)
 a,
                in an equation for ‘gfoldl’
       at test.hs:33:1-34
     Possible fix:
       add (Data a) to the context of
         the data constructor ‘:*’
         or the type signature for
              gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
                        -> (forall g. g -> c g) -> Shape n a -> c (Shape n
 a)
         or the instance declaration
 ...
 }}}

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


More information about the ghc-tickets mailing list