Cannot derive well-kinded instance of form ‘Category
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
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.8.1-rc2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |