Malcolm Wallace wrote:
> > {-# LANGUAGE CPP #-}
>> main = putStrLn (__FILE__ ++ ":" ++ show __LINE__)
>>
>> This outputs:
>> test.hs:2
>
>> 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
>
> It works for me. If
{-# LANGUAGE CPP #-}
main = putStrLn (__FILE__ ++ ":" ++ show __LINE__)
This outputs:
test.hs:2
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
It works for me. If you place that text in Try/Me.hs and call
Matthew Elder wrote:
> {-# 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
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 hierar
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