binary-orphans-0.1.8.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 (prior to scientific-0.3.4.0)
  • semigroups
  • 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 Source #

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 PutM 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 Source #

Encode a value in the Put monad.

get :: Get t Source #

Decode a value in the Get monad

putList :: [t] -> Put Source #

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
Binary Bool 
Instance details

Defined in Data.Binary.Class

Binary Char 
Instance details

Defined in Data.Binary.Class

Binary Double 
Instance details

Defined in Data.Binary.Class

Binary Float 
Instance details

Defined in Data.Binary.Class

Binary Int 
Instance details

Defined in Data.Binary.Class

Methods

put :: Int -> Put Source #

get :: Get Int Source #

putList :: [Int] -> Put Source #

Binary Int8 
Instance details

Defined in Data.Binary.Class

Binary Int16 
Instance details

Defined in Data.Binary.Class

Binary Int32 
Instance details

Defined in Data.Binary.Class

Binary Int64 
Instance details

Defined in Data.Binary.Class

Binary Integer 
Instance details

Defined in Data.Binary.Class

Binary Natural

Since: 0.7.3.0

Instance details

Defined in Data.Binary.Class

Binary Ordering 
Instance details

Defined in Data.Binary.Class

Binary Word 
Instance details

Defined in Data.Binary.Class

Binary Word8 
Instance details

Defined in Data.Binary.Class

Binary Word16 
Instance details

Defined in Data.Binary.Class

Binary Word32 
Instance details

Defined in Data.Binary.Class

Binary Word64 
Instance details

Defined in Data.Binary.Class

Binary RuntimeRep

@since 0.8.5.0. See

Instance details

Defined in Data.Binary.Class

Binary VecCount

@since 0.8.5.0. See

Instance details

Defined in Data.Binary.Class

Binary VecElem

@since 0.8.5.0. See

Instance details

Defined in Data.Binary.Class

Binary SomeTypeRep 
Instance details

Defined in Data.Binary.Class

Binary () 
Instance details

Defined in Data.Binary.Class

Methods

put :: () -> Put Source #

get :: Get () Source #

putList :: [()] -> Put Source #

Binary TyCon

@since 0.8.5.0. See

Instance details

Defined in Data.Binary.Class

Binary KindRep

@since 0.8.5.0. See

Instance details

Defined in Data.Binary.Class

Binary TypeLitSort

@since 0.8.5.0. See

Instance details

Defined in Data.Binary.Class

Binary ByteString 
Instance details

Defined in Data.Binary.Class

Binary ByteString 
Instance details

Defined in Data.Binary.Class

Binary Scientific

Note that in the future I intend to change the type of the base10Exponent from Int to Integer. To be forward compatible the Binary instance already encodes the exponent as Integer.

Instance details

Defined in Data.Scientific

Binary UTCTime Source # 
Instance details

Defined in Data.Binary.Orphans

Binary Value Source # 
Instance details

Defined in Data.Binary.Orphans

Binary Void

Since: 0.8.0.0

Instance details

Defined in Data.Binary.Class

Binary Version

Since: 0.8.0.0

Instance details

Defined in Data.Binary.Class

Binary All

Since: 0.8.4.0

Instance details

Defined in Data.Binary.Class

Methods

put :: All -> Put Source #

get :: Get All Source #

putList :: [All] -> Put Source #

Binary Any

Since: 0.8.4.0

Instance details

Defined in Data.Binary.Class

Methods

put :: Any -> Put Source #

get :: Get Any Source #

putList :: [Any] -> Put Source #

Binary Fingerprint

Since: 0.7.6.0

Instance details

Defined in Data.Binary.Class

Binary ShortByteString 
Instance details

Defined in Data.Binary.Class

Binary IntSet 
Instance details

Defined in Data.Binary.Class

Binary ZonedTime Source #

Since: binary-orphans-0.1.8.0

Instance details

Defined in Data.Binary.Orphans

Binary LocalTime Source # 
Instance details

Defined in Data.Binary.Orphans

Binary TimeOfDay Source # 
Instance details

Defined in Data.Binary.Orphans

Binary TimeZone Source # 
Instance details

Defined in Data.Binary.Orphans

Binary UniversalTime Source # 
Instance details

Defined in Data.Binary.Orphans

Binary SystemTime Source #

Since: binary-orphans-0.1.7.0

Instance details

