-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A composable exception handler
--
@package partial-handler
@version 1.0.0.0
module PartialHandler
-- | A composable exception handler.
newtype PartialHandler a
PartialHandler :: (SomeException -> Maybe (IO a)) -> PartialHandler a
-- | A function, which handles all exceptions.
--
-- Can be used as a parameter to standard functions like catch and
-- handle, or to process the result of try.
type TotalHandler a = SomeException -> IO a
-- | Convert a partial handler into a total handler, which throws an error
-- for unhandled cases. In other words, the produced total handler is
-- itself a partial function, so use this only in cases when an unhandled
-- exception should be considered as a bug.
totalize :: PartialHandler a -> TotalHandler a
-- | Convert a partial handler into a total handler, which rethrows all
-- unhandled exceptions.
totalizeRethrowing :: PartialHandler a -> TotalHandler a
-- | Convert a partial handler into a total handler, which rethrows all
-- unhandled exceptions to the specified thread and the current thread.
totalizeRethrowingTo :: ThreadId -> PartialHandler a -> TotalHandler a
-- | Convert a partial handler into a total handler, which rethrows all
-- unhandled exceptions to the specified thread, while the current thread
-- continues the execution.
totalizeRethrowingTo_ :: ThreadId -> PartialHandler () -> TotalHandler ()
-- | A handler of exceptions of a specific type.
typed :: Exception e => (e -> Maybe (IO a)) -> PartialHandler a
-- | A handler of the ThreadKilled exception.
onThreadKilled :: IO a -> PartialHandler a
-- | A handler of all exceptions of type IOError by their type.
onIOErrorByType :: (IOErrorType -> Maybe (IO a)) -> PartialHandler a
-- | A handler of an IOError exception with type satisfying the
-- isAlreadyExistsError predicate.
onAlreadyExists :: IO a -> PartialHandler a
-- | A handler of an IOError exception with type satisfying the
-- isDoesNotExistError predicate.
onDoesNotExist :: IO a -> PartialHandler a
-- | A handler of an IOError exception with type satisfying the
-- isAlreadyInUseError predicate.
onAlreadyInUse :: IO a -> PartialHandler a
-- | A handler of an IOError exception with type satisfying the
-- isFullError predicate.
onFull :: IO a -> PartialHandler a
-- | A handler of an IOError exception with type satisfying the
-- isEOFError predicate.
onEOF :: IO a -> PartialHandler a
-- | A handler of an IOError exception with type satisfying the
-- isIllegalOperation predicate.
onIllegalOperation :: IO a -> PartialHandler a
-- | A handler of an IOError exception with type satisfying the
-- isPermissionError predicate.
onPermission :: IO a -> PartialHandler a
-- | A handler of an IOError exception with type satisfying the
-- isUserError predicate.
onUser :: IO a -> PartialHandler a
instance Monoid (PartialHandler a)