@@ -5,6 +5,26 @@
55--
66-- - very fast.
77--
8+-- /Note:/ unlike 'Control.Monad.Trans.State.StateT', the 'State' effect doesn't
9+-- lose state modifications in presence of runtime exceptions:
10+--
11+-- >>> import Control.Exception (ErrorCall)
12+-- >>> import Control.Monad.Catch
13+--
14+-- >>> import qualified Control.Monad.Trans.State.Strict as S
15+-- >>> :{
16+-- (`S.execStateT` "Hi") . handle (\(_::ErrorCall) -> pure ()) $ do
17+-- S.modify (++ " there!")
18+-- error "oops"
19+-- :}
20+-- "Hi"
21+--
22+-- >>> :{
23+-- runEff . execState "Hi" . handle (\(_::ErrorCall) -> pure ()) $ do
24+-- modify (++ " there!")
25+-- error "oops"
26+-- :}
27+-- "Hi there!"
828module Effectful.State.Local
929 ( State
1030 , runState