[Haskell-cafe] Re: Error message reform (was: Strange type error with associated type synonyms)

Bulat Ziganshin bulat.ziganshin at gmail.com
Wed May 27 17:45:14 EDT 2009

Hello Max,

Thursday, May 28, 2009, 1:30:28 AM, you wrote:

> I prefer this wording:

> The inferred type of `True' is `Bool',
> while the type of the first argument of `f' should be `Int'.
> In the expression: f True

yes, it's also self-explanatory

> I prefer all three to Hugs's

> ERROR - Type error in application
> *** Expression     : f True
> *** Term           : True
> *** Type           : Bool
> *** Does not match : Int

for me, it was better than ghc errmsg. main thing is that i don't feel
automatically what is expected and what is inferred. here Hugs says
that True is Bool and the remaining is Int, so i "feel" the situation

overall, this expected/inferred words are probably go directly from
compiler algorithms. it looks natural for compiler developer - saying
that some term has different types evaluated by two different compiler
parts. but for me as a user it's natural to think in terms of function
having parameter of some type and term having another type, so i need
to fix the call giving it the right parameter:

> The type of the first argument of `f' should be `Int',
> while the inferred type of `True' is `Bool'.
> In the expression: f True

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list