diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2014-10-06 21:55:02 +0100 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2014-10-06 22:03:07 +0100 |
commit | b30b185e5c653dfed948d71ce2336be70be3b418 (patch) | |
tree | 649c5a21d7ce7999f632ef8fd070b440efc09d28 /testsuite | |
parent | a1b539142d7853bc02c36f1b3e8d489a9864f0e9 (diff) | |
download | haskell-b30b185e5c653dfed948d71ce2336be70be3b418.tar.gz |
testsuite: fix T1735_Help/State.hs build failure (AMP)
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/typecheck/should_run/T1735_Help/State.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_run/T1735_Help/State.hs b/testsuite/tests/typecheck/should_run/T1735_Help/State.hs index 7b048eb2df..d696af738f 100644 --- a/testsuite/tests/typecheck/should_run/T1735_Help/State.hs +++ b/testsuite/tests/typecheck/should_run/T1735_Help/State.hs @@ -1,6 +1,9 @@ module T1735_Help.State where
+import Control.Monad (ap, liftM)
+
+
newtype StateT s m a = StateT { runStateT :: s -> m (a,s) }
instance Monad m => Monad (StateT s m) where
@@ -10,6 +13,13 @@ instance Monad m => Monad (StateT s m) where runStateT (k a) s'
fail str = StateT $ \_ -> fail str
+instance Monad m => Functor (StateT s m) where
+ fmap = liftM
+
+instance Monad m => Applicative (StateT s m) where
+ pure = return
+ (<*>) = ap
+
get :: Monad m => StateT s m s
get = StateT $ \s -> return (s, s)
|