aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Theriault <alec.theriault@gmail.com>2020-03-22 11:46:42 -0400
committerAlec Theriault <alec.theriault@gmail.com>2020-03-22 11:46:42 -0400
commit5bef8bd8a72465a0abb1753a8bbeb94634a9d698 (patch)
treedb2abb1fe471b49c7501ffafce22cef1a95e74c8
parentdec888641006eb685a642ec489b198c61a5736dc (diff)
Clean up warnings
* unused imports * imports of `Data.List` without import lists * missing `CompatPrelude` file in `.cabal`
-rw-r--r--haddock-api/src/Haddock/Backends/Hoogle.hs3
-rw-r--r--haddock-api/src/Haddock/Backends/LaTeX.hs9
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/Decl.hs1
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs2
-rw-r--r--haddock-api/src/Haddock/Interface.hs2
-rw-r--r--haddock-api/src/Haddock/Interface/AttachInstances.hs2
-rw-r--r--haddock-api/src/Haddock/Interface/Create.hs2
-rw-r--r--haddock-api/src/Haddock/Interface/LexParseRn.hs2
-rw-r--r--haddock-api/src/Haddock/Interface/Rename.hs2
-rw-r--r--haddock-api/src/Haddock/InterfaceFile.hs2
-rw-r--r--haddock-api/src/Haddock/Utils.hs1
-rw-r--r--haddock-api/src/Haddock/Utils/Json.hs2
-rw-r--r--haddock-library/haddock-library.cabal26
-rw-r--r--haddock.cabal1
14 files changed, 22 insertions, 35 deletions
diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs
index 1f98ef9c..b38d4047 100644
--- a/haddock-api/src/Haddock/Backends/Hoogle.hs
+++ b/haddock-api/src/Haddock/Backends/Hoogle.hs
@@ -27,10 +27,9 @@ import Haddock.Utils hiding (out)
import GHC
import Outputable
-import NameSet
import Data.Char
-import Data.List
+import Data.List (isPrefixOf, intercalate)
import Data.Maybe
import Data.Version
diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs
index f2fb1041..63b12a14 100644
--- a/haddock-api/src/Haddock/Backends/LaTeX.hs
+++ b/haddock-api/src/Haddock/Backends/LaTeX.hs
@@ -38,7 +38,7 @@ import System.FilePath
import Data.Char
import Control.Monad
import Data.Maybe
-import Data.List
+import Data.List ( sort )
import Prelude hiding ((<>))
import Haddock.Doc (combineDocumentation)
@@ -517,12 +517,6 @@ ppSubSigLike unicode typ argDocs subdocs leader = do_args 0 leader typ
gadtOpen = char '{'
-ppForAllSeparator :: Bool -> ForallVisFlag -> LaTeX
-ppForAllSeparator unicode fvf =
- case fvf of
- ForallVis -> text "\\ " <> arrow unicode
- ForallInvis -> dot
-
ppTypeSig :: [Name] -> HsType DocNameI -> Bool -> LaTeX
ppTypeSig nms ty unicode =
hsep (punctuate comma $ map ppSymName nms)
@@ -1063,7 +1057,6 @@ ppForAllPart unicode tvs fvf = hsep (forallSymbol unicode : tvs') <> fv
ForallVis -> text "\\ " <> arrow unicode
ForallInvis -> dot
-
ppr_mono_lty :: LHsType DocNameI -> Bool -> LaTeX
ppr_mono_lty ty unicode = ppr_mono_ty (unLoc ty) unicode
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
index c7ae15ca..b450dc94 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
@@ -36,7 +36,6 @@ import Text.XHtml hiding ( name, title, p, quote )
import BasicTypes (PromotionFlag(..), isPromoted)
import GHC hiding (LexicalFixity(..))
-import qualified GHC
import GHC.Exts
import Name
import BooleanFormula
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
index edab4b16..0d7accfc 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs
@@ -19,7 +19,7 @@ module Haddock.Backends.Xhtml.DocMarkup (
docElement, docSection, docSection_,
) where
-import Data.List
+import Data.List (intersperse)
import Documentation.Haddock.Markup
import Haddock.Backends.Xhtml.Names
import Haddock.Backends.Xhtml.Utils
diff --git a/haddock-api/src/Haddock/Interface.hs b/haddock-api/src/Haddock/Interface.hs
index c2c0d733..24568235 100644
--- a/haddock-api/src/Haddock/Interface.hs
+++ b/haddock-api/src/Haddock/Interface.hs
@@ -44,7 +44,7 @@ import Haddock.Utils
import Control.Monad
import Control.Exception (evaluate)
-import Data.List
+import Data.List (foldl', isPrefixOf, nub)
import qualified Data.Map as Map
import qualified Data.Set as Set
import Text.Printf
diff --git a/haddock-api/src/Haddock/Interface/AttachInstances.hs b/haddock-api/src/Haddock/Interface/AttachInstances.hs
index 35f24ee5..685dca01 100644
--- a/haddock-api/src/Haddock/Interface/AttachInstances.hs
+++ b/haddock-api/src/Haddock/Interface/AttachInstances.hs
@@ -21,7 +21,7 @@ import Haddock.GhcUtils
import Control.Applicative ((<|>))
import Control.Arrow hiding ((<+>))
-import Data.List
+import Data.List (sortBy)
import Data.Ord (comparing)
import Data.Maybe ( maybeToList, mapMaybe, fromMaybe )
import qualified Data.Map as Map
diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs
index d5cbdaf5..b182a615 100644
--- a/haddock-api/src/Haddock/Interface/Create.hs
+++ b/haddock-api/src/Haddock/Interface/Create.hs
@@ -32,7 +32,7 @@ import Data.Bifunctor
import Data.Bitraversable
import qualified Data.Map as M
import Data.Map (Map)
-import Data.List
+import Data.List (find, foldl', sortBy)
import Data.Maybe
import Data.Ord
import Control.Applicative
diff --git a/haddock-api/src/Haddock/Interface/LexParseRn.hs b/haddock-api/src/Haddock/Interface/LexParseRn.hs
index 0b40ed3c..08a3c0f8 100644
--- a/haddock-api/src/Haddock/Interface/LexParseRn.hs
+++ b/haddock-api/src/Haddock/Interface/LexParseRn.hs
@@ -22,7 +22,7 @@ module Haddock.Interface.LexParseRn
import Control.Arrow
import Control.Monad
import Data.Functor (($>))
-import Data.List
+import Data.List (maximumBy, (\\))
import Data.Ord
import Documentation.Haddock.Doc (metaDocConcat)
import DynFlags (languageExtensions)
diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs
index 72d063dc..0b122b07 100644
--- a/haddock-api/src/Haddock/Interface/Rename.hs
+++ b/haddock-api/src/Haddock/Interface/Rename.hs
@@ -22,14 +22,12 @@ import Haddock.Types
import Bag (emptyBag)
import GHC hiding (NoLink)
import Name
-import Outputable ( panic )
import RdrName (RdrName(Exact))
import TysWiredIn (eqTyCon_RDR)
import Control.Applicative
import Control.Arrow ( first )
import Control.Monad hiding (mapM)
-import Data.List
import qualified Data.Map as Map hiding ( Map )
import Prelude hiding (mapM)
diff --git a/haddock-api/src/Haddock/InterfaceFile.hs b/haddock-api/src/Haddock/InterfaceFile.hs
index b5be311a..3ce2fabb 100644
--- a/haddock-api/src/Haddock/InterfaceFile.hs
+++ b/haddock-api/src/Haddock/InterfaceFile.hs
@@ -26,7 +26,7 @@ import Haddock.Utils hiding (out)
import Control.Monad
import Data.Array
import Data.IORef
-import Data.List
+import Data.List (mapAccumR)
import qualified Data.Map as Map
import Data.Map (Map)
import Data.Word
diff --git a/haddock-api/src/Haddock/Utils.hs b/haddock-api/src/Haddock/Utils.hs
index 79673365..3eb702c9 100644
--- a/haddock-api/src/Haddock/Utils.hs
+++ b/haddock-api/src/Haddock/Utils.hs
@@ -65,7 +65,6 @@ import BasicTypes ( PromotionFlag(..) )
import Exception (ExceptionMonad)
import GHC
import Name
-import Outputable ( panic )
import Control.Monad ( liftM )
import Data.Char ( isAlpha, isAlphaNum, isAscii, ord, chr )
diff --git a/haddock-api/src/Haddock/Utils/Json.hs b/haddock-api/src/Haddock/Utils/Json.hs
index e3c3dddc..2270a547 100644
--- a/haddock-api/src/Haddock/Utils/Json.hs
+++ b/haddock-api/src/Haddock/Utils/Json.hs
@@ -19,7 +19,7 @@ import Data.Char
import Data.Int
import Data.String
import Data.Word
-import Data.List
+import Data.List (intersperse)
import Data.Monoid
import Data.ByteString.Builder (Builder)
diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal
index e58fe2ef..294ef5be 100644
--- a/haddock-library/haddock-library.cabal
+++ b/haddock-library/haddock-library.cabal
@@ -59,22 +59,20 @@ test-suite spec
type: exitcode-stdio-1.0
main-is: Spec.hs
hs-source-dirs:
- test
- src
-
- cpp-options:
- -DTEST
+ test
+ src
other-modules:
- Documentation.Haddock.Doc
- Documentation.Haddock.Markup
- Documentation.Haddock.Parser
- Documentation.Haddock.Parser.Monad
- Documentation.Haddock.Parser.Util
- Documentation.Haddock.Parser.UtilSpec
- Documentation.Haddock.ParserSpec
- Documentation.Haddock.Types
- Documentation.Haddock.Parser.Identifier
+ CompatPrelude
+ Documentation.Haddock.Doc
+ Documentation.Haddock.Markup
+ Documentation.Haddock.Parser
+ Documentation.Haddock.Parser.Monad
+ Documentation.Haddock.Parser.Util
+ Documentation.Haddock.Parser.UtilSpec
+ Documentation.Haddock.ParserSpec
+ Documentation.Haddock.Types
+ Documentation.Haddock.Parser.Identifier
build-depends:
, base-compat ^>= 0.9.3 || ^>= 0.11.0
diff --git a/haddock.cabal b/haddock.cabal
index 92fe249e..425ed454 100644
--- a/haddock.cabal
+++ b/haddock.cabal
@@ -87,6 +87,7 @@ executable haddock
transformers
other-modules:
+ CompatPrelude
Documentation.Haddock.Parser
Documentation.Haddock.Parser.Monad
Documentation.Haddock.Parser.Identifier