instant-bytes-0.2: Generic Serial instances through instant-generics

Safe HaskellNone
LanguageHaskell2010

Generics.Instant.Functions.Bytes

Contents

Synopsis

Documentation

You can use gserializeDefault and gdeserializeDefault as your generic serialize and deserialize implementations for any Representable type as follows:

instance Serial MyType where
   serialize = gserializeDefault
   deserialize = gdeserializeDefault

class (Representable a, GSerial (Rep a)) => RepGSerial a Source

RepGSerial is simply a synonym for (Representable a, GSerial (Rep a)) with the convenient kind (* -> Constraint)

Instances

Internals

class GSerial a where Source

Methods

gserialize :: MonadPut m => a -> m () Source

gdeserialize :: MonadGet m => m a Source

Instances

GSerial Z Source 
GSerial U Source 
Serial a => GSerial (Var a) Source 
Serial a => GSerial (Rec a) Source 
(GSumSerial a, GSumSerial b, GSerial a, GSerial b, GSumSize * a, GSumSize * b) => GSerial ((:+:) a b) Source 
(GSerial a, GSerial b) => GSerial ((:*:) a b) Source 
GSerial a => GSerial (CEq k k c p q a) Source 
GSerial a => GSerial (CEq k k c p p a) Source 

Even more internal

class GSumSerial a Source

Minimal complete definition

putSum, getSum

Instances

(GSumSerial a, GSumSerial b, GSerial a, GSerial b) => GSumSerial ((:+:) a b) Source 
GSerial a => GSumSerial (CEq k k c p q a) Source 
GSerial a => GSumSerial (CEq k k c p p a) Source 

class GSumSize a Source

Minimal complete definition

sumSize

Instances

(GSumSize * a, GSumSize * b) => GSumSize * ((:+:) a b) Source 
GSumSize * (CEq k k c p q a) Source