Cabal-3.3.0.0: A framework for packaging Haskell software

Safe HaskellNone
LanguageHaskell2010

Distribution.Utils.IOData

Contents

Description

Since: 2.2.0

Synopsis

IOData & IODataMode type

data IOData #

Represents either textual or binary data passed via I/O functions which support binary/text mode

Since: 2.2

Constructors

IODataText String

How Text gets encoded is usually locale-dependent.

IODataBinary ByteString

Raw binary which gets read/written in binary mode.

Instances
NFData IOData # 
Instance details

Defined in Distribution.Utils.IOData

Methods

rnf :: IOData -> () #

data IODataMode mode where #

Since: 3.2

class NFData mode => KnownIODataMode mode where #

Since: 2.2

Minimal complete definition

hGetIODataContents, toIOData, iodataMode

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.

toIOData :: mode -> IOData #

iodataMode :: IODataMode mode #

withIOData :: IOData -> (forall mode. IODataMode mode -> mode -> r) -> r #

null :: IOData -> Bool #

Test whether IOData is empty

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: 2.2