[Haskell-cafe] exceptions vs. Either

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Wed Aug 4 06:25:43 EDT 2004


Ketil Malde <ketil+haskell at ii.uib.no> writes:

> Hmm...if I run it through CPP and 
>   #define HEAD (\x -> if null x then error ("__FILE__:__LINE__") else head x)
> is the __LINE__ resolved at the place of declaration or at the place of usage?

According to the C standard, at the position of /usage/ of the macro `HEAD'.

Incidentally, cpphs does not yet implement __FILE__ or __LINE__
replacements.  Is their usage widespread amongst Haskell users?

Regards,
    Malcolm


More information about the Haskell-Cafe mailing list