on master help sign in
Ambiguous default for MonadState
2b7b27eIndex Int
ether.cabal+2−4
@@ -54,10 +54,8 @@ library
54 Control.Monad.Ether.Implicit.State.Lazy
54 Control.Monad.Ether.Implicit.State.Lazy
55 Control.Monad.Ether.Implicit.State.Strict
55 Control.Monad.Ether.Implicit.State.Strict
56 Control.Monad.Ether.Implicit.Except
56 Control.Monad.Ether.Implicit.Except
57− Control.Monad.Ether.Ambiguous
57+
58− Control.Monad.Ether.Ambiguous.State
59− Control.Monad.Ether.Ambiguous.State.Lazy
60− Control.Monad.Ether.Ambiguous.State.Strict
58+ other-modules: Control.Monad.Ether.State.Common
61
59
62 build-depends: base >=4.7 && <4.10
60 build-depends: base >=4.7 && <4.10
63 , transformers >=0.4.2
61 , transformers >=0.4.2
src/Control/Monad/Ether/Ambiguous.hsdeleted−13
@@ -1,13 +0,0 @@
1−
2−-- | This module provides convenience exports of all
3−-- ambiguously tagged monad classes from Ether.
4−
5−module Control.Monad.Ether.Ambiguous (module X) where
6−
7−import Control.Monad as X
8−import Control.Monad.Fix as X
9−import Control.Monad.Ether.Reader as X
10−import Control.Monad.Ether.Writer as X
11−import Control.Monad.Ether.Ambiguous.State as X
12−import Control.Monad.Ether.Except as X
13−import Control.Monad.Trans.Ether.Dispatch as X
src/Control/Monad/Ether/Ambiguous/State.hsdeleted−8
@@ -1,8 +0,0 @@
1−
2−-- | See "Control.Monad.Ether.State".
3−
4−module Control.Monad.Ether.Ambiguous.State
5− ( module Control.Monad.Ether.Ambiguous.State.Lazy
6− ) where
7−
8−import Control.Monad.Ether.Ambiguous.State.Lazy
src/Control/Monad/Ether/Ambiguous/State/Lazy.hsdeleted−79
@@ -1,79 +0,0 @@
1−{-# LANGUAGE AllowAmbiguousTypes #-}
2−{-# LANGUAGE ScopedTypeVariables #-}
3−{-# LANGUAGE MagicHash #-}
4−
5−-- | See "Control.Monad.Ether.State.Lazy".
6−
7−module Control.Monad.Ether.Ambiguous.State.Lazy
8− (
9− -- * MonadState class
10− MonadState
11− , get
12− , put
13− , state
14− , modify
15− , gets
16− -- * The State monad
17− , State
18− , runState
19− , evalState
20− , execState
21− -- * The StateT monad transformer
22− , StateT
23− , stateT
24− , runStateT
25− , evalStateT
26− , execStateT
27− ) where
28−
29−import GHC.Prim (Proxy#, proxy#)
30−import Control.Monad.Ether.State.Lazy (MonadState, StateT, State)
31−import qualified Control.Monad.Ether.State.Lazy as Explicit
32−
33−-- | See 'Control.Monad.Ether.State.Lazy.stateT'.
34−stateT :: forall tag s m a . (s -> m (a, s)) -> StateT tag s m a
35−stateT = Explicit.stateT proxy#
36−
37−-- | See 'Control.Monad.Ether.State.Lazy.runStateT'.
38−runStateT :: forall tag s m a . StateT tag s m a -> s -> m (a, s)
39−runStateT = Explicit.runStateT proxy#
40−
41−-- | See 'Control.Monad.Ether.State.Lazy.runState'.
42−runState :: forall tag s a . State tag s a -> s -> (a, s)
43−runState = Explicit.runState proxy#
44−
45−-- | See 'Control.Monad.Ether.State.Lazy.evalStateT'.
46−evalStateT :: forall tag s m a . Monad m => StateT tag s m a -> s -> m a
47−evalStateT = Explicit.evalStateT proxy#
48−
49−-- | See 'Control.Monad.Ether.State.Lazy.evalState'.
50−evalState :: forall tag s a . State tag s a -> s -> a
51−evalState = Explicit.evalState proxy#
52−
53−-- | See 'Control.Monad.Ether.State.Lazy.execStateT'.
54−execStateT :: forall tag s m a . Monad m => StateT tag s m a -> s -> m s
55−execStateT = Explicit.execStateT proxy#
56−
57−-- | See 'Control.Monad.Ether.State.Lazy.execState'.
58−execState :: forall tag s a . State tag s a -> s -> s
59−execState = Explicit.execState proxy#
60−
61−-- | See 'Control.Monad.Ether.State.Lazy.get'.
62−get :: forall tag s m . MonadState tag s m => m s
63−get = Explicit.get (proxy# :: Proxy# tag)
64−
65−-- | See 'Control.Monad.Ether.State.Lazy.gets'.
66−gets :: forall tag s m a . MonadState tag s m => (s -> a) -> m a
67−gets = Explicit.gets (proxy# :: Proxy# tag)
68−
69−-- | See 'Control.Monad.Ether.State.Lazy.put'.
70−put :: forall tag s m . MonadState tag s m => s -> m ()
71−put = Explicit.put (proxy# :: Proxy# tag)
72−
73−-- | See 'Control.Monad.Ether.State.Lazy.state'.
74−state :: forall tag s m a . MonadState tag s m => (s -> (a, s)) -> m a
75−state = Explicit.state (proxy# :: Proxy# tag)
76−
77−-- | See 'Control.Monad.Ether.State.Lazy.modify'.
78−modify :: forall tag s m . MonadState tag s m => (s -> s) -> m ()
79−modify = Explicit.modify (proxy# :: Proxy# tag)
src/Control/Monad/Ether/Ambiguous/State/Strict.hsdeleted−79
@@ -1,79 +0,0 @@
1−{-# LANGUAGE AllowAmbiguousTypes #-}
2−{-# LANGUAGE ScopedTypeVariables #-}
3−{-# LANGUAGE MagicHash #-}
4−
5−-- | See "Control.Monad.Ether.State.Strict".
6−
7−module Control.Monad.Ether.Ambiguous.State.Strict
8− (
9− -- * MonadState class
10− MonadState
11− , get
12− , put
13− , state
14− , modify
15− , gets
16− -- * The State monad
17− , State
18− , runState
19− , evalState
20− , execState
21− -- * The StateT monad transformer
22− , StateT
23− , stateT
24− , runStateT
25− , evalStateT
26− , execStateT
27− ) where
28−
29−import GHC.Prim (Proxy#, proxy#)
30−import Control.Monad.Ether.State.Strict (MonadState, StateT, State)
31−import qualified Control.Monad.Ether.State.Strict as Explicit
32−
33−-- | See 'Control.Monad.Ether.State.Strict.stateT'.
34−stateT :: forall tag s m a . (s -> m (a, s)) -> StateT tag s m a
35−stateT = Explicit.stateT proxy#
36−
37−-- | See 'Control.Monad.Ether.State.Strict.runStateT'.
38−runStateT :: forall tag s m a . StateT tag s m a -> s -> m (a, s)
39−runStateT = Explicit.runStateT proxy#
40−
41−-- | See 'Control.Monad.Ether.State.Strict.runState'.
42−runState :: forall tag s a . State tag s a -> s -> (a, s)
43−runState = Explicit.runState proxy#
44−
45−-- | See 'Control.Monad.Ether.State.Strict.evalStateT'.
46−evalStateT :: forall tag s m a . Monad m => StateT tag s m a -> s -> m a
47−evalStateT = Explicit.evalStateT proxy#
48−
49−-- | See 'Control.Monad.Ether.State.Strict.evalState'.
50−evalState :: forall tag s a . State tag s a -> s -> a
51−evalState = Explicit.evalState proxy#
52−
53−-- | See 'Control.Monad.Ether.State.Strict.execStateT'.
54−execStateT :: forall tag s m a . Monad m => StateT tag s m a -> s -> m s
55−execStateT = Explicit.execStateT proxy#
56−
57−-- | See 'Control.Monad.Ether.State.Strict.execState'.
58−execState :: forall tag s a . State tag s a -> s -> s
59−execState = Explicit.execState proxy#
60−
61−-- | See 'Control.Monad.Ether.State.Strict.get'.
62−get :: forall tag s m . MonadState tag s m => m s
63−get = Explicit.get (proxy# :: Proxy# tag)
64−
65−-- | See 'Control.Monad.Ether.State.Strict.gets'.
66−gets :: forall tag s m a . MonadState tag s m => (s -> a) -> m a
67−gets = Explicit.gets (proxy# :: Proxy# tag)
68−
69−-- | See 'Control.Monad.Ether.State.Strict.put'.
70−put :: forall tag s m . MonadState tag s m => s -> m ()
71−put = Explicit.put (proxy# :: Proxy# tag)
72−
73−-- | See 'Control.Monad.Ether.State.Strict.state'.
74−state :: forall tag s m a . MonadState tag s m => (s -> (a, s)) -> m a
75−state = Explicit.state (proxy# :: Proxy# tag)
76−
77−-- | See 'Control.Monad.Ether.State.Strict.modify'.
78−modify :: forall tag s m . MonadState tag s m => (s -> s) -> m ()
79−modify = Explicit.modify (proxy# :: Proxy# tag)
src/Control/Monad/Ether/Implicit/State/Lazy.hs+1−1
@@ -26,7 +26,7 @@ module Control.Monad.Ether.Implicit.State.Lazy
26 , execStateT
26 , execStateT
27 ) where
27 ) where
28
28
29−import qualified Control.Monad.Ether.Ambiguous.State.Lazy as A
29+import qualified Control.Monad.Ether.State.Lazy as A
30
30
31-- | See 'Control.Monad.Ether.State.Lazy.StateT'.
31-- | See 'Control.Monad.Ether.State.Lazy.StateT'.
32type StateT s = A.StateT s s
32type StateT s = A.StateT s s
src/Control/Monad/Ether/Implicit/State/Strict.hs+1−1
@@ -26,7 +26,7 @@ module Control.Monad.Ether.Implicit.State.Strict
26 , execStateT
26 , execStateT
27 ) where
27 ) where
28
28
29−import qualified Control.Monad.Ether.Ambiguous.State.Strict as A
29+import qualified Control.Monad.Ether.State.Strict as A
30
30
31-- | See 'Control.Monad.Ether.State.Strict.StateT'.
31-- | See 'Control.Monad.Ether.State.Strict.StateT'.
32type StateT s = A.StateT s s
32type StateT s = A.StateT s s
src/Control/Monad/Ether/State/Class.hs+10−18
@@ -4,15 +4,15 @@
4{-# LANGUAGE FunctionalDependencies #-}
4{-# LANGUAGE FunctionalDependencies #-}
5{-# LANGUAGE TypeFamilies #-}
5{-# LANGUAGE TypeFamilies #-}
6{-# LANGUAGE PolyKinds #-}
6{-# LANGUAGE PolyKinds #-}
7+{-# LANGUAGE TypeApplications #-}
8+{-# LANGUAGE ScopedTypeVariables #-}
7{-# LANGUAGE MagicHash #-}
9{-# LANGUAGE MagicHash #-}
8
10
9-- | See "Control.Monad.State.Class".
11-- | See "Control.Monad.State.Class".
10
12
11module Control.Monad.Ether.State.Class
13module Control.Monad.Ether.State.Class
12− ( MonadState(..)
14+ ( MonadState(..)
13− , modify
14− , gets
15− ) where
15+ ) where
16
16
17import GHC.Prim (Proxy#)
17import GHC.Prim (Proxy#)
18import qualified Control.Monad.Trans.Ether.State.Lazy as S.L
18import qualified Control.Monad.Trans.Ether.State.Lazy as S.L
@@ -40,23 +40,15 @@ class Monad m => MonadState tag s m | m tag -> s where
40 put t s'
40 put t s'
41 return a
41 return a
42
42
43−-- | Modifies the state inside a state monad.
44−modify :: MonadState tag s m => Proxy# tag -> (s -> s) -> m ()
45−modify t f = state t (\s -> ((), f s))
46−
47−-- | Gets specific component of the state, using a projection function supplied.
48−gets :: MonadState tag s m => Proxy# tag -> (s -> a) -> m a
49−gets t f = fmap f (get t)
50−
51instance (Monad m, s ~ s') => MonadState tag s (S.L.StateT tag s' m) where
43instance (Monad m, s ~ s') => MonadState tag s (S.L.StateT tag s' m) where
52− get = S.L.get
44+ get _ = S.L.get @tag
53− put = S.L.put
45+ put _ = S.L.put @tag
54− state = S.L.state
46+ state _ = S.L.state @tag
55
47
56instance (Monad m, s ~ s') => MonadState tag s (S.S.StateT tag s' m) where
48instance (Monad m, s ~ s') => MonadState tag s (S.S.StateT tag s' m) where
57− get = S.S.get
49+ get _ = S.S.get @tag
58− put = S.S.put
50+ put _ = S.S.put @tag
59− state = S.S.state
51+ state _ = S.S.state @tag
60
52
61instance {-# OVERLAPPABLE #-}
53instance {-# OVERLAPPABLE #-}
62 ( Lift.MonadTrans t
54 ( Lift.MonadTrans t
src/Control/Monad/Ether/State/Common.hsnew file+37
@@ -0,0 +1,37 @@
1+{-# LANGUAGE AllowAmbiguousTypes #-}
2+{-# LANGUAGE TypeApplications #-}
3+{-# LANGUAGE ScopedTypeVariables #-}
4+{-# LANGUAGE MagicHash #-}
5+
6+module Control.Monad.Ether.State.Common
7+ ( MonadState
8+ , get
9+ , put
10+ , state
11+ , modify
12+ , gets
13+ ) where
14+
15+import GHC.Prim (Proxy#, proxy#)
16+import Control.Monad.Ether.State.Class (MonadState)
17+import qualified Control.Monad.Ether.State.Class as C
18+
19+-- | Return the state from the internals of the monad.
20+get :: forall tag s m . MonadState tag s m => m s
21+get = C.get (proxy# :: Proxy# tag)
22+
23+-- | Replace the state inside the monad.
24+put :: forall tag s m . MonadState tag s m => s -> m ()
25+put = C.put (proxy# :: Proxy# tag)
26+
27+-- | Embed a simple state action into the monad.
28+state :: forall tag s m a . MonadState tag s m => (s -> (a, s)) -> m a
29+state = C.state (proxy# :: Proxy# tag)
30+
31+-- | Modifies the state inside a state monad.
32+modify :: forall tag s m . MonadState tag s m => (s -> s) -> m ()
33+modify f = state @tag (\s -> ((), f s))
34+
35+-- | Gets specific component of the state, using a projection function supplied.
36+gets :: forall tag s m a . MonadState tag s m => (s -> a) -> m a
37+gets f = fmap f (get @tag)
src/Control/Monad/Ether/State/Lazy.hs+5−2
@@ -4,7 +4,10 @@
4module Control.Monad.Ether.State.Lazy
4module Control.Monad.Ether.State.Lazy
5 (
5 (
6 -- * MonadState class
6 -- * MonadState class
7− MonadState(..)
7+ MonadState
8+ , get
9+ , put
10+ , state
8 , modify
11 , modify
9 , gets
12 , gets
10 -- * The State monad
13 -- * The State monad
@@ -20,5 +23,5 @@ module Control.Monad.Ether.State.Lazy
20 , execStateT
23 , execStateT
21 ) where
24 ) where
22
25
23−import Control.Monad.Ether.State.Class
26+import Control.Monad.Ether.State.Common
24import Control.Monad.Trans.Ether.State.Lazy hiding (state, get, put)
27import Control.Monad.Trans.Ether.State.Lazy hiding (state, get, put)
src/Control/Monad/Ether/State/Strict.hs+5−2
@@ -4,7 +4,10 @@
4module Control.Monad.Ether.State.Strict
4module Control.Monad.Ether.State.Strict
5 (
5 (
6 -- * MonadState class
6 -- * MonadState class
7− MonadState(..)
7+ MonadState
8+ , get
9+ , put
10+ , state
8 , modify
11 , modify
9 , gets
12 , gets
10 -- * The State monad
13 -- * The State monad
@@ -20,5 +23,5 @@ module Control.Monad.Ether.State.Strict
20 , execStateT
23 , execStateT
21 ) where
24 ) where
22
25
23−import Control.Monad.Ether.State.Class
26+import Control.Monad.Ether.State.Common
24import Control.Monad.Trans.Ether.State.Strict hiding (state, get, put)
27import Control.Monad.Trans.Ether.State.Strict hiding (state, get, put)
src/Control/Monad/Trans/Ether/Except.hs−1
@@ -9,7 +9,6 @@
9{-# LANGUAGE AllowAmbiguousTypes #-}
9{-# LANGUAGE AllowAmbiguousTypes #-}
10{-# LANGUAGE TypeApplications #-}
10{-# LANGUAGE TypeApplications #-}
11{-# LANGUAGE ScopedTypeVariables #-}
11{-# LANGUAGE ScopedTypeVariables #-}
12−{-# LANGUAGE MagicHash #-}
13
12
14-- | See "Control.Monad.Trans.Except".
13-- | See "Control.Monad.Trans.Except".
15
14
src/Control/Monad/Trans/Ether/State/Lazy.hs+22−22
@@ -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 #-}
10
11
11-- | See "Control.Monad.Trans.State.Lazy".
12-- | See "Control.Monad.Trans.State.Lazy".
12
13
@@ -29,7 +30,6 @@ module Control.Monad.Trans.Ether.State.Lazy
29 , put
30 , put
30 ) where
31 ) where
31
32
32−import GHC.Prim (Proxy#)
33import Data.Functor.Identity (Identity(..))
33import Data.Functor.Identity (Identity(..))
34import qualified Control.Monad.Trans.State.Lazy as Trans
34import qualified Control.Monad.Trans.State.Lazy 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)
50
50
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
54
54
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
59
59
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
64
64
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
69
69
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
74
74
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
79
79
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
84
84
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
89
89
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
93
93
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
src/Control/Monad/Trans/Ether/State/Strict.hs+22−22
@@ -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 #-}
10
11
11-- | See "Control.Monad.Trans.State.Strict".
12-- | See "Control.Monad.Trans.State.Strict".
12
13
@@ -29,7 +30,6 @@ module Control.Monad.Trans.Ether.State.Strict
29 , put
30 , put
30 ) where
31 ) where
31
32
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)
50
50
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
54
54
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
59
59
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
64
64
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
69
69
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
74
74
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
79
79
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
84
84
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
89
89
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
93
93
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
test/Regression/T1.hs+1−1
@@ -1,6 +1,6 @@
1module Regression.T1 (test1) where
1module Regression.T1 (test1) where
2
2
3−import Control.Monad.Ether.Ambiguous
3+import Control.Monad.Ether
4import Control.Ether.Abbr
4import Control.Ether.Abbr
5
5
6import Test.Tasty
6import Test.Tasty
test/Regression/T3.hs+1−1
@@ -1,7 +1,7 @@
1module Regression.T3 (test3) where
1module Regression.T3 (test3) where
2
2
3import Control.Ether.Abbr
3import Control.Ether.Abbr
4−import Control.Monad.Ether.Ambiguous
4+import Control.Monad.Ether
5
5
6import qualified Control.Monad.Reader as T
6import qualified Control.Monad.Reader as T
7import qualified Control.Monad.State as T
7import qualified Control.Monad.State as T
test/Regression/T4.hs+1−1
@@ -1,7 +1,7 @@
1module Regression.T4 (test4) where
1module Regression.T4 (test4) where
2
2
3import Control.Ether.Abbr
3import Control.Ether.Abbr
4−import Control.Monad.Ether.Ambiguous
4+import Control.Monad.Ether
5
5
6import Test.Tasty
6import Test.Tasty
7import Test.Tasty.QuickCheck
7import Test.Tasty.QuickCheck
test/Regression/T7.hs+1−1
@@ -3,7 +3,7 @@ module Regression.T7 (test7) where
3import Data.Monoid
3import Data.Monoid
4import Control.Monad
4import Control.Monad
5
5
6−import Control.Monad.Ether.Ambiguous
6+import Control.Monad.Ether
7import qualified Control.Monad.Writer as T
7import qualified Control.Monad.Writer as T
8
8
9import Test.Tasty
9import Test.Tasty
test/Regression/T8.hs+1−1
@@ -1,7 +1,7 @@
1module Regression.T8 (test8) where
1module Regression.T8 (test8) where
2
2
3import Control.Ether.Abbr
3import Control.Ether.Abbr
4−import Control.Monad.Ether.Ambiguous
4+import Control.Monad.Ether
5
5
6import qualified Control.Monad.State as T
6import qualified Control.Monad.State as T
7
7
test/Regression/T9.hs+1−1
@@ -1,7 +1,7 @@
1module Regression.T9 (test9) where
1module Regression.T9 (test9) where
2
2
3import Control.Ether.Abbr
3import Control.Ether.Abbr
4−import Control.Monad.Ether.Ambiguous
4+import Control.Monad.Ether
5
5
6import Test.Tasty
6import Test.Tasty
7import Test.Tasty.QuickCheck
7import Test.Tasty.QuickCheck