[GHC] #9173: Better type error messages

GHC ghc-devs at haskell.org
Fri Sep 25 05:06:37 UTC 2015


#9173: Better type error messages
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.8.2
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 I wonder if it would help at all to just reverse the order of the two,
 that is,
 {{{
     Couldn't match actual type ‘[Char]’ with expected type ‘Int’
     In the expression: "Howdy!"
 }}}
 Presumably the programmer has a strong association between the expression
 and its (actual) type, and then can work out what "expected type" refers
 to by elimination.

 I'm also not that attached to the phrase "expected type". We could be more
 explicit and say something like "type ‘Int’ expected from context". I
 think the phrase "actual type" is quite good, though.

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


More information about the ghc-tickets mailing list