Hello Cafe,
I am trying to improve the error reporting in my sendfile library, and I know I can find out the current file name and line number with something like this:
{-# LANGUAGE CPP #-}
main = putStrLn (__FILE__ ++ ":" ++ show __LINE__)
This outputs:
test.hs:2
Unfortunately, if your file is in a hierarchy of folders, this flat file name doesn't give much context. Is there a macro to find out the current module? IE if I had a module Foo.Bar.Car.MyModule, I would like to be able to output something like this on error:
Foo.Bar.Car.MyModule:2
Any help is appreciated!
Thanks,
Matt
--
Need somewhere to put your code? http://patch-tag.com
Want to build a webapp? http://happstack.com