summaryrefslogtreecommitdiff
path: root/compiler/llvmGen
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2019-06-08 20:48:07 +0200
committerKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2019-06-09 14:35:50 +0200
commit4c44e323e8ac0e28e87e93ab53cbf7eb21ac9c25 (patch)
treeb0991218e9cac8f76224df017856045c71d779e4 /compiler/llvmGen
parent8754002973dcde8709458044e541ddc8f4fcf6bb (diff)
downloadhaskell-wip/derive-functor.tar.gz
Use DeriveFunctor throughout the codebase (#15654)wip/derive-functor
Diffstat (limited to 'compiler/llvmGen')
-rw-r--r--compiler/llvmGen/LlvmCodeGen/Base.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen/Base.hs b/compiler/llvmGen/LlvmCodeGen/Base.hs
index d55c339888..ab9695778c 100644
--- a/compiler/llvmGen/LlvmCodeGen/Base.hs
+++ b/compiler/llvmGen/LlvmCodeGen/Base.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveFunctor #-}
-- ----------------------------------------------------------------------------
-- | Base LLVM Code Generation module
@@ -209,10 +210,7 @@ type LlvmEnvMap = UniqFM LlvmType
-- | The Llvm monad. Wraps @LlvmEnv@ state as well as the @IO@ monad
newtype LlvmM a = LlvmM { runLlvmM :: LlvmEnv -> IO (a, LlvmEnv) }
-
-instance Functor LlvmM where
- fmap f m = LlvmM $ \env -> do (x, env') <- runLlvmM m env
- return (f x, env')
+ deriving (Functor)
instance Applicative LlvmM where
pure x = LlvmM $ \env -> return (x, env)