| Maintainer | Bas 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.
- type CloseAction = IO ()
- data CloseHandle r
- onExit :: MonadIO pr => CloseAction -> RegionT s pr (CloseHandle (RegionT s pr))
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.