aboutsummaryrefslogtreecommitdiff
path: root/haddock-api
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-04-26 09:35:15 -0400
committerGitHub <noreply@github.com>2020-04-26 09:35:15 -0400
commit7c34f89d801bafba3162bc091dd486cbb9e9fd5b (patch)
tree1cc57abaaa39c4523822f95ffb9c61156f1f28e4 /haddock-api
parentda4e2bd788b6231494d6ac56a8e88bcfa4be51f6 (diff)
parent2d2587182568cc5aa4b29d401517337c32459c66 (diff)
Merge pull request #1166 from hsyl20/wip/hsyl20/modules/utils
Module structure
Diffstat (limited to 'haddock-api')
-rw-r--r--haddock-api/src/Haddock.hs6
-rw-r--r--haddock-api/src/Haddock/Backends/Hoogle.hs3
-rw-r--r--haddock-api/src/Haddock/Backends/Hyperlinker.hs2
-rw-r--r--haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs10
-rw-r--r--haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs2
-rw-r--r--haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs2
-rw-r--r--haddock-api/src/Haddock/Backends/LaTeX.hs8
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/Decl.hs2
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/Layout.hs2
-rw-r--r--haddock-api/src/Haddock/Backends/Xhtml/Names.hs2
-rw-r--r--haddock-api/src/Haddock/Convert.hs4
-rw-r--r--haddock-api/src/Haddock/GhcUtils.hs10
-rw-r--r--haddock-api/src/Haddock/Interface.hs6
-rw-r--r--haddock-api/src/Haddock/Interface/AttachInstances.hs6
-rw-r--r--haddock-api/src/Haddock/Interface/Create.hs7
-rw-r--r--haddock-api/src/Haddock/Interface/Json.hs4
-rw-r--r--haddock-api/src/Haddock/Interface/LexParseRn.hs4
-rw-r--r--haddock-api/src/Haddock/Interface/Rename.hs3
-rw-r--r--haddock-api/src/Haddock/Interface/Specialize.hs2
-rw-r--r--haddock-api/src/Haddock/InterfaceFile.hs6
-rw-r--r--haddock-api/src/Haddock/Options.hs2
-rw-r--r--haddock-api/src/Haddock/Parser.hs4
-rw-r--r--haddock-api/src/Haddock/Types.hs2
-rw-r--r--haddock-api/src/Haddock/Utils.hs5
24 files changed, 50 insertions, 54 deletions
diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs
index 87f83cfe..314458b2 100644
--- a/haddock-api/src/Haddock.hs
+++ b/haddock-api/src/Haddock.hs
@@ -67,11 +67,11 @@ import Text.ParserCombinators.ReadP (readP_to_S)
import GHC hiding (verbosity)
import Config
import GHC.Driver.Session hiding (projectVersion, verbosity)
-import ErrUtils
+import GHC.Utils.Error
import GHC.Driver.Packages
-import Panic (handleGhcException)
+import GHC.Utils.Panic (handleGhcException)
import GHC.Types.Module
-import FastString
+import GHC.Data.FastString
import qualified GHC.Runtime.Loader
--------------------------------------------------------------------------------
diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs
index 36001714..5d658a7e 100644
--- a/haddock-api/src/Haddock/Backends/Hoogle.hs
+++ b/haddock-api/src/Haddock/Backends/Hoogle.hs
@@ -26,8 +26,7 @@ import Haddock.Types hiding (Version)
import Haddock.Utils hiding (out)
import GHC
-import Outputable
-import GHC.Types.Name.Set
+import GHC.Utils.Outputable as Outputable
import Data.Char
import Data.List
diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker.hs b/haddock-api/src/Haddock/Backends/Hyperlinker.hs
index 8e0e4d54..fb238995 100644
--- a/haddock-api/src/Haddock/Backends/Hyperlinker.hs
+++ b/haddock-api/src/Haddock/Backends/Hyperlinker.hs
@@ -21,7 +21,7 @@ import System.FilePath
import GHC.Iface.Ext.Types ( HieFile(..), HieASTs(..) )
import GHC.Iface.Ext.Binary ( readHieFile, hie_file_result)
import Data.Map as M
-import FastString ( mkFastString )
+import GHC.Data.FastString ( mkFastString )
import GHC.Types.Module ( Module, moduleName )
import GHC.Types.Name.Cache ( initNameCache )
import GHC.Types.Unique.Supply ( mkSplitUniqSupply )
diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
index ddf70b5f..41591c6e 100644
--- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
+++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
@@ -11,15 +11,15 @@ import qualified Data.ByteString as BS
import GHC.Types.Basic ( IntegralLit(..) )
import GHC.Driver.Session
-import ErrUtils ( pprLocErrMsg )
-import FastString ( mkFastString )
+import GHC.Utils.Error ( pprLocErrMsg )
+import GHC.Data.FastString ( mkFastString )
import GHC.Parser.Lexer as Lexer
( P(..), ParseResult(..), PState(..), Token(..)
, mkPStatePure, lexer, mkParserFlags', getErrorMessages)
-import Bag ( bagToList )
-import Outputable ( showSDoc, panic, text, ($$) )
+import GHC.Data.Bag ( bagToList )
+import GHC.Utils.Outputable ( showSDoc, panic, text, ($$) )
import GHC.Types.SrcLoc
-import StringBuffer ( StringBuffer, atEnd )
+import GHC.Data.StringBuffer ( StringBuffer, atEnd )
import Haddock.Backends.Hyperlinker.Types as T
import Haddock.GhcUtils
diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs
index a83c935c..a6134cd2 100644
--- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs
+++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs
@@ -17,7 +17,7 @@ import GHC.Types.Module ( ModuleName, moduleNameString )
import GHC.Types.Name ( getOccString, isInternalName, Name, nameModule, nameUnique )
import GHC.Types.SrcLoc
import GHC.Types.Unique ( getKey )
-import Encoding ( utf8DecodeByteString )
+import GHC.Utils.Encoding ( utf8DecodeByteString )
import System.FilePath.Posix ((</>))
diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs
index b3ccf1be..17ba00f0 100644
--- a/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs
+++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs
@@ -21,7 +21,7 @@ import GHC
import GHC.Iface.Ext.Types ( HieAST(..), HieType(..), HieArgs(..), TypeIndex, HieTypeFlat )
import GHC.Iface.Type
import GHC.Types.Name ( getOccFS, getOccString )
-import Outputable ( showSDoc )
+import GHC.Utils.Outputable( showSDoc )
import GHC.Types.Var ( VarBndr(..) )
import System.FilePath.Posix ((</>), (<.>))
diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs
index 560a0f40..c54cc459 100644
--- a/haddock-api/src/Haddock/Backends/LaTeX.hs
+++ b/haddock-api/src/Haddock/Backends/LaTeX.hs
@@ -21,16 +21,16 @@ import Documentation.Haddock.Markup
import Haddock.Types
import Haddock.Utils
import Haddock.GhcUtils
-import Pretty hiding (Doc, quote)
-import qualified Pretty
+import GHC.Utils.Ppr hiding (Doc, quote)
+import qualified GHC.Utils.Ppr as Pretty
import GHC.Types.Basic ( PromotionFlag(..) )
import GHC
import GHC.Types.Name.Occurrence
import GHC.Types.Name ( nameOccName )
import GHC.Types.Name.Reader ( rdrNameOcc )
-import FastString ( unpackFS )
-import Outputable ( panic)
+import GHC.Data.FastString ( unpackFS )
+import GHC.Utils.Outputable ( panic)
import qualified Data.Map as Map
import System.Directory
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
index 153caf86..a8ff584d 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
@@ -38,7 +38,7 @@ import GHC.Types.Basic (PromotionFlag(..), isPromoted)
import GHC hiding (LexicalFixity(..))
import GHC.Exts
import GHC.Types.Name
-import BooleanFormula
+import GHC.Data.BooleanFormula
import GHC.Types.Name.Reader ( rdrNameOcc )
-- | Pretty print a declaration
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
index e08bf575..21d544cd 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs
@@ -49,7 +49,7 @@ import qualified Data.Map as Map
import Text.XHtml hiding ( name, title, quote )
import Data.Maybe (fromMaybe)
-import FastString ( unpackFS )
+import GHC.Data.FastString ( unpackFS )
import GHC
import GHC.Types.Name (nameOccName)
diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Names.hs b/haddock-api/src/Haddock/Backends/Xhtml/Names.hs
index 6c5fecee..83279f70 100644
--- a/haddock-api/src/Haddock/Backends/Xhtml/Names.hs
+++ b/haddock-api/src/Haddock/Backends/Xhtml/Names.hs
@@ -29,7 +29,7 @@ import qualified Data.List as List
import GHC hiding (LexicalFixity(..))
import GHC.Types.Name
import GHC.Types.Name.Reader
-import FastString (unpackFS)
+import GHC.Data.FastString (unpackFS)
-- | Indicator of how to render a 'DocName' into 'Html'
diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs
index ceb6916e..6a9598ed 100644
--- a/haddock-api/src/Haddock/Convert.hs
+++ b/haddock-api/src/Haddock/Convert.hs
@@ -19,7 +19,7 @@ module Haddock.Convert (
PrintRuntimeReps(..),
) where
-import Bag ( emptyBag )
+import GHC.Data.Bag ( emptyBag )
import GHC.Types.Basic ( TupleSort(..), SourceText(..), LexicalFixity(..)
, PromotionFlag(..), DefMethSpec(..) )
import GHC.Core.Class
@@ -44,7 +44,7 @@ import GHC.Builtin.Types ( eqTyConName, listTyConName, liftedTypeKindTyConName
import GHC.Builtin.Names ( hasKey, eqTyConKey, ipClassKey, tYPETyConKey
, liftedRepDataConKey )
import GHC.Types.Unique ( getUnique )
-import Util ( chkAppend,dropList, filterByList, filterOut )
+import GHC.Utils.Misc ( chkAppend,dropList, filterByList, filterOut )
import GHC.Types.Var
import GHC.Types.Var.Set
diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs
index f681c1dc..8341faf5 100644
--- a/haddock-api/src/Haddock/GhcUtils.hs
+++ b/haddock-api/src/Haddock/GhcUtils.hs
@@ -23,9 +23,9 @@ import Data.Char ( isSpace )
import Haddock.Types( DocName, DocNameI )
-import Exception
-import FV
-import Outputable ( Outputable, panic, showPpr )
+import GHC.Utils.Exception
+import GHC.Utils.FV as FV
+import GHC.Utils.Outputable ( Outputable, panic, showPpr )
import GHC.Types.Name
import GHC.Types.Name.Set
import GHC.Types.Module
@@ -43,8 +43,8 @@ import GHC.Core.Type ( isRuntimeRepVar )
import GHC.Builtin.Types( liftedRepDataConTyCon )
import GHC.Hs.Utils (CollectPass(..))
-import StringBuffer ( StringBuffer )
-import qualified StringBuffer as S
+import GHC.Data.StringBuffer ( StringBuffer )
+import qualified GHC.Data.StringBuffer as S
import Data.ByteString ( ByteString )
import qualified Data.ByteString as BS
diff --git a/haddock-api/src/Haddock/Interface.hs b/haddock-api/src/Haddock/Interface.hs
index 52bf6f7b..80ce2b55 100644
--- a/haddock-api/src/Haddock/Interface.hs
+++ b/haddock-api/src/Haddock/Interface.hs
@@ -51,16 +51,16 @@ import Distribution.Verbosity
import Text.Printf
import GHC.Types.Module (mkModuleSet, emptyModuleSet, unionModuleSet, ModuleSet)
-import Digraph
+import GHC.Data.Graph.Directed
import GHC.Driver.Session hiding (verbosity)
import GHC hiding (verbosity)
import GHC.Driver.Types
-import FastString (unpackFS)
+import GHC.Data.FastString (unpackFS)
import GHC.Tc.Types (tcg_rdr_env)
import GHC.Types.Name (nameIsFromExternalPackage, nameOccName)
import GHC.Types.Name.Occurrence (isTcOcc)
import GHC.Types.Name.Reader (unQualOK, gre_name, globalRdrEnvElts)
-import ErrUtils (withTimingD)
+import GHC.Utils.Error (withTimingD)
#if defined(mingw32_HOST_OS)
import System.IO
diff --git a/haddock-api/src/Haddock/Interface/AttachInstances.hs b/haddock-api/src/Haddock/Interface/AttachInstances.hs
index 00e9aabb..7dba9d03 100644
--- a/haddock-api/src/Haddock/Interface/AttachInstances.hs
+++ b/haddock-api/src/Haddock/Interface/AttachInstances.hs
@@ -30,15 +30,15 @@ import qualified Data.Set as Set
import GHC.Core.Class
import GHC.Driver.Session
import GHC.Core (isOrphan)
-import ErrUtils
+import GHC.Utils.Error
import GHC.Core.FamInstEnv
import GHC
import GHC.Core.InstEnv
import GHC.Types.Module ( ModuleSet, moduleSetElts )
-import MonadUtils (liftIO)
+import GHC.Utils.Monad (liftIO)
import GHC.Types.Name
import GHC.Types.Name.Env
-import Outputable (text, sep, (<+>))
+import GHC.Utils.Outputable (text, sep, (<+>))
import GHC.Types.SrcLoc
import GHC.Core.TyCon
import GHC.Core.TyCo.Rep
diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs
index de4febf8..7e05e669 100644
--- a/haddock-api/src/Haddock/Interface/Create.hs
+++ b/haddock-api/src/Haddock/Interface/Create.hs
@@ -34,7 +34,6 @@ import qualified Data.Map as M
import Data.Map (Map)
import Data.List
import Data.Maybe
-import Data.Ord
import Control.Applicative
import Control.Monad
import Data.Traversable
@@ -50,12 +49,12 @@ import GHC.Types.Name
import GHC.Types.Name.Set
import GHC.Types.Name.Env
import GHC.Driver.Packages ( lookupModuleInAllPackages, PackageName(..) )
-import Bag
+import GHC.Data.Bag
import GHC.Types.Name.Reader
import GHC.Tc.Types
-import FastString ( unpackFS, bytesFS )
+import GHC.Data.FastString ( unpackFS, bytesFS )
import GHC.Types.Basic ( StringLiteral(..), SourceText(..), PromotionFlag(..) )
-import qualified Outputable as O
+import qualified GHC.Utils.Outputable as O
-- | Use a 'TypecheckedModule' to produce an 'Interface'.
diff --git a/haddock-api/src/Haddock/Interface/Json.hs b/haddock-api/src/Haddock/Interface/Json.hs
index 88387edd..701c68bf 100644
--- a/haddock-api/src/Haddock/Interface/Json.hs
+++ b/haddock-api/src/Haddock/Interface/Json.hs
@@ -6,10 +6,10 @@ module Haddock.Interface.Json (
) where
import GHC.Types.Basic
-import Json
+import GHC.Utils.Json
import GHC.Types.Module
import GHC.Types.Name
-import Outputable
+import GHC.Utils.Outputable
import Control.Arrow
import Data.Map (Map)
diff --git a/haddock-api/src/Haddock/Interface/LexParseRn.hs b/haddock-api/src/Haddock/Interface/LexParseRn.hs
index 22279614..2b03ecfa 100644
--- a/haddock-api/src/Haddock/Interface/LexParseRn.hs
+++ b/haddock-api/src/Haddock/Interface/LexParseRn.hs
@@ -32,9 +32,9 @@ import Haddock.Interface.ParseModuleHeader
import Haddock.Parser
import Haddock.Types
import GHC.Types.Name
-import Outputable ( showPpr, showSDoc )
+import GHC.Utils.Outputable ( showPpr, showSDoc )
import GHC.Types.Name.Reader
-import EnumSet
+import GHC.Data.EnumSet as EnumSet
import GHC.Rename.Env (dataTcOccs)
processDocStrings :: DynFlags -> Maybe Package -> GlobalRdrEnv -> [HsDocString]
diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs
index 4ca4a13d..59c2f818 100644
--- a/haddock-api/src/Haddock/Interface/Rename.hs
+++ b/haddock-api/src/Haddock/Interface/Rename.hs
@@ -19,10 +19,9 @@ import Data.Traversable (mapM)
import Haddock.GhcUtils
import Haddock.Types
-import Bag (emptyBag)
+import GHC.Data.Bag (emptyBag)
import GHC hiding (NoLink)
import GHC.Types.Name
-import Outputable ( panic )
import GHC.Types.Name.Reader (RdrName(Exact))
import GHC.Builtin.Types (eqTyCon_RDR)
diff --git a/haddock-api/src/Haddock/Interface/Specialize.hs b/haddock-api/src/Haddock/Interface/Specialize.hs
index 52cbcdbf..a939dfbd 100644
--- a/haddock-api/src/Haddock/Interface/Specialize.hs
+++ b/haddock-api/src/Haddock/Interface/Specialize.hs
@@ -14,7 +14,7 @@ import Haddock.Types
import GHC
import GHC.Types.Name
-import FastString
+import GHC.Data.FastString
import GHC.Builtin.Types.Prim ( funTyConName )
import GHC.Builtin.Types ( listTyConName )
diff --git a/haddock-api/src/Haddock/InterfaceFile.hs b/haddock-api/src/Haddock/InterfaceFile.hs
index 2e841fad..4be0bdde 100644
--- a/haddock-api/src/Haddock/InterfaceFile.hs
+++ b/haddock-api/src/Haddock/InterfaceFile.hs
@@ -32,9 +32,9 @@ import Data.Map (Map)
import Data.Word
import GHC.Iface.Binary (getSymtabName, getDictFastString)
-import Binary
-import FastMutInt
-import FastString
+import GHC.Utils.Binary
+import GHC.Data.FastMutInt
+import GHC.Data.FastString
import GHC hiding (NoLink)
import GHC.Driver.Monad (withSession)
import GHC.Driver.Types
diff --git a/haddock-api/src/Haddock/Options.hs b/haddock-api/src/Haddock/Options.hs
index 69cf61f5..cccca201 100644
--- a/haddock-api/src/Haddock/Options.hs
+++ b/haddock-api/src/Haddock/Options.hs
@@ -44,7 +44,7 @@ import qualified Data.Char as Char
import Data.Version
import Control.Applicative
import Distribution.Verbosity
-import FastString
+import GHC.Data.FastString
import GHC ( DynFlags, Module, moduleUnitId )
import Haddock.Types
import Haddock.Utils
diff --git a/haddock-api/src/Haddock/Parser.hs b/haddock-api/src/Haddock/Parser.hs
index cf66cd1a..e1b5c787 100644
--- a/haddock-api/src/Haddock/Parser.hs
+++ b/haddock-api/src/Haddock/Parser.hs
@@ -17,12 +17,12 @@ import qualified Documentation.Haddock.Parser as P
import Documentation.Haddock.Types
import GHC.Driver.Session ( DynFlags )
-import FastString ( fsLit )
+import GHC.Data.FastString ( fsLit )
import GHC.Parser.Lexer ( mkPState, unP, ParseResult(POk) )
import GHC.Parser ( parseIdentifier )
import GHC.Types.Name.Reader ( RdrName )
import GHC.Types.SrcLoc ( mkRealSrcLoc, unLoc )
-import StringBuffer ( stringToStringBuffer )
+import GHC.Data.StringBuffer ( stringToStringBuffer )
parseParas :: DynFlags -> Maybe Package -> String -> MetaDoc mod RdrName
parseParas d p = overDoc (P.overIdentifier (parseIdent d)) . P.parseParas p
diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs
index f12a6bce..c172320c 100644
--- a/haddock-api/src/Haddock/Types.hs
+++ b/haddock-api/src/Haddock/Types.hs
@@ -42,7 +42,7 @@ import GHC
import GHC.Driver.Session (Language)
import qualified GHC.LanguageExtensions as LangExt
import GHC.Types.Name.Occurrence
-import Outputable
+import GHC.Utils.Outputable
-----------------------------------------------------------------------------
-- * Convenient synonyms
diff --git a/haddock-api/src/Haddock/Utils.hs b/haddock-api/src/Haddock/Utils.hs
index df14eeb2..9bd0d656 100644
--- a/haddock-api/src/Haddock/Utils.hs
+++ b/haddock-api/src/Haddock/Utils.hs
@@ -62,10 +62,9 @@ import Haddock.Types
import Haddock.GhcUtils
import GHC.Types.Basic ( PromotionFlag(..) )
-import Exception (ExceptionMonad)
+import GHC.Utils.Exception (ExceptionMonad)
import GHC
import GHC.Types.Name
-import Outputable ( panic )
import Control.Monad ( liftM )
import Data.Char ( isAlpha, isAlphaNum, isAscii, ord, chr )
@@ -88,7 +87,7 @@ import Distribution.ReadE
import qualified System.Posix.Internals
#endif
-import MonadUtils ( MonadIO(..) )
+import GHC.Utils.Monad ( MonadIO(..) )
--------------------------------------------------------------------------------