[GHC] #9612: Use functional dependencies to give more specific error messages

GHC ghc-devs at haskell.org
Fri Sep 19 11:50:11 UTC 2014


#9612: Use functional dependencies to give more specific error messages
-------------------------------------+-------------------------------------
              Reporter:  rwbarton    |            Owner:
                  Type:  feature     |           Status:  new
  request                            |        Milestone:
              Priority:  normal      |          Version:  7.8.3
             Component:  Compiler    |         Keywords:
  (Type checker)                     |     Architecture:  Unknown/Multiple
            Resolution:              |       Difficulty:  Unknown
      Operating System:              |       Blocked By:
  Unknown/Multiple                   |  Related Tickets:
       Type of failure:              |
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Which version of GHC are you using?  With HEAD or 7.8 I get
 {{{
 T9612.hs:6:33:
     Couldn't match expected type ‘[(Int, a)]’
                 with actual type ‘(Int, a)’
     Relevant bindings include
       x :: a (bound at T9612.hs:5:8)
       y :: a (bound at T9612.hs:5:3)
       f :: a -> (Int, a) -> Writer [(Int, a)] (Int, a)
         (bound at T9612.hs:5:1)
     In the first argument of ‘tell’, namely ‘(n, x)’
     In a stmt of a 'do' block: tell (n, x)
 }}}
 which is certainly better than the one you display.

 I had to add `import Control.Monad.Trans.Writer.Strict` at the top.

 Simon

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


More information about the ghc-tickets mailing list