aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/src
diff options
context:
space:
mode:
Diffstat (limited to 'haddock-api/src')
-rw-r--r--haddock-api/src/Haddock/Interface.hs48
-rw-r--r--haddock-api/src/Haddock/Interface/Create.hs49
2 files changed, 50 insertions, 47 deletions
diff --git a/haddock-api/src/Haddock/Interface.hs b/haddock-api/src/Haddock/Interface.hs
index 74dbc9c7..fd44e58b 100644
--- a/haddock-api/src/Haddock/Interface.hs
+++ b/haddock-api/src/Haddock/Interface.hs
@@ -34,42 +34,44 @@ module Haddock.Interface (
) where
-import Haddock.GhcUtils
-import Haddock.InterfaceFile
-import Haddock.Interface.Create
-import Haddock.Interface.AttachInstances
-import Haddock.Interface.Rename
+import Haddock.GhcUtils (moduleString, pretty)
+import Haddock.Interface.AttachInstances (attachInstances)
+import Haddock.Interface.Create (createInterface1, runIfM)
+import Haddock.Interface.Rename (renameInterface)
+import Haddock.InterfaceFile (InterfaceFile, ifInstalledIfaces, ifLinkEnv)
import Haddock.Options hiding (verbosity)
-import Haddock.Types
-import Haddock.Utils
-
-import Control.Monad
-import Control.Monad.IO.Class ( MonadIO )
-import Data.IORef
+import Haddock.Types (DocOption (..), Documentation (..), ExportItem (..), IfaceMap, InstIfaceMap, Interface, LinkEnv,
+ expItemDecl, expItemMbDoc, ifaceDoc, ifaceExportItems, ifaceExports, ifaceHaddockCoverage,
+ ifaceInstances, ifaceMod, ifaceOptions, ifaceVisibleExports, instMod, runWriter, throwE)
+import Haddock.Utils (Verbosity (..), normal, out, verbose)
+
+import Control.Monad (unless, when)
+import Control.Monad.IO.Class (MonadIO, liftIO)
+import Data.IORef (atomicModifyIORef', newIORef, readIORef)
import Data.List (foldl', isPrefixOf, nub)
+import Text.Printf (printf)
import qualified Data.Map as Map
import qualified Data.Set as Set
-import Text.Printf
import GHC hiding (verbosity)
import GHC.Data.FastString (unpackFS)
-import GHC.Data.Graph.Directed
-import GHC.Driver.Env
-import GHC.Driver.Monad
+import GHC.Data.Graph.Directed (flattenSCCs)
+import GHC.Driver.Env (hsc_dflags, hsc_home_unit, hsc_logger, hsc_static_plugins, hsc_units)
+import GHC.Driver.Monad (modifySession, withTimingM)
import GHC.Driver.Session hiding (verbosity)
import GHC.HsToCore.Docs
-import GHC.Plugins (Outputable, StaticPlugin(..), Plugin(..), PluginWithArgs(..), defaultPlugin, keepRenamedSource)
-import GHC.Tc.Types (TcM, TcGblEnv(..))
+import GHC.Plugins (Outputable, Plugin (..), PluginWithArgs (..), StaticPlugin (..), defaultPlugin, keepRenamedSource)
+import GHC.Tc.Types (TcGblEnv (..), TcM)
import GHC.Tc.Utils.Env (tcLookupGlobal)
import GHC.Tc.Utils.Monad (getTopEnv, setGblEnv)
import GHC.Types.Name (nameIsFromExternalPackage, nameOccName)
import GHC.Types.Name.Occurrence (isTcOcc)
-import GHC.Types.Name.Reader (unQualOK, greMangledName, globalRdrEnvElts)
-import GHC.Unit.Module.Env (mkModuleSet, emptyModuleSet, unionModuleSet, ModuleSet)
-import GHC.Unit.Module.Graph
-import GHC.Unit.Module.ModSummary
-import GHC.Unit.Types
-import GHC.Utils.Error
+import GHC.Types.Name.Reader (globalRdrEnvElts, greMangledName, unQualOK)
+import GHC.Unit.Module.Env (ModuleSet, emptyModuleSet, mkModuleSet, unionModuleSet)
+import GHC.Unit.Module.Graph (ModuleGraphNode (..))
+import GHC.Unit.Module.ModSummary (emsModSummary, isBootSummary)
+import GHC.Unit.Types (IsBootInterface (..))
+import GHC.Utils.Error (withTiming)
#if defined(mingw32_HOST_OS)
import System.IO
diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs
index a921342e..b039e095 100644
--- a/haddock-api/src/Haddock/Interface/Create.hs
+++ b/haddock-api/src/Haddock/Interface/Create.hs
@@ -32,48 +32,49 @@
module Haddock.Interface.Create (IfM, runIfM, createInterface1) where
import Documentation.Haddock.Doc (metaDocAppend)
+import Haddock.Convert (PrintRuntimeReps (..), tyThingToLHsDecl)
+import Haddock.GhcUtils (addClassContext, filterSigNames, lHsQTyVarsToTypes, mkEmptySigType, moduleString, parents,
+ pretty, restrictTo, sigName, unL)
+import Haddock.Interface.LexParseRn (processDocString, processDocStringParas, processDocStrings, processModuleHeader)
+import Haddock.Options (Flag (..), modulePackageInfo)
import Haddock.Types hiding (liftErrMsg)
-import Haddock.Options
-import Haddock.GhcUtils
-import Haddock.Utils
-import Haddock.Convert
-import Haddock.Interface.LexParseRn
+import Haddock.Utils (replace)
-import Control.Monad.Reader
+import Control.Monad.Reader (MonadReader (..), ReaderT, asks, runReaderT)
import Control.Monad.Writer.Strict hiding (tell)
-import Data.Bitraversable
-import qualified Data.Map as M
+import Data.Bitraversable (bitraverse)
+import Data.List (find, foldl')
import Data.Map (Map)
-import Data.List (foldl', find)
-import Data.Maybe
-import Data.Traversable
+import qualified Data.Map as M
+import Data.Maybe (catMaybes, fromJust, isJust, mapMaybe, maybeToList)
+import Data.Traversable (for)
-import GHC.Stack
import GHC hiding (lookupName)
-import GHC.Core.Class
+import GHC.Core.Class (ClassMinimalDef, classMinimalDef)
import GHC.Core.ConLike (ConLike (..))
import GHC.Data.FastString (bytesFS, unpackFS)
-import GHC.Driver.Ppr
+import GHC.Driver.Ppr (showSDoc)
import GHC.HsToCore.Docs hiding (mkMaps)
import GHC.Parser.Annotation (IsUnicodeSyntax (..))
+import GHC.Stack (HasCallStack)
import GHC.Tc.Types hiding (IfM)
import GHC.Tc.Utils.Monad (finalSafeMode)
import GHC.Types.Avail hiding (avail)
import qualified GHC.Types.Avail as Avail
import GHC.Types.Basic (PromotionFlag (..))
-import GHC.Types.Name
-import GHC.Types.Name.Env
-import GHC.Types.Name.Reader
-import GHC.Types.Name.Set
-import GHC.Types.SourceFile
-import GHC.Types.SourceText
+import GHC.Types.Name (getOccString, getSrcSpan, isDataConName, isValName, nameIsLocalOrFrom, nameOccName)
+import GHC.Types.Name.Env (lookupNameEnv)
+import GHC.Types.Name.Reader (GlobalRdrEnv, greMangledName, lookupGlobalRdrEnv)
+import GHC.Types.Name.Set (elemNameSet, mkNameSet)
+import GHC.Types.SourceFile (HscSource (..))
+import GHC.Types.SourceText (SourceText (..), sl_fs)
import qualified GHC.Types.SrcLoc as SrcLoc
import qualified GHC.Unit.Module as Module
-import GHC.Unit.Module.ModSummary
-import GHC.Unit.Module.Warnings
-import GHC.Unit.State
+import GHC.Unit.Module.ModSummary (msHsFilePath)
+import GHC.Unit.Module.Warnings (WarningTxt (..), Warnings (..))
+import GHC.Unit.State (PackageName (..), UnitState, lookupModuleInAllUnits)
import qualified GHC.Utils.Outputable as O
-import GHC.Utils.Panic
+import GHC.Utils.Panic (pprPanic)
newtype IfEnv m = IfEnv
{