regions-0.6.0.1: Provides the region monad for safely opening and working with scarce resources.

MaintainerBas van Dijk <v.dijk.bas@gmail.com>

Control.Monad.Trans.Region.OnExit

Description

This module is not intended for end-users. It should only be used by library authors wishing to extend this regions library.

Synopsis

Documentation

type CloseAction = IO ()Source

An IO computation that closes or finalizes a resource. For example hClose or free.

data CloseHandle r Source

A handle to a CloseAction that allows you to duplicate the action to a parent region using dup.

Instances

onExit :: MonadIO pr => CloseAction -> RegionT s pr (CloseHandle (RegionT s pr))Source

Register the CloseAction in the region. When the region terminates all registered close actions will be perfomed if they're not duplicated to a parent region.