summaryrefslogtreecommitdiff
path: root/compiler/main/DriverPipeline.hs
diff options
context:
space:
mode:
authorAustin Seipp <austin@well-typed.com>2013-09-11 18:46:54 -0500
committerAustin Seipp <austin@well-typed.com>2013-09-11 18:47:15 -0500
commitb20cf4ecbf244f091f4084c11ae2350d248ce6ef (patch)
treed595c6c632773bb4110468c23467f0b339096538 /compiler/main/DriverPipeline.hs
parent1ef941a82eafb8f22c19e2643685679d2454c24a (diff)
downloadhaskell-b20cf4ecbf244f091f4084c11ae2350d248ce6ef.tar.gz
Fix AMP warnings.
Authored-by: David Luposchainsky <dluposchainsky@gmail.com> Signed-off-by: Austin Seipp <austin@well-typed.com>
Diffstat (limited to 'compiler/main/DriverPipeline.hs')
-rw-r--r--compiler/main/DriverPipeline.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 7c5bc90647..a6567c8c39 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -669,6 +669,13 @@ newtype CompPipeline a = P { unP :: PipeEnv -> PipeState -> IO (PipeState, a) }
evalP :: CompPipeline a -> PipeEnv -> PipeState -> IO a
evalP f env st = liftM snd $ unP f env st
+instance Functor CompPipeline where
+ fmap = liftM
+
+instance Applicative CompPipeline where
+ pure = return
+ (<*>) = ap
+
instance Monad CompPipeline where
return a = P $ \_env state -> return (state, a)
P m >>= k = P $ \env state -> do (state',a) <- m env state