ouroboros-network-testing
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.Testing.Serialise

Contents

Synopsis

Class

class Serialise a where #

Types that are instances of the Serialise class allow values to be quickly encoded or decoded directly to a CBOR representation, for object transmission or storage.

Since: serialise-0.2.0.0

Minimal complete definition

Nothing

Methods

encode :: a -> Encoding #

Definition for encoding a given type into a binary representation, using the Encoding Monoid.

Since: serialise-0.2.0.0

default encode :: (Generic a, GSerialiseEncode (Rep a)) => a -> Encoding #

decode :: Decoder s a #

Definition of a given Decoder for a type.

Since: serialise-0.2.0.0

default decode :: (Generic a, GSerialiseDecode (Rep a)) => Decoder s a #

encodeList :: [a] -> Encoding #

Utility to support specialised encoding for some list type - used for Char/String instances in this package.

Since: serialise-0.2.0.0

decodeList :: Decoder s [a] #

Utility to support specialised decoding for some list type - used for Char/String instances in this package.

Since: serialise-0.2.0.0

Instances

Instances details
Serialise ByteString

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise ByteString

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise ShortByteString

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Term

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise IntSet

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Void

Since: serialise-0.2.4.0

Instance details

Defined in Codec.Serialise.Class

Serialise All

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Any

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise SomeTypeRep

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Version

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Fingerprint

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CChar

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CClock

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CDouble

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CFloat

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CInt

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CIntMax

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CIntPtr

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CLLong

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CLong

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CPtrdiff

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CSChar

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CSUSeconds

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CShort

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CSigAtomic

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CSize

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CTime

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CUChar

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CUInt

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CUIntMax

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CUIntPtr

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CULLong

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CULong

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CUSeconds

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CUShort

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise CWchar

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise ExitCode

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Int16

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Int32

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Int64

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Int8

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Word16

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Word32

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Word64

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Word8

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise KindRep

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Ordering

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise TyCon

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise TypeLitSort

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Half

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Text

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Text

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise UTCTime

UTCTime is encoded using the extended time format which is currently in Internet Draft state, https://tools.ietf.org/html/draft-bormann-cbor-time-tag-00.

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Integer

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Natural

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise ()

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: () -> Encoding #

decode :: Decoder s () #

encodeList :: [()] -> Encoding #

decodeList :: Decoder s [()] #

Serialise Bool

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Char

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Double

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Float

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Int

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Levity

Since: serialise-0.2.6.0

Instance details

Defined in Codec.Serialise.Class

