hoogle 5.0.4 → 5.0.5
raw patch · 9 files changed
+33/−24 lines, 9 filesdep ~haskell-src-extsPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: haskell-src-exts
API changes (from Hackage documentation)
Files
- CHANGES.txt +4/−0
- hoogle.cabal +5/−5
- html/index.html +1/−1
- src/Action/CmdLine.hs +3/−1
- src/Action/Generate.hs +9/−8
- src/Action/Search.hs +1/−1
- src/Action/Server.hs +8/−6
- src/Action/Test.hs +1/−1
- src/Input/Set.hs +1/−1
CHANGES.txt view
@@ -1,5 +1,9 @@ Changelog for Hoogle +5.0.5+ #193, support multiple --local flags+ #195, add --home flag to server mode+ Allow haskell-src-exts-1.19 5.0.4 #184, use file URLs for local docs #183, make --local look for .txt files recursively
hoogle.cabal view
@@ -1,7 +1,7 @@-cabal-version: >= 1.10+cabal-version: >= 1.18 build-type: Simple name: hoogle-version: 5.0.4+version: 5.0.5 license: BSD3 license-file: LICENSE category: Development@@ -43,7 +43,7 @@ library hs-source-dirs: src- default-language: Haskell98+ default-language: Haskell2010 if flag(network-uri) build-depends: network-uri >= 2.6, network >= 2.6@@ -65,7 +65,7 @@ directory, extra >= 1.4, filepath,- haskell-src-exts >= 1.18 && < 1.19,+ haskell-src-exts >= 1.18 && < 1.20, http-conduit, http-types, js-flot,@@ -131,7 +131,7 @@ executable hoogle main-is: src/Main.hs- default-language: Haskell98+ default-language: Haskell2010 ghc-options: -threaded build-depends:
html/index.html view
@@ -23,7 +23,7 @@ </ul> </div> <form action="." method="get" id="search">- <a id="logo" href="http://hoogle.haskell.org">+ <a id="logo" href="#{home}"> <img src="#{cdn}hoogle.png" width="160" height="58" alt="Hoogle" /></a> <input name="hoogle" id="hoogle" class="HOOGLE_REAL" type="text" autocomplete="off" accesskey="1" placeholder="Search for..." value="#{search}" />
src/Action/CmdLine.hs view
@@ -35,7 +35,7 @@ ,database :: FilePath ,insecure :: Bool ,include :: [String]- ,local_ :: Maybe FilePath+ ,local_ :: [FilePath] ,debug :: Bool ,language :: Language }@@ -47,6 +47,7 @@ ,local :: Bool ,language :: Language ,scope :: String+ ,home :: String ,host :: String ,https :: Bool ,cert :: FilePath@@ -120,6 +121,7 @@ ,logs = "" &= opt "log.txt" &= typFile &= help "File to log requests to (defaults to stdout)" ,local = False &= help "Allow following file:// links, restricts to 127.0.0.1 Set --host explicitely (including to '*' for any host) to override the localhost-only behaviour" ,scope = def &= help "Default scope to start with"+ ,home = "http://hoogle.haskell.org" &= typ "URL" &= help "Set the URL linked to by the Hoogle logo." ,host = "" &= help "Set the host to bind on (e.g., an ip address; '!4' for ipv4-only; '!6' for ipv6-only; default: '*' for any host)." ,https = def &= help "Start an https server (use --cert and --key to specify paths to the .pem files)" ,cert = "cert.pem" &= typFile &= help "Path to the certificate pem file (when running an https server)"
src/Action/Generate.hs view
@@ -126,9 +126,9 @@ return (cbl, want, source) -readHaskellDir :: Timing -> FilePath -> IO (Map.Map String Package, Set.Set String, Source IO (String, URL, LStr))-readHaskellDir timing dir = do- packages <- map (takeBaseName &&& id) . filter ((==) ".txt" . takeExtension) <$> listFilesRecursive dir+readHaskellDirs :: Timing -> [FilePath] -> IO (Map.Map String Package, Set.Set String, Source IO (String, URL, LStr))+readHaskellDirs timing dirs = do+ packages <- map (takeBaseName &&& id) . filter ((==) ".txt" . takeExtension) <$> concatMapM listFilesRecursive dirs let source = forM_ packages $ \(name, file) -> do src <- liftIO $ strReadFile file dir <- liftIO $ canonicalizePath $ takeDirectory file@@ -173,10 +173,10 @@ download <- return $ downloadInput timing insecure download (takeDirectory database) settings <- loadSettings (cbl, want, source) <- case language of- Haskell | Just "" <- local_ -> readHaskellGhcpkg timing settings- | Just dir <- local_ -> readHaskellDir timing dir- | otherwise -> readHaskellOnline timing settings download- Frege | isJust local_ -> errorIO "No support for local Frege databases"+ Haskell | [""] <- local_ -> readHaskellGhcpkg timing settings+ | [] <- local_ -> readHaskellOnline timing settings download+ | otherwise -> readHaskellDirs timing local_+ Frege | null local_ -> errorIO "No support for local Frege databases" | otherwise -> readFregeOnline timing download let (cblErrs, popularity) = packagePopularity cbl want <- return $ if include /= [] then Set.fromList include else want@@ -205,11 +205,12 @@ ((fmap Set.fromList $ mapC fst3 =$= sinkList) |$| (((zipFromC 1 =$= consume) >> when (null include) (sourceList packages)) =$= pipelineC 10 (items =$= sinkList)))+ putStrLn "" let missing = [x | x <- Set.toList $ want `Set.difference` seen , fmap packageLibrary (Map.lookup x cbl) /= Just False] whenNormal $ when (missing /= []) $ do- putStrLn $ ("Packages not found: " ++) $ unwords $ sortOn lower missing+ putStrLn $ "Packages missing documentation: " ++ unwords (sortOn lower missing) when (Set.null seen) $ exitFail "No packages were found, aborting (use no arguments to index all of Stackage)"
src/Action/Search.hs view
@@ -127,7 +127,7 @@ "author:Neil-Mitchell" === hackage "filepath" -- FIXME: "author:Neil-M" === hackage "filepath" -- FIXME: "Data.Se.insert" === hackage "containers/docs/Data-Set.html#v:insert"- "set:-haskell-platform author:Neil-Mitchell" === hackage "cmdargs"+ "set:-haskell-platform author:Neil-Mitchell" === hackage "safe" "author:Neil-Mitchell category:Development" === hackage "derive" "( )" ==$ flip seq True -- used to segfault "( -is:exact) package:base=" ==$ flip seq True
src/Action/Server.hs view
@@ -54,7 +54,7 @@ evaluate spawned dataDir <- getDataDir withSearch database $ \store ->- server log cmd $ replyServer log local store cdn (dataDir </> "html") scope+ server log cmd $ replyServer log local store cdn home (dataDir </> "html") scope actionReplay :: CmdLine -> IO () actionReplay Replay{..} = withBuffering stdout NoBuffering $ do@@ -63,7 +63,7 @@ (t,_) <- duration $ withSearch database $ \store -> do log <- logNone dataDir <- getDataDir- let op = replyServer log False store "" (dataDir </> "html") scope+ let op = replyServer log False store "" "" (dataDir </> "html") scope replicateM_ repeat_ $ forM_ qs $ \x -> do res <- op x evaluate $ rnf res@@ -74,8 +74,8 @@ spawned :: UTCTime spawned = unsafePerformIO getCurrentTime -replyServer :: Log -> Bool -> StoreRead -> String -> FilePath -> String -> Input -> IO Output-replyServer log local store cdn htmlDir scope = \Input{..} -> case inputURL of+replyServer :: Log -> Bool -> StoreRead -> String -> String -> FilePath -> String -> Input -> IO Output+replyServer log local store cdn home htmlDir scope = \Input{..} -> case inputURL of -- without -fno-state-hack things can get folded under this lambda [] -> do let grab name = [x | (a,x) <- inputArgs, a == name, x /= ""]@@ -125,7 +125,9 @@ str = templateStr . lstrPack tagOptions sel = concat [tag "option" ["selected=selected" | x `elem` sel] x | x <- completionTags store] params = map (second str)- [("cdn",cdn),("jquery",if null cdn then "plugin/jquery.js" else JQuery.url)+ [("cdn",cdn)+ ,("home",home)+ ,("jquery",if null cdn then "plugin/jquery.js" else JQuery.url) ,("version",showVersion version ++ " " ++ showUTCTime "%Y-%m-%d %H:%M" spawned)] templateIndex = templateFile (htmlDir </> "index.html") `templateApply` params templateEmpty = templateFile (htmlDir </> "welcome.html")@@ -231,7 +233,7 @@ log <- logNone dataDir <- getDataDir let q === want = do- OutputString (lstrUnpack -> res) <- replyServer log False store "" (dataDir </> "html") "" (Input [] [("hoogle",q)])+ OutputString (lstrUnpack -> res) <- replyServer log False store "" "" (dataDir </> "html") "" (Input [] [("hoogle",q)]) if want `isInfixOf` res then putChar '.' else fail $ "Bad substring: " ++ res if sample then "Wife" === "<b>type family</b>"
src/Action/Test.hs view
@@ -28,7 +28,7 @@ putStrLn "" putStrLn "Sample database tests"- actionGenerate defaultGenerate{database=sample, local_=Just "misc/sample-data"}+ actionGenerate defaultGenerate{database=sample, local_=["misc/sample-data"]} action_search_test True sample action_server_test True sample putStrLn ""
src/Input/Set.hs view
@@ -13,7 +13,7 @@ setStackage :: FilePath -> IO (Set.Set String) setStackage file = Set.fromList . filter (`notElem` stackOverflow) . f . lines <$> readFile' file where- stackOverflow = ["telegram-api","pinchot"] -- see https://github.com/ndmitchell/hoogle/issues/167+ stackOverflow = [] -- ["telegram-api","pinchot","gogol-dfareporting"] -- see https://github.com/ndmitchell/hoogle/issues/167 f (x:xs) | Just x <- stripPrefix "constraints:" x = map (fst . word1) $ takeWhile (" " `isPrefixOf`) $ (' ':x) : xs