@@ -13,8 +13,16 @@ module Control.Monad.Trans.Ether.State
1313 , State'
1414 , runEtherStateT
1515 , runEtherState
16+ , evalEtherStateT
17+ , evalEtherState
18+ , execEtherStateT
19+ , execEtherState
1620 , runStateT'
1721 , runState'
22+ , evalStateT'
23+ , evalState'
24+ , execStateT'
25+ , execState'
1826 --
1927 , etherStateT
2028 , mapEtherStateT
@@ -60,6 +68,18 @@ runEtherStateT _proxy (EtherStateT (S.StateT f)) = f
6068runEtherState :: proxy tag -> EtherState tag s a -> s -> (a, s)
6169runEtherState proxy m s = runIdentity (runEtherStateT proxy m s)
6270
71+evalEtherStateT :: Functor m => proxy tag -> EtherStateT tag s m a -> s -> m a
72+evalEtherStateT proxy m s = fmap fst (runEtherStateT proxy m s)
73+
74+evalEtherState :: proxy tag -> EtherState tag s a -> s -> a
75+evalEtherState proxy m s = fst (runEtherState proxy m s)
76+
77+execEtherStateT :: Functor m => proxy tag -> EtherStateT tag s m a -> s -> m s
78+execEtherStateT proxy m s = fmap snd (runEtherStateT proxy m s)
79+
80+execEtherState :: proxy tag -> EtherState tag s a -> s -> s
81+execEtherState proxy m s = snd (runEtherState proxy m s)
82+
6383mapEtherStateT :: proxy tag -> (m (a, s) -> n (b, s)) -> EtherStateT tag s m a -> EtherStateT tag s n b
6484mapEtherStateT _proxy f m = EtherStateT $ S.mapStateT f (coerce m)
6585
@@ -84,6 +104,18 @@ runStateT' = runEtherStateT Proxy
84104runState' :: State' s a -> s -> (a, s)
85105runState' m s = runIdentity (runStateT' m s)
86106
107+evalStateT' :: Functor m => StateT' s m a -> s -> m a
108+evalStateT' m s = fmap fst (runStateT' m s)
109+
110+evalState' :: State' s a -> s -> a
111+evalState' m s = fst (runState' m s)
112+
113+execStateT' :: Functor m => StateT' s m a -> s -> m s
114+execStateT' m s = fmap snd (runStateT' m s)
115+
116+execState' :: State' s a -> s -> s
117+execState' m s = snd (runState' m s)
118+
87119-- Instances for mtl classes
88120
89121instance Class.MonadCont m => Class.MonadCont (EtherStateT tag s m) where