License | BSD3 |
---|---|
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.
- data Dynamic
- = forall a . (Typeable a, Binary a) => Dynamic !a
- | Serial !ByteString
- fromDynamic :: forall a. (Typeable a, Binary a) => Dynamic -> Maybe (a, Bool)
- newtype DynamicState = DynamicState {}
- 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
A Dynamic value, potentially stored serialized
Constructors
forall a . (Typeable a, Binary a) => Dynamic !a | |
Serial !ByteString |
newtype DynamicState Source
An extensible record, indexed by type, using state to cache deserializtion
Constructors
DynamicState | |
Fields |
Instances
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