genericserialize-0.1: Serialization library using Data.Generics

Data.Generics.Serialization.Streams

Description

This module provides a limited form of stream used by the serializers, and utility functions for using serializers on lists.

Synopsis

Documentation

class Monad m => MonadWStream m e | m -> e whereSource

The class of streams that support write operations. e is the type of elements written.

Methods

putv :: [e] -> m ()Source

Instances

data ListBuild e a Source

An implementation of MonadWStream using difference lists.

Instances

buildList :: ListBuild e () -> [e]Source

Run an action in a MonadWStream to produce a list, using ListBuild.

class Monad m => MonadRStream m e | m -> e whereSource

The class of readable streams.

Methods

getv :: m eSource

Read one element. Invokes fail if there are no more to read.

peekv :: m (Maybe e)Source

Examine the next element without removing it.

Instances

data ListRead e a Source

An implementation of MonadRStream using lists.

Instances

withList :: ListRead e a -> [e] -> Maybe aSource

Run an action in a MonadRStream to consume a list, using ListRead.