#5852: methods and associated types treated differently wrt. qualification
------------------------------+---------------------------------------------
 Reporter:  jeltsch           |          Owner:                                 
     Type:  feature request   |         Status:  new                            
 Priority:  normal            |      Component:  Compiler                       
  Version:  7.0.4             |       Keywords:  type families, qualified import
       Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple               
  Failure:  Other             |       Testcase:                                 
Blockedby:                    |       Blocking:                                 
  Related:                    |  
------------------------------+---------------------------------------------
 Say I have the following module:
 {{{
 {-# LANGUAGE TypeFamilies #-}
 module M where

     class C a where

         type T a :: *

         m :: a
 }}}
 Now I use this module in another module via a qualified import:
 {{{
 {-# LANGUAGE TypeFamilies #-}
 module U where

     import qualified M

     instance M.C Integer where

         type M.T Integer = Integer

         m = 0
 }}}
 Note that in the instance declaration, the associated type {{{T}}} is
 qualified, while the method {{{m}}} is not. Removing the qualification of
 {{{T}}} is not accepted by GHC, but neither is adding a qualification to
 {{{m}}}. I think this inconsistency is unfortunate, so that it might be
 good to remove it.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to