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/rename/RnPat.hs | |
parent | 8754002973dcde8709458044e541ddc8f4fcf6bb (diff) | |
download | haskell-wip/derive-functor.tar.gz |
Use DeriveFunctor throughout the codebase (#15654)wip/derive-functor
Diffstat (limited to 'compiler/rename/RnPat.hs')
-rw-r--r-- | compiler/rename/RnPat.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rename/RnPat.hs b/compiler/rename/RnPat.hs index ca8c665e28..4a08ab4761 100644 --- a/compiler/rename/RnPat.hs +++ b/compiler/rename/RnPat.hs @@ -16,6 +16,7 @@ free variables. {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE ViewPatterns #-} +{-# LANGUAGE DeriveFunctor #-} module RnPat (-- main entry points rnPat, rnPats, rnBindPat, rnPatAndThen, @@ -72,7 +73,7 @@ import TysWiredIn ( nilDataCon ) import DataCon import qualified GHC.LanguageExtensions as LangExt -import Control.Monad ( when, liftM, ap, guard ) +import Control.Monad ( when, ap, guard ) import qualified Data.List.NonEmpty as NE import Data.Ratio @@ -107,11 +108,9 @@ p1 scope over p2,p3. newtype CpsRn b = CpsRn { unCpsRn :: forall r. (b -> RnM (r, FreeVars)) -> RnM (r, FreeVars) } + deriving (Functor) -- See Note [CpsRn monad] -instance Functor CpsRn where - fmap = liftM - instance Applicative CpsRn where pure x = CpsRn (\k -> k x) (<*>) = ap |