[GHC] #2544: Improve "Can't unify" error messages from type functions

GHC cvs-ghc at haskell.org
Thu Jan 13 00:12:24 CET 2011


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

  * status:  new => closed
  * testcase:  => indexed-types/should_fail/T2544
  * resolution:  => fixed


Comment:

 It's even improved a bit more in HEAD
 {{{
 T2544.hs:15:12:
     Could not deduce (IxMap l ~ IxMap i0)
     from the context (Ix l, Ix r)
       bound by the instance declaration at T2544.hs:13:10-37
     NB: `IxMap' is a type function, and may not be injective
     Expected type: IxMap (l :|: r) [Int]
       Actual type: BiApp (IxMap i0) (IxMap r) [Int]
     In the return type of a call of `BiApp'
     In the expression: BiApp empty empty
     In an equation for `empty': empty = BiApp empty empty

 T2544.hs:15:24:
     Could not deduce (IxMap i1 ~ IxMap r)
     from the context (Ix l, Ix r)
       bound by the instance declaration at T2544.hs:13:10-37
     NB: `IxMap' is a type function, and may not be injective
     Expected type: IxMap r [Int]
       Actual type: IxMap i1 [Int]
     In the second argument of `BiApp', namely `empty'
     In the expression: BiApp empty empty
     In an equation for `empty': empty = BiApp empty empty
 }}}
 So let's close. I'll add a test for completeness.

 Thanks for bringing it up.

 Simon

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



More information about the Glasgow-haskell-bugs mailing list