diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2019-06-08 20:48:07 +0200 |
---|---|---|
committer | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2019-06-09 14:35:50 +0200 |
commit | 4c44e323e8ac0e28e87e93ab53cbf7eb21ac9c25 (patch) | |
tree | b0991218e9cac8f76224df017856045c71d779e4 /compiler/main/PipelineMonad.hs | |
parent | 8754002973dcde8709458044e541ddc8f4fcf6bb (diff) | |
download | haskell-wip/derive-functor.tar.gz |
Use DeriveFunctor throughout the codebase (#15654)wip/derive-functor
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 |