@@ -221,9 +221,7 @@ tcRnModule hsc_env keep_lbls pmod = do
221
221
HsParsedModule { hpm_module = parsedSource pmod,
222
222
hpm_src_files = pm_extra_src_files pmod,
223
223
hpm_annotations = pm_annotations pmod }
224
- let rn_info = case mrn_info of
225
- Just x -> x
226
- Nothing -> error " no renamed info tcRnModule"
224
+ let rn_info = fromMaybe (error " no renamed info tcRnModule" ) mrn_info
227
225
pure (TcModuleResult pmod rn_info tc_gbl_env splices False )
228
226
229
227
mkHiFileResultNoCompile :: HscEnv -> TcModuleResult -> IO HiFileResult
@@ -1026,6 +1024,7 @@ getDocsBatch
1026
1024
-> Module -- ^ a moudle where the names are in scope
1027
1025
-> [Name ]
1028
1026
-> IO (Either ErrorMessages (Map. Map Name (Either GetDocsFailure (Maybe HsDocString , Maybe (Map. Map Int HsDocString )))))
1027
+ -- ^ Return a 'Map' of 'Name's to 'Either' (no docs messages) (general doc body & arg docs)
1029
1028
getDocsBatch hsc_env _mod _names = do
1030
1029
((_warns,errs), res) <- initTc hsc_env HsSrcFile False _mod fakeSpan $ Map. fromList <$> traverse findNameInfo _names
1031
1030
pure $ maybeToEither errs res
@@ -1043,9 +1042,9 @@ getDocsBatch hsc_env _mod _names = do
1043
1042
<- loadModuleInterface " getModuleInterface" mod
1044
1043
pure . (name,) $
1045
1044
if isNothing mb_doc_hdr && Map. null dmap && Map. null amap
1046
- then Left $ NoDocsInIface mod $ compiled name
1045
+ then Left $ NoDocsInIface mod $ isCompiled name
1047
1046
else Right (Map. lookup name dmap, Map. lookup name amap)
1048
- compiled n =
1047
+ isCompiled n =
1049
1048
-- TODO: Find a more direct indicator.
1050
1049
case nameSrcLoc n of
1051
1050
RealSrcLoc {} -> False
@@ -1066,7 +1065,7 @@ lookupName hsc_env mod name = do
1066
1065
tcthing <- tcLookup name
1067
1066
case tcthing of
1068
1067
AGlobal thing -> return thing
1069
- ATcId {tct_id= id } -> return ( AnId id )
1068
+ ATcId {tct_id= id } -> return $ AnId id
1070
1069
_ -> panic " tcRnLookupName'"
1071
1070
return res
1072
1071
0 commit comments