[GHC] #14331: Overzealous free-floating kind check causes deriving clause to be rejected

GHC ghc-devs at haskell.org
Thu Jan 11 17:32:38 UTC 2018


#14331: Overzealous free-floating kind check causes deriving clause to be rejected
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       Component:  Compiler (Type    |              Version:  8.2.1
  checker)                           |
      Resolution:                    |             Keywords:  deriving
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  GHC rejects       |            Test Case:
  valid program                      |  deriving/should_compile/T14331
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 What do we think of

 {{{#!hs
 class Cat k (cat :: k -> k -> *) where
   catId   :: cat a a
   catComp :: cat b c -> cat a b -> cat a c

 instance Cat * (->) where
   catId   = id
   catComp = (.)

 newtype Fun1 a b = Fun1 (a -> b) deriving (Cat k)
 }}}

 This is currently accepted and in the testsuite as
 `deriving/should_compile/T11732c`. I think this should fail, because it
 requires unifying `k` with `Type`. There is useful commentary in #11732.

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


More information about the ghc-tickets mailing list