ContentsIndex
Org.Org.Semantic.HBase.Category.MonadBracket
Synopsis
class Monad m => MonadGuard m where
guard :: m (Maybe r) -> m (Maybe r) -> m r -> m r
bracket :: m () -> m () -> m r -> m r
final :: m () -> m r -> m r
finally :: MonadGuard m => m a -> m () -> m a
resultBracket :: (MonadGuard m, MonadStandardReference m ref) => m a -> (m a -> m ()) -> (m a -> m r) -> m r
Documentation
class Monad m => MonadGuard m where
catching without the exception type
Methods
guard :: m (Maybe r) -> m (Maybe r) -> m r -> m r
guard before after foo if before returns Just r or fails, that's the result. otherwise, execute foo, then execute after even if foo fails return the result of foo unless after returns Just r or fails.
bracket :: m () -> m () -> m r -> m r
final :: m () -> m r -> m r
Instances
MonadGuard m => MonadGuard (Contextual m context)
MonadGuard m => MonadGuard (ExceptionMonad m ex)
MonadUnique m u => MonadGuard (GuardContinuationPass u (m k))
MonadGuard IO
finally :: MonadGuard m => m a -> m () -> m a
resultBracket :: (MonadGuard m, MonadStandardReference m ref) => m a -> (m a -> m ()) -> (m a -> m r) -> m r
Produced by Haddock version 0.6