From d3dcfadaa31815dc6ad1d45adf67d2386e33091c Mon Sep 17 00:00:00 2001 From: David Waern Date: Sat, 14 Nov 2009 12:10:47 +0000 Subject: hlint police --- src/Haddock/Interface/Create.hs | 14 +++++++------- src/Haddock/Interface/ExtractFnArgDocs.hs | 1 - src/Haddock/Interface/LexParseRn.hs | 3 +-- 3 files changed, 8 insertions(+), 10 deletions(-) (limited to 'src/Haddock/Interface') diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 298f96ac..7a1d6d25 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -280,7 +280,7 @@ warnAboutFilteredDecls mdl decls = do tell $ nub [ "Warning: " ++ modStr ++ ": Instances of type and data " ++ "families are not yet supported. Instances of the following families " - ++ "will be filtered out:\n " ++ (concat $ intersperse ", " + ++ "will be filtered out:\n " ++ concat (intersperse ", " $ map (occNameString . nameOccName) typeInstances) ] let instances = nub [ pretty i | (L _ (InstD (InstDecl i _ _ ats)), _, _) <- decls @@ -289,7 +289,7 @@ warnAboutFilteredDecls mdl decls = do unless (null instances) $ tell $ nub [ "Warning: " ++ modStr ++ ": We do not support associated types in instances yet. " - ++ "These instances are affected:\n" ++ (concat $ intersperse ", " instances) ] + ++ "These instances are affected:\n" ++ concat (intersperse ", " instances) ] -------------------------------------------------------------------------------- @@ -446,13 +446,13 @@ mkExportItems modMap this_mod gre exported_names decls declMap lookupExport (IEThingAll t) = declWith t lookupExport (IEThingWith t _) = declWith t lookupExport (IEModuleContents m) = fullContentsOf m - lookupExport (IEGroup lev docStr) = liftErrMsg $ do + lookupExport (IEGroup lev docStr) = liftErrMsg $ ifDoc (lexParseRnHaddockComment DocSectionComment gre docStr) (\doc -> return [ ExportGroup lev "" doc ]) - lookupExport (IEDoc docStr) = liftErrMsg $ do + lookupExport (IEDoc docStr) = liftErrMsg $ ifDoc (lexParseRnHaddockComment NormalHaddockComment gre docStr) (\doc -> return [ ExportDoc doc ]) - lookupExport (IEDocNamed str) = liftErrMsg $ do + lookupExport (IEDocNamed str) = liftErrMsg $ ifDoc (findNamedDoc str [ unL d | (d,_,_) <- decls ]) (\docStr -> ifDoc (lexParseRnHaddockComment NormalHaddockComment gre docStr) @@ -606,7 +606,7 @@ mkExportItems modMap this_mod gre exported_names decls declMap subs' = filter ((`elem` exported_names) . fst) subs sub_names = map fst subs' - isExported n = n `elem` exported_names + isExported = (`elem` exported_names) fullContentsOf modname | m == this_mod = liftErrMsg $ fullContentsOfThisModule gre decls @@ -663,7 +663,7 @@ fullContentsOfThisModule gre decls = liftM catMaybes $ mapM mkExportItem decls where mkExportItem (L _ (DocD (DocGroup lev docStr)), _, _) = do mbDoc <- lexParseRnHaddockComment DocSectionComment gre docStr - return $ fmap (\doc -> ExportGroup lev "" doc) mbDoc + return $ fmap (ExportGroup lev "") mbDoc mkExportItem (L _ (DocD (DocCommentNamed _ docStr)), _, _) = do mbDoc <- lexParseRnHaddockComment NormalHaddockComment gre docStr return $ fmap ExportDoc mbDoc diff --git a/src/Haddock/Interface/ExtractFnArgDocs.hs b/src/Haddock/Interface/ExtractFnArgDocs.hs index 0a6a05de..d3d7160f 100644 --- a/src/Haddock/Interface/ExtractFnArgDocs.hs +++ b/src/Haddock/Interface/ExtractFnArgDocs.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE PatternGuards #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Interface.ExtractFnArgDocs diff --git a/src/Haddock/Interface/LexParseRn.hs b/src/Haddock/Interface/LexParseRn.hs index 04464e77..026e753c 100644 --- a/src/Haddock/Interface/LexParseRn.hs +++ b/src/Haddock/Interface/LexParseRn.hs @@ -58,8 +58,7 @@ lexParseRnHaddockComment hty gre (HsDocString fs) = do Nothing -> do tell ["doc comment parse failed: "++str] return Nothing - Just doc -> do - return (Just (rnHsDoc gre doc)) + Just doc -> return (Just (rnHsDoc gre doc)) #else lexParseRnHaddockComment _ _ doc = return (Just doc) #endif -- cgit v1.2.3