[Haskell-cafe] Show instances for error messages (Was: Refactoring status)

Emil Axelsson emax at cs.chalmers.se
Thu Jan 10 01:19:43 EST 2008

I think partial type signatures


would allow that kind of "tunneling". Is there any ongoing work on that?

/ Emil

Henning Thielemann skrev:
> On Mon, 7 Jan 2008, Emil Axelsson wrote:
>> One approach to programming in Haskell, which I use all the time, is to write
>> the type signature before the function body. This means that if I'm trying to do
>> something strange, I will often be warned by the type checker even before I've
>> written the strange code.
>> But I've also been bitten by the problem of having to change a lot of type
>> signatures just because I want to e.g. show an overloaded variable.
> ... which is especially annoying if you need the Show instance for an
> 'error'.  Since 'error' denotes a programming error it should never be
> evaluated and thus the Show instance is only for cases which must not
> happen. Paradoxical. It would be interesting if it is possible to tunnel
> Show class dictionaries through to an 'error' like IO is tunneled to
> 'trace'.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

More information about the Haskell-Cafe mailing list