[GHC] #13718: diagnostic colors: differentiate between message head and message body

GHC ghc-devs at haskell.org
Thu May 18 16:03:53 UTC 2017


#13718: diagnostic colors: differentiate between message head and message body
-------------------------------------+-------------------------------------
        Reporter:  int-e             |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1-rc2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13444            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * cc: Rufflewind (added)


Comment:

 Since I had trouble visualizing this, let me try to format what you're
 seeing.

 With the default `GHC_COLORS`, this is what you see:

 {{{
 #!html
 <pre>
 Prelude> () ()

 <strong><interactive>:1:1: <span style="color: red">error:</span>
     • Couldn't match expected type ‘() -> t’ with actual type ‘()’
     • The function ‘()’ is applied to one argument,
       but its type ‘()’ has none
       In the expression: () ()
       In an equation for ‘it’: it = () ()
     • Relevant bindings include it :: t (bound at
 <interactive>:1:1)</strong></pre>
 }}}

 With `GHC_COLORS="message=0"`, this is what you see:

 {{{
 #!html
 <pre>
 Prelude> () ()

 <interactive>:1:1: <strong><span style="color:
 red">error:</span></strong>
     • Couldn't match expected type ‘() -> t’ with actual type ‘()’
     • The function ‘()’ is applied to one argument,
       but its type ‘()’ has none
       In the expression: () ()
       In an equation for ‘it’: it = () ()
     • Relevant bindings include it :: t (bound at
 <interactive>:1:1)</pre>
 }}}

 And this is what you'd prefer to see with `GHC_COLORS="message=0"`:

 {{{
 #!html
 <pre>
 Prelude> () ()

 <strong><interactive>:1:1: <span style="color:
 red">error:</span></strong>
     • Couldn't match expected type ‘() -> t’ with actual type ‘()’
     • The function ‘()’ is applied to one argument,
       but its type ‘()’ has none
       In the expression: () ()
       In an equation for ‘it’: it = () ()
     • Relevant bindings include it :: t (bound at
 <interactive>:1:1)</pre>
 }}}

 Is that correct?

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


More information about the ghc-tickets mailing list