aivika-transformers-2.1: Transformers for the Aivika simulation library

CopyrightCopyright (c) 2009-2014, David Sorokin <david.sorokin@gmail.com>
LicenseBSD3
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Simulation.Aivika.Trans.Exception

Description

Tested with: GHC 7.8.3

It defines a type class of monads with IO exception handling capabilities.

Synopsis

Documentation

class ExceptionThrowing m where Source

A computation within which we can throw an exception.

Methods

throwComp :: Exception e => e -> m a Source

Throw an exception.

class (ExceptionThrowing m, MonadIO m) => ExceptionHandling m where Source

A computation within which we can handle IO exceptions as well as define finalisation blocks.

Methods

catchComp :: (Exception e, MonadIO m) => m a -> (e -> m a) -> m a Source

Catch an IO exception within the computation.

finallyComp :: MonadIO m => m a -> m b -> m a Source

Introduce a finalisation block.