Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type ScopedHandle s = ScopedResource s Handle
- file :: MonadUnliftIO m => FilePath -> IOMode -> Scoped s m (ScopedHandle s)
- data IOMode
- hPutStrLn :: MonadIO m => ScopedHandle s -> Text -> Scoped s m ()
- hPutStr :: MonadIO m => ScopedHandle s -> Text -> Scoped s m ()
- hGetLine :: MonadIO m => ScopedHandle s -> Scoped s m Text
- hGetContents :: MonadIO m => ScopedHandle s -> Scoped s m Text
Scoped Handle
type ScopedHandle s = ScopedResource s Handle Source #
Allocating a new ScopedHandle
in a Scoped
block
file :: MonadUnliftIO m => FilePath -> IOMode -> Scoped s m (ScopedHandle s) Source #
Given a FilePath
, safely allocates and deallocates a ScopedHandle
in a Scoped
block
Working with ScopedHandle
See openFile
hPutStrLn :: MonadIO m => ScopedHandle s -> Text -> Scoped s m () Source #
Like hPutStrLn
but for ScopedHandle
hPutStr :: MonadIO m => ScopedHandle s -> Text -> Scoped s m () Source #
Like hPutStr
but for ScopedHandle
hGetLine :: MonadIO m => ScopedHandle s -> Scoped s m Text Source #
Like hGetLine
but for ScopedHandle
hGetContents :: MonadIO m => ScopedHandle s -> Scoped s m Text Source #
Like hGetContents
but for ScopedHandle