From 488fd5ef7762202b3c050442bc43fc32e02db046 Mon Sep 17 00:00:00 2001 From: David Waern Date: Wed, 1 Apr 2009 20:48:42 +0000 Subject: hlint police --- src/Haddock/Interface/Create.hs | 5 ++--- src/Haddock/Interface/Rename.hs | 10 +++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 21304c4e..e5beffd1 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -239,9 +239,8 @@ warnAboutFilteredDecls mdl decls = do let instances = nub [ pretty i | (L _ (InstD (InstDecl i _ _ ats)), _, _) <- decls , not (null ats) ] - when (not $ null instances) $ - - tell $ nub $ [ + unless (null instances) $ + tell $ nub [ "Warning: " ++ modStr ++ ": We do not support associated types in instances yet. " ++ "These instances are affected:\n" ++ (concat $ intersperse ", " instances) ] diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 82b3b618..7a9a3292 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -65,7 +65,7 @@ renameInterface renamingEnv warnings iface = unless (OptHide `elem` ifaceOptions iface || null strings || not warnings) $ tell ["Warning: " ++ moduleString (ifaceMod iface) ++ ": could not find link destinations for:\n"++ - " " ++ concat (map (' ':) strings) ] + unwords (" " : strings) ] return $ iface { ifaceRnDoc = finalModuleDoc, ifaceRnDocMap = rnDocMap, @@ -93,7 +93,7 @@ instance Monad (GenRnM n) where return = returnRn returnRn :: a -> GenRnM n a -returnRn a = RnM (\_ -> (a,[])) +returnRn a = RnM (const (a,[])) thenRn :: GenRnM n a -> (a -> GenRnM n b) -> GenRnM n b m `thenRn` k = RnM (\lkp -> case unRn m lkp of (a,out1) -> case unRn (k a) lkp of @@ -102,7 +102,7 @@ m `thenRn` k = RnM (\lkp -> case unRn m lkp of getLookupRn :: RnM (Name -> (Bool, DocName)) getLookupRn = RnM (\lkp -> (lkp,[])) outRn :: Name -> RnM () -outRn name = RnM (\_ -> ((),[name])) +outRn name = RnM (const ((),[name])) lookupRn :: (DocName -> a) -> Name -> RnM a lookupRn and_then name = do @@ -134,11 +134,11 @@ renameL = mapM rename renameExportItems :: [ExportItem Name] -> RnM [ExportItem DocName] -renameExportItems items = mapM renameExportItem items +renameExportItems = mapM renameExportItem renameMaybeDoc :: Maybe (HsDoc Name) -> RnM (Maybe (HsDoc DocName)) -renameMaybeDoc mbDoc = mapM renameDoc mbDoc +renameMaybeDoc = mapM renameDoc renameLDoc :: LHsDoc Name -> RnM (LHsDoc DocName) -- cgit v1.2.3