[GHC] #11967: Custom message when showing functions, comparing functions, ...

GHC ghc-devs at haskell.org
Mon May 23 21:48:04 UTC 2016


#11967: Custom message when showing functions, comparing functions, ...
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Core Libraries    |              Version:  7.10.3
      Resolution:                    |             Keywords:
                                     |  CustomTypeErrors
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Iceland_jack):

 I'll put this here, from a
 [https://twitter.com/paf31/status/734566028483657729 tweet]
 {{{#!hs
 instance TypeError (Text "Lists are not numbers!"
                :$$: Text "Use (++) or (Data.Monoid.<>) instead!")
   => Num [a]
 }}}

 {{{
 ghci> "Hello" + " " + "World!"

 <interactive>:91:1: error:
     • Lists are not numbers!
       Use (++) or (Data.Monoid.<>) instead!
     • In the expression: "Hello" + " " + "World!"
       In an equation for ‘it’: it = "Hello" + " " + "World!"
 }}}

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


More information about the ghc-tickets mailing list