bytepatch-0.3.1: Patch byte-representable data in a bytestream.
Safe HaskellNone
LanguageHaskell2010

StreamPatch.Stream

Synopsis

Documentation

class Monad m => MonadFwdInplaceStream m where Source #

Associated Types

type Chunk m :: Type Source #

Methods

readahead :: Natural -> m (Chunk m) Source #

Read a number of bytes without advancing the cursor.

advance :: Natural -> m () Source #

Advance cursor without reading.

overwrite :: Chunk m -> m () Source #

Insert bytes into the stream at the cursor position, overwriting existing bytes.

Instances

Instances details
MonadIO m => MonadFwdInplaceStream (ReaderT Handle m) Source # 
Instance details

Defined in StreamPatch.Stream

Associated Types

type Chunk (ReaderT Handle m) Source #

Monad m => MonadFwdInplaceStream (StateT ([a], [a]) m) Source # 
Instance details

Defined in StreamPatch.Stream

Associated Types

type Chunk (StateT ([a], [a]) m) Source #

Methods

readahead :: Natural -> StateT ([a], [a]) m (Chunk (StateT ([a], [a]) m)) Source #

advance :: Natural -> StateT ([a], [a]) m () Source #

overwrite :: Chunk (StateT ([a], [a]) m) -> StateT ([a], [a]) m () Source #

Monad m => MonadFwdInplaceStream (StateT (ByteString, Builder) m) Source # 
Instance details

Defined in StreamPatch.Stream

Associated Types

type Chunk (StateT (ByteString, Builder) m) Source #

class MonadFwdInplaceStream m => MonadCursorInplaceStream m where Source #

A forward stream, but backward too.

Methods

move :: Integer -> m () Source #

Move cursor.

Instances

Instances details
MonadIO m => MonadCursorInplaceStream (ReaderT Handle m) Source # 
Instance details

Defined in StreamPatch.Stream

Methods

move :: Integer -> ReaderT Handle m () Source #

class MonadFwdInplaceStream m => MonadFwdStream m where Source #

Methods

insert :: Chunk m -> m () Source #