[QuickCheck] Detecting UserInterrupt / getting uncaught exceptions

Simon Hengel sol at typeful.net
Thu Nov 15 12:43:03 GMT 2012


On Thu, Nov 15, 2012 at 01:30:31PM +0100, Nick Smallbone wrote:
> Hi Simon,
> 
> My first thought was "let's make QuickCheck rethrow any interrupt
> exceptions that it gets". But this would make it impossible to get a
> Result back from quickCheckResult if the user pressed ctrl-C. So I
> think probably you will have to rethrow the exception yourself.
> 
> But it's bad that you have to parse the failure reason to find out
> what the exception was. I think I'll add an exception field to Result
> to fix that. It won't tie QuickCheck to the new exceptions API: the
> field will just have type Maybe SomeException on new GHCs and Maybe
> Exception on old GHCs/Hugs.

Awesome.  That would solve both of my use cases :)

Cheers,
Simon



More information about the QuickCheck mailing list