[GHC] #7224: Polymorphic kind annotations on type classes don't always work as expected

GHC cvs-ghc at haskell.org
Thu Sep 6 18:24:59 CEST 2012


#7224: Polymorphic kind annotations on type classes don't always work as expected
---------------------------------------+------------------------------------
 Reporter:  slindley                   |          Owner:                         
     Type:  bug                        |         Status:  new                    
 Priority:  normal                     |      Component:  Compiler (Type checker)
  Version:  7.6.1-rc1                  |       Keywords:  kind polymorphism      
       Os:  Unknown/Multiple           |   Architecture:  Unknown/Multiple       
  Failure:  GHC rejects valid program  |       Testcase:                         
Blockedby:                             |       Blocking:                         
  Related:                             |  
---------------------------------------+------------------------------------
 Consider the following code for defining Atkey-style parameterised monads:

 {{{
 {-# LANGUAGE
     PolyKinds
  #-}

 class PMonad m where
   ret  :: a -> m i i a
   bind :: m i j a -> (a -> m j k b) -> m i k b
 class PMonad' (m :: i -> i -> * -> *) where
   ret'  :: a -> m i i a
   bind' :: m i j a -> (a -> m j k b) -> m i k b
 }}}

 The following types are inferred for {{{ret}}} and {{{ret'}}}:

 {{{
 *Main> :t ret
 ret :: PMonad * m => a -> m i i a
 *Main> :t ret'
 ret' :: PMonad' m => a -> m BOX BOX a
 }}}

 But {{{ret'}}} should have the former type.

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



More information about the Glasgow-haskell-bugs mailing list