Opened 7 years ago

Closed 5 years ago

#7269 closed bug (fixed)

GeneralizedNewtypeDeriving and PolyKinds

Reported by: dreixel Owned by: dreixel
Priority: normal Milestone: 7.8.3
Component: Compiler Version: 7.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: deriving/should_compile/T7269
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


The following code

{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}

class C (a :: k)

instance C Int

newtype MyInt = MyInt Int deriving C

fails with this error:

    Cannot derive well-kinded instance of form `C k (MyInt ...)'
      Class `C' expects an argument of kind `k'
    In the newtype declaration for `MyInt'

I believe this should work, and I think I know what's going on. I'm working on it.

Change History (7)

comment:1 Changed 6 years ago by igloo

difficulty: Unknown
Milestone: 7.8.1

comment:2 Changed 5 years ago by thoughtpolice


Moving to 7.10.1

comment:3 Changed 5 years ago by Simon Peyton Jones <simonpj@…>

In b1436f55da2b0e005ac09be6651a2c4d934027ec/ghc:

Fix yet another bug in 'deriving' for polykinded classes (Trac #7269)

This patch makes the code a bit simpler if anything.

comment:4 Changed 5 years ago by simonpj

Status: newmerge
Test Case: deriving/should_compile/T7269

Fixed at last.

comment:5 Changed 5 years ago by nomeata

Please add the test case:

<command line>: does not exist: T7269.hs

*** unexpected failure for T7269(normal)

comment:6 Changed 5 years ago by simonpj

Sorry, done

comment:7 Changed 5 years ago by thoughtpolice

Resolution: fixed
Status: mergeclosed

Merged into 7.8.3.

Note: See TracTickets for help on using tickets.