#816: Weird fundep behavior (with -fallow-undecidable-instances)
----------------------------------------+-----------------------------------
    Reporter:  nibro                    |        Owner:  simonpj
        Type:  bug                      |       Status:  new    
    Priority:  normal                   |    Milestone:  6.8    
   Component:  Compiler (Type checker)  |      Version:  6.4.2  
    Severity:  normal                   |   Resolution:         
    Keywords:                           |   Difficulty:  Unknown
          Os:  Unknown                  |     Testcase:  tc216  
Architecture:  Unknown                  |  
----------------------------------------+-----------------------------------
Comment (by simonpj):

 I doubt I'll ever fix this, because we have a better way.  With indexed
 type families we'll write
 {{{
 class Foo x  where
  type Y x
  foo :: x -> Y x

 class Bar x y where
  bar :: x -> y -> Int

 instance (Foo x y, Bar y z) => Bar x z where
  bar x z = bar (foo x) z
 }}}
 So now the inference problem becomes
 {{{
    GIVEN: (Foo x, Bar (Y x) z)
    WANTED: (Foo x, Bar (Y x) z)
 }}}
 which is trivially solvable.

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/816>
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