Serialise RuntimeRep

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise VecCount

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise VecElem

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise Word

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise a => Serialise (Complex a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise a => Serialise (First a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise a => Serialise (Last a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: Last a -> Encoding #

decode :: Decoder s (Last a) #

encodeList :: [Last a] -> Encoding #

decodeList :: Decoder s [Last a] #

Serialise a => Serialise (Max a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: Max a -> Encoding #

decode :: Decoder s (Max a) #

encodeList :: [Max a] -> Encoding #

decodeList :: Decoder s [Max a] #

Serialise a => Serialise (Min a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: Min a -> Encoding #

decode :: Decoder s (Min a) #

encodeList :: [Min a] -> Encoding #

decodeList :: Decoder s [Min a] #

Serialise a => Serialise (WrappedMonoid a) 
Instance details

Defined in Codec.Serialise.Class

Serialise a => Serialise (IntMap a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise a => Serialise (Seq a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: Seq a -> Encoding #

decode :: Decoder s (Seq a) #

encodeList :: [Seq a] -> Encoding #

decodeList :: Decoder s [Seq a] #

(Ord a, Serialise a) => Serialise (Set a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: Set a -> Encoding #

decode :: Decoder s (Set a) #

encodeList :: [Set a] -> Encoding #

decodeList :: Decoder s [Set a] #

Serialise a => Serialise (Tree a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: Tree a -> Encoding #

decode :: Decoder s (Tree a) #

encodeList :: [Tree a] -> Encoding #

decodeList :: Decoder s [Tree a] #

Serialise a => Serialise (NonEmpty a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise a => Serialise (Identity a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise a => Serialise (First a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise a => Serialise (Last a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: Last a -> Encoding #

decode :: Decoder s (Last a) #

encodeList :: [Last a] -> Encoding #

decodeList :: Decoder s [Last a] #

Serialise a => Serialise (Down a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: Down a -> Encoding #

decode :: Decoder s (Down a) #

encodeList :: [Down a] -> Encoding #

decodeList :: Decoder s [Down a] #

Serialise a => Serialise (Dual a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: Dual a -> Encoding #

decode :: Decoder s (Dual a) #

encodeList :: [Dual a] -> Encoding #

decodeList :: Decoder s [Dual a] #

Serialise a => Serialise (Product a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise a => Serialise (Sum a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: Sum a -> Encoding #

decode :: Decoder s (Sum a) #

encodeList :: [Sum a] -> Encoding #

decodeList :: Decoder s [Sum a] #

Serialise a => Serialise (ZipList a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

(Serialise a, Integral a) => Serialise (Ratio a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise a => Serialise (Maybe a)

Since: serialise-0.2.4.0

Instance details

Defined in Codec.Serialise.Class

(Serialise a, Hashable a, Eq a) => Serialise (HashSet a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise a => Serialise (Vector a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

(Serialise a, Prim a) => Serialise (Vector a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

(Serialise a, Storable a) => Serialise (Vector a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

(Serialise a, Unbox a) => Serialise (Vector a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise a => Serialise (Maybe a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Serialise a => Serialise [a]

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: [a] -> Encoding #

decode :: Decoder s [a] #

encodeList :: [[a]] -> Encoding #

decodeList :: Decoder s [[a]] #

Serialise (Fixed e)

Values are serialised in units of least precision represented as Integer.

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

(Ord k, Serialise k, Serialise v) => Serialise (Map k v)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: Map k v -> Encoding #

decode :: Decoder s (Map k v) #

encodeList :: [Map k v] -> Encoding #

decodeList :: Decoder s [Map k v] #

(Serialise a, Serialise b) => Serialise (Either a b)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: Either a b -> Encoding #

decode :: Decoder s (Either a b) #

encodeList :: [Either a b] -> Encoding #

decodeList :: Decoder s [Either a b] #

Serialise (Proxy a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Typeable a => Serialise (TypeRep a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

(Serialise a, Serialise b) => Serialise (Either a b)

Since: serialise-0.2.4.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: Either a b -> Encoding #

decode :: Decoder s (Either a b) #

encodeList :: [Either a b] -> Encoding #

decodeList :: Decoder s [Either a b] #

(Serialise a, Serialise b) => Serialise (These a b)

Since: serialise-0.2.4.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: These a b -> Encoding #

decode :: Decoder s (These a b) #

encodeList :: [These a b] -> Encoding #

decodeList :: Decoder s [These a b] #

(Serialise a, Serialise b) => Serialise (Pair a b)

Since: serialise-0.2.4.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: Pair a b -> Encoding #

decode :: Decoder s (Pair a b) #

encodeList :: [Pair a b] -> Encoding #

decodeList :: Decoder s [Pair a b] #

(Serialise a, Serialise b) => Serialise (These a b)

Since: serialise-0.2.4.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: These a b -> Encoding #

decode :: Decoder s (These a b) #

encodeList :: [These a b] -> Encoding #

decodeList :: Decoder s [These a b] #

(Serialise k, Hashable k, Eq k, Serialise v) => Serialise (HashMap k v)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: HashMap k v -> Encoding #

decode :: Decoder s (HashMap k v) #

encodeList :: [HashMap k v] -> Encoding #

decodeList :: Decoder s [HashMap k v] #

(Serialise a, Serialise b) => Serialise (a, b)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: (a, b) -> Encoding #

decode :: Decoder s (a, b) #

encodeList :: [(a, b)] -> Encoding #

decodeList :: Decoder s [(a, b)] #

Serialise a => Serialise (Const a b)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: Const a b -> Encoding #

decode :: Decoder s (Const a b) #

encodeList :: [Const a b] -> Encoding #

decodeList :: Decoder s [Const a b] #

Serialise (f a) => Serialise (Alt f a)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: Alt f a -> Encoding #

decode :: Decoder s (Alt f a) #

encodeList :: [Alt f a] -> Encoding #

decodeList :: Decoder s [Alt f a] #

(Serialise a, Serialise b, Serialise c) => Serialise (a, b, c)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: (a, b, c) -> Encoding #

decode :: Decoder s (a, b, c) #

encodeList :: [(a, b, c)] -> Encoding #

decodeList :: Decoder s [(a, b, c)] #

(Serialise a, Serialise b, Serialise c, Serialise d) => Serialise (a, b, c, d)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: (a, b, c, d) -> Encoding #

decode :: Decoder s (a, b, c, d) #

encodeList :: [(a, b, c, d)] -> Encoding #

decodeList :: Decoder s [(a, b, c, d)] #

(Serialise a, Serialise b, Serialise c, Serialise d, Serialise e) => Serialise (a, b, c, d, e)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: (a, b, c, d, e) -> Encoding #

decode :: Decoder s (a, b, c, d, e) #

encodeList :: [(a, b, c, d, e)] -> Encoding #

decodeList :: Decoder s [(a, b, c, d, e)] #

(Serialise a, Serialise b, Serialise c, Serialise d, Serialise e, Serialise f) => Serialise (a, b, c, d, e, f)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: (a, b, c, d, e, f) -> Encoding #

decode :: Decoder s (a, b, c, d, e, f) #

encodeList :: [(a, b, c, d, e, f)] -> Encoding #

decodeList :: Decoder s [(a, b, c, d, e, f)] #

(Serialise a, Serialise b, Serialise c, Serialise d, Serialise e, Serialise f, Serialise g) => Serialise (a, b, c, d, e, f, g)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: (a, b, c, d, e, f, g) -> Encoding #

decode :: Decoder s (a, b, c, d, e, f, g) #

encodeList :: [(a, b, c, d, e, f, g)] -> Encoding #

decodeList :: Decoder s [(a, b, c, d, e, f, g)] #

(Serialise a, Serialise b, Serialise c, Serialise d, Serialise e, Serialise f, Serialise g, Serialise h) => Serialise (a, b, c, d, e, f, g, h)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: (a, b, c, d, e, f, g, h) -> Encoding #

decode :: Decoder s (a, b, c, d, e, f, g, h) #

encodeList :: [(a, b, c, d, e, f, g, h)] -> Encoding #

decodeList :: Decoder s [(a, b, c, d, e, f, g, h)] #

(Serialise a, Serialise b, Serialise c, Serialise d, Serialise e, Serialise f, Serialise g, Serialise h, Serialise i) => Serialise (a, b, c, d, e, f, g, h, i)

Since: serialise-0.2.0.0

Instance details

Defined in Codec.Serialise.Class

Methods

encode :: (a, b, c, d, e, f, g, h, i) -> Encoding #

decode :: Decoder s (a, b, c, d, e, f, g, h, i) #

encodeList :: [(a, b, c, d, e, f, g, h, i)] -> Encoding #

decodeList :: Decoder s [(a, b, c, d, e, f, g, h, i)] #