License | GPL2 |
---|---|
Maintainer | [email protected] |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Extensions |
|
Data.DynamicState.Serializable
Description
This module is HashMap ConcreteTypeRep Dynamic with a twist. The Dynamic used can also be ByteString, to make repeated reserialization cheap. A user-provided State-like is used to store this.
Synopsis
- newtype DynamicState = DynamicState {
- unDynamicState :: HashMap ConcreteTypeRep Dynamic
- getDyn :: forall m a. (Typeable a, Binary a, Monad m) => m DynamicState -> (DynamicState -> m ()) -> m (Maybe a)
- putDyn :: forall m a. (Typeable a, Binary a, Monad m) => m DynamicState -> (DynamicState -> m ()) -> a -> m ()
Documentation
newtype DynamicState Source #
An extensible record, indexed by type, using state to cache deserializtion
Constructors
DynamicState | |
Fields
|
Instances
Binary DynamicState Source # | |
Defined in Data.DynamicState.Serializable | |
Monoid DynamicState Source # | |
Defined in Data.DynamicState.Serializable Methods mempty :: DynamicState # mappend :: DynamicState -> DynamicState -> DynamicState # mconcat :: [DynamicState] -> DynamicState # | |
Semigroup DynamicState Source # | |
Defined in Data.DynamicState.Serializable Methods (<>) :: DynamicState -> DynamicState -> DynamicState # sconcat :: NonEmpty DynamicState -> DynamicState # stimes :: Integral b => b -> DynamicState -> DynamicState # |
getDyn :: forall m a. (Typeable a, Binary a, Monad m) => m DynamicState -> (DynamicState -> m ()) -> m (Maybe a) Source #
Get a value, inside a State-like monad specified by the first two functions
putDyn :: forall m a. (Typeable a, Binary a, Monad m) => m DynamicState -> (DynamicState -> m ()) -> a -> m () Source #
Set a value, inside a State-like monad specified by the first two functions