pipes-io-0.1: Stateful IO streams based on pipes

Safe HaskellSafe
LanguageHaskell2010

Pipes.IOStream

Contents

Synopsis

IStream and OStream

Convert between IOStreams and pipes

Reading

readWith :: IStream a -> Parser a IO r -> IO r Source #

Wrapping

wrapIStream :: IStream a -> (Producer a IO () -> Producer b IO ()) -> IO (IStream b) Source #

Writting

write :: OStream a -> a -> IO () Source #

Detecting end of stream

Connect and resume for consumer

(>->+) :: Monad m => Producer a m x -> Consumer a m y -> m (Consumer a m y) Source #

Pairs each await in the consumer with an yield in the producer. Returns remaining consumer.

Re-exports

type Producer b = Proxy X () () b #

Producers can only yield

type Consumer a = Proxy () a () X #

Consumers can only await

type Parser a m r = forall x. StateT (Producer a m x) m r #

A Parser is an action that reads from and writes to a stored Producer