Assertion in IO monad
Simon Marlow
marlowsd at gmail.com
Tue Mar 29 10:35:08 CEST 2011
On 28/03/2011 11:05, Mitar wrote:
> Hi!
>
> On Fri, Mar 25, 2011 at 5:43 PM, Simon Marlow<marlowsd at gmail.com> wrote:
>> I think
>>
>> evaluate (assert ...)
>>
>> is guaranteed to work.
>
> I made something like:
>
> assertIO :: Bool -> IO ()
> assertIO cond = evaluate (assert cond ())
>
> But the problem is that exception raised have line information of this
> definition and not of the call itself.
Use Template Haskell, or a CPP macro?
Cheers,
Simon
More information about the Libraries
mailing list