| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Bluefin.StateSource
Synopsis
- data StateSource (e :: Effects)
- withStateSource :: forall (es :: Effects) a. (forall (e :: Effects). StateSource e -> Eff (e :& es) a) -> Eff es a
- newState :: forall (e :: Effects) (es :: Effects) s. e <: es => StateSource e -> s -> Eff es (State s e)
Documentation
A StateSource allows you to allocate new
State handles, much like ST
allows you to allocate new STRefs. This can be
useful when you want to avoid nested runState
(or evalState) blocks, or you need a number
of mutable states that is only dynamically known.
Handle
data StateSource (e :: Effects) #
Handlers
withStateSource :: forall (es :: Effects) a. (forall (e :: Effects). StateSource e -> Eff (e :& es) a) -> Eff es a #