hoogle 4.2.36 → 4.2.37
raw patch · 19 files changed
+66/−33 lines, 19 filesdep ~shakePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: shake
API changes (from Hackage documentation)
Files
- CHANGES.txt +2/−0
- README.md +1/−1
- hoogle.cabal +3/−3
- src/Console/Rank.hs +3/−2
- src/General/Base.hs +10/−0
- src/General/System.hs +1/−1
- src/General/Util.hs +0/−1
- src/General/Web.hs +1/−1
- src/Hoogle/DataBase/All.hs +2/−1
- src/Hoogle/DataBase/Items.hs +0/−1
- src/Hoogle/Query/Parser.hs +3/−0
- src/Hoogle/Score/Type.hs +1/−2
- src/Hoogle/Store/WriteBuffer.hs +0/−1
- src/Recipe/All.hs +10/−10
- src/Recipe/Cabal.hs +20/−3
- src/Test.hs +1/−1
- src/Test/Parse_Query.hs +1/−0
- src/Web/Response.hs +4/−1
- src/Web/Server.hs +3/−4
CHANGES.txt view
@@ -1,5 +1,7 @@ Changelog for Hoogle +4.2.37+ #94, GHC 7.10 support 4.2.36 #85, add support for missing type constructors 4.2.35
README.md view
@@ -1,4 +1,4 @@-# Hoogle [](http://hackage.haskell.org/package/hoogle) [](https://travis-ci.org/ndmitchell/hoogle)+# Hoogle [](https://hackage.haskell.org/package/hoogle) [](https://travis-ci.org/ndmitchell/hoogle) Hoogle is a Haskell API search engine, which allows you to search many standard Haskell libraries by either function name, or by approximate type signature. To experiment, visit the online version at http://haskell.org/hoogle.
hoogle.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.10 build-type: Simple name: hoogle-version: 4.2.36+version: 4.2.37 license: BSD3 license-file: docs/LICENSE category: Development@@ -15,7 +15,7 @@ or by approximate type signature. homepage: http://www.haskell.org/hoogle/ bug-reports: https://github.com/ndmitchell/hoogle/issues-tested-with: GHC==7.8.2, GHC==7.6.3+tested-with: GHC==7.10.1, GHC==7.8.3, GHC==7.6.3, GHC==7.4.2 extra-source-files: README.md CHANGES.txt@@ -151,7 +151,7 @@ wai >= 1.1, warp >= 1.1, Cabal >= 1.8,- shake >= 0.11,+ shake >= 0.14, QuickCheck, haskell-src-exts >= 1.16 && < 1.17
src/Console/Rank.hs view
@@ -1,4 +1,4 @@-+{-# LANGUAGE ScopedTypeVariables #-} module Console.Rank(rank) where import General.Base@@ -16,7 +16,8 @@ scores (pre,xs) = concatMap trans [ [ fst $ head $ search db q ++ [error $ "Did not find in " ++ query ++ ", " ++ y]- | y <- ys , let (err,db) = (error "this feature has been disabled" createDatabase) Haskell [] $ unlines $ pre ++ ["a::" ++ y]+ | y <- ys+ , let (err::String,db) = (error "this feature has been disabled" createDatabase) Haskell [] $ unlines $ pre ++ ["a::" ++ y] , null err || error "Errors while converting rank database" ] | (query,ys) <- xs, let q = right ("Could not parse query: " ++ query) $ parseQuery Haskell query]
src/General/Base.hs view
@@ -4,7 +4,12 @@ -- have been in base, or could plausibly be added. module General.Base(module General.Base, module X) where +import Prelude as X+#if __GLASGOW_HASKELL__ < 710 import Control.Applicative as X ((<*>),(<$>))+#else+import Control.Applicative as X ((<$>))+#endif import Control.Arrow as X import Control.DeepSeq as X import Control.Monad as X@@ -25,6 +30,11 @@ import qualified Data.ByteString.Lazy.Char8 as LBS import System.IO++#if __GLASGOW_HASKELL__ < 710+sortOn f = sortBy (comparing f)+#endif+ type LBString = LBS.ByteString
src/General/System.hs view
@@ -3,7 +3,7 @@ -- | Module for system like things in base/directory/etc, or could plausibly be added. module General.System(module General.System, module X) where -import System.Cmd as X+import System.Process as X import System.Directory as X import System.Environment as X import System.Exit as X
src/General/Util.hs view
@@ -18,7 +18,6 @@ (++?) :: String -> String -> String a ++? b = if null a || null b then [] else a ++ b -sortOn f = sortBy (comparing f) groupOn f = groupBy ((==) `on` f) nubOn f = nubBy ((==) `on` f)
src/General/Web.hs view
@@ -15,7 +15,7 @@ ) where #ifndef MIN_VERSION_wai-#define MIN_VERSION_wai(a,b,c) 0+#define MIN_VERSION_wai(a,b,c) 1 #endif import General.System
src/Hoogle/DataBase/All.hs view
@@ -4,8 +4,9 @@ ,module Hoogle.DataBase.Serialise ) where +import Prelude()+import General.Base import Hoogle.Store.All-import Data.Monoid import Hoogle.DataBase.Type import Hoogle.Type.All import Hoogle.Score.All
src/Hoogle/DataBase/Items.hs view
@@ -3,7 +3,6 @@ module Hoogle.DataBase.Items(Items, createItems, entriesItems) where import General.Base-import General.Util import General.Web import Hoogle.Type.All import qualified Data.Map as Map
src/Hoogle/Query/Parser.hs view
@@ -1,7 +1,10 @@+{-# LANGUAGE CPP #-} module Hoogle.Query.Parser(parseQuery) where +#if __GLASGOW_HASKELL__ < 710 import Control.Applicative ((*>))+#endif import General.Base import Hoogle.Query.Type import Hoogle.Type.All as Hoogle
src/Hoogle/Score/Type.hs view
@@ -5,8 +5,7 @@ scoreCosts, cost ) where -import Data.List-import Data.Monoid+import General.Base data TypeCost
src/Hoogle/Store/WriteBuffer.hs view
@@ -13,7 +13,6 @@ import Foreign import qualified Data.ByteString as BS import qualified Data.ByteString.Internal as BS-import General.Util bufferSize = 10000 :: Word32
src/Recipe/All.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE RecordWildCards, ScopedTypeVariables, DeriveDataTypeable, GeneralizedNewtypeDeriving #-}+{-# LANGUAGE RecordWildCards, ScopedTypeVariables, DeriveDataTypeable, GeneralizedNewtypeDeriving, CPP #-} module Recipe.All(recipes) where @@ -59,7 +59,7 @@ wget opts url out putNormal $ "Downloaded " ++ out - "downloads/*.cache" *> \out -> do+ "downloads/*.cache" %> \out -> do let src = dropExtension out need [src] src <- liftIO $ readFileUtf8' src@@ -68,12 +68,12 @@ old <- readFileUtf8' out when (src /= old) $ writeFileUtf8 out src - "//*.tar" *> \out -> do+ "//*.tar" %> \out -> do let src = out <.> "gz" need [src] ungzip src out - "//*.index" *> \out -> do+ "//*.index" %> \out -> do let src = out -<.> "tar" need [src] putNormal $ "Extracting tar file " ++ out@@ -96,20 +96,20 @@ need $ map (<.> "hoo") $ ["all" | "all" `elem` bad] ++ good alternatives $ do -- Match *.txt- "keyword.txt" *> \out -> do+ "keyword.txt" %> \out -> do let src = "downloads/keyword.htm.cache" need [src] contents <- liftIO $ readFileUtf8' src liftIO $ writeFileUtf8 out $ translateKeywords contents - "default.txt" *> \out -> do+ "default.txt" %> \out -> do writeFileLines out ["@combine keyword","@combine package","@combine platform"] - "platform.txt" *> \out -> do+ "platform.txt" %> \out -> do contents <- readFile' "downloads/platform.cabal.cache" writeFileLines out ["@combine " ++ x | x <- platformPackages contents] - "package.txt" *> \out -> do+ "package.txt" %> \out -> do cabs <- index "downloads/cabal.index" xs <- liftIO $ forM (Map.toList cabs) $ \(name,ver) -> do src <- try $ readCabal $ srcCabal name ver@@ -120,7 +120,7 @@ ["--","-- Version " ++ ver, "@url package/" ++ name, "@entry package " ++ name] liftIO $ writeFileUtf8 out $ unlines $ ("@url " ++ hackage) : "@package package" : concat xs - "*.txt" *> \out -> do+ "*.txt" %> \out -> do let name = takeBaseName out base = name == "base" cab <- fmap (fmap $ srcCabal name) $ verCabal (CabalVersion name)@@ -159,7 +159,7 @@ i <- imported $ t <.> "txt" fmap (i++) $ genImported (Set.insert t seen) (fst (splitDeps i) ++ odo) - "*.hoo" *> \out -> do+ "*.hoo" %> \out -> do let src = out -<.> "txt" need [src] contents <- liftIO $ fmap lines $ readFileUtf8' src
src/Recipe/Cabal.hs view
@@ -1,4 +1,4 @@-+{-# LANGUAGE CPP #-} module Recipe.Cabal( Cabal(..), readCabal ) where@@ -13,9 +13,12 @@ import Distribution.Verbosity import Distribution.Version import Recipe.Haddock+#if __GLASGOW_HASKELL__ >= 710+import Language.Haskell.Extension (Language(..))+#endif -ghcVersion = [7,6,3]+ghcVersion = [7,8,3] data Cabal = Cabal {cabalName :: String@@ -29,7 +32,21 @@ readCabal file = do pkg <- readPackageDescription silent file let plat = Platform I386 Linux- comp = CompilerId GHC (Version ghcVersion [])+ compid = CompilerId GHC (Version ghcVersion [])+#if __GLASGOW_HASKELL__ < 710+ comp = compid+#else+ comp = CompilerInfo+ { compilerInfoId = compid+ , compilerInfoAbiTag = NoAbiTag+ , compilerInfoCompat = Nothing+ , compilerInfoLanguages = Just [Haskell98, Haskell2010]+ -- It's too much of a pain to get all the extensions,+ -- things work anyway. See 'getExtensions' in+ -- 'Distribution.Simple.GHC.Internal'.+ , compilerInfoExtensions = Nothing+ }+#endif pkg <- return $ case finalizePackageDescription [] (const True) plat comp [] pkg of Left _ -> flattenPackageDescription pkg Right (pkg,_) -> pkg
src/Test.hs view
@@ -1,7 +1,7 @@ module Main(main) where import Control.Monad-import System.Cmd+import System.Process import System.Directory import System.Exit import System.FilePath
src/Test/Parse_Query.hs view
@@ -1,6 +1,7 @@ module Test.Parse_Query(parse_Query) where +import Prelude() import General.Base import Test.General import Hoogle.Query.All
src/Web/Response.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE CPP #-} module Web.Response(response, ResponseArgs(..), responseArgs) where @@ -9,12 +10,14 @@ import General.Web import Web.Page import Data.Generics.Uniplate+#if __GLASGOW_HASKELL__ < 710+import System.Locale+#endif import qualified Data.Aeson as J import qualified Data.ByteString.Lazy.Char8 as LBS import Data.Time.Clock import Data.Time.Format-import System.Locale import Network.Wai import Network.HTTP.Types(hContentType) import System.IO.Unsafe(unsafeInterleaveIO)
src/Web/Server.hs view
@@ -4,7 +4,7 @@ module Web.Server(server) where #ifndef MIN_VERSION_wai-#define MIN_VERSION_wai(a,b,c) 0+#define MIN_VERSION_wai(a,b,c) 1 #endif import General.Base@@ -131,9 +131,8 @@ serveFile cache file rewriteLinks = do b <- doesFileExist file if not b- then return $ responseNotFound file- else (if rewriteLinks then rewriteHaddockFileLinks else return) $ ResponseFile ok200 hdr file Nothing- + then return $ responseNotFound file+ else (if rewriteLinks then rewriteHaddockFileLinks else return) $ ResponseFile ok200 hdr file Nothing where hdr = (hContentType, fromString $ contentExt $ takeExtension file) : [(hCacheControl, fromString "max-age=604800" {- 1 week -}) | cache]