diff options
author | Neil Mitchell <unknown> | 2008-06-16 07:13:48 +0000 |
---|---|---|
committer | Neil Mitchell <unknown> | 2008-06-16 07:13:48 +0000 |
commit | 43004293124cd3082ced37c1af5864b735a5768a (patch) | |
tree | 37c18df3aac8f38ef7ef31304b9854d5f1847281 /src/Haddock | |
parent | f8d50701d2abc8fa5e89cf5d02e97f090dc769ee (diff) |
Change Hoogle to take the package name and package version separately
Diffstat (limited to 'src/Haddock')
-rw-r--r-- | src/Haddock/Backends/Hoogle.hs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/Haddock/Backends/Hoogle.hs b/src/Haddock/Backends/Hoogle.hs index 4c9c7c66..94109d82 100644 --- a/src/Haddock/Backends/Hoogle.hs +++ b/src/Haddock/Backends/Hoogle.hs @@ -25,14 +25,18 @@ import Data.Maybe import System.FilePath -prefix = ["-- Hoogle documentation, generated by Haddock", - "-- See Hoogle, http://www.haskell.org/hoogle/"] - - -ppHoogle :: Maybe String -> [Interface] -> FilePath -> IO () -ppHoogle maybe_package ifaces odir = do - let filename = (fromMaybe "main" maybe_package) <.> "txt" - contents = prefix ++ concat [ppModule i | i <- ifaces, OptHide `notElem` ifaceOptions i] +prefix = ["-- Hoogle documentation, generated by Haddock" + ,"-- See Hoogle, http://www.haskell.org/hoogle/" + ,""] + + +ppHoogle :: String -> String -> [Interface] -> FilePath -> IO () +ppHoogle package version ifaces odir = do + let filename = package <.> "txt" + contents = prefix ++ + ["@package " ++ package] ++ + ["@version " ++ version | version /= ""] ++ + concat [ppModule i | i <- ifaces, OptHide `notElem` ifaceOptions i] writeFile (odir </> filename) (unlines contents) |