#4485: Unexplained change in type-inference + OverlappingInstances in
---------------------------------+------------------------------------------
    Reporter:  JeremyShaw        |        Owner:                           
        Type:  bug               |       Status:  new                      
    Priority:  normal            |    Milestone:                           
   Component:  Compiler          |      Version:  7.0.1 RC1                
    Keywords:                    |     Testcase:                           
   Blockedby:                    |   Difficulty:                           
          Os:  Unknown/Multiple  |     Blocking:                           
Architecture:  Unknown/Multiple  |      Failure:  GHC rejects valid program
---------------------------------+------------------------------------------

Comment(by JeremyShaw):

 Regarding, XMLGenT Identity (), I just meant that:

 {{{
 instance EmbedAsChild (IdentityT IO) FooBar where
    asChild b = asChild $ ((genElement "foo") :: XMLGenT Identity ())
 }}}

 produces a type error. So clearly genElement does not actually have that
 type. But I make no informed claims that the GHC type checker should be
 able to figure that out.

 Your explanation makes sense (and matches what is in the documentation).
 The fact that things worked under GHC 6.12, made me wonder if there was
 some other secret voodoo that I did not know about, or if 6.12 was just
 conveniently broken.

 I am a little bit frightened of enabling IncohorentInstances. If they
 could be enabled just in the original module where the class is enabled,
 that might not be so bad. But if I have to enabled them everywhere I used
 the class, that is not so thrilling. In my experience, enabling
 IncohorentInstances is almost never the right thing to do. Since I use
 other classes and instances, it would also allow those to be incoherent
 when I would really prefer a compiler error.

 It would be somewhat nice if IncoherentInstances could be enabled on a
 per-class basis due to its 'unsafe' nature.

 thanks!
 - jeremy

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