chatty-0.7.0.1: Some monad transformers and typeclasses for abstraction of global dependencies.

Safe HaskellSafe
LanguageHaskell2010

Text.Chatty.Finalizer

Description

Provides handle-closing.

Synopsis

Documentation

class Monad m => ChFinalizer m where Source #

Class for all handle-finalizing monads. Required for file redirections.

Minimal complete definition

mqfh, mfin

Methods

mqfh :: Handle -> m () Source #

Enqueue handle

mqfhs :: [Handle] -> m () Source #

Enqueue list of handles

mfin :: m () Source #

Finalize all queued handles

newtype HandleCloserT m a Source #

Handle-closing transformer

Constructors

HandleCloser 

Fields

withLazyIO :: (MonadIO m, Functor m) => HandleCloserT m a -> m a Source #

Run function with handle closer