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

License | GPL2
Maintainer | zcarterc@gmail.com
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell2010

Extensions

- Cpp
- ScopedTypeVariables
- DeriveDataTypeable
- ExplicitForAll

Data.DynamicState

Description

This module implements a simple HashMap ConcreteTypeRep Dynamic

Synopsis

- newtype DynamicState = DynamicState {
  - unDynamicState :: HashMap ConcreteTypeRep Dynamic
  }
- getDyn :: Typeable a => DynamicState -> Maybe a
- setDyn :: Typeable a => DynamicState -> a -> DynamicState
- _dyn :: (Typeable a, Functor f) => a -> (a -> f a) -> DynamicState -> f DynamicState

# Documentation

newtype DynamicState Source #

An extensible record, indexed by type

Constructors

DynamicState |

Fields

- unDynamicState :: HashMap ConcreteTypeRep Dynamic

#### Instances

Instances details

Monoid DynamicState Source # |
Instance details Defined in Data.DynamicState Methods mempty :: DynamicState Source # mappend :: DynamicState -> DynamicState -> DynamicState Source # mconcat :: [DynamicState] -> DynamicState Source #
Semigroup DynamicState Source # |
Instance details Defined in Data.DynamicState Methods (<>) :: DynamicState -> DynamicState -> DynamicState Source # sconcat :: NonEmpty DynamicState -> DynamicState Source # stimes :: Integral b => b -> DynamicState -> DynamicState Source #

getDyn :: Typeable a => DynamicState -> Maybe a Source #

setDyn :: Typeable a => DynamicState -> a -> DynamicState Source #

_dyn :: (Typeable a, Functor f) => a -> (a -> f a) -> DynamicState -> f DynamicState Source #

Lens with default value