summaryrefslogtreecommitdiff
path: root/compiler/llvmGen
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2019-06-08 20:48:07 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-06-12 07:37:12 -0400
commit1219f8e8a3d1b58263bea76822322b746a632778 (patch)
treebd93bdf1e09cd26a7c6104ba37c6734a74e8a7bc /compiler/llvmGen
parent217e6db4af6752b13c586d4e8925a4a9a2f47245 (diff)
downloadhaskell-1219f8e8a3d1b58263bea76822322b746a632778.tar.gz
Use DeriveFunctor throughout the codebase (#15654)
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)