Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Mask :: Effect where
- Mask :: ((m ~> m) -> m a) -> Mask m a
- UninterruptibleMask :: ((m ~> m) -> m a) -> Mask m a
- Bracket :: m a -> (a -> m c) -> (a -> m b) -> Mask m b
- BracketOnError :: m a -> (a -> m c) -> (a -> m b) -> Mask m b
- mask :: Mask :> es => ((~>) (Eff es) (Eff es) -> Eff es a) -> Eff es a
- uninterruptibleMask :: Mask :> es => ((~>) (Eff es) (Eff es) -> Eff es a) -> Eff es a
- bracket :: Mask :> es => Eff es a -> (a -> Eff es c) -> (a -> Eff es b) -> Eff es b
- bracketOnError :: Mask :> es => Eff es a -> (a -> Eff es c) -> (a -> Eff es b) -> Eff es b
- mask_ :: Mask :> es => Eff es a -> Eff es a
- uninterruptibleMask_ :: Mask :> es => Eff es a -> Eff es a
- bracket_ :: Mask :> es => Eff es a -> Eff es c -> (a -> Eff es b) -> Eff es b
- finally :: Mask :> es => Eff es a -> Eff es b -> Eff es a
- onError :: Mask :> es => Eff es a -> Eff es b -> Eff es a
- runMask :: Eff (Mask ': es) ~> Eff es
Effect
data Mask :: Effect where Source #
An effect capable of mask
ing and specifically, bracket
ing operations, i.e. allowing cleanup after
operations that my raise exceptions.
Mask :: ((m ~> m) -> m a) -> Mask m a | |
UninterruptibleMask :: ((m ~> m) -> m a) -> Mask m a | |
Bracket :: m a -> (a -> m c) -> (a -> m b) -> Mask m b | |
BracketOnError :: m a -> (a -> m c) -> (a -> m b) -> Mask m b |
Operations
mask_ :: Mask :> es => Eff es a -> Eff es a Source #
Variant of mask
that does not provide a restoring function.
uninterruptibleMask_ :: Mask :> es => Eff es a -> Eff es a Source #
Variant of uninterruptibleMask
that does not provide a restoring function.
bracket_ :: Mask :> es => Eff es a -> Eff es c -> (a -> Eff es b) -> Eff es b Source #
Variant of bracket
that does not pass the allocated resource to the cleanup action.
finally :: Mask :> es => Eff es a -> Eff es b -> Eff es a Source #
Attach a cleanup action that will always run to a potentially throwing computation.
onError :: Mask :> es => Eff es a -> Eff es b -> Eff es a Source #
Attach an action that runs if the main computation throws an exception.