free-game-1.0.3: Create games for free

Safe HaskellSafe-Inferred

FreeGame.Internal.Finalizer

Synopsis

Documentation

newtype FinalizerT m a Source

An action with explicit releasing action.

Constructors

FinalizerT 

Fields

unFinalizerT :: forall r. (a -> m r) -> (IO () -> r -> m r) -> m r
 

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.

mapFinalizerT :: (Monad m, Monad n) => (forall x. m x -> n x) -> FinalizerT m a -> FinalizerT n aSource