Defined in Data.Binary.Orphans

Binary NominalDiffTime Source # 
Instance details

Defined in Data.Binary.Orphans

Binary AbsoluteTime Source #

Since: binary-orphans-0.1.4.0

Instance details

Defined in Data.Binary.Orphans

Binary DiffTime Source # 
Instance details

Defined in Data.Binary.Orphans

Binary Day Source # 
Instance details

Defined in Data.Binary.Orphans

Methods

put :: Day -> Put Source #

get :: Get Day Source #

putList :: [Day] -> Put Source #

Binary a => Binary [a] 
Instance details

Defined in Data.Binary.Class

Methods

put :: [a] -> Put Source #

get :: Get [a] Source #

putList :: [[a]] -> Put Source #

Binary a => Binary (Maybe a) 
Instance details

Defined in Data.Binary.Class

Methods

put :: Maybe a -> Put Source #

get :: Get (Maybe a) Source #

putList :: [Maybe a] -> Put Source #

(Binary a, Integral a) => Binary (Ratio a) 
Instance details

Defined in Data.Binary.Class

Methods

put :: Ratio a -> Put Source #

get :: Get (Ratio a) Source #

putList :: [Ratio a] -> Put Source #

Binary a => Binary (Complex a) 
Instance details

Defined in Data.Binary.Class

Methods

put :: Complex a -> Put Source #

get :: Get (Complex a) Source #

putList :: [Complex a] -> Put Source #

Binary (Fixed a)

Since: 0.8.0.0

Instance details

Defined in Data.Binary.Class

Methods

put :: Fixed a -> Put Source #

get :: Get (Fixed a) Source #

putList :: [Fixed a] -> Put Source #

Binary a => Binary (Min a)

Since: 0.8.4.0

Instance details

Defined in Data.Binary.Class

Methods

put :: Min a -> Put Source #

get :: Get (Min a) Source #

putList :: [Min a] -> Put Source #

Binary a => Binary (Max a)

Since: 0.8.4.0

Instance details

Defined in Data.Binary.Class

Methods

put :: Max a -> Put Source #

get :: Get (Max a) Source #

putList :: [Max a] -> Put Source #

Binary a => Binary (First a)

Since: 0.8.4.0

Instance details

Defined in Data.Binary.Class

Methods

put :: First a -> Put Source #

get :: Get (First a) Source #

putList :: [First a] -> Put Source #

Binary a => Binary (Last a)

Since: 0.8.4.0

Instance details

Defined in Data.Binary.Class

Methods

put :: Last a -> Put Source #

get :: Get (Last a) Source #

putList :: [Last a] -> Put Source #

Binary m => Binary (WrappedMonoid m)

Since: 0.8.4.0

Instance details

Defined in Data.Binary.Class

Binary a => Binary (Option a)

Since: 0.8.4.0

Instance details

Defined in Data.Binary.Class

Methods

put :: Option a -> Put Source #

get :: Get (Option a) Source #

putList :: [Option a] -> Put Source #

Binary a => Binary (Identity a) 
Instance details

Defined in Data.Binary.Class

Binary a => Binary (First a)

Since: 0.8.4.0

Instance details

Defined in Data.Binary.Class

Methods

put :: First a -> Put Source #

get :: Get (First a) Source #

putList :: [First a] -> Put Source #

Binary a => Binary (Last a)

Since: 0.8.4.0

Instance details

Defined in Data.Binary.Class

Methods

put :: Last a -> Put Source #

get :: Get (Last a) Source #

putList :: [Last a] -> Put Source #

Binary a => Binary (Dual a)

Since: 0.8.4.0

Instance details

Defined in Data.Binary.Class

Methods

put :: Dual a -> Put Source #

get :: Get (Dual a) Source #

putList :: [Dual a] -> Put Source #

Binary a => Binary (Sum a)

Since: 0.8.4.0

Instance details

Defined in Data.Binary.Class

Methods

put :: Sum a -> Put Source #

get :: Get (Sum a) Source #

putList :: [Sum a] -> Put Source #

Binary a => Binary (Product a)

Since: 0.8.4.0

Instance details

Defined in Data.Binary.Class

Methods

put :: Product a -> Put Source #

get :: Get (Product a) Source #

putList :: [Product a] -> Put Source #

Binary a => Binary (NonEmpty a)

Since: 0.8.4.0

