I realized I should have made a bigger version bump: Announcing version 0.3.0<div><a href="http://hackage.haskell.org/package/file-location">http://hackage.haskell.org/package/file-location</a><br><br><div class="gmail_quote">

On Wed, Aug 10, 2011 at 5:53 PM, Greg Weber <span dir="ltr">&lt;<a href="mailto:greg@gregweber.info">greg@gregweber.info</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Were you excited when Simon Marlow announced he might be able to add stack traces to Haskell? Would you settle for just the first line of the stack trace? It is a little known fact that template haskell exposes the file and line number information.<div>


<br></div><div>file-location contains common debugging/error/exception functions and template haskell versions that give file location information.</div><div><br></div><div><div>    &gt; $(err &quot;OH NO!&quot;)</div><div>


    main:Main main.hs:16:1 OH NO!</div></div><div><br></div><div><div>    &gt; debug [1,2,3]</div><div>    DEBUG: [1,2,3]</div><div>    [1,2,3]</div></div><div><br></div><div>    &gt; $(dbg) [1,2,3]</div><div>    DEBUG main:Main main.hs:1:3 [1,2,3]</div>


<div>    [1,2,3]</div><div><br></div><div><div>    ($(thrwIO) AException) `catch` \e -&gt; putStrLn (&quot;Caught &quot; ++ show (e :: AException))</div></div><div><div>    Caught AException &quot;main:Main test/main.hs:25:6&quot;</div>


</div><div><br></div><div><br></div><div>Don&#39;t like the exception dependency? Use version 0.2.3 for now until the exceptions are split into a separate package.</div><div><div>Just want the debug helpers (like the debug function) but not interested in the template haskell? The library is already split into modules based on dependencies. The near future plan is to separate this into separate packages, including one with the non-TH debug helpers.</div>


<div><br></div><div>Also see the github README for more examples: <a href="https://github.com/gregwebs/FileLocation.hs" target="_blank">https://github.com/gregwebs/FileLocation.hs</a></div></div><div><br></div><div>I think haskell could use a few more debug helpers. Perhaps some of these could be pushed back into the standard distribution.</div>


<div><br></div><div>Thanks, and I am looking forward to your feedback,</div><div>Greg Weber</div><font color="#888888"><div><br></div>
</font></blockquote></div><br></div>