| License | GPL2 |
|---|---|
| Maintainer | zcarterc@gmail.com |
| 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 Methods put :: DynamicState -> Put Source # get :: Get DynamicState Source # putList :: [DynamicState] -> Put Source # | |
| Monoid DynamicState Source # | |
Defined in Data.DynamicState.Serializable Methods mempty :: DynamicState Source # mappend :: DynamicState -> DynamicState -> DynamicState Source # mconcat :: [DynamicState] -> DynamicState Source # | |
| Semigroup DynamicState Source # | |
Defined in Data.DynamicState.Serializable Methods (<>) :: DynamicState -> DynamicState -> DynamicState Source # sconcat :: NonEmpty DynamicState -> DynamicState Source # stimes :: Integral b => b -> DynamicState -> DynamicState Source # | |
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