On 9/5/07, Ketil Malde <[EMAIL PROTECTED]> wrote:
> On Wed, 2007-09-05 at 08:19 +0100, Simon Peyton-Jones wrote:
> Error message from GHCi:
>     test/error.hs:2:8:
>         No instance for (Num String)
>           arising from use of `+' at test/error.hs:2:8-17
>         Possible fix: add an instance declaration for (Num String)
>         In the expression: x + (show s)
>         In the definition of `f': f x s = x + (show s)
>
> >         your suggestion for the error message you'd like to have seen.

ghc --newbie-errors error.hs

. . .
. . .

Error message from GHCi:
    test/error.hs:2:8:
        You have tried to apply the operator '+' to 'x' and 'show s'
        'show s' is a String.
        I don't know how to apply '+' to a String.
        May I suggest either:
        (1) '+' is a method of type class Num. Tell me how to apply
'+' to a String by making String an instance of the class Num
        (2) You didn't really mean '+'
        In the expression: x + (show s)
        In the definition of `f': f x s = x + (show s)
--
Dan
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to