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

2008-01-09 Thread Emil Axelsson
I think partial type signatures http://hackage.haskell.org/trac/haskell-prime/wiki/PartialTypeAnnotations 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 Has

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

2008-01-07 Thread Emil Axelsson
The only possible definition of such a function is something like unsafeShow :: (forall a . Show a => a) -> String unsafeShow a = show (a :: Bool) right? And you'd also need to coerce the argument type in order to use it: putStrLn $ unsafeShow $ unsafeCoerce True Right? Then a nicer de

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

2008-01-07 Thread Lutz Donnerhacke
* Henning Thielemann wrote: > 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'. unsafeShow :: (forall a . Show a => a) -> String ___ Haskell-Cafe mai

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

2008-01-07 Thread Henning Thielemann
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