@@ -208,9 +208,7 @@ tcRnModule hsc_env keep_lbls pmod = do
208
208
HsParsedModule { hpm_module = parsedSource pmod,
209
209
hpm_src_files = pm_extra_src_files pmod,
210
210
hpm_annotations = pm_annotations pmod }
211
- let rn_info = case mrn_info of
212
- Just x -> x
213
- Nothing -> error " no renamed info tcRnModule"
211
+ let rn_info = fromMaybe (error " no renamed info tcRnModule" ) mrn_info
214
212
pure (TcModuleResult pmod rn_info tc_gbl_env splices False )
215
213
216
214
mkHiFileResultNoCompile :: HscEnv -> TcModuleResult -> IO HiFileResult
@@ -966,6 +964,7 @@ getDocsBatch
966
964
-> Module -- ^ a moudle where the names are in scope
967
965
-> [Name ]
968
966
-> IO (Either ErrorMessages (Map. Map Name (Either GetDocsFailure (Maybe HsDocString , Maybe (Map. Map Int HsDocString )))))
967
+ -- ^ Return a 'Map' of 'Name's to 'Either' (no docs messages) (general doc body & arg docs)
969
968
getDocsBatch hsc_env _mod _names = do
970
969
((_warns,errs), res) <- initTc hsc_env HsSrcFile False _mod fakeSpan $ Map. fromList <$> traverse findNameInfo _names
971
970
pure $ maybeToEither errs res
@@ -983,9 +982,9 @@ getDocsBatch hsc_env _mod _names = do
983
982
<- loadModuleInterface " getModuleInterface" mod
984
983
pure . (name,) $
985
984
if isNothing mb_doc_hdr && Map. null dmap && Map. null amap
986
- then Left $ NoDocsInIface mod $ compiled name
985
+ then Left $ NoDocsInIface mod $ isCompiled name
987
986
else Right (Map. lookup name dmap, Map. lookup name amap)
988
- compiled n =
987
+ isCompiled n =
989
988
-- TODO: Find a more direct indicator.
990
989
case nameSrcLoc n of
991
990
RealSrcLoc {} -> False
@@ -1006,7 +1005,7 @@ lookupName hsc_env mod name = do
1006
1005
tcthing <- tcLookup name
1007
1006
case tcthing of
1008
1007
AGlobal thing -> return thing
1009
- ATcId {tct_id= id } -> return ( AnId id )
1008
+ ATcId {tct_id= id } -> return $ AnId id
1010
1009
_ -> panic " tcRnLookupName'"
1011
1010
return res
1012
1011
0 commit comments