@@ -32,6 +32,7 @@ ethereal "R1" "r1"
32ethereal "R2" "r2"
32ethereal "R2" "r2"
33ethereal "S1" "s1"
33ethereal "S1" "s1"
34ethereal "Foo" "foo"
34ethereal "Foo" "foo"
36main :: IO ()
37main :: IO ()
37main = defaultMain suite
38main = defaultMain suite
@@ -200,3 +201,43 @@ summatorCore xs = do
201summatorCore' :: Num a => [a] -> (Sum a, Sum a)
202summatorCore' :: Num a => [a] -> (Sum a, Sum a)
202summatorCore' = runWriter foo . T.execWriterT . summatorCore
203summatorCore' = runWriter foo . T.execWriterT . summatorCore
205+wrapState_f :: T.MonadState Int m => m String
206+wrapState_f = fmap show T.get
208+wrapState_g :: T.MonadState Bool m => m String
209+wrapState_g = fmap show T.get
212+ :: ( MonadState Foo Int m
213+ , MonadState Bar Bool m
215+wrapState_useboth = do
216+ a <- ethered foo wrapState_f
217+ b <- ethered bar wrapState_g
220+wrapStateCore :: Int -> Bool -> String
221+wrapStateCore int bool = evalState foo (evalStateT bar wrapState_useboth bool) int
223+wrapStateBad1_g :: MonadState Foo Int m => m ()
224+wrapStateBad1_g = modify foo (*100)
226+wrapStateBad1_useboth :: MonadState Foo Int m => m String
227+wrapStateBad1_useboth = do
229+ ethered foo wrapState_f
231+wrapStateBad1 :: Int -> String
232+wrapStateBad1 = evalState foo wrapStateBad1_useboth
235+ :: ( T.MonadState Int m
236+ , MonadState Foo Int m
242+wrapStateBad2Core :: Int -> Int
243+wrapStateBad2Core = evalState foo (ensureUniqueTags $ ethered foo wrapStateBad2)