[GHC] #9173: Better type error messages

GHC ghc-devs at haskell.org
Thu Jun 29 19:38:26 UTC 2017


#9173: Better type error messages
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.8.2
      Resolution:                    |             Keywords:
                                     |  TypeErrorMessages
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  warning at compile-time            |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by j.waldmann):

 Interesting, but I think this is a separate issue
 (type error message for list literals).

 `['a', True]` gets translated to `'a' : (True : [])`, see language spec
 3.7.
 https://www.haskell.org/onlinereport/haskell2010/haskellch3.html#x8-340003.7
 So there is no special rule for typing list literals, as the compiler
 checks the translated code anyway.

 Or so I thought, but in fact there is: after stating the translation, the
 standard states that in `[e1, ..., ek]`, "the types of e1 ... ek must all
 be the same". Is this normative, or just a (redundant) explanation?

 I do think that compiler (error) messages should use wording from the
 standard. (So, looking up words in OED does not really help. The committee
 that wrote the standard already did this.)

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


More information about the ghc-tickets mailing list