[Haskell] ANNOUNCE: LocH, source locations in error, trace,
Donald Bruce Stewart
dons at cse.unsw.edu.au
Tue Nov 14 21:09:48 EST 2006
The topic of improving exception diagnosis in Haskell is hot at the
moment, and I'm pleased to announce the release of LocH, a small Haskell
module providing source location-specific error messages and debugging
strings for Haskell code.
It uses the compiler-expanded 'assert' token, rather than cpp or m4, to
provide a lightweight approach to generating source locations. No
preprocessor is required. The code is available under a BSD license.
The LocH home:
trace assert "Starting ..." $ do
trace assert "Finished" $ do
let x = check assert $ head ( :: [Int])
A.hs:4:10-15: Starting ...
a.out: A.hs:8:18-23: Prelude.head: empty list
LocH provides located versions of trace, failure, as well as check and checkIO
to wrap exception-throwing pure and IO code.
May all your exceptions be located,
More information about the Haskell