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/codeGen/StgCmmMonad.hs | |
parent | 8754002973dcde8709458044e541ddc8f4fcf6bb (diff) | |
download | haskell-wip/derive-functor.tar.gz |
Use DeriveFunctor throughout the codebase (#15654)wip/derive-functor
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)) |