@@ -1,13 +1,5 @@
11module Main where
22
3−import Control.Monad
4−
5−import Control.Monad.Ether
6−import Control.Ether.Abbr
7−
8−import qualified Control.Monad.Reader as T
9−import qualified Control.Monad.State as T
10−
113import Test.Tasty
124
135import Regression.T1
@@ -19,9 +11,6 @@ import Regression.T6
1911import Regression.T7
2012import Regression.T8
2113
22−ethereal "Foo" "foo"
23−ethereal "Bar" "bar"
24−
2514main :: IO ()
2615main = defaultMain suite
2716
@@ -36,40 +25,3 @@ suite = testGroup "Ether"
3625 , test7
3726 , test8
3827 ]
39−
40−wrapState_f :: T.MonadState Int m => m String
41−wrapState_f = liftM show T.get
42−
43−wrapState_g :: T.MonadState Bool m => m String
44−wrapState_g = liftM show T.get
45−
46−wrapState_useboth :: Ether '[Foo <-> Int, Bar <-> Bool] m => m String
47−wrapState_useboth = do
48− a <- tagAttach foo wrapState_f
49− b <- tagAttach bar wrapState_g
50− return (a ++ b)
51−
52−wrapStateCore :: Int -> Bool -> String
53−wrapStateCore int bool = evalState foo (evalStateT bar wrapState_useboth bool) int
54−
55−wrapStateBad1_g :: MonadState Foo Int m => m ()
56−wrapStateBad1_g = modify foo (*100)
57−
58−wrapStateBad1_useboth :: MonadState Foo Int m => m String
59−wrapStateBad1_useboth = do
60− wrapStateBad1_g
61− tagAttach foo wrapState_f
62−
63−wrapStateBad1 :: Int -> String
64−wrapStateBad1 = evalState foo wrapStateBad1_useboth
65−
66−wrapStateBad2 :: (T.MonadState Int m , MonadState Foo Int m) => m Int
67−wrapStateBad2 = do
68− modify foo (*100)
69− T.get
70−
71−wrapStateBad2Core :: Int -> Int
72−wrapStateBad2Core = evalState foo (tagAttach foo wrapStateBad2)
73−
74−wrapReaderCore :: Int -> Int
75−wrapReaderCore = runReader foo (tagAttach foo (liftM2 (+) T.ask (ask foo)))