binary-io-0.5.0: Read and write values of types that implement Binary
Safe HaskellNone
LanguageHaskell2010

Data.Binary.IO

Description

Read and write values of types that implement Binary from and to Handles

This module homes the unlifted API variant. For proper documentation check out the equally named functions in Data.Binary.IO.Lifted

Synopsis

Reader

data ReaderError Source #

An error that can occur during reading

Since: 0.4.0

Constructors

ReaderGetError

Error from the Get operation

Fields

newtype Reader Source #

Alias for Reader IO

Since: 0.0.1

Constructors

Reader 

Fields

Instances

Instances details
CanGet Reader IO Source # 
Instance details

Defined in Data.Binary.IO

Methods

runGet :: Reader -> Get a -> IO a Source #

newReader Source #

Arguments

:: Handle

Handle that will be read from

-> IO Reader 

Unlifted version of newReader

Since: 0.0.1

newReaderWith Source #

Arguments

:: IO ByteString

Chunk producer

-> IO Reader 

Unlifted version of newReaderWith.

Since: 0.1.1

Writer

newtype Writer Source #

Since: 0.0.1

Constructors

Writer 

Fields

Instances

Instances details
CanPut Writer IO Source # 
Instance details

Defined in Data.Binary.IO

Methods

runPut :: Writer -> PutM a -> IO a Source #

newWriter Source #

Arguments

:: Handle

Handle that will be written to

-> Writer 

Unlifted version of newWriter

Since: 0.0.1

newWriterWith Source #

Arguments

:: (ByteString -> IO ())

Chunk handler

-> Writer 

Unlifted version of newWriterWith

Since: 0.1.1

Pipe

newPipe :: IO (Reader, Writer) Source #

Unlifted version of newPipe

Since: 0.2.0

Duplex

data Duplex Source #

Since: 0.0.1

Constructors

Duplex 

Instances

Instances details
CanPut Duplex IO Source # 
Instance details

Defined in Data.Binary.IO

Methods

runPut :: Duplex -> PutM a -> IO a Source #

CanGet Duplex IO Source # 
Instance details

Defined in Data.Binary.IO

Methods

runGet :: Duplex -> Get a -> IO a Source #

newDuplex Source #

Arguments

:: Handle

Handle that will be read from and written to

-> IO Duplex 

Unlifted version of newDuplex

Since: 0.0.1

newDuplexWith :: IO ByteString -> (ByteString -> IO ()) -> IO Duplex Source #

Unlifted version of newDuplexWith

Since: 0.1.1

Classes

type CanGet r = CanGet r IO Source #

Alias for CanGet r IO

Since: 0.0.1

runGet Source #

Arguments

:: CanGet r 
=> r

Reader / source

-> Get a

Operation to execute

-> IO a 

Unlifted version of runGet

Since: 0.0.1

read Source #

Arguments

:: (CanGet r, Binary a) 
=> r

Read source

-> IO a 

Unlifted version of read

Since: 0.0.1

isEmpty :: CanGet r => r -> IO Bool Source #

Unlifted version of isEmpty

Since: 0.3.0

type CanPut w = CanPut w IO Source #

Alias for CanPut w IO

Since: 0.0.1

runPut Source #

Arguments

:: CanPut w 
=> w

Writer / target

-> PutM a

Operation to execute

-> IO a 

Unlifted version of runPut

Since: 0.0.1

write Source #

Arguments

:: (CanPut w, Binary a) 
=> w

Write target

-> a

Value to be written

-> IO () 

Unlifted version of write

Since: 0.0.1