#2544: Improve "Can't unify" error messages from type functions
----------------------------------------+-----------------------------------
    Reporter:  simonpj                  |        Owner:              
        Type:  bug                      |       Status:  new         
    Priority:  low                      |    Milestone:  7.0.2       
   Component:  Compiler (Type checker)  |      Version:  6.8.3       
    Keywords:                           |     Testcase:              
   Blockedby:                           |   Difficulty:  Unknown     
          Os:  Unknown/Multiple         |     Blocking:              
Architecture:  Unknown/Multiple         |      Failure:  None/Unknown
----------------------------------------+-----------------------------------
Changes (by jwlato):

 * cc: jwl...@… (added)
  * failure:  => None/Unknown


Comment:

 With ghc-7.0.1, the error message is now:
 {{{
 bug.hs:11:12:
     Could not deduce (IxMap r ~ IxMap i1) from the context (Ix l, Ix r)
     NB: `IxMap' is a type function, and may not be injective
     Expected type: IxMap (l :|: r) [Int]
       Actual type: BiApp (IxMap l) (IxMap i1) [Int]
     In the expression: BiApp empty empty
     In an equation for `empty': empty = BiApp empty empty
     In the instance declaration for `Ix (l :|: r)'

 bug.hs:11:18:
     Could not deduce (IxMap i ~ IxMap l) from the context (Ix l, Ix r)
     NB: `IxMap' is a type function, and may not be injective
     Expected type: IxMap l [Int]
       Actual type: IxMap i [Int]
     In the first argument of `BiApp', namely `empty'
     In the expression: BiApp empty empty
     In an equation for `empty': empty = BiApp empty empty
 Failed, modules loaded: none.
 }}}

 Can this be closed? These error messages are much more useful (at least to
 my eye).

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