Tue May 12 10:12:29 PDT 2009  [email protected]
  * Improve error messages for type functions
  Ignore-this: 69207771396a7940b1bb1413622b0b5d
  
  Following a suggestion of Claus Reinke, this patch improves the error
  messages involving type functions.  Here's the relevant note from TcTyFuns.
  
  Note [Non-injective type functions]
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  It's very confusing to get a message like
       Couldn't match expected type `Depend s'
              against inferred type `Depend s1'
  so pp_open_tc adds:
         NB: `Depend' is a (non-injective) type function
  
  Currently we add this independently for each argument, so we also get
       Couldn't match expected type `a'
              against inferred type `Dual (Dual a)'
         NB: `Dual' is a (non-injective) type function
  which is arguably redundant.  But on the other hand, it's probably
  a good idea for the programmer to know the error involves type functions
  so I've left it in for now.  The obvious alternative is to only add
  this NB in the case of matching (T ...) ~ (T ...). 
  

    M ./compiler/typecheck/TcTyFuns.lhs -2 +30
    M ./compiler/types/TyCon.lhs +12

View patch online:
http://darcs.haskell.org/ghc/_darcs/patches/20090512171229-1287e-4e75e94894aadfe26cf88da13a43efb40e7351cc.gz

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to