diff options
author | Simon Hengel <sol@typeful.net> | 2012-05-26 19:00:42 +0200 |
---|---|---|
committer | Simon Hengel <sol@typeful.net> | 2012-05-26 19:21:29 +0200 |
commit | 095fb18d1965353ad574b93a5d744677a1c9420a (patch) | |
tree | 9d7956644eb70f0120a06150881b958dc23212ba /src/Haddock | |
parent | 37e0abebc1e14e59ac352b0a5f633a63233f04de (diff) |
Add Applicative instance for (GenRnM a)
Diffstat (limited to 'src/Haddock')
-rw-r--r-- | src/Haddock/Interface/Rename.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 7f322eca..b703da0f 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -97,6 +97,10 @@ instance Monad (GenRnM n) where instance Functor (GenRnM n) where fmap f x = do a <- x; return (f a) +instance Applicative (GenRnM n) where + pure = return + (<*>) = ap + returnRn :: a -> GenRnM n a returnRn a = RnM (const (a,[])) thenRn :: GenRnM n a -> (a -> GenRnM n b) -> GenRnM n b @@ -144,12 +148,12 @@ renameExportItems = mapM renameExportItem renameDocForDecl :: DocForDecl Name -> RnM (DocForDecl DocName) renameDocForDecl (doc, fnArgsDoc) = - (,) `fmap` renameDocumentation doc `ap` renameFnArgsDoc fnArgsDoc + (,) <$> renameDocumentation doc <*> renameFnArgsDoc fnArgsDoc renameDocumentation :: Documentation Name -> RnM (Documentation DocName) renameDocumentation (Documentation mDoc mWarning) = - Documentation `fmap` mapM renameDoc mDoc `ap` mapM renameDoc mWarning + Documentation <$> mapM renameDoc mDoc <*> mapM renameDoc mWarning renameLDocHsSyn :: LHsDocString -> RnM LHsDocString |