diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2019-06-08 20:48:07 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-06-12 07:37:12 -0400 |
commit | 1219f8e8a3d1b58263bea76822322b746a632778 (patch) | |
tree | bd93bdf1e09cd26a7c6104ba37c6734a74e8a7bc /compiler/codeGen/StgCmmMonad.hs | |
parent | 217e6db4af6752b13c586d4e8925a4a9a2f47245 (diff) | |
download | haskell-1219f8e8a3d1b58263bea76822322b746a632778.tar.gz |
Use DeriveFunctor throughout the codebase (#15654)
Diffstat (limited to 'compiler/codeGen/StgCmmMonad.hs')
-rw-r--r-- | compiler/codeGen/StgCmmMonad.hs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/codeGen/StgCmmMonad.hs b/compiler/codeGen/StgCmmMonad.hs index 8be5c4551f..d6f84c6a0a 100644 --- a/compiler/codeGen/StgCmmMonad.hs +++ b/compiler/codeGen/StgCmmMonad.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE GADTs #-} ----------------------------------------------------------------------------- @@ -111,9 +112,7 @@ import Data.List -------------------------------------------------------- newtype FCode a = FCode { doFCode :: CgInfoDownwards -> CgState -> (a, CgState) } - -instance Functor FCode where - fmap f (FCode g) = FCode $ \i s -> case g i s of (a, s') -> (f a, s') + deriving (Functor) instance Applicative FCode where pure val = FCode (\_info_down state -> (val, state)) |