[GHC] #8865: Cannot derive well-kinded instance of form ‘Category

GHC ghc-devs at haskell.org
Sun Mar 9 08:50:00 UTC 2014


#8865: Cannot derive well-kinded instance of form ‘Category
----------------------------+----------------------------------------------
       Reporter:            |             Owner:
  adinapoli                 |            Status:  new
           Type:  bug       |         Milestone:  7.8.1
       Priority:  normal    |           Version:  7.8.1-rc2
      Component:  Compiler  |  Operating System:  MacOS X
       Keywords:            |   Type of failure:  GHC rejects valid program
   Architecture:  x86_64    |         Test Case:
  (amd64)                   |          Blocking:
     Difficulty:  Unknown   |
     Blocked By:            |
Related Tickets:            |
----------------------------+----------------------------------------------
 Hello everyone,
 sorry if this was already reported somewhere.

 I'm playing with GHC 7.8.1 RC2 and I'm updating hsenv to support GHC 7.8.
 This is a real code snippet, which was compiling fine in GHC 7.6.x


 {{{
 newtype ArgArrow a b = ArgArrow (StaticArrowT KnownArgs (Kleisli (ReaderT
 Args IO)) a b)
     deriving (Category, Arrow, ArrowChoice)
 }}}

 but that yields the following in GHC 7.8.1-RC2

 {{{
  Cannot derive well-kinded instance of form ‘Category (ArgArrow ...)’
       Class ‘Category’ expects an argument of kind ‘k -> k -> *’
     In the newtype declaration for ‘ArgArrow’
 }}}

 This might be related to the new feature of GHC 7.8, namely "kind
 variables" (you get the idea, even if the name is not 100% accurate). To
 make the code compile I had to enable {{{ StandaloneDeriving }}} and write
 the following:

 {{{
 newtype ArgArrow a b = ArgArrow (StaticArrowT KnownArgs (Kleisli (ReaderT
 Args IO)) a b)
     deriving (Arrow, ArrowChoice)

 deriving instance Category ArgArrow
 }}}

 Is this by design or is a genuine bug? Thanks!

 Alfredo

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


More information about the ghc-tickets mailing list