data-accessor-0.2.2.7: Utilities for accessing and manipulating fields of records

Safe Haskell | Safe
Language | Haskell98

Data.Accessor.BinaryRead

Description

Reading records from streams

This is still only for demonstration and might be of not much use and you should not rely on the interface.

# Documentation

type Stream = [Word8] #

class C a where #

Minimal complete definition

any

Methods

any :: ByteSource source => source a #

Instances

C Char # |
Methods any :: ByteSource source => source Char #
C Int # |
Methods any :: ByteSource source => source Int #
C Word8 # |
Methods any :: ByteSource source => source Word8 #

class Monad source => ByteSource source where #

Minimal complete definition

readWord8

Methods

readWord8 :: source Word8 #

Instances

(ByteStream s, Monad m) => ByteSource (StateT s m) # |
Methods readWord8 :: StateT s m Word8 #

class ByteStream s where #

Minimal complete definition

getWord8

Methods

getWord8 :: Monad m => s -> m (Word8, s) #

Instances

ByteCompatible byte => ByteStream [byte] # |
Methods getWord8 :: Monad m => [byte] -> m (Word8, [byte]) #

class ByteCompatible byte where #

Minimal complete definition

toByte

Methods

toByte :: byte -> Word8 #

Instances

ByteCompatible Word8 # |
Methods toByte :: Word8 -> Word8 #

newtype Parser s r #

Constructors

Parser |
Fields runParser :: (r, s) -> Maybe (r, s)

field :: (ByteStream s, C a) => T r a -> Parser s r #

record :: [Parser s r] -> Parser s r #