Instance details

Defined in Data.Binary.Class

(FoldCase a, Binary a) => Binary (CI a) Source #

Since: binary-orphans-0.1.5.0

Instance details

Defined in Data.Binary.Orphans

Methods

put :: CI a -> Put Source #

get :: Get (CI a) Source #

putList :: [CI a] -> Put Source #

Binary e => Binary (IntMap e) 
Instance details

Defined in Data.Binary.Class

Methods

put :: IntMap e -> Put Source #

get :: Get (IntMap e) Source #

putList :: [IntMap e] -> Put Source #

Binary e => Binary (Tree e) 
Instance details

Defined in Data.Binary.Class

Methods

put :: Tree e -> Put Source #

get :: Get (Tree e) Source #

putList :: [Tree e] -> Put Source #

Binary e => Binary (Seq e) 
Instance details

Defined in Data.Binary.Class

Methods

put :: Seq e -> Put Source #

get :: Get (Seq e) Source #

putList :: [Seq e] -> Put Source #

Binary a => Binary (Set a) 
Instance details

Defined in Data.Binary.Class

Methods

put :: Set a -> Put Source #

get :: Get (Set a) Source #

putList :: [Set a] -> Put Source #

(Hashable a, Binary a) => Binary (Hashed a) Source # 
Instance details

Defined in Data.Binary.Orphans

Methods

put :: Hashed a -> Put Source #

get :: Get (Hashed a) Source #

putList :: [Hashed a] -> Put Source #

(Hashable v, Eq v, Binary v) => Binary (HashSet v) Source # 
Instance details

Defined in Data.Binary.Orphans

Methods

put :: HashSet v -> Put Source #

get :: Get (HashSet v) Source #

putList :: [HashSet v] -> Put Source #

(Binary a, Binary b) => Binary (Either a b) 
Instance details

Defined in Data.Binary.Class

Methods

put :: Either a b -> Put Source #

get :: Get (Either a b) Source #

putList :: [Either a b] -> Put Source #

Typeable a => Binary (TypeRep a) 
Instance details

Defined in Data.Binary.Class

Methods

put :: TypeRep a -> Put Source #

get :: Get (TypeRep a) Source #

putList :: [TypeRep a] -> Put Source #

(Binary a, Binary b) => Binary (a, b) 
Instance details

Defined in Data.Binary.Class

Methods

put :: (a, b) -> Put Source #

get :: Get (a, b) Source #

putList :: [(a, b)] -> Put Source #

(Hashable k, Eq k, Binary k, Binary v) => Binary (HashMap k v) Source # 
Instance details

Defined in Data.Binary.Orphans

Methods

put :: HashMap k v -> Put Source #

get :: Get (HashMap k v) Source #

putList :: [HashMap k v] -> Put Source #

(Binary k, Binary e) => Binary (Map k e) 
Instance details

Defined in Data.Binary.Class

Methods

put :: Map k e -> Put Source #

get :: Get (Map k e) Source #

putList :: [Map k e] -> Put Source #

(Binary i, Ix i, Binary e, IArray UArray e) => Binary (UArray i e) 
Instance details

Defined in Data.Binary.Class

Methods

put :: UArray i e -> Put Source #

get :: Get (UArray i e) Source #

putList :: [UArray i e] -> Put Source #

(Binary i, Ix i, Binary e) => Binary (Array i e) 
Instance details

Defined in Data.Binary.Class

Methods

put :: Array i e -> Put Source #

get :: Get (Array i e) Source #

putList :: [Array i e] -> Put Source #

(Binary a, Binary b) => Binary (Arg a b)

Since: 0.8.4.0

Instance details

Defined in Data.Binary.Class

Methods

put :: Arg a b -> Put Source #

get :: Get (Arg a b) Source #

putList :: [Arg a b] -> Put Source #

(Binary a, Binary b, Binary c) => Binary (a, b, c) 
Instance details

Defined in Data.Binary.Class

Methods

put :: (a, b, c) -> Put Source #

get :: Get (a, b, c) Source #

putList :: [(a, b, c)] -> Put Source #

Binary (f a) => Binary (Alt f a)

Since: 0.8.4.0

Instance details

Defined in Data.Binary.Class

Methods

put :: Alt f a -> Put Source #

get :: Get (Alt f a) Source #

putList :: [Alt f a] -> Put Source #

