[GHC] #7082: Default type family instances

GHC cvs-ghc at haskell.org
Wed Jul 18 01:49:09 CEST 2012


#7082: Default type family instances
---------------------------------------+------------------------------------
 Reporter:  guest                      |          Owner:                         
     Type:  bug                        |         Status:  new                    
 Priority:  normal                     |      Component:  Compiler (Type checker)
  Version:  7.4.1                      |       Keywords:                         
       Os:  Unknown/Multiple           |   Architecture:  Unknown/Multiple       
  Failure:  GHC rejects valid program  |       Testcase:                         
Blockedby:                             |       Blocking:                         
  Related:                             |  
---------------------------------------+------------------------------------
 The following code does not compile in GHC 7.4, unless line (2) is
 uncommented. I thought line (1) would remove need for (2). If it does not,
 probably declaration (1) should cause an error.

 {{{
 {-# LANGUAGE TypeFamilies #-}
 class R m where
   type D m a :: *
   type D m a = ()                -- (1)
   f :: m a -> D m a -> ()

 instance R Maybe where
   -- type D Maybe a = ()         -- (2)
   f = undefined

 x = f (Nothing :: Maybe Int) ()
 }}}

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



More information about the Glasgow-haskell-bugs mailing list