@@ -213,9 +213,7 @@ tcRnModule hsc_env keep_lbls pmod = do
213
213
HsParsedModule { hpm_module = parsedSource pmod,
214
214
hpm_src_files = pm_extra_src_files pmod,
215
215
hpm_annotations = pm_annotations pmod }
216
- let rn_info = case mrn_info of
217
- Just x -> x
218
- Nothing -> error " no renamed info tcRnModule"
216
+ let rn_info = fromMaybe (error " no renamed info tcRnModule" ) mrn_info
219
217
pure (TcModuleResult pmod rn_info tc_gbl_env splices False )
220
218
221
219
mkHiFileResultNoCompile :: HscEnv -> TcModuleResult -> IO HiFileResult
@@ -995,6 +993,7 @@ getDocsBatch
995
993
-> Module -- ^ a moudle where the names are in scope
996
994
-> [Name ]
997
995
-> IO (Either ErrorMessages (Map. Map Name (Either GetDocsFailure (Maybe HsDocString , Maybe (Map. Map Int HsDocString )))))
996
+ -- ^ Return a 'Map' of 'Name's to 'Either' (no docs messages) (general doc body & arg docs)
998
997
getDocsBatch hsc_env _mod _names = do
999
998
((_warns,errs), res) <- initTc hsc_env HsSrcFile False _mod fakeSpan $ Map. fromList <$> traverse findNameInfo _names
1000
999
pure $ maybeToEither errs res
@@ -1012,9 +1011,9 @@ getDocsBatch hsc_env _mod _names = do
1012
1011
<- loadModuleInterface " getModuleInterface" mod
1013
1012
pure . (name,) $
1014
1013
if isNothing mb_doc_hdr && Map. null dmap && Map. null amap
1015
- then Left $ NoDocsInIface mod $ compiled name
1014
+ then Left $ NoDocsInIface mod $ isCompiled name
1016
1015
else Right (Map. lookup name dmap, Map. lookup name amap)
1017
- compiled n =
1016
+ isCompiled n =
1018
1017
-- TODO: Find a more direct indicator.
1019
1018
case nameSrcLoc n of
1020
1019
RealSrcLoc {} -> False
@@ -1035,7 +1034,7 @@ lookupName hsc_env mod name = do
1035
1034
tcthing <- tcLookup name
1036
1035
case tcthing of
1037
1036
AGlobal thing -> return thing
1038
- ATcId {tct_id= id } -> return ( AnId id )
1037
+ ATcId {tct_id= id } -> return $ AnId id
1039
1038
_ -> panic " tcRnLookupName'"
1040
1039
return res
1041
1040
0 commit comments