definitive-parser-3.1: General LogicT-based parser combinator library compatible with the definitive-base Prelude

Safe HaskellNone
LanguageHaskell2010

Language.Format

Contents

Synopsis

You'll need this

class Generic a #

Representable types of kind *. This class is derivable in GHC with the DeriveGeneric flag on.

Minimal complete definition

from, to

Instances

Generic Bool 

Associated Types

type Rep Bool :: * -> * #

Methods

from :: Bool -> Rep Bool x #

to :: Rep Bool x -> Bool #

Generic Ordering 

Associated Types

type Rep Ordering :: * -> * #

Methods

from :: Ordering -> Rep Ordering x #

to :: Rep Ordering x -> Ordering #

Generic () 

Associated Types

type Rep () :: * -> * #

Methods

from :: () -> Rep () x #

to :: Rep () x -> () #

Generic Void 

Associated Types

type Rep Void :: * -> * #

Methods

from :: Void -> Rep Void x #

to :: Rep Void x -> Void #

Generic Version 

Associated Types

type Rep Version :: * -> * #

Methods

from :: Version -> Rep Version x #

to :: Rep Version x -> Version #

Generic ExitCode 

Associated Types

type Rep ExitCode :: * -> * #

Methods

from :: ExitCode -> Rep ExitCode x #

to :: Rep ExitCode x -> ExitCode #

Generic All 

Associated Types

type Rep All :: * -> * #

Methods

from :: All -> Rep All x #

to :: Rep All x -> All #

Generic Any 

Associated Types

type Rep Any :: * -> * #

Methods

from :: Any -> Rep Any x #

to :: Rep Any x -> Any #

Generic Fixity 

Associated Types

type Rep Fixity :: * -> * #

Methods

from :: Fixity -> Rep Fixity x #

to :: Rep Fixity x -> Fixity #

Generic Associativity 

Associated Types

type Rep Associativity :: * -> * #

Generic SourceUnpackedness 
Generic SourceStrictness 
Generic DecidedStrictness 
Generic [a] 

Associated Types

type Rep [a] :: * -> * #

Methods

from :: [a] -> Rep [a] x #

to :: Rep [a] x -> [a] #

Generic (Maybe a) 

Associated Types

type Rep (Maybe a) :: * -> * #

Methods

from :: Maybe a -> Rep (Maybe a) x #

to :: Rep (Maybe a) x -> Maybe a #

Generic (V1 p) 

Associated Types

type Rep (V1 p) :: * -> * #

Methods

from :: V1 p -> Rep (V1 p) x #

to :: Rep (V1 p) x -> V1 p #

Generic (U1 p) 

Associated Types

type Rep (U1 p) :: * -> * #

Methods

from :: U1 p -> Rep (U1 p) x #

to :: Rep (U1 p) x -> U1 p #

Generic (Par1 p) 

Associated Types

type Rep (Par1 p) :: * -> * #

Methods

from :: Par1 p -> Rep (Par1 p) x #

to :: Rep (Par1 p) x -> Par1 p #

Generic (Identity a) 

Associated Types

type Rep (Identity a) :: * -> * #

Methods

from :: Identity a -> Rep (Identity a) x #

to :: Rep (Identity a) x -> Identity a #

Generic (Min a) 

Associated Types

type Rep (Min a) :: * -> * #

Methods

from :: Min a -> Rep (Min a) x #

to :: Rep (Min a) x -> Min a #

Generic (Max a) 

Associated Types

type Rep (Max a) :: * -> * #

Methods

from :: Max a -> Rep (Max a) x #

to :: Rep (Max a) x -> Max a #

Generic (First a) 

Associated Types

type Rep (First a) :: * -> * #

Methods

from :: First a -> Rep (First a) x #

to :: Rep (First a) x -> First a #

Generic (Last a) 

Associated Types

type Rep (Last a) :: * -> * #

Methods

from :: Last a -> Rep (Last a) x #

to :: Rep (Last a) x -> Last a #

Generic (WrappedMonoid m) 

Associated Types

type Rep (WrappedMonoid m) :: * -> * #

Generic (Option a) 

Associated Types

type Rep (Option a) :: * -> * #

Methods

from :: Option a -> Rep (Option a) x #

to :: Rep (Option a) x -> Option a #

Generic (NonEmpty a) 

Associated Types

type Rep (NonEmpty a) :: * -> * #

Methods

from :: NonEmpty a -> Rep (NonEmpty a) x #

to :: Rep (NonEmpty a) x -> NonEmpty a #

Generic (Complex a) 

Associated Types

type Rep (Complex a) :: * -> * #

Methods

from :: Complex a -> Rep (Complex a) x #

to :: Rep (Complex a) x -> Complex a #

Generic (ZipList a) 

Associated Types

type Rep (ZipList a) :: * -> * #

Methods

from :: ZipList a -> Rep (ZipList a) x #

to :: Rep (ZipList a) x -> ZipList a #

