[Haskell-cafe] Printing call site for partial functions

Joachim Breitner mail at joachim-breitner.de
Thu Apr 26 16:05:50 CEST 2012


Hi,

Am Mittwoch, den 25.04.2012, 18:36 +0300 schrieb Michael Snoyman:
> I'm sure there are many better ways to approach the problem, and I
> can't speak to the complexity of implementation within GHC. I *can*
> say, however, that this would have saved me a lot of time in the
> example I gave above, and I'd bet many Haskellers have similar
> stories. This could be a huge debugging win across the board.

using TH (which I only reluctantly advocate for general usage) you can
get good location information behaviour, see
http://hackage.haskell.org/packages/archive/stm-stats/0.2.0.0/doc/html/Control-Concurrent-STM-Stats.html#v:trackThisSTM
(and its source) for one example. One would use this approach maybe with
http://hackage.haskell.org/packages/archive/safe/0.3.3/doc/html/Safe.html#v:headNote

Greetings,
Joachim


-- 
Joachim Breitner
  e-Mail: mail at joachim-breitner.de
  Homepage: http://www.joachim-breitner.de
  Jabber-ID: nomeata at joachim-breitner.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120426/a6bbf550/attachment.pgp>


More information about the Haskell-Cafe mailing list