@@ -84,7 +84,7 @@ import qualified Data.DList as DL
84
84
import Data.IORef
85
85
import qualified Data.IntMap.Strict as IntMap
86
86
import Data.List.Extra
87
- import qualified Data.Map.Strict as Map
87
+ import qualified Data.Map.Strict as MS
88
88
import Data.Maybe
89
89
import qualified Data.Text as T
90
90
import Data.Time (UTCTime , getCurrentTime )
@@ -93,7 +93,6 @@ import System.Directory
93
93
import System.FilePath
94
94
import System.IO.Extra (fixIO , newTempFileWithin )
95
95
96
- -- GHC API imports
97
96
-- GHC API imports
98
97
import GHC (GetDocsFailure (.. ),
99
98
mgModSummaries ,
@@ -108,6 +107,7 @@ import Data.Functor
108
107
import qualified Data.HashMap.Strict as HashMap
109
108
import Data.IntMap (IntMap )
110
109
import Data.Map (Map )
110
+ import qualified Data.Map as ML
111
111
import Data.Tuple.Extra (dupe )
112
112
import Data.Either.Extra (maybeToEither )
113
113
import Data.Unique as Unique
@@ -751,7 +751,7 @@ mergeEnvs env extraModSummaries extraMods envs = do
751
751
-- To work around this, we coerce to the underlying type
752
752
-- To remove this, I plan to upstream the missing Monoid instance
753
753
concatFC :: [FinderCache ] -> FinderCache
754
- concatFC = unsafeCoerce (mconcat @ (Map InstalledModule InstalledFindResult ))
754
+ concatFC = unsafeCoerce (mconcat @ (ML. Map InstalledModule InstalledFindResult ))
755
755
756
756
withBootSuffix :: HscSource -> ModLocation -> ModLocation
757
757
withBootSuffix HsBootFile = addBootSuffixLocnOut
@@ -1033,7 +1033,7 @@ getDocsNonInteractive'
1033
1033
(Env TcGblEnv TcLclEnv )
1034
1034
(Name ,
1035
1035
Either
1036
- GetDocsFailure (Maybe HsDocString , Maybe (Map . Map Int HsDocString )))
1036
+ GetDocsFailure (Maybe HsDocString , Maybe (MS . Map Int HsDocString )))
1037
1037
getDocsNonInteractive' name =
1038
1038
case nameModule_maybe name of
1039
1039
Nothing -> return (name, Left $ NameHasNoModule name)
@@ -1051,12 +1051,12 @@ getDocsNonInteractive' name =
1051
1051
RealSrcLoc {} -> False
1052
1052
UnhelpfulLoc {} -> True
1053
1053
pure . (name,) $
1054
- if isNothing mb_doc_hdr && Map .null dmap && Map .null amap
1054
+ if isNothing mb_doc_hdr && MS .null dmap && MS .null amap
1055
1055
then Left $ NoDocsInIface mod isNameCompiled
1056
- else Right (Map .lookup name dmap, Map .lookup name amap)
1056
+ else Right (MS .lookup name dmap, MS .lookup name amap)
1057
1057
1058
1058
-- | Non-interactive modification of 'GHC.Runtime.Eval.getDocs'.
1059
- getDocsNonInteractive :: HscEnv -> Module -> Name -> IO (Either GHC. ErrorMessages (Name , Either GetDocsFailure (Maybe HsDocString , Maybe (Map . Map Int HsDocString ))))
1059
+ getDocsNonInteractive :: HscEnv -> Module -> Name -> IO (Either GHC. ErrorMessages (Name , Either GetDocsFailure (Maybe HsDocString , Maybe (MS . Map Int HsDocString ))))
1060
1060
getDocsNonInteractive hsc_env mod name = do
1061
1061
((_warns,errs), res) <- initTypecheckEnv hsc_env mod $ getDocsNonInteractive' name
1062
1062
pure $ maybeToEither errs res
@@ -1068,10 +1068,10 @@ getDocsBatch
1068
1068
-> Module -- ^ a moudle where the names are in scope
1069
1069
-> [Name ]
1070
1070
-- 2021-11-18: NOTE: Map Int would become IntMap if next GHCs.
1071
- -> IO (Either GHC. ErrorMessages (Map . Map Name (Either GetDocsFailure (Maybe HsDocString , Maybe (Map . Map Int HsDocString )))))
1071
+ -> IO (Either GHC. ErrorMessages (MS . Map Name (Either GetDocsFailure (Maybe HsDocString , Maybe (MS . Map Int HsDocString )))))
1072
1072
-- ^ Return a 'Map' of 'Name's to 'Either' (no docs messages) (general doc body & arg docs)
1073
1073
getDocsBatch hsc_env mod names = do
1074
- ((_warns,errs), res) <- initTypecheckEnv hsc_env mod $ Map . fromList <$> traverse getDocsNonInteractive' names
1074
+ ((_warns,errs), res) <- initTypecheckEnv hsc_env mod $ MS . fromList <$> traverse getDocsNonInteractive' names
1075
1075
pure $ maybeToEither errs res
1076
1076
1077
1077
-- | Non-interactive, batch version of 'InteractiveEval.lookupNames'.
0 commit comments