[GHC] #7328: Seemingly inappropriate "expecting one more argument" error in polykinded class

GHC cvs-ghc at haskell.org
Sun Oct 14 15:20:58 CEST 2012


#7328: Seemingly inappropriate "expecting one more argument" error in polykinded
class
---------------------------------------+------------------------------------
 Reporter:  illissius                  |          Owner:                  
     Type:  bug                        |         Status:  new             
 Priority:  normal                     |      Component:  Compiler        
  Version:  7.6.1                      |       Keywords:                  
       Os:  Unknown/Multiple           |   Architecture:  Unknown/Multiple
  Failure:  GHC rejects valid program  |       Testcase:                  
Blockedby:                             |       Blocking:                  
  Related:                             |  
---------------------------------------+------------------------------------
 Triggered by the following code:

 {{{
 {-# LANGUAGE PolyKinds, GADTs #-}

 data Proxy a

 class Foo a where
     foo :: a ~ f i => Proxy (Foo f)
 }}}

 GHC writes:

 {{{
 test.hs:6:34:
     Expecting one more argument to `f'
     In the type `a ~ f i => Proxy (Foo f)'
     In the class declaration for `Foo'
 }}}

 It seems to me that given Foo :: forall k. k -> Constraint, Proxy ::
 forall k. k -> *, a :: k, f :: k1 -> k, that Foo in Proxy (Foo f) should
 be instantiated at k1 -> k, and Proxy at Constraint, and that this should
 work.

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



More information about the Glasgow-haskell-bugs mailing list