dynamic-state-0.3.1: Optionally serializable dynamic state keyed by type

LicenseGPL2
Maintainerzcarterc@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010
Extensions
  • Cpp
  • ScopedTypeVariables
  • DeriveDataTypeable
  • ExistentialQuantification
  • TupleSections
  • ExplicitForAll

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

Documentation

newtype DynamicState Source #

An extensible record, indexed by type, using state to cache deserializtion

Constructors

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