[Haskell-cafe] code-as-config, run-time checks and error locations
daniel.trstenjak at gmail.com
Sat Apr 6 20:18:03 CEST 2013
most of the time I'm just using these cpp macros:
#define __POS__ (__FILE__ ++ ":" ++ show __LINE__)
#define ERROR error $ __POS__ ++ " -> " ++
Instead of writing 'error "blub"' you would write 'ERROR "blub"'
and additionally get the file name and the line.
There's a bracktracing functionality in the more recent versions of
ghc. I think it has been discussed on this mailing list.
More information about the Haskell-Cafe