-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Catch errors thrown from pure computations.
--   
--   Takes an error-throwing expression and puts it back in the Maybe it
--   belongs in.
--   
--   Note that this suffers from the <a>asynchronous exceptions re-thrown
--   as synchronous</a> problem. Buyer beware.
@package spoon
@version 0.3.1


-- | Two functions for catching pureish exceptions in pure values. This
--   library considers pureish to be any error call or undefined, failed
--   pattern matches, arithmetic exceptions, and array bounds exceptions.
module Control.Spoon
type Handles a = [Handler (Maybe a)]
defaultHandles :: Handles a

-- | Evaluate a value to normal form and return Nothing if any exceptions
--   are thrown during evaluation. For any error-free value, <tt>spoon =
--   Just</tt>.
spoon :: NFData a => a -> Maybe a

-- | Evaluate a value to normal form and return Nothing if any exceptions
--   are thrown during evaluation. For any error-free value, <tt>spoon =
--   Just</tt>.
spoonWithHandles :: NFData a => Handles a -> a -> Maybe a

-- | Like <a>spoon</a>, but only evaluates to WHNF.
teaspoon :: a -> Maybe a
teaspoonWithHandles :: Handles a -> a -> Maybe a
