aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Waern <david.waern@gmail.com>2009-03-27 21:15:11 +0000
committerDavid Waern <david.waern@gmail.com>2009-03-27 21:15:11 +0000
commit2c2c603e58b73b646c3fe025a1d7d5570ce5739b (patch)
treee4db987b6ef9269ef8f02c8aa018241a452b710e /src
parentd7c352b108c1c0b12abca1184f1d71380556d823 (diff)
Remove H.GHC.Typecheck
Diffstat (limited to 'src')
-rw-r--r--src/Haddock/GHC.hs2
-rw-r--r--src/Haddock/GHC/Typecheck.hs53
-rw-r--r--src/Haddock/Interface.hs37
3 files changed, 36 insertions, 56 deletions
diff --git a/src/Haddock/GHC.hs b/src/Haddock/GHC.hs
index 7856273e..f0157f29 100644
--- a/src/Haddock/GHC.hs
+++ b/src/Haddock/GHC.hs
@@ -7,12 +7,10 @@
module Haddock.GHC (
startGhc,
- module Haddock.GHC.Typecheck,
module Haddock.GHC.Utils
) where
-import Haddock.GHC.Typecheck
import Haddock.GHC.Utils
import Haddock.Exception
import Haddock.Options
diff --git a/src/Haddock/GHC/Typecheck.hs b/src/Haddock/GHC/Typecheck.hs
deleted file mode 100644
index 4af2f811..00000000
--- a/src/Haddock/GHC/Typecheck.hs
+++ /dev/null
@@ -1,53 +0,0 @@
---
--- Haddock - A Haskell Documentation Tool
---
--- (c) Simon Marlow 2003
---
-
-
-module Haddock.GHC.Typecheck (
- mkGhcModule
-) where
-
-
-import Haddock.Types
-
-import Data.Maybe
-import GHC
-import SrcLoc
-
-import Data.List
-
-
-type CheckedMod = (Module, FilePath, FullyCheckedMod)
-
-
-type FullyCheckedMod = (ParsedSource,
- RenamedSource,
- TypecheckedSource,
- ModuleInfo)
-
-
--- | Dig out what we want from the typechecker output
-mkGhcModule :: CheckedMod -> DynFlags -> GhcModule
-mkGhcModule (mdl, file, checkedMod) dynflags = GhcModule {
- ghcModule = mdl,
- ghcFilename = file,
- ghcMbDocOpts = mbOpts,
- ghcHaddockModInfo = info,
- ghcMbDoc = mbDoc,
- ghcGroup = group_,
- ghcMbExports = mbExports,
- ghcExportedNames = modInfoExports modInfo,
- ghcDefinedNames = map getName $ modInfoTyThings modInfo,
- ghcNamesInScope = fromJust $ modInfoTopLevelScope modInfo,
- ghcInstances = modInfoInstances modInfo
-}
- where
-#if __GLASGOW_HASKELL__ == 608 && __GHC_PATCHLEVEL__ == 2
- HsModule _ _ _ _ _ mbOpts _ _ = unLoc parsed
-#else
- mbOpts = haddockOptions dynflags
-#endif
- (group_, _, mbExports, mbDoc, info) = renamed
- (parsed, renamed, _, modInfo) = checkedMod
diff --git a/src/Haddock/Interface.hs b/src/Haddock/Interface.hs
index 3f959721..b3b2395b 100644
--- a/src/Haddock/Interface.hs
+++ b/src/Haddock/Interface.hs
@@ -21,7 +21,6 @@ import Haddock.Interface.Rename
import Haddock.Types
import Haddock.Options
import Haddock.GHC.Utils
-import Haddock.GHC.Typecheck
import Haddock.Exception
import Haddock.Utils
import Haddock.InterfaceFile
@@ -29,6 +28,7 @@ import Haddock.InterfaceFile
import qualified Data.Map as Map
import Data.Map (Map)
import Data.List
+import Data.Maybe
import Control.Monad
import Control.Exception ( evaluate )
import Distribution.Verbosity
@@ -210,6 +210,41 @@ processModule verbosity session modsum flags modMap instIfaceMap = do
return Nothing
#endif
+
+type CheckedMod = (Module, FilePath, FullyCheckedMod)
+
+
+type FullyCheckedMod = (ParsedSource,
+ RenamedSource,
+ TypecheckedSource,
+ ModuleInfo)
+
+
+-- | Dig out what we want from the typechecker output
+mkGhcModule :: CheckedMod -> DynFlags -> GhcModule
+mkGhcModule (mdl, file, checkedMod) dynflags = GhcModule {
+ ghcModule = mdl,
+ ghcFilename = file,
+ ghcMbDocOpts = mbOpts,
+ ghcHaddockModInfo = info,
+ ghcMbDoc = mbDoc,
+ ghcGroup = group_,
+ ghcMbExports = mbExports,
+ ghcExportedNames = modInfoExports modInfo,
+ ghcDefinedNames = map getName $ modInfoTyThings modInfo,
+ ghcNamesInScope = fromJust $ modInfoTopLevelScope modInfo,
+ ghcInstances = modInfoInstances modInfo
+}
+ where
+#if __GLASGOW_HASKELL__ == 608 && __GHC_PATCHLEVEL__ == 2
+ HsModule _ _ _ _ _ mbOpts _ _ = unLoc parsed
+#else
+ mbOpts = haddockOptions dynflags
+#endif
+ (group_, _, mbExports, mbDoc, info) = renamed
+ (parsed, renamed, _, modInfo) = checkedMod
+
+
-- | Build a mapping which for each original name, points to the "best"
-- place to link to in the documentation. For the definition of
-- "best", we use "the module nearest the bottom of the dependency