Binary b => Binary (Tagged s b) Source # 
Instance details

Defined in Data.Binary.Orphans

Methods

put :: Tagged s b -> Put Source #

get :: Get (Tagged s b) Source #

putList :: [Tagged s b] -> Put Source #

(Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d) 
Instance details

Defined in Data.Binary.Class

Methods

put :: (a, b, c, d) -> Put Source #

get :: Get (a, b, c, d) Source #

putList :: [(a, b, c, d)] -> Put Source #

(Binary a, Binary b, Binary c, Binary d, Binary e) => Binary (a, b, c, d, e) 
Instance details

Defined in Data.Binary.Class

Methods

put :: (a, b, c, d, e) -> Put Source #

get :: Get (a, b, c, d, e) Source #

putList :: [(a, b, c, d, e)] -> Put Source #

(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f) => Binary (a, b, c, d, e, f) 
Instance details

Defined in Data.Binary.Class

Methods

put :: (a, b, c, d, e, f) -> Put Source #

get :: Get (a, b, c, d, e, f) Source #

putList :: [(a, b, c, d, e, f)] -> Put Source #

(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f, Binary g) => Binary (a, b, c, d, e, f, g) 
Instance details

Defined in Data.Binary.Class

Methods

put :: (a, b, c, d, e, f, g) -> Put Source #

get :: Get (a, b, c, d, e, f, g) Source #

putList :: [(a, b, c, d, e, f, g)] -> Put Source #

(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) 
Instance details

Defined in Data.Binary.Class

Methods

put :: (a, b, c, d, e, f, g, h) -> Put Source #

get :: Get (a, b, c, d, e, f, g, h) Source #

putList :: [(a, b, c, d, e, f, g, h)] -> Put Source #

(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) 
Instance details

Defined in Data.Binary.Class

Methods

put :: (a, b, c, d, e, f, g, h, i) -> Put Source #

get :: Get (a, b, c, d, e, f, g, h, i) Source #

putList :: [(a, b, c, d, e, f, g, h, i)] -> Put Source #

(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) 
Instance details

Defined in Data.Binary.Class

Methods

put :: (a, b, c, d, e, f, g, h, i, j) -> Put Source #

get :: Get (a, b, c, d, e, f, g, h, i, j) Source #

putList :: [(a, b, c, d, e, f, g, h, i, j)] -> Put Source #

Module re-export

Orphan instances

Binary UTCTime Source # 
Instance details

Binary Value Source # 
Instance details

Binary ZonedTime Source #

Since: binary-orphans-0.1.8.0

Instance details

Binary LocalTime Source # 
Instance details

Binary TimeOfDay Source # 
Instance details

Binary TimeZone Source # 
Instance details

Binary UniversalTime Source # 
Instance details

Binary SystemTime Source #

Since: binary-orphans-0.1.7.0

Instance details

Binary NominalDiffTime Source # 
Instance details

Binary AbsoluteTime Source #

Since: binary-orphans-0.1.4.0

Instance details

Binary DiffTime Source # 
Instance details

Binary Day Source # 
Instance details

Methods

put :: Day -> Put Source #

get :: Get Day Source #

putList :: [Day] -> Put Source #

(FoldCase a, Binary a) => Binary (CI a) Source #

Since: binary-orphans-0.1.5.0

Instance details

Methods

put :: CI a -> Put Source #

get :: Get (CI a) Source #

putList :: [CI a] -> Put Source #

(Hashable a, Binary a) => Binary (Hashed a) Source # 
Instance details

Methods

put :: Hashed a -> Put Source #

get :: Get (Hashed a) Source #

putList :: [Hashed a] -> Put Source #

(Hashable v, Eq v, Binary v) => Binary (HashSet v) Source # 
Instance details

Methods

put :: HashSet v -> Put Source #

get :: Get (HashSet v) Source #

putList :: [HashSet v] -> Put Source #

(Hashable k, Eq k, Binary k, Binary v) => Binary (HashMap k v) Source # 
Instance details

Methods

put :: HashMap k v -> Put Source #

get :: Get (HashMap k v) Source #

putList :: [HashMap k v] -> Put Source #

Binary b => Binary (Tagged s b) Source # 
Instance details

Methods

put :: Tagged s b -> Put Source #

get :: Get (Tagged s b) Source #

putList :: [Tagged s b] -> Put Source #