mutagen-0.1.0.0: Property-based testing framework for Haskell using type-preserving mutations.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Mutagen.Exception

Description

Exception handling utilities.

Synopsis

Exception handling utilities

type AnException = SomeException Source #

A general exception type.

tryEvaluate :: a -> IO (Either AnException a) Source #

Evaluate a value to weak head normal form, catching any exceptions.

tryEvaluateIO :: IO a -> IO (Either AnException a) Source #

Evaluate an IO action to weak head normal form, catching any exceptions.

evaluate :: a -> IO a Source #

Evaluate a value to weak head normal form.

finally :: IO a -> IO b -> IO a Source #

Ensure that a cleanup action is run after an IO action, even if an exception is thrown.

discard :: a Source #

A special error value. If a property evaluates discard, it causes Mutagen to discard the current test case. This can be useful if you want to discard the current test case, but are somewhere you can't use ==>, such as inside a generator.

isDiscard :: AnException -> Bool Source #

Predicate to check whether an exception is our special discard.