@@ -6,7 +6,8 @@
66{-# LANGUAGE DataKinds #-}
77{-# LANGUAGE PolyKinds #-}
88{-# LANGUAGE GeneralizedNewtypeDeriving #-}
9−{-# LANGUAGE MagicHash #-}
9+{-# LANGUAGE AllowAmbiguousTypes #-}
10+{-# LANGUAGE ScopedTypeVariables #-}
1011
1112-- | See "Control.Monad.Trans.State.Strict".
1213
@@ -29,7 +30,6 @@ module Control.Monad.Trans.Ether.State.Strict
2930 , put
3031 ) where
3132
32−import GHC.Prim (Proxy#)
3333import Data.Functor.Identity (Identity(..))
3434import qualified Control.Monad.Trans.State.Strict as Trans
3535import Control.Monad.Trans.Ether.Tagged
@@ -49,48 +49,48 @@ type State tag r = StateT tag r Identity
4949type StateT tag s = TaggedTrans tag (Trans.StateT s)
5050
5151-- | Constructor for computations in the state monad transformer.
52−stateT :: Proxy# tag -> (s -> m (a, s)) -> StateT tag s m a
53−stateT _ = pack . Trans.StateT
52+stateT :: forall tag s m a . (s -> m (a, s)) -> StateT tag s m a
53+stateT = pack . Trans.StateT
5454
5555-- | Constructor for computations in the state monad
5656-- (the inverse of 'runState').
57−state :: Monad m => Proxy# tag -> (s -> (a, s)) -> StateT tag s m a
58−state _ = pack . Trans.state
57+state :: forall tag s m a . Monad m => (s -> (a, s)) -> StateT tag s m a
58+state = pack . Trans.state
5959
6060-- | Runs a 'StateT' with the given initial state
6161-- and returns both the final value and the final state.
62−runStateT :: Proxy# tag -> StateT tag s m a -> s -> m (a, s)
63−runStateT _ = Trans.runStateT . unpack
62+runStateT :: forall tag s m a . StateT tag s m a -> s -> m (a, s)
63+runStateT = Trans.runStateT . unpack
6464
6565-- | Runs a 'StateT' with the given initial state
6666-- and returns the final value, discarding the final state.
67−evalStateT :: Monad m => Proxy# tag -> StateT tag s m a -> s -> m a
68−evalStateT _ = Trans.evalStateT . unpack
67+evalStateT :: forall tag s m a . Monad m => StateT tag s m a -> s -> m a
68+evalStateT = Trans.evalStateT . unpack
6969
7070-- | Runs a 'StateT' with the given initial state
7171-- and returns the final state, discarding the final value.
72−execStateT :: Monad m => Proxy# tag -> StateT tag s m a -> s -> m s
73−execStateT _ = Trans.execStateT . unpack
72+execStateT :: forall tag s m a . Monad m => StateT tag s m a -> s -> m s
73+execStateT = Trans.execStateT . unpack
7474
7575-- | Runs a 'State' with the given initial state
7676-- and returns both the final value and the final state.
77−runState :: Proxy# tag -> State tag s a -> s -> (a, s)
78−runState _ = Trans.runState . unpack
77+runState :: forall tag s a . State tag s a -> s -> (a, s)
78+runState = Trans.runState . unpack
7979
8080-- | Runs a 'State' with the given initial state
8181-- and returns the final value, discarding the final state.
82−evalState :: Proxy# tag -> State tag s a -> s -> a
83−evalState _ = Trans.evalState . unpack
82+evalState :: forall tag s a . State tag s a -> s -> a
83+evalState = Trans.evalState . unpack
8484
8585-- | Runs a 'State' with the given initial state
8686-- and returns the final state, discarding the final value.
87−execState :: Proxy# tag -> State tag s a -> s -> s
88−execState _ = Trans.execState . unpack
87+execState :: forall tag s a . State tag s a -> s -> s
88+execState = Trans.execState . unpack
8989
9090-- | Fetch the current value of the state within the monad.
91−get :: Monad m => Proxy# tag -> StateT tag s m s
92−get _ = pack Trans.get
91+get :: forall tag s m . Monad m => StateT tag s m s
92+get = pack Trans.get
9393
9494-- | Set the value of the state within the monad.
95−put :: Monad m => Proxy# tag -> s -> StateT tag s m ()
96−put _ = pack . Trans.put
95+put :: forall tag s m . Monad m => s -> StateT tag s m ()
96+put = pack . Trans.put