hscurses-1.3.0.2: NCurses bindings for Haskell

UI.HSCurses.MonadException

Documentation

class Monad m => MonadExc m whereSource

Methods

catchM :: m a -> (Exception -> m a) -> m aSource

blockM :: m a -> m aSource

unblockM :: m a -> m aSource

Instances

class (MonadIO m, MonadExc m) => MonadExcIO m Source

Instances

catchJustMSource

Arguments

:: MonadExc m 
=> (Exception -> Maybe b)

Predicate to select exceptions

-> m a

Computation to run

-> (b -> m a)

Handler

-> m a 

handleM :: MonadExc m => (Exception -> m a) -> m a -> m aSource

handleJustM :: MonadExc m => (Exception -> Maybe b) -> (b -> m a) -> m a -> m aSource

tryM :: MonadExc m => m a -> m (Either Exception a)Source

tryJustM :: MonadExc m => (Exception -> Maybe b) -> m a -> m (Either b a)Source

catchDynM :: (MonadExc m, Typeable exc) => m a -> (exc -> m a) -> m aSource

bracketMSource

Arguments

:: MonadExc m 
=> m a

computation to run first ("acquire resource")

-> (a -> m b)

computation to run last ("release resource")

-> (a -> m c)

computation to run in-between

-> m c 

bracketM_ :: MonadExc m => m a -> m b -> m c -> m cSource

finallySource

Arguments

:: IO a

computation to run first

-> IO b

computation to run afterward (even if an exception was raised)

-> IO a 

modifyState :: MonadExc m => (s -> m (a, s)) -> StateT s m aSource

catchState :: MonadExc m => StateT s m a -> (Exception -> StateT s m a) -> StateT s m aSource

unblockState :: MonadExc m => StateT s m a -> StateT s m aSource

blockState :: MonadExc m => StateT s m a -> StateT s m aSource