@@ -46,55 +46,49 @@ type State tag r = StateT tag r Identity
4646-- the final state of the first computation as the initial state of the second.
4747type StateT tag s = TT tag (Trans.StateT s)
4848
49−tagged :: proxy tag -> Trans.StateT s m a -> StateT tag s m a
50−tagged _ = pack
51−
52−untagged :: proxy tag -> StateT tag s m a -> Trans.StateT s m a
53−untagged _ = unpack
54−
5549-- | Constructor for computations in the state monad transformer.
5650stateT :: proxy tag -> (s -> m (a, s)) -> StateT tag s m a
57−stateT t = tagged t . Trans.StateT
51+stateT _ = pack . Trans.StateT
5852
5953-- | Constructor for computations in the state monad
6054-- (the inverse of 'runState').
6155state :: Monad m => proxy tag -> (s -> (a, s)) -> StateT tag s m a
62−state t = tagged t . Trans.state
56+state _ = pack . Trans.state
6357
6458-- | Runs a 'StateT' with the given initial state
6559-- and returns both the final value and the final state.
6660runStateT :: proxy tag -> StateT tag s m a -> s -> m (a, s)
67−runStateT t = Trans.runStateT . untagged t
61+runStateT _ = Trans.runStateT . unpack
6862
6963-- | Runs a 'StateT' with the given initial state
7064-- and returns the final value, discarding the final state.
7165evalStateT :: Monad m => proxy tag -> StateT tag s m a -> s -> m a
72−evalStateT t = Trans.evalStateT . untagged t
66+evalStateT _ = Trans.evalStateT . unpack
7367
7468-- | Runs a 'StateT' with the given initial state
7569-- and returns the final state, discarding the final value.
7670execStateT :: Monad m => proxy tag -> StateT tag s m a -> s -> m s
77−execStateT t = Trans.execStateT . untagged t
71+execStateT _ = Trans.execStateT . unpack
7872
7973-- | Runs a 'State' with the given initial state
8074-- and returns both the final value and the final state.
8175runState :: proxy tag -> State tag s a -> s -> (a, s)
82−runState t = Trans.runState . untagged t
76+runState _ = Trans.runState . unpack
8377
8478-- | Runs a 'State' with the given initial state
8579-- and returns the final value, discarding the final state.
8680evalState :: proxy tag -> State tag s a -> s -> a
87−evalState t = Trans.evalState . untagged t
81+evalState _ = Trans.evalState . unpack
8882
8983-- | Runs a 'State' with the given initial state
9084-- and returns the final state, discarding the final value.
9185execState :: proxy tag -> State tag s a -> s -> s
92−execState t = Trans.execState . untagged t
86+execState _ = Trans.execState . unpack
9387
9488-- | Fetch the current value of the state within the monad.
9589get :: Monad m => proxy tag -> StateT tag s m s
96−get t = tagged t Trans.get
90+get _ = pack Trans.get
9791
9892-- | Set the value of the state within the monad.
9993put :: Monad m => proxy tag -> s -> StateT tag s m ()
100−put t = tagged t . Trans.put
94+put _ = pack . Trans.put