binary-orphans-0.1.0.0: Orphan instances for binary

Copyright(C) 2015 Oleg Grenrus
LicenseBSD3
MaintainerOleg Grenrus <oleg.grenrus@iki.fi>
Safe HaskellNone
LanguageHaskell2010

Data.Binary.Orphans

Contents

Description

Provides orphan Binary instances for types in various packages:

  • aeson
  • scientific
  • tagged
  • text (through text-binary, or text >= 1.2.1)
  • time
  • unordered-containers
  • vector (through vector-binary-instances)

Also there is Binary Fixed instance.

Synopsis

Class re-export

class Binary t where

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.

Minimal complete definition

Nothing

Methods

put :: t -> Put

Encode a value in the Put monad.

get :: Get t

Decode a value in the Get monad

Instances

Binary Bool 
Binary Char 
Binary Double 
Binary Float 
Binary Int 
Binary Int8 
Binary Int16 
Binary Int32 
Binary Int64 
Binary Integer 
Binary Ordering 
Binary Word 
Binary Word8 
Binary Word16 
Binary Word32 
Binary Word64 
Binary () 
Binary ByteString 
Binary ByteString 
Binary Scientific 
Binary Text 
Binary UTCTime 
Binary Value 
Binary Text 
Binary IntSet 
Binary LocalTime 
Binary TimeOfDay 
Binary TimeZone 
Binary NominalDiffTime 
Binary Day 
Binary UniversalTime 
Binary DiffTime 
Binary a => Binary [a] 
(Binary a, Integral a) => Binary (Ratio a) 
Binary a => Binary (Maybe a) 
Binary (Fixed a) 
Binary e => Binary (IntMap e) 
Binary a => Binary (Set a) 
Binary e => Binary (Tree e) 
Binary e => Binary (Seq e) 
(Hashable v, Eq v, Binary v) => Binary (HashSet v) 
Binary a => Binary (Vector a)

Boxed, generic vectors.

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

Unboxed vectors

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

Storable vectors

(Binary a, Binary b) => Binary (Either a b) 
(Binary a, Binary b) => Binary (a, b) 
(Hashable k, Eq k, Binary k, Binary v) => Binary (HashMap k v) 
(Binary k, Binary e) => Binary (Map k e) 
(Binary i, Ix i, Binary e, IArray UArray e) => Binary (UArray i e) 
(Binary i, Ix i, Binary e) => Binary (Array i e) 
(Binary a, Binary b, Binary c) => Binary (a, b, c) 
Binary b => Binary (Tagged k s b) 
(Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d) 
(Binary a, Binary b, Binary c, Binary d, Binary e) => Binary (a, b, c, d, e) 
(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f) => Binary (a, b, c, d, e, f) 
(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f, Binary g) => Binary (a, b, c, d, e, f, g) 
(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f, Binary g, Binary h) => Binary (a, b, c, d, e, f, g, h) 
(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f, Binary g, Binary h, Binary i) => Binary (a, b, c, d, e, f, g, h, i) 
(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f, Binary g, Binary h, Binary i, Binary j) => Binary (a, b, c, d, e, f, g, h, i, j) 

Module re-export