Safe Haskell | None |
---|---|
Language | Haskell98 |
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 -> c Source
encodeBundle :: Coding c => Bundle -> c Source
decodeMessage :: Coding c => c -> Maybe Message Source
decodeBundle :: Coding c => c -> Bundle Source