[GHC] #7873: A poly-kinded newtype existential crisis

GHC cvs-ghc at haskell.org
Wed May 1 03:32:39 CEST 2013


#7873: A poly-kinded newtype existential crisis
--------------------------------------+-------------------------------------
Reporter:  ekmett                     |          Owner:                  
    Type:  bug                        |         Status:  new             
Priority:  normal                     |      Component:  Compiler        
 Version:  7.6.3                      |       Keywords:                  
      Os:  Unknown/Multiple           |   Architecture:  Unknown/Multiple
 Failure:  GHC rejects valid program  |      Blockedby:                  
Blocking:                             |        Related:                  
--------------------------------------+-------------------------------------

Comment(by goldfire):

 I agree with kosmikus. With {{{PolyKinds}}}, {{{Magic}}} is indeed
 existential. Here is the version with explicit kinds (which isn't valid
 Haskell):

 {{{
 newtype Magic = forall (k :: BOX). Magic (forall (p :: k -> *) (a :: k). p
 a -> Int)
 }}}

 However, there is a happy workaround. GHC scopes the kind variable {{{k}}}
 appropriately when the annotation is explicit. The following compiles:

 {{{
 newtype Magic = Magic (forall (p :: k -> *) (a :: k). p a -> Int)
 }}}

 This is slightly strange behavior, but I don't see an easy fix short of
 allowing explicit kind quantification. (Of course, I would love to have
 explicit kind quantification, but that's a story for another time.)

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



More information about the ghc-tickets mailing list