Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
FreeGame.Internal.Finalizer
- newtype FinalizerT m a = FinalizerT {
- unFinalizerT :: forall r. (a -> m r) -> (IO () -> r -> m r) -> m r
- finalizer :: Monad m => IO () -> FinalizerT m ()
- runFinalizerT :: Monad m => FinalizerT m a -> m (a, IO ())
- execFinalizerT :: MonadIO m => FinalizerT m a -> m a
- mapFinalizerT :: (Monad m, Monad n) => (forall x. m x -> n x) -> FinalizerT m a -> FinalizerT n a
Documentation
newtype FinalizerT m a Source
An action with explicit releasing action.
Constructors
FinalizerT | |
Fields
|
Instances
MonadTrans FinalizerT | |
Monad (FinalizerT m) | |
Functor (FinalizerT m) | |
Applicative (FinalizerT m) | |
MonadIO m => MonadIO (FinalizerT m) | |
FromFinalizer (FinalizerT IO) |
finalizer :: Monad m => IO () -> FinalizerT m () Source
Add a finalizer.
runFinalizerT :: Monad m => FinalizerT m a -> m (a, IO ()) Source
Run the action and run all associated finalizers.
execFinalizerT :: MonadIO m => FinalizerT m a -> m a Source
mapFinalizerT :: (Monad m, Monad n) => (forall x. m x -> n x) -> FinalizerT m a -> FinalizerT n a Source