| Copyright | (C) 2015 Oleg Grenrus |
|---|---|
| License | BSD3 |
| Maintainer | Oleg Grenrus <oleg.grenrus@iki.fi> |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.Binary.Orphans
Description
- class Binary t where
- module Data.Binary
Class re-export
The Binary class provides put and get, methods to encode and
decode a Haskell value to a lazy ByteString. It mirrors the Read and
Show classes for textual representation of Haskell types, and is
suitable for serialising Haskell values to disk, over the network.
For decoding and generating simple external binary formats (e.g. C
structures), Binary may be used, but in general is not suitable
for complex protocols. Instead use the Put and Get primitives
directly.
Instances of Binary should satisfy the following property:
decode . encode == id
That is, the get and put methods should be the inverse of each
other. A range of instances are provided for basic Haskell types.
Methods
Encode a value in the Put monad.
Decode a value in the Get monad
Encode a list of values in the Put monad. The default implementation may be overridden to be more efficient but must still have the same encoding format.
Instances
Module re-export
module Data.Binary
Orphan instances
| Binary UTCTime # | |
| Binary Value # | |
| Binary All # | Since: binary-orphans-0.1.1.0 |
| Binary Any # | Since: binary-orphans-0.1.1.0 |
| Binary AbsoluteTime # | Since: binary-orphans-0.1.4.0 |
| Binary LocalTime # | |
| Binary TimeOfDay # | |
| Binary TimeZone # | |
| Binary NominalDiffTime # | |
| Binary Day # | |
| Binary UniversalTime # | |
| Binary DiffTime # | |
| Binary a => Binary (Min a) # | Since: binary-orphans-0.1.3.0 |
| Binary a => Binary (Max a) # | Since: binary-orphans-0.1.3.0 |
| Binary a => Binary (First a) # | Since: binary-orphans-0.1.3.0 |
| Binary a => Binary (Last a) # | Since: binary-orphans-0.1.3.0 |
| Binary m => Binary (WrappedMonoid m) # | Since: binary-orphans-0.1.5.0 |
| Binary a => Binary (Option a) # | Since: binary-orphans-0.1.3.0 |
| Binary a => Binary (NonEmpty a) # | Since: binary-orphans-0.1.3.0 |
| Binary a => Binary (Dual a) # | Since: 0.1.1.0 |
| Binary a => Binary (Sum a) # | Since: binary-orphans-0.1.1.0 |
| Binary a => Binary (Product a) # | Since: binary-orphans-0.1.1.0 |
| Binary a => Binary (First a) # | Since: binary-orphans-0.1.1.0 |
| Binary a => Binary (Last a) # | Since: binary-orphans-0.1.1.0 |
| (FoldCase a, Binary a) => Binary (CI a) # | Since: binary-orphans-0.1.5.0 |
| (Hashable a, Binary a) => Binary (Hashed a) # | |
| (Hashable v, Eq v, Binary v) => Binary (HashSet v) # | |
| (Hashable k, Eq k, Binary k, Binary v) => Binary (HashMap k v) # | |
| (Binary a, Binary b) => Binary (Arg a b) # | Since: binary-orphans-0.1.5.0 |
| Binary (f a) => Binary (Alt k f a) # | Since: binary-orphans-0.1.5.0 |
| Binary b => Binary (Tagged k s b) # | |