diff --git a/haskell-docs.cabal b/haskell-docs.cabal
--- a/haskell-docs.cabal
+++ b/haskell-docs.cabal
@@ -1,5 +1,5 @@
 name:                haskell-docs
-version:             4.2.8
+version:             4.2.9
 synopsis:            A program to find and display the docs and type of a name
 description:         Given a module name and a name, or just a name, it will find and display
                      the documentation of that name.
@@ -50,7 +50,7 @@
 build-type:          Simple
 Tested-With:         GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4,
                      GHC == 7.10.2, GHC == 8.0.2, GHC == 8.1.*,
-                     GHC == 8.2.2
+                     GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5
 cabal-version:       >=1.8
 Homepage:            http://github.com/ivan-m/haskell-docs
 Bug-Reports:         http://github.com/ivan-m/haskell-docs/issues
@@ -88,12 +88,19 @@
                      , cryptohash
                      , directory
                      , filepath
-                     , ghc >= 7.4 && < 8.3
+                     , ghc >= 7.4 && < 8.7
                      , ghc-paths
                      , monad-loops
                      , process
                      , text
                      , unordered-containers
+  if impl(ghc==8.6.*)
+     build-depends:   haddock-api==2.22.*
+                    , haddock-library == 1.7.0
+  if impl(ghc==8.4.*)
+     build-depends:   haddock-api==2.20.*
+                    -- haddock-library 1.6.1 was deprecated
+                    , haddock-library == 1.6.0
   if impl(ghc==8.2.*)
      build-depends:   haddock-api==2.18.*
                     , haddock-library
diff --git a/src/Haskell/Docs/Ghc.hs b/src/Haskell/Docs/Ghc.hs
--- a/src/Haskell/Docs/Ghc.hs
+++ b/src/Haskell/Docs/Ghc.hs
@@ -74,19 +74,7 @@
 #if __GLASGOW_HASKELL__ == 704
 showSDocForUser _ = Outputable.showSDocForUser
 #endif
-#if __GLASGOW_HASKELL__ == 706
-showSDocForUser = Outputable.showSDocForUser
-#endif
-#if __GLASGOW_HASKELL__ == 708
-showSDocForUser = Outputable.showSDocForUser
-#endif
-#if __GLASGOW_HASKELL__ == 710
-showSDocForUser = Outputable.showSDocForUser
-#endif
-#if __GLASGOW_HASKELL__ == 800
-showSDocForUser = Outputable.showSDocForUser
-#endif
-#if __GLASGOW_HASKELL__ == 802
+#if __GLASGOW_HASKELL__ >= 706
 showSDocForUser = Outputable.showSDocForUser
 #endif
 
diff --git a/src/Haskell/Docs/Index.hs b/src/Haskell/Docs/Index.hs
--- a/src/Haskell/Docs/Index.hs
+++ b/src/Haskell/Docs/Index.hs
@@ -31,6 +31,7 @@
 import qualified Data.Text.IO             as T
 import           Documentation.Haddock
 import           GHC                      hiding (verbosity)
+import           GHC.Paths                (ghc_pkg)
 import           Name
 import           System.Directory
 import           System.Environment
@@ -74,7 +75,10 @@
                                (pack pkg <> ":" <> pack modu) m)
                M.empty
                flatfile)
-  where (<>) = mappend
+#if !(MIN_VERSION_base (4,11,0))
+  where
+   (<>) = mappend
+#endif
 
 -- | Generate a flat file of all package, module, name combinations.
 generateFlatFile :: [String] -> IO [(String, String, String)]
@@ -111,7 +115,10 @@
      forM_ (M.toList i)
            (\(ident,modules) -> T.hPutStrLn h (ident <> " " <> modules))
      hClose h
-  where (<>) = mappend
+#if !(MIN_VERSION_base (4,11,0))
+  where
+   (<>) = mappend
+#endif
 
 -- | Filename to read/write index to.
 getIndexFilename :: IO FilePath
@@ -160,4 +167,4 @@
        Just uflags -> return uflags
        Nothing -> case lookup "GHC_PACKAGE_PATH" env of
            Just path -> return ("-no-user-pg-db" ++ "-pkg-db=" ++ path)
-           Nothing   -> readProcess "ghc-pkg" ["--version"] ""
+           Nothing   -> readProcess ghc_pkg ["--version"] ""
diff --git a/src/haddock-api/Haskell/Docs/HaddockDoc.hs b/src/haddock-api/Haskell/Docs/HaddockDoc.hs
--- a/src/haddock-api/Haskell/Docs/HaddockDoc.hs
+++ b/src/haddock-api/Haskell/Docs/HaddockDoc.hs
@@ -35,6 +35,9 @@
 #if MIN_VERSION_haddock_api (2,17,0)
 doc (DocMathInline mth) = mth
 doc (DocMathDisplay mth) = mth
+#if MIN_VERSION_haddock_api (2,19,0)
+doc (DocTable _) = ""
+#endif
 #endif
 
 -- The header type is unexported, so this constructor is useless.
