hoogle 5.0.15 → 5.0.16
raw patch · 8 files changed
+33/−17 lines, 8 filesdep +semigroupsdep ~haskell-src-extsPVP ok
version bump matches the API change (PVP)
Dependencies added: semigroups
Dependency ranges changed: haskell-src-exts
API changes (from Hackage documentation)
Files
- CHANGES.txt +2/−0
- LICENSE +1/−1
- hoogle.cabal +5/−3
- html/index.html +1/−1
- src/General/Log.hs +7/−4
- src/General/Util.hs +5/−3
- src/Input/Cabal.hs +7/−4
- src/Input/Item.hs +5/−1
CHANGES.txt view
@@ -1,5 +1,7 @@ Changelog for Hoogle +5.0.16, released 2018-01-03+ #232, allow haskell-src-exts-1.18-1.20 5.0.15, released 2017-12-12 Allow haskell-src-exts-1.20 5.0.14, released 2017-11-28
LICENSE view
@@ -1,4 +1,4 @@-Copyright Neil Mitchell 2004-2017.+Copyright Neil Mitchell 2004-2018. All rights reserved. Redistribution and use in source and binary forms, with or without
hoogle.cabal view
@@ -1,13 +1,13 @@ cabal-version: >= 1.18 build-type: Simple name: hoogle-version: 5.0.15+version: 5.0.16 license: BSD3 license-file: LICENSE category: Development author: Neil Mitchell <ndmitchell@gmail.com> maintainer: Neil Mitchell <ndmitchell@gmail.com>-copyright: Neil Mitchell 2004-2017+copyright: Neil Mitchell 2004-2018 synopsis: Haskell API Search description: Hoogle is a Haskell API search engine, which allows you to@@ -67,7 +67,7 @@ extra >= 1.4, filepath, old-locale,- haskell-src-exts >= 1.20 && < 1.21,+ haskell-src-exts >= 1.18 && < 1.21, http-conduit, http-types, js-flot,@@ -97,6 +97,8 @@ cc-options: -std=c99 ghc-options: -fno-state-hack+ if impl(ghc < 8.0)+ build-depends: semigroups >= 0.18 exposed-modules: Hoogle
html/index.html view
@@ -34,6 +34,6 @@ #{body} <div class="push"></div> </div>- <div id="footer">© <a href="http://ndmitchell.com">Neil Mitchell</a> 2004-2017, version #{version}</div>+ <div id="footer">© <a href="http://ndmitchell.com">Neil Mitchell</a> 2004-2018, version #{version}</div> </body> </html>
src/General/Log.hs view
@@ -16,7 +16,7 @@ import qualified Data.Set as Set import qualified Data.Map.Strict as Map import qualified Data.ByteString.Lazy.Char8 as LBS-import Data.Monoid+import Data.Semigroup import General.Util import Data.Maybe import Data.List@@ -91,14 +91,17 @@ ,iErrors :: !Int -- number of errors } -instance Monoid SummaryI where- mempty = SummaryI Set.empty 0 0 (toAverage 0) 0- mappend (SummaryI x1 x2 x3 x4 x5) (SummaryI y1 y2 y3 y4 y5) =+instance Semigroup SummaryI where+ SummaryI x1 x2 x3 x4 x5 <> SummaryI y1 y2 y3 y4 y5 = SummaryI (f x1 y1) (x2+y2) (max x3 y3) (x4 <> y4) (x5+y5) -- more efficient union for the very common case of a single element where f x y | Set.size x == 1 = Set.insert (head $ Set.toList x) y | Set.size y == 1 = Set.insert (head $ Set.toList y) x | otherwise = Set.union x y++instance Monoid SummaryI where+ mempty = SummaryI Set.empty 0 0 (toAverage 0) 0+ mappend = (<>) summarize :: Day -> SummaryI -> Summary summarize date SummaryI{..} = Summary date (Set.size iUsers) iUses iSlowest (fromAverage iAverage) iErrors
src/General/Util.hs view
@@ -29,7 +29,7 @@ import Data.List.Extra import Data.Char import Data.Either.Extra-import Data.Monoid+import Data.Semigroup import Data.Tuple.Extra import Control.Monad.Extra import qualified Data.ByteString.Lazy as LBS@@ -243,9 +243,12 @@ fromAverage :: Fractional a => Average a -> a fromAverage (Average a b) = a / fromIntegral b +instance Num a => Semigroup (Average a) where+ Average x1 x2 <> Average y1 y2 = Average (x1+y1) (x2+y2)+ instance Num a => Monoid (Average a) where mempty = Average 0 0- mappend (Average x1 x2) (Average y1 y2) = Average (x1+y1) (x2+y2)+ mappend = (<>) readMaybe :: Read a => String -> Maybe a@@ -346,4 +349,3 @@ let a === b = if a == b then putChar '.' else error $ show (a,b) parseTrailingVersion "shake-0.15.2" === ("shake",[0,15,2]) parseTrailingVersion "test-of-stuff1" === ("test-of-stuff1",[])-
src/Input/Cabal.hs view
@@ -27,7 +27,7 @@ import qualified Data.Map.Strict as Map import General.Util import General.Conduit-import Data.Monoid+import Data.Semigroup import Control.Applicative import Prelude @@ -44,11 +44,14 @@ ,packageDocs :: Maybe FilePath -- ^ Directory where the documentation is located } deriving Show -instance Monoid Package where- mempty = Package [] True T.empty T.empty [] Nothing- mappend (Package x1 x2 x3 x4 x5 x6) (Package y1 y2 y3 y4 y5 y6) =+instance Semigroup Package where+ Package x1 x2 x3 x4 x5 x6 <> Package y1 y2 y3 y4 y5 y6 = Package (x1++y1) (x2||y2) (one x3 y3) (one x4 y4) (nubOrd $ x5 ++ y5) (x6 `mplus` y6) where one a b = if T.null a then b else a++instance Monoid Package where+ mempty = Package [] True T.empty T.empty [] Nothing+ mappend = (<>) instance NFData Package where rnf (Package a b c d e f) = rnf (a,b,c,d,e,f)
src/Input/Item.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE GeneralizedNewtypeDeriving, DeriveDataTypeable, DeriveFunctor, ViewPatterns #-}+{-# LANGUAGE CPP, GeneralizedNewtypeDeriving, DeriveDataTypeable, DeriveFunctor, ViewPatterns #-} {-# LANGUAGE RecordWildCards, OverloadedStrings, PatternGuards, ScopedTypeVariables #-} -- | Types used to generate the input.@@ -178,7 +178,11 @@ TVar a b -> TVar a (b ++ [ty y]) ty (TyVar _ x) = TVar (fromName x) [] ty (TyCon _ x) = TCon (fromQName x) []+#if !defined(MIN_VERSION_haskell_src_exts) || MIN_VERSION_haskell_src_exts(1,20,0) ty (TyInfix an a (UnpromotedName _ b) c) = ty $ let ap = TyApp an in TyCon an b `ap` a `ap` c+#else+ ty (TyInfix an a b c) = ty $ let ap = TyApp an in TyCon an b `ap` a `ap` c+#endif ty (TyKind _ x _) = ty x ty (TyBang _ _ _ x) = ty x ty (TyParen _ x) = ty x