Support for access to a shared, mutable value of a particular type.
The value is shared between multiple threads. If you want each thead to
manage its own version of the value, use Effectful.State.Static.Local.
Note: unlike the Control.Monad.Trans.State.StateT monad transformer from
the transformers library, the State effect doesn't discard state updates
when an exception is received:
Example1 expression
>>> import qualified Control.Monad.Trans.State.Strict as S
Example1 expression
>>> :{ (`S.execStateT` "Hi") . handle (\(_::ErrorCall) -> pure ()) $ do S.modify (++ " there!") error "oops":}"Hi"