on master help sign in
Expose TcModuleResult in RuleTypes (#2014)

This should really be part of the public API.

commit1a7d83c7e808614e5ab83514c5fdacd1f3a234f1 authorMoritz Kiefer <moritz.kiefer@purelyfunctional.org> dateThu 4 Jul 2019, 20:29 (7 years ago) parent5beb77c
2 files changed+18−20
src/Development/IDE/Core/Compile.hs+5−19 src/Development/IDE/Core/RuleTypes.hs+13−1
src/Development/IDE/Core/Compile.hs+5−19
@@ -16,10 +16,11 @@ module Development.IDE.Core.Compile
1616 , addRelativeImport
1717 ) where
1818
19−import Development.IDE.GHC.Warnings
20−import Development.IDE.GHC.CPP
21−import Development.IDE.Types.Diagnostics
22−import Development.IDE.GHC.Error
19+import Development.IDE.Core.RuleTypes
20+import Development.IDE.GHC.CPP
21+import Development.IDE.GHC.Error
22+import Development.IDE.GHC.Warnings
23+import Development.IDE.Types.Diagnostics
2324import Development.IDE.GHC.Orphans()
2425import Development.IDE.GHC.Util
2526import Development.IDE.GHC.Compat
@@ -42,7 +43,6 @@ import StringBuffer as SB
4243import TidyPgm
4344import qualified GHC.LanguageExtensions as LangExt
4445
45−import Control.DeepSeq
4646import Control.Monad.Extra
4747import Control.Monad.Except
4848import Control.Monad.Trans.Except
@@ -57,20 +57,6 @@ import System.Directory
5757import System.IO.Extra
5858import Data.Char
5959
60−
61−-- | Contains the typechecked module and the OrigNameCache entry for
62−-- that module.
63−data TcModuleResult = TcModuleResult
64− { tmrModule :: TypecheckedModule
65− , tmrModInfo :: HomeModInfo
66− }
67−instance Show TcModuleResult where
68− show = show . pm_mod_summary . tm_parsed_module . tmrModule
69−
70−instance NFData TcModuleResult where
71− rnf = rwhnf
72−
73−
7460-- | Given a string buffer, return a pre-processed @ParsedModule@.
7561parseModule
7662 :: IdeOptions
src/Development/IDE/Core/RuleTypes.hs+13−1
@@ -12,7 +12,6 @@ module Development.IDE.Core.RuleTypes(
1212 ) where
1313
1414import Control.DeepSeq
15−import Development.IDE.Core.Compile (TcModuleResult)
1615import Development.IDE.Import.FindImports (Import(..))
1716import Development.IDE.Import.DependencyInformation
1817import Data.Hashable
@@ -21,6 +20,7 @@ import Development.Shake hiding (Env, newCache)
2120import GHC.Generics (Generic)
2221
2322import GHC
23+import HscTypes (HomeModInfo)
2424import Development.IDE.GHC.Compat
2525
2626import Development.IDE.Spans.Type
@@ -42,6 +42,18 @@ type instance RuleResult GetDependencyInformation = DependencyInformation
4242-- This rule is also responsible for calling ReportImportCycles for each file in the transitive closure.
4343type instance RuleResult GetDependencies = TransitiveDependencies
4444
45+-- | Contains the typechecked module and the OrigNameCache entry for
46+-- that module.
47+data TcModuleResult = TcModuleResult
48+ { tmrModule :: TypecheckedModule
49+ , tmrModInfo :: HomeModInfo
50+ }
51+instance Show TcModuleResult where
52+ show = show . pm_mod_summary . tm_parsed_module . tmrModule
53+
54+instance NFData TcModuleResult where
55+ rnf = rwhnf
56+
4557-- | The type checked version of this file, requires TypeCheck+
4658type instance RuleResult TypeCheck = TcModuleResult
4759