Generic (Dual a) 

Associated Types

type Rep (Dual a) :: * -> * #

Methods

from :: Dual a -> Rep (Dual a) x #

to :: Rep (Dual a) x -> Dual a #

Generic (Endo a) 

Associated Types

type Rep (Endo a) :: * -> * #

Methods

from :: Endo a -> Rep (Endo a) x #

to :: Rep (Endo a) x -> Endo a #

Generic (Sum a) 

Associated Types

type Rep (Sum a) :: * -> * #

Methods

from :: Sum a -> Rep (Sum a) x #

to :: Rep (Sum a) x -> Sum a #

Generic (Product a) 

Associated Types

type Rep (Product a) :: * -> * #

Methods

from :: Product a -> Rep (Product a) x #

to :: Rep (Product a) x -> Product a #

Generic (First a) 

Associated Types

type Rep (First a) :: * -> * #

Methods

from :: First a -> Rep (First a) x #

to :: Rep (First a) x -> First a #

Generic (Last a) 

Associated Types

type Rep (Last a) :: * -> * #

Methods

from :: Last a -> Rep (Last a) x #

to :: Rep (Last a) x -> Last a #

Generic (Either a b) 

Associated Types

type Rep (Either a b) :: * -> * #

Methods

from :: Either a b -> Rep (Either a b) x #

to :: Rep (Either a b) x -> Either a b #

Generic (Rec1 f p) 

Associated Types

type Rep (Rec1 f p) :: * -> * #

Methods

from :: Rec1 f p -> Rep (Rec1 f p) x #

to :: Rep (Rec1 f p) x -> Rec1 f p #

Generic (URec Char p) 

Associated Types

type Rep (URec Char p) :: * -> * #

Methods

from :: URec Char p -> Rep (URec Char p) x #

to :: Rep (URec Char p) x -> URec Char p #

Generic (URec Double p) 

Associated Types

type Rep (URec Double p) :: * -> * #

Methods

from :: URec Double p -> Rep (URec Double p) x #

to :: Rep (URec Double p) x -> URec Double p #

Generic (URec Float p) 

Associated Types

type Rep (URec Float p) :: * -> * #

Methods

from :: URec Float p -> Rep (URec Float p) x #

to :: Rep (URec Float p) x -> URec Float p #

Generic (URec Int p) 

Associated Types

type Rep (URec Int p) :: * -> * #

Methods

from :: URec Int p -> Rep (URec Int p) x #

to :: Rep (URec Int p) x -> URec Int p #

Generic (URec Word p) 

Associated Types

type Rep (URec Word p) :: * -> * #

Methods

from :: URec Word p -> Rep (URec Word p) x #

to :: Rep (URec Word p) x -> URec Word p #

Generic (URec (Ptr ()) p) 

Associated Types

type Rep (URec (Ptr ()) p) :: * -> * #

Methods

from :: URec (Ptr ()) p -> Rep (URec (Ptr ()) p) x #

to :: Rep (URec (Ptr ()) p) x -> URec (Ptr ()) p #

Generic (a, b) 

Associated Types

type Rep (a, b) :: * -> * #

Methods

from :: (a, b) -> Rep (a, b) x #

to :: Rep (a, b) x -> (a, b) #

Generic (Arg a b) 

Associated Types

type Rep (Arg a b) :: * -> * #

Methods

from :: Arg a b -> Rep (Arg a b) x #

to :: Rep (Arg a b) x -> Arg a b #

Generic (WrappedMonad m a) 

Associated Types

type Rep (WrappedMonad m a) :: * -> * #

Methods

from :: WrappedMonad m a -> Rep (WrappedMonad m a) x #

to :: Rep (WrappedMonad m a) x -> WrappedMonad m a #

Generic (Proxy k t) 

Associated Types

type Rep (Proxy k t) :: * -> * #

Methods

from :: Proxy k t -> Rep (Proxy k t) x #

to :: Rep (Proxy k t) x -> Proxy k t #

Generic (Bimap a b) 

Associated Types

type Rep (Bimap a b) :: * -> * #

Methods

from :: Bimap a b -> Rep (Bimap a b) x #

to :: Rep (Bimap a b) x -> Bimap a b #

Generic (Equiv e a) 

Associated Types

type Rep (Equiv e a) :: * -> * #

Methods

from :: Equiv e a -> Rep (Equiv e a) x #

to :: Rep (Equiv e a) x -> Equiv e a #

Generic (Free f a) 

Associated Types

type Rep (Free f a) :: * -> * #

Methods

from :: Free f a -> Rep (Free f a) x #

to :: Rep (Free f a) x -> Free f a #

Generic (K1 i c p) 

Associated Types

type Rep (K1 i c p) :: * -> * #

Methods

from :: K1 i c p -> Rep (K1 i c p) x #

to :: Rep (K1 i c p) x -> K1 i c p #

Generic ((:+:) f g p) 

Associated Types

type Rep ((:+:) f g p) :: * -> * #

