@@ -6,7 +6,8 @@
6{-# LANGUAGE DataKinds #-}
6{-# LANGUAGE DataKinds #-}
7{-# LANGUAGE PolyKinds #-}
7{-# LANGUAGE PolyKinds #-}
8{-# LANGUAGE GeneralizedNewtypeDeriving #-}
8{-# LANGUAGE GeneralizedNewtypeDeriving #-}
9−{-# LANGUAGE MagicHash #-}
9+{-# LANGUAGE AllowAmbiguousTypes #-}
10+{-# LANGUAGE ScopedTypeVariables #-}
11-- | See "Control.Monad.Trans.State.Strict".
12-- | See "Control.Monad.Trans.State.Strict".
@@ -29,7 +30,6 @@ module Control.Monad.Trans.Ether.State.Strict
32−import GHC.Prim (Proxy#)
33import Data.Functor.Identity (Identity(..))
33import Data.Functor.Identity (Identity(..))
34import qualified Control.Monad.Trans.State.Strict as Trans
34import qualified Control.Monad.Trans.State.Strict as Trans
35import Control.Monad.Trans.Ether.Tagged
35import Control.Monad.Trans.Ether.Tagged
@@ -49,48 +49,48 @@ type State tag r = StateT tag r Identity
49type StateT tag s = TaggedTrans tag (Trans.StateT s)
49type StateT tag s = TaggedTrans tag (Trans.StateT s)
51-- | Constructor for computations in the state monad transformer.
51-- | Constructor for computations in the state monad transformer.
52−stateT :: Proxy# tag -> (s -> m (a, s)) -> StateT tag s m a
52+stateT :: forall tag s m a . (s -> m (a, s)) -> StateT tag s m a
53−stateT _ = pack . Trans.StateT
53+stateT = pack . Trans.StateT
55-- | Constructor for computations in the state monad
55-- | Constructor for computations in the state monad
56-- (the inverse of 'runState').
56-- (the inverse of 'runState').
57−state :: Monad m => Proxy# tag -> (s -> (a, s)) -> StateT tag s m a
57+state :: forall tag s m a . Monad m => (s -> (a, s)) -> StateT tag s m a
58−state _ = pack . Trans.state
58+state = pack . Trans.state
60-- | Runs a 'StateT' with the given initial state
60-- | Runs a 'StateT' with the given initial state
61-- and returns both the final value and the final state.
61-- and returns both the final value and the final state.
62−runStateT :: Proxy# tag -> StateT tag s m a -> s -> m (a, s)
62+runStateT :: forall tag s m a . StateT tag s m a -> s -> m (a, s)
63−runStateT _ = Trans.runStateT . unpack
63+runStateT = Trans.runStateT . unpack
65-- | Runs a 'StateT' with the given initial state
65-- | Runs a 'StateT' with the given initial state
66-- and returns the final value, discarding the final state.
66-- and returns the final value, discarding the final state.
67−evalStateT :: Monad m => Proxy# tag -> StateT tag s m a -> s -> m a
67+evalStateT :: forall tag s m a . Monad m => StateT tag s m a -> s -> m a
68−evalStateT _ = Trans.evalStateT . unpack
68+evalStateT = Trans.evalStateT . unpack
70-- | Runs a 'StateT' with the given initial state
70-- | Runs a 'StateT' with the given initial state
71-- and returns the final state, discarding the final value.
71-- and returns the final state, discarding the final value.
72−execStateT :: Monad m => Proxy# tag -> StateT tag s m a -> s -> m s
72+execStateT :: forall tag s m a . Monad m => StateT tag s m a -> s -> m s
73−execStateT _ = Trans.execStateT . unpack
73+execStateT = Trans.execStateT . unpack
75-- | Runs a 'State' with the given initial state
75-- | Runs a 'State' with the given initial state
76-- and returns both the final value and the final state.
76-- and returns both the final value and the final state.
77−runState :: Proxy# tag -> State tag s a -> s -> (a, s)
77+runState :: forall tag s a . State tag s a -> s -> (a, s)
78−runState _ = Trans.runState . unpack
78+runState = Trans.runState . unpack
80-- | Runs a 'State' with the given initial state
80-- | Runs a 'State' with the given initial state
81-- and returns the final value, discarding the final state.
81-- and returns the final value, discarding the final state.
82−evalState :: Proxy# tag -> State tag s a -> s -> a
82+evalState :: forall tag s a . State tag s a -> s -> a
83−evalState _ = Trans.evalState . unpack
83+evalState = Trans.evalState . unpack
85-- | Runs a 'State' with the given initial state
85-- | Runs a 'State' with the given initial state
86-- and returns the final state, discarding the final value.
86-- and returns the final state, discarding the final value.
87−execState :: Proxy# tag -> State tag s a -> s -> s
87+execState :: forall tag s a . State tag s a -> s -> s
88−execState _ = Trans.execState . unpack
88+execState = Trans.execState . unpack
90-- | Fetch the current value of the state within the monad.
90-- | Fetch the current value of the state within the monad.
91−get :: Monad m => Proxy# tag -> StateT tag s m s
91+get :: forall tag s m . Monad m => StateT tag s m s
92−get _ = pack Trans.get
92+get = pack Trans.get
94-- | Set the value of the state within the monad.
94-- | Set the value of the state within the monad.
95−put :: Monad m => Proxy# tag -> s -> StateT tag s m ()
95+put :: forall tag s m . Monad m => s -> StateT tag s m ()
96−put _ = pack . Trans.put
96+put = pack . Trans.put