#1781: Type equality class leads to non-termination
----------------------------------------+-----------------------------------
    Reporter:  chak                     |        Owner:         
        Type:  bug                      |       Status:  new    
    Priority:  normal                   |    Milestone:         
   Component:  Compiler (Type checker)  |      Version:  6.9    
    Severity:  normal                   |   Resolution:         
    Keywords:                           |   Difficulty:  Unknown
          Os:  Unknown                  |     Testcase:         
Architecture:  Unknown                  |  
----------------------------------------+-----------------------------------
Comment (by chak):

 This program was rejected by 6.6.1 with the message
 {{{
 /Users/chak/Code/haskell/E_Class.hs:10:0:
     The equation(s) for `plus' have two arguments,
     but its type `Int -> a' has only one
 }}}
 which is arguably not the right thing to do either.

 I haven't traced this, but the problem may well be due to an interaction
 between equality constraints and FDs - at least since I fixed
 `TcUnify.subFunTys`.  The latter function will defer a wanted equality `a
 ~ (b1 -> b2)`, which in principle would be entailed by the given `E a (Int
 -> Int)` (with `b1, b2 := Int`).  However, the normalisation and
 entailment machinery for equalities doesn't know about FDs.  (I would
 think that should lead to an error message rather than non-termination,
 but oh well....)

 Incidentally,
 {{{
 module ShouldCompile where

 plus :: (a ~ (Int -> Int)) => Int -> a
 plus x y = x + y
 }}}
 works fine.

 I would expect that this would be fixed as soon as we implement FDs by way
 of TFs.

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