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:
Example3 expressions
>>> import Control.Exception (ErrorCall)>>> import Control.Monad.Catch>>> import Control.Monad.Trans.State.Strict qualified as S
Example1 expression
>>> :{ (`S.execStateT` "Hi") . handle (\(_::ErrorCall) -> pure ()) $ do S.modify (++ " there!") error "oops":}"Hi"
Deprecated. State modifications made via operations of the same State effect within the callback are discarded. Use a combination of get and put instead.
Apply the monadic function to the current state and return a value.
Deprecated. State modifications made via operations of the same State effect within the callback are discarded. Use a combination of get and put instead.