Safe Haskell | None |
---|
A type-class to provide coding operations to different data types using the same function names.
- class Coding a where
- encodePacket :: Packet -> a
- decodePacket :: a -> Packet
- type Coder = (Packet -> ByteString, ByteString -> Packet)
- encodeMessage :: Coding c => Message -> c
- encodeBundle :: Coding c => Bundle -> c
- decodeMessage :: Coding c => c -> Maybe Message
- decodeBundle :: Coding c => c -> Bundle
Documentation
Converting from and to binary packet representations.
type Coder = (Packet -> ByteString, ByteString -> Packet)Source
An encodePacket
and decodePacket
pair over ByteString
.
encodeMessage :: Coding c => Message -> cSource
encodeBundle :: Coding c => Bundle -> cSource
decodeMessage :: Coding c => c -> Maybe MessageSource
decodeBundle :: Coding c => c -> BundleSource