Maintainer | Bas van Dijk <v.dijk.bas@gmail.com> |
---|
Unsafe functions for retrieving the native Handle
from a regional file
handle and for lifting operations on Handles
to RegionalFileHandles
.
These operations are unsafe because they allow you to close regional file
handles before exiting their region. So they enable you to perform IO
with
already closed handles.
- unsafeHandle :: FileHandle handle => handle ioMode r -> Handle ioMode
- wrap :: (FileHandle handle, MonadIO m) => (Handle ioMode -> IO α) -> handle ioMode r -> m α
- wrap2 :: (FileHandle handle, MonadIO m) => (Handle ioMode -> β -> IO α) -> handle ioMode r -> β -> m α
- wrap3 :: (FileHandle handle, MonadIO m) => (Handle ioMode -> γ -> β -> IO α) -> handle ioMode r -> γ -> β -> m α
- sanitizeIOError :: IO α -> IO α
Documentation
unsafeHandle :: FileHandle handle => handle ioMode r -> Handle ioModeSource
wrap2 :: (FileHandle handle, MonadIO m) => (Handle ioMode -> β -> IO α) -> handle ioMode r -> β -> m αSource
wrap3 :: (FileHandle handle, MonadIO m) => (Handle ioMode -> γ -> β -> IO α) -> handle ioMode r -> γ -> β -> m αSource
sanitizeIOError :: IO α -> IO αSource
Modify thrown IOErrors
in the given computation by erasing the
ioe_handle
field in the IOError
which may contain the Handle
which
caused the IOError
.
I use this to ensure that Handles
don't leak out the region via
exceptions.