@@ -13,20 +13,12 @@
13module Control.Monad.Ether.State
13module Control.Monad.Ether.State
18 , runStateT
16 , runStateT
19 , runState
17 , runState
20 , evalStateT
18 , evalStateT
21 , evalState
19 , evalState
22 , execStateT
20 , execStateT
23 , execState
21 , execState
31 , MonadState
23 , MonadState
@@ -34,16 +26,8 @@ module Control.Monad.Ether.State
46−import Data.Proxy (Proxy(Proxy))
47import Control.Monad.Trans (lift)
31import Control.Monad.Trans (lift)
49import Control.Monad.Trans.Ether.Reader (ReaderT)
33import Control.Monad.Trans.Ether.Reader (ReaderT)
@@ -84,23 +68,6 @@ gets proxy f = fmap f (get proxy)
84modify :: MonadState tag s m => proxy tag -> (s -> s) -> m ()
68modify :: MonadState tag s m => proxy tag -> (s -> s) -> m ()
85modify proxy f = state proxy $ \ s -> ((), f s)
69modify proxy f = state proxy $ \ s -> ((), f s)
87−type MonadState' s = MonadState s s
89−get' :: forall m s . MonadState' s m => m s
90−get' = get (Proxy :: Proxy s)
92−gets' :: forall m s a . MonadState' s m => (s -> a) -> m a
93−gets' = gets (Proxy :: Proxy s)
95−put' :: forall m s . MonadState' s m => s -> m ()
96−put' = put (Proxy :: Proxy s)
98−state' :: forall m s a . MonadState' s m => (s -> (a, s)) -> m a
99−state' = state (Proxy :: Proxy s)
101−modify' :: forall m s . MonadState' s m => (s -> s) -> m ()
102−modify' = modify (Proxy :: Proxy s)
104instance {-# OVERLAPPING #-} Monad m => MonadState tag s (StateT tag s m) where
71instance {-# OVERLAPPING #-} Monad m => MonadState tag s (StateT tag s m) where
105 get proxy = etherStateT proxy (\s -> return (s, s))
72 get proxy = etherStateT proxy (\s -> return (s, s))
106 put proxy s = etherStateT proxy (\_ -> return ((), s))
73 put proxy s = etherStateT proxy (\_ -> return ((), s))