| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Distribution.Utils.IOData
Contents
Description
Since: Cabal-2.2.0
Synopsis
- data IOData
- data IODataMode mode where
- class NFData mode => KnownIODataMode mode where
- hGetIODataContents :: Handle -> IO mode
- toIOData :: mode -> IOData
- iodataMode :: IODataMode mode
- withIOData :: IOData -> (forall mode. IODataMode mode -> mode -> r) -> r
- null :: IOData -> Bool
- hPutContents :: Handle -> IOData -> IO ()
IOData & IODataMode type
Represents either textual or binary data passed via I/O functions which support binary/text mode
Since: Cabal-2.2
Constructors
| IODataText String | How Text gets encoded is usually locale-dependent. |
| IODataBinary ByteString | Raw binary which gets read/written in binary mode. |
data IODataMode mode where #
Since: Cabal-3.2
Constructors
| IODataModeText :: IODataMode String | |
| IODataModeBinary :: IODataMode ByteString |
class NFData mode => KnownIODataMode mode where #
Since: Cabal-2.2
Methods
hGetIODataContents :: Handle -> IO mode #
IOData Wrapper for hGetContents
Note: This operation uses lazy I/O. Use NFData to force all
data to be read and consequently the internal file handle to be
closed.
iodataMode :: IODataMode mode #
Instances
| KnownIODataMode ByteString # | |
Defined in Distribution.Utils.IOData | |
| a ~ Char => KnownIODataMode [a] # | |
Defined in Distribution.Utils.IOData | |
withIOData :: IOData -> (forall mode. IODataMode mode -> mode -> r) -> r #
hPutContents :: Handle -> IOData -> IO () #
IOData Wrapper for hPutStr and hClose
This is the dual operation ot hGetIODataContents,
and consequently the handle is closed with hClose.
Note: this performs lazy-IO.
Since: Cabal-2.2