diff options
Diffstat (limited to 'compiler/main/PipelineMonad.hs')
-rw-r--r-- | compiler/main/PipelineMonad.hs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/main/PipelineMonad.hs b/compiler/main/PipelineMonad.hs index bbb1a17b65..d152d04530 100644 --- a/compiler/main/PipelineMonad.hs +++ b/compiler/main/PipelineMonad.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE NamedFieldPuns #-} -- | The CompPipeline monad and associated ops -- @@ -22,13 +23,11 @@ import FileCleanup (TempFileLifetime) import Control.Monad newtype CompPipeline a = P { unP :: PipeEnv -> PipeState -> IO (PipeState, a) } + deriving (Functor) 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 a = P $ \_env state -> return (state, a) (<*>) = ap |