hoogle 5.0.10 → 5.0.11
raw patch · 4 files changed
+16/−5 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Hoogle: defaultDatabaseLocation :: IO FilePath
Files
- CHANGES.txt +2/−0
- hoogle.cabal +1/−1
- src/Action/CmdLine.hs +8/−3
- src/Hoogle.hs +5/−1
CHANGES.txt view
@@ -1,5 +1,7 @@ Changelog for Hoogle +5.0.11+ #209, add a defaultDatabaseLocation function 5.0.10 #205, change how the link URL is computed #206, put newer versions of a package first
hoogle.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.18 build-type: Simple name: hoogle-version: 5.0.10+version: 5.0.11 license: BSD3 license-file: LICENSE category: Development
src/Action/CmdLine.hs view
@@ -2,7 +2,8 @@ {-# OPTIONS_GHC -fno-warn-missing-fields -fno-cse #-} module Action.CmdLine(- CmdLine(..), Language(..), getCmdLine,+ CmdLine(..), Language(..),+ getCmdLine, defaultDatabaseLang, defaultGenerate, whenLoud, whenNormal ) where@@ -69,14 +70,18 @@ } deriving (Data,Typeable,Show) +defaultDatabaseLang :: Language -> IO FilePath+defaultDatabaseLang lang = do+ dir <- getAppUserDataDirectory "hoogle"+ return $ dir </> "default-" ++ lower (show lang) ++ "-" ++ showVersion version ++ ".hoo"+ getCmdLine :: [String] -> IO CmdLine getCmdLine args = do args <- withArgs args $ cmdArgsRun cmdLineMode -- fill in the default database args <- if database args /= "" then return args else do- dir <- getAppUserDataDirectory "hoogle"- return $ args{database=dir </> "default-" ++ lower (show $ language args) ++ "-" ++ showVersion version ++ ".hoo"}+ db <- defaultDatabaseLang $ language args; return args{database=db} -- fix up people using Hoogle 4 instructions args <- case args of
src/Hoogle.hs view
@@ -1,7 +1,7 @@ -- | High level Hoogle API module Hoogle(- Database, withDatabase, searchDatabase,+ Database, withDatabase, searchDatabase, defaultDatabaseLocation, Target(..), URL, hoogle ) where@@ -26,6 +26,10 @@ -- | Load a database from a file. withDatabase :: NFData a => FilePath -> (Database -> IO a) -> IO a withDatabase file act = storeReadFile file $ act . Database++-- | The default location of a database+defaultDatabaseLocation :: IO FilePath+defaultDatabaseLocation = defaultDatabaseLang Haskell -- | Search a database, given a query string, produces a list of results. searchDatabase :: Database -> String -> [Target]