#5248: Infer type context from type or data constructor
---------------------------------+------------------------------------------
    Reporter:  gidyn             |       Owner:                           
        Type:  feature request   |      Status:  new                      
    Priority:  normal            |   Component:  Compiler (Type checker)  
     Version:  7.0.3             |    Keywords:                           
    Testcase:                    |   Blockedby:                           
          Os:  Unknown/Multiple  |    Blocking:                           
Architecture:  Unknown/Multiple  |     Failure:  GHC rejects valid program
---------------------------------+------------------------------------------
 If I have code such as

 {{{
 class Foo f where
     foo :: a -> f a

 data Bar f a = Foo f => Bar {bar :: f a}

 instance Foo (Bar f) where
     foo a = Bar (foo a)
 }}}

 GHC will demand Foo f => on the instance declaration, even though this can
 be inferred from the definition of Bar.

 I understand ''why'' this is happening, but it should not be necessary to
 repeat information already given. Some code violates DRY dozens of times
 because of this limitation.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to