Methods

from :: (f :+: g) p -> Rep ((f :+: g) p) x #

to :: Rep ((f :+: g) p) x -> (f :+: g) p #

Generic ((:*:) f g p) 

Associated Types

type Rep ((:*:) f g p) :: * -> * #

Methods

from :: (f :*: g) p -> Rep ((f :*: g) p) x #

to :: Rep ((f :*: g) p) x -> (f :*: g) p #

Generic ((:.:) f g p) 

Associated Types

type Rep ((:.:) f g p) :: * -> * #

Methods

from :: (f :.: g) p -> Rep ((f :.: g) p) x #

to :: Rep ((f :.: g) p) x -> (f :.: g) p #

Generic (a, b, c) 

Associated Types

type Rep (a, b, c) :: * -> * #

Methods

from :: (a, b, c) -> Rep (a, b, c) x #

to :: Rep (a, b, c) x -> (a, b, c) #

Generic (WrappedArrow a b c) 

Associated Types

type Rep (WrappedArrow a b c) :: * -> * #

Methods

from :: WrappedArrow a b c -> Rep (WrappedArrow a b c) x #

to :: Rep (WrappedArrow a b c) x -> WrappedArrow a b c #

Generic (Const k a b) 

Associated Types

type Rep (Const k a b) :: * -> * #

Methods

from :: Const k a b -> Rep (Const k a b) x #

to :: Rep (Const k a b) x -> Const k a b #

Generic (Alt k f a) 

Associated Types

type Rep (Alt k f a) :: * -> * #

Methods

from :: Alt k f a -> Rep (Alt k f a) x #

to :: Rep (Alt k f a) x -> Alt k f a #

Generic (Relation e a b) 

Associated Types

type Rep (Relation e a b) :: * -> * #

Methods

from :: Relation e a b -> Rep (Relation e a b) x #

to :: Rep (Relation e a b) x -> Relation e a b #

Generic (M1 i c f p) 

Associated Types

type Rep (M1 i c f p) :: * -> * #

Methods

from :: M1 i c f p -> Rep (M1 i c f p) x #

to :: Rep (M1 i c f p) x -> M1 i c f p #

Generic (a, b, c, d) 

Associated Types

type Rep (a, b, c, d) :: * -> * #

Methods

from :: (a, b, c, d) -> Rep (a, b, c, d) x #

to :: Rep (a, b, c, d) x -> (a, b, c, d) #

Generic (a, b, c, d, e) 

Associated Types

type Rep (a, b, c, d, e) :: * -> * #

Methods

from :: (a, b, c, d, e) -> Rep (a, b, c, d, e) x #

to :: Rep (a, b, c, d, e) x -> (a, b, c, d, e) #

Generic (a, b, c, d, e, f) 

Associated Types

type Rep (a, b, c, d, e, f) :: * -> * #

Methods

from :: (a, b, c, d, e, f) -> Rep (a, b, c, d, e, f) x #

to :: Rep (a, b, c, d, e, f) x -> (a, b, c, d, e, f) #

Generic (a, b, c, d, e, f, g) 

Associated Types

type Rep (a, b, c, d, e, f, g) :: * -> * #

Methods

from :: (a, b, c, d, e, f, g) -> Rep (a, b, c, d, e, f, g) x #

to :: Rep (a, b, c, d, e, f, g) x -> (a, b, c, d, e, f, g) #

Serialization

class ParseStreamType s => SerialStreamType s Source #

Associated Types

type StreamBuilder s :: * Source #

Instances

class (SerialStreamType stream, ParseStream stream, StreamChar stream ~ Word8, Monoid (StreamBuilder stream)) => SerialStream stream where Source #

Minimal complete definition

encodeByte, toSerialStream

Methods

encodeByte :: Proxy stream -> Word8 -> StreamBuilder stream Source #

toSerialStream :: StreamBuilder stream -> stream Source #

class SerialStream stream => Serializable stream t where Source #

Methods

encode :: Proxy stream -> t -> StreamBuilder stream Source #

encode :: (Generic t, GenSerializable stream (Rep t)) => Proxy stream -> t -> StreamBuilder stream Source #

Instances

SerialStream stream => Serializable stream Integer Source # 

Methods

encode :: Proxy stream -> Integer -> StreamBuilder stream Source #

SerialStream stream => Serializable stream () Source # 

Methods

encode :: Proxy stream -> () -> StreamBuilder stream Source #

SerialStream stream => Serializable stream Bool Source # 

Methods

encode :: Proxy stream -> Bool -> StreamBuilder stream Source #

SerialStream stream => Serializable stream Int Source # 

Methods

encode :: Proxy stream -> Int -> StreamBuilder stream Source #

SerialStream stream => Serializable stream Word8 Source # 

Methods

encode :: Proxy stream -> Word8 -> StreamBuilder stream Source #

