Created
April 4, 2020 18:53
-
-
Save louwers/47af7abe6f9fbab69fa80c8475420ee3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lookupHtmlForModule :: (FilePath -> FilePath -> FilePath) -> DynFlags -> Module -> IO (Maybe FilePath) | |
lookupHtmlForModule mkDocPath df m = do | |
let mfs = go <$> (listToMaybe =<< lookupHtmls df ui) | |
htmls <- filterM doesFileExist (concat . maybeToList $ mfs) | |
return $ listToMaybe htmls | |
where | |
go pkgDocDir = map (mkDocPath pkgDocDir) [mn, mns] | |
ui = moduleUnitId m | |
mn = map (\x -> if x == '.' then '-' else x) mns | |
mns = moduleNameString $ moduleName m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment