[Haskell-cafe] cpphs calls error when it finds an #error declaration

Niklas Hambüchen mail at nh2.me
Thu Aug 29 02:34:43 CEST 2013


On 29/08/13 00:43, Malcolm Wallace wrote:
> Have you tried simply wrapping the call to runCpphs in a "catch"?  Something like
> 
>     safeRunCpphs :: ... -> IO (Either String String)
>     safeRunCpphs foo = fmap Right (runCpphs foo) `catch` (\(UserError s)-> Left s

Yes, that is what I'm doing at the moment. The problem with this is that
it does not allow me to distinguish between a programmer error (error)
on the caller or implementation side, and an #error in the input file.




More information about the Haskell-Cafe mailing list