-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A variation of Data.Dynamic.Dynamic with a Binary instance
--
-- This Dynamic is instance Binary by encapsulating only values of types
-- that are Binary. It is a bit more efficient than something similar to
-- (ByteString, TypeRep) as it avoids unnecessary encode/decoding
-- round-trips.
@package bindynamic
@version 1.0.0.1
-- | Provides a data type similar to Dynamic from
-- base:Data.Dynamic, but with a Binary instance. This of
-- course means that only instances of Binary can be
-- encapsulated in this Dynamic.
module Data.Dynamic.Binary
-- | This Dynamic is a variant of the Dynamic from
-- base:Data.Dynamic with a Binary instance. It
-- encapsulates a value of an arbitrary type, provided that the type is
-- instance of both Typeable and Binary.
--
-- The advantage over just using a ByteString is the type
-- safety: Raw ByteStrings have no associated type, and the
-- Binary interface makes no guarantee that the representations
-- for values of different types are different.
--
-- The advantage over using a type-tagged ByteString is that
-- Dynamic avoids unnecessary encoding/decoding by internally
-- containing either a ByteString or a decoded value.
data Dynamic
-- | Converts an arbitrary value into an object of type Dynamic.
toDyn :: (Typeable a, Binary a) => a -> Dynamic
-- | Converts a Dynamic object back into an ordinary Haskell value
-- of the correct type.
fromDyn :: (Typeable a, Binary a) => Dynamic -> a -> a
-- | Converts a Dynamic object back into an ordinary Haskell value
-- of the correct type.
fromDynamic :: forall a. (Typeable a, Binary a) => Dynamic -> Maybe a
-- | Getter for the TypeRep of this Dynamic.
dynTypeRep :: Dynamic -> TypeRep
instance GHC.Show.Show Data.Dynamic.Binary.Dynamic
instance GHC.Exception.Exception Data.Dynamic.Binary.Dynamic
instance Data.Binary.Class.Binary Data.Dynamic.Binary.Dynamic