Serializable Bytes Char Source # 
Serializable Bytes Double Source # 
Serializable Bytes Float Source # 
Serializable Bytes Word16 Source # 
Serializable Bytes Word32 Source # 
Serializable Bytes Word64 Source # 
Serializable Bytes Bytes Source # 
Serializable stream a => Serializable stream (Range a) Source # 

Methods

encode :: Proxy stream -> Range a -> StreamBuilder stream Source #

Serializable stream a => Serializable stream (Set a) Source # 

Methods

encode :: Proxy stream -> Set a -> StreamBuilder stream Source #

Serializable stream a => Serializable stream [a] Source # 

Methods

encode :: Proxy stream -> [a] -> StreamBuilder stream Source #

Serializable stream a => Serializable stream (Maybe a) Source # 

Methods

encode :: Proxy stream -> Maybe a -> StreamBuilder stream Source #

SerialStream stream => Serializable stream (Proxy a) Source # 

Methods

encode :: Proxy stream -> Proxy a -> StreamBuilder stream Source #

Serializable Bytes (LittleEndian Word16) Source # 
Serializable Bytes (LittleEndian Word32) Source # 
Serializable Bytes (LittleEndian Word64) Source # 
(Serializable stream a, Serializable stream b) => Serializable stream ((:+:) a b) Source # 

Methods

encode :: Proxy stream -> (a :+: b) -> StreamBuilder stream Source #

(Serializable stream a, Serializable stream b) => Serializable stream ((:*:) a b) Source # 

Methods

encode :: Proxy stream -> (a :*: b) -> StreamBuilder stream Source #

(Ord a, Serializable stream a, Serializable stream e) => Serializable stream (Equiv e a) Source # 

Methods

encode :: Proxy stream -> Equiv e a -> StreamBuilder stream Source #

(Serializable stream k, Serializable stream a) => Serializable stream (Bimap k a) Source # 

Methods

encode :: Proxy stream -> Bimap k a -> StreamBuilder stream Source #

(Serializable stream k, Serializable stream a) => Serializable stream (Map k a) Source # 

Methods

encode :: Proxy stream -> Map k a -> StreamBuilder stream Source #

(Serializable stream k, Serializable stream a) => Serializable stream (Cofree (Map k) a) Source # 

Methods

encode :: Proxy stream -> Cofree (Map k) a -> StreamBuilder stream Source #

Serializable stream a => Serializable stream (Cofree [] a) Source # 

Methods

encode :: Proxy stream -> Cofree [] a -> StreamBuilder stream Source #

Serializable stream a => Serializable stream (Cofree Maybe a) Source # 

Methods

encode :: Proxy stream -> Cofree Maybe a -> StreamBuilder stream Source #

(Serializable stream k, Serializable stream a) => Serializable stream (Free (Map k) a) Source # 

Methods

encode :: Proxy stream -> Free (Map k) a -> StreamBuilder stream Source #

Serializable stream a => Serializable stream (Free [] a) Source # 

Methods

encode :: Proxy stream -> Free [] a -> StreamBuilder stream Source #

Serializable stream a => Serializable stream (Free Maybe a) Source # 

Methods

encode :: Proxy stream -> Free Maybe a -> StreamBuilder stream Source #

(Serializable stream a, Serializable stream b, Serializable stream c) => Serializable stream (Union3 a b c) Source # 

Methods

encode :: Proxy stream -> Union3 a b c -> StreamBuilder stream Source #

(Serializable stream a, Serializable stream b, Serializable stream c) => Serializable stream (a, b, c) Source # 

Methods

encode :: Proxy stream -> (a, b, c) -> StreamBuilder stream Source #

(Ord a, Ord b, Serializable stream a, Serializable stream b, Serializable stream e) => Serializable stream (Relation e a b) Source # 

Methods

encode :: Proxy stream -> Relation e a b -> StreamBuilder stream Source #

Serializable stream (f (g a)) => Serializable stream ((:.:) f g a) Source # 

Methods

encode :: Proxy stream -> (f :.: g) a -> StreamBuilder stream Source #

(Serializable stream a, Serializable stream b, Serializable stream c, Serializable stream d) => Serializable stream (Union4 a b c d) Source # 

Methods

encode :: Proxy stream -> Union4 a b c d -> StreamBuilder stream Source #

(Serializable stream a, Serializable stream b, Serializable stream c, Serializable stream d) => Serializable stream (a, b, c, d) Source # 

Methods

encode :: Proxy stream -> (a, b, c, d) -> StreamBuilder stream Source #

(Serializable stream a, Serializable stream b, Serializable stream c, Serializable stream d, Serializable stream e) => Serializable stream (Union5 a b c d e) Source # 

Methods

encode :: Proxy stream -> Union5 a b c d e -> StreamBuilder stream Source #

(Serializable stream a, Serializable stream b, Serializable stream c, Serializable stream d, Serializable stream e) => Serializable stream (a, b, c, d, e) Source # 

Methods

encode :: Proxy stream -> (a, b, c, d, e) -> StreamBuilder stream Source #

(Serializable stream a, Serializable stream b, Serializable stream c, Serializable stream d, Serializable stream e, Serializable stream f) => Serializable stream (Union6 a b c d e f) Source # 

Methods

encode :: Proxy stream -> Union6 a b c d e f -> StreamBuilder stream Source #

(Serializable stream a, Serializable stream b, Serializable stream c, Serializable stream d, Serializable stream e, Serializable stream f) => Serializable stream (a, b, c, d, e, f) Source # 

Methods

encode :: Proxy stream -> (a, b, c, d, e, f) -> StreamBuilder stream Source #

(Serializable stream a, Serializable stream b, Serializable stream c, Serializable stream d, Serializable stream e, Serializable stream f, Serializable stream g) => Serializable stream (Union7 a b c d e f g) Source # 

Methods

encode :: Proxy stream -> Union7 a b c d e f g -> StreamBuilder stream Source #

(Serializable stream a, Serializable stream b, Serializable stream c, Serializable stream d, Serializable stream e, Serializable stream f, Serializable stream g) => Serializable stream (a, b, c, d, e, f, g) Source # 

Methods

encode :: Proxy stream -> (a, b, c, d, e, f, g) -> StreamBuilder stream Source #

(Serializable stream a, Serializable stream b, Serializable stream c, Serializable stream d, Serializable stream e, Serializable stream f, Serializable stream g, Serializable stream h) => Serializable stream (Union8 a b c d e f g h) Source # 

Methods

encode :: Proxy stream -> Union8 a b c d e f g h -> StreamBuilder stream Source #

(Serializable stream a, Serializable stream b, Serializable stream c, Serializable stream d, Serializable stream e, Serializable stream f, Serializable stream g, Serializable stream h) => Serializable stream (a, b, c, d, e, f, g, h) Source # 

Methods

encode :: Proxy stream -> (a, b, c, d, e, f, g, h) -> StreamBuilder stream Source #

(Serializable stream a, Serializable stream b, Serializable stream c, Serializable stream d, Serializable stream e, Serializable stream f, Serializable stream g, Serializable stream h, Serializable stream i) => Serializable stream (Union9 a b c d e f g h i) Source # 

Methods

encode :: Proxy stream -> Union9 a b c d e f g h i -> StreamBuilder stream Source #

(Serializable stream a, Serializable stream b, Serializable stream c, Serializable stream d, Serializable stream e, Serializable stream f, Serializable stream g, Serializable stream h, Serializable stream i) => Serializable stream (a, b, c, d, e, f, g, h, i) Source # 

Methods

encode :: Proxy stream -> (a, b, c, d, e, f, g, h, i) -> StreamBuilder stream Source #

class Serializable stream t => Format stream t where Source #

Methods

datum :: Parser stream t Source #

datum :: (Generic t, GenFormat stream (Rep t)) => Parser stream t Source #

Instances

SerialStream stream => Format stream Integer Source # 

Methods

datum :: Parser stream Integer Source #

SerialStream stream => Format stream () Source # 

Methods

datum :: Parser stream () Source #

SerialStream stream => Format stream Bool Source # 

Methods

datum :: Parser stream Bool Source #

SerialStream stream => Format stream Int Source # 

Methods

datum :: Parser stream Int Source #

SerialStream stream => Format stream Word8 Source # 

Methods

datum :: Parser stream Word8 Source #

Format Bytes Char Source # 
Format Bytes Double Source # 
Format Bytes Float Source # 
Format Bytes Word16 Source # 
Format Bytes Word32 Source # 
Format Bytes Word64 Source # 
Format Bytes Bytes Source # 
Format stream a => Format stream (Range a) Source # 

Methods

datum :: Parser stream (Range a) Source #

(Ord a, Format stream a) => Format stream (Set a) Source # 

Methods

datum :: Parser stream (Set a) Source #

Format stream a => Format stream [a] Source # 

Methods

datum :: Parser stream [a] Source #

Format stream a => Format stream (Maybe a) Source # 

Methods

datum :: Parser stream (Maybe a) Source #

SerialStream stream => Format stream (Proxy a) Source # 

Methods

datum :: Parser stream (Proxy a) Source #

Format Bytes (LittleEndian Word16) Source # 
Format Bytes (LittleEndian Word32) Source # 
Format Bytes (LittleEndian Word64) Source # 
(Format stream a, Format stream b) => Format stream ((:+:) a b) Source # 

Methods

datum :: Parser stream (a :+: b) Source #

(Format stream a, Format stream b) => Format stream ((:*:) a b) Source # 

Methods

datum :: Parser stream (a :*: b) Source #

(Ord a, Format stream a, Format stream e) => Format stream (Equiv e a) Source # 

Methods

datum :: Parser stream (Equiv e a) Source #

(Ord k, Ord a, Format stream k, Format stream a) => Format stream (Bimap k a) Source # 

Methods

datum :: Parser stream (Bimap k a) Source #

(Ord k, Format stream k, Format stream a) => Format stream (Map k a) Source # 

Methods

datum :: Parser stream (Map k a) Source #

(Ord k, Format stream k, Format stream a) => Format stream (Cofree (Map k) a) Source # 

Methods

datum :: Parser stream (Cofree (Map k) a) Source #

Format stream a => Format stream (Cofree [] a) Source # 

Methods

datum :: Parser stream (Cofree [] a) Source #

Format stream a => Format stream (Cofree Maybe a) Source # 

Methods

datum :: Parser stream (Cofree Maybe a) Source #

(Ord k, Format stream k, Format stream a) => Format stream (Free (Map k) a) Source # 

Methods

datum :: Parser stream (Free (Map k) a) Source #

Format stream a => Format stream (Free [] a) Source # 

Methods

datum :: Parser stream (Free [] a) Source #

Format stream a => Format stream (Free Maybe a) Source # 

Methods

datum :: Parser stream (Free Maybe a) Source #

(Format stream a, Format stream b, Format stream c) => Format stream (Union3 a b c) Source # 

Methods

datum :: Parser stream (Union3 a b c) Source #

(Format stream a, Format stream b, Format stream c) => Format stream (a, b, c) Source # 

Methods

datum :: Parser stream (a, b, c) Source #

(Ord a, Ord b, Format stream a, Format stream b, Format stream e) => Format stream (Relation e a b) Source # 

Methods

datum :: Parser stream (Relation e a b) Source #

Format stream (f (g a)) => Format stream ((:.:) f g a) Source # 

Methods

datum :: Parser stream ((f :.: g) a) Source #

(Format stream a, Format stream b, Format stream c, Format stream d) => Format stream (Union4 a b c d) Source # 

Methods

datum :: Parser stream (Union4 a b c d) Source #

(Format stream a, Format stream b, Format stream c, Format stream d) => Format stream (a, b, c, d) Source # 

Methods

datum :: Parser stream (a, b, c, d) Source #

(Format stream a, Format stream b, Format stream c, Format stream d, Format stream e) => Format stream (Union5 a b c d e) Source # 

Methods

datum :: Parser stream (Union5 a b c d e) Source #

(Format stream a, Format stream b, Format stream c, Format stream d, Format stream e) => Format stream (a, b, c, d, e) Source # 

Methods

datum :: Parser stream (a, b, c, d, e) Source #

(Format stream a, Format stream b, Format stream c, Format stream d, Format stream e, Format stream f) => Format stream (Union6 a b c d e f) Source # 

Methods

datum :: Parser stream (Union6 a b c d e f) Source #

(Format stream a, Format stream b, Format stream c, Format stream d, Format stream e, Format stream f) => Format stream (Tuple6 a b c d e f) Source # 

Methods

datum :: Parser stream (Tuple6 a b c d e f) Source #

(Format stream a, Format stream b, Format stream c, Format stream d, Format stream e, Format stream f, Format stream g) => Format stream (Union7 a b c d e f g) Source # 

Methods

datum :: Parser stream (Union7 a b c d e f g) Source #

(Format stream a, Format stream b, Format stream c, Format stream d, Format stream e, Format stream f, Format stream g) => Format stream (Tuple7 a b c d e f g) Source # 

Methods

datum :: Parser stream (Tuple7 a b c d e f g) Source #

(Format stream a, Format stream b, Format stream c, Format stream d, Format stream e, Format stream f, Format stream g, Format stream h) => Format stream (Union8 a b c d e f g h) Source # 

Methods

datum :: Parser stream (Union8 a b c d e f g h) Source #

(Format stream a, Format stream b, Format stream c, Format stream d, Format stream e, Format stream f, Format stream g, Format stream h) => Format stream (Tuple8 a b c d e f g h) Source # 

Methods

datum :: Parser stream (Tuple8 a b c d e f g h) Source #

(Format stream a, Format stream b, Format stream c, Format stream d, Format stream e, Format stream f, Format stream g, Format stream h, Format stream i) => Format stream (Union9 a b c d e f g h i) Source # 

Methods

datum :: Parser stream (Union9 a b c d e f g h i) Source #

(Format stream a, Format stream b, Format stream c, Format stream d, Format stream e, Format stream f, Format stream g, Format stream h, Format stream i) => Format stream (Tuple9 a b c d e f g h i) Source # 

Methods

datum :: Parser stream (Tuple9 a b c d e f g h i) Source #

data Builder :: * #

Builders denote sequences of bytes. They are Monoids where mempty is the zero-length sequence and mappend is concatenation, which runs in O(1).

serialize :: forall stream t. Serializable stream t => t -> stream Source #

serial :: (Format stream t, Serializable stream t') => Traversal t t' stream stream Source #

Convenience functions

defaultEncode :: (Generic t, GenSerializable stream (Rep t)) => Proxy stream -> t -> StreamBuilder stream Source #

defaultDatum :: (Generic t, GenFormat stream (Rep t)) => Parser stream t Source #

encodeFree :: (Serializable stream (Forest f a), Serializable stream a) => Proxy stream -> Free f a -> StreamBuilder stream Source #

encodeCofree :: (Serializable stream (Coforest f a), Serializable stream a) => Proxy stream -> Cofree f a -> StreamBuilder stream Source #

datumFree :: (Format stream (Forest f a), Format stream a) => Parser stream (Free f a) Source #

datumCofree :: (Format stream (Coforest f a), Format stream a) => Parser stream (Cofree f a) Source #

word8 :: Word8 -> Builder #

Encode a single unsigned byte as-is.

data Word8 :: * #

8-bit unsigned integer type

Instances

Bounded Word8 
Enum Word8 
Eq Word8 

Methods

(==) :: Word8 -> Word8 -> Bool #

(/=) :: Word8 -> Word8 -> Bool #

Integral Word8 
Num Word8 
Ord Word8 

Methods

compare :: Word8 -> Word8 -> Ordering #

(<) :: Word8 -> Word8 -> Bool #

(<=) :: Word8 -> Word8 -> Bool #

(>) :: Word8 -> Word8 -> Bool #

(>=) :: Word8 -> Word8 -> Bool #

max :: Word8 -> Word8 -> Word8 #

min :: Word8 -> Word8 -> Word8 #

Read Word8 
Real Word8 

Methods

toRational :: Word8 -> Rational #

Show Word8 

Methods

showsPrec :: Int -> Word8 -> ShowS #

show :: Word8 -> String #

showList :: [Word8] -> ShowS #

Ix Word8 
Storable Word8 

Methods

sizeOf :: Word8 -> Int #

alignment :: Word8 -> Int #

peekElemOff :: Ptr Word8 -> Int -> IO Word8 #

pokeElemOff :: Ptr Word8 -> Int -> Word8 -> IO () #

peekByteOff :: Ptr b -> Int -> IO Word8 #

pokeByteOff :: Ptr b -> Int -> Word8 -> IO () #

peek :: Ptr Word8 -> IO Word8 #

poke :: Ptr Word8 -> Word8 -> IO () #

Bits Word8 
FiniteBits Word8 
NFData Word8 

Methods

rnf :: Word8 -> () #

Stream Word8 Bytes 

Methods

uncons :: Bytes -> Maybe (Word8, Bytes) #

cons :: Word8 -> Bytes -> Bytes #

SerialStream stream => Format stream Word8 Source # 

Methods

datum :: Parser stream Word8 Source #

SerialStream stream => Serializable stream Word8 Source # 

Methods

encode :: Proxy stream -> Word8 -> StreamBuilder stream Source #

data Word16 :: * #

16-bit unsigned integer type

Instances

Bounded Word16 
Enum Word16 
Eq Word16 

Methods

(==) :: Word16 -> Word16 -> Bool #

(/=) :: Word16 -> Word16 -> Bool #

Integral Word16 
Num Word16 
Ord Word16 
Read Word16 
Real Word16 
Show Word16 
Ix Word16 
Storable Word16 
Bits Word16 
FiniteBits Word16 
NFData Word16 

Methods

rnf :: Word16 -> () #

Format Bytes Word16 Source # 
Serializable Bytes Word16 Source # 
Format Bytes (LittleEndian Word16) Source # 
Serializable Bytes (LittleEndian Word16) Source # 

data Word32 :: * #

32-bit unsigned integer type

Instances

Bounded Word32 
Enum Word32 
Eq Word32 

Methods

(==) :: Word32 -> Word32 -> Bool #

(/=) :: Word32 -> Word32 -> Bool #

Integral Word32 
Num Word32 
Ord Word32 
Read Word32 
Real Word32 
Show Word32 
Ix Word32 
Storable Word32 
Bits Word32 
FiniteBits Word32 
NFData Word32 

Methods

rnf :: Word32 -> () #

Format Bytes Word32 Source # 
Serializable Bytes Word32 Source # 
Format Bytes (LittleEndian Word32) Source # 
Serializable Bytes (LittleEndian Word32) Source # 

data Word64 :: * #

64-bit unsigned integer type

Instances

Bounded Word64 
Enum Word64 
Eq Word64 

Methods

(==) :: Word64 -> Word64 -> Bool #

(/=) :: Word64 -> Word64 -> Bool #

Integral Word64 
Num Word64 
Ord Word64 
Read Word64 
Real Word64 
Show Word64 
Ix Word64 
Storable Word64 
Bits Word64 
FiniteBits Word64 
NFData Word64 

Methods

rnf :: Word64 -> () #

Format Bytes Word64 Source # 
Serializable Bytes Word64 Source # 
Format Bytes (LittleEndian Word64) Source # 
Serializable Bytes (LittleEndian Word64) Source # 

encodeAlt :: Serializable stream a => Proxy stream -> Word8 -> a -> StreamBuilder stream Source #

data FormatAlt stream a Source #

Constructors

Format stream b => FormatAlt (b -> a) 

datumOf :: SerialStream stream => [FormatAlt stream a] -> Parser stream a Source #

Bidirectional serialization

runConnection Source #

Arguments

:: (MonadIO io, Monoid m) 
=> (a -> m)

An accumulating function

-> Bool

Close handle after parsing ?

-> Handle

A bidirectional Handle

-> ((?write :: Bytes -> IO ()) => ParserT Bytes io a)

The parser to run (has access to receive and send actions)

-> io m 

runConnection_ :: MonadIO io => Bool -> Handle -> ((?write :: Bytes -> IO ()) => ParserT Bytes io a) -> io () Source #

send :: (Serializable Bytes t, MonadIO m, ?write :: Bytes -> IO ()) => t -> m () Source #

receive :: (Format stream t, Monad m) => ParserT stream m t Source #

data Proxy a Source #

A proxy type to specify response types

Constructors

Proxy 

Instances

SerialStream stream => Format stream (Proxy a) Source # 

Methods

datum :: Parser stream (Proxy a) Source #

SerialStream stream => Serializable stream (Proxy a) Source # 

Methods

encode :: Proxy stream -> Proxy a -> StreamBuilder stream Source #

Eq (Proxy a) Source # 

Methods

(==) :: Proxy a -> Proxy a -> Bool #

(/=) :: Proxy a -> Proxy a -> Bool #

Ord (Proxy a) Source # 

Methods

compare :: Proxy a -> Proxy a -> Ordering #

(<) :: Proxy a -> Proxy a -> Bool #

(<=) :: Proxy a -> Proxy a -> Bool #

(>) :: Proxy a -> Proxy a -> Bool #

(>=) :: Proxy a -> Proxy a -> Bool #

max :: Proxy a -> Proxy a -> Proxy a #

min :: Proxy a -> Proxy a -> Proxy a #

Show (Proxy a) Source # 

Methods

showsPrec :: Int -> Proxy a -> ShowS #

show :: Proxy a -> String #

showList :: [Proxy a] -> ShowS #

exchange :: (MonadIO m, ?write :: Bytes -> IO (), Format stream a, Serializable Bytes b) => (Proxy a -> b) -> ParserT stream m a Source #

sending :: (MonadIO m, ?write :: Bytes -> IO (), Serializable Bytes a) => Proxy a -> a -> m () Source #

GND replacement for GHC 7.8 and up

coerceEncode :: forall stream t t'. Serializable stream t => (t -> t') -> Proxy stream -> t' -> StreamBuilder stream Source #

coerceDatum :: forall stream t t'. Format stream t => (t -> t') -> Parser stream t' Source #

Orphan instances

Semigroup Word8 Source # 

Methods

(+) :: Word8 -> Word8 -> Word8 #

Semigroup Word16 Source # 

Methods

(+) :: Word16 -> Word16 -> Word16 #

Semigroup Word32 Source # 

Methods

(+) :: Word32 -> Word32 -> Word32 #

Semigroup Word64 Source # 

Methods

(+) :: Word64 -> Word64 -> Word64 #

Semigroup Builder Source # 

Methods

(+) :: Builder -> Builder -> Builder #

Monoid Word8 Source # 

Methods

zero :: Word8 #

Monoid Word16 Source # 

Methods

zero :: Word16 #

Monoid Word32 Source # 

Methods

zero :: Word32 #

Monoid Word64 Source # 

Methods

zero :: Word64 #

Monoid Builder Source # 

Methods

zero :: Builder #

Disjonctive Word8 Source # 

Methods

negate :: Word8 -> Word8 #

(-) :: Word8 -> Word8 -> Word8 #

Disjonctive Word16 Source # 

Methods

negate :: Word16 -> Word16 #

(-) :: Word16 -> Word16 -> Word16 #

Disjonctive Word32 Source # 

Methods

negate :: Word32 -> Word32 #

(-) :: Word32 -> Word32 -> Word32 #

Disjonctive Word64 Source # 

Methods

negate :: Word64 -> Word64 #

(-) :: Word64 -> Word64 -> Word64 #

Semiring Word8 Source # 

Methods

(*) :: Word8 -> Word8 -> Word8 #

Semiring Word16 Source # 

Methods

(*) :: Word16 -> Word16 -> Word16 #

Semiring Word32 Source # 

Methods

(*) :: Word32 -> Word32 -> Word32 #

Semiring Word64 Source # 

Methods

(*) :: Word64 -> Word64 -> Word64 #

Ring Word8 Source # 

Methods

one :: Word8 #

Ring Word16 Source # 

Methods

one :: Word16 #

Ring Word32 Source # 

Methods

one :: Word32 #

Ring Word64 Source # 

Methods

one :: Word64 #

ParseStream Bytes Source # 
ParseStreamType Bytes Source # 

Associated Types

type StreamToken Bytes :: * Source #

type StreamChar Bytes :: * Source #