summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-haskell/bloomfilter')
-rw-r--r--dev-haskell/bloomfilter/Manifest2
-rw-r--r--dev-haskell/bloomfilter/bloomfilter-1.2.6.10-r2.ebuild38
-rw-r--r--dev-haskell/bloomfilter/bloomfilter-2.0.1.0-r1.ebuild39
-rw-r--r--dev-haskell/bloomfilter/bloomfilter-2.0.1.0.ebuild10
-rw-r--r--dev-haskell/bloomfilter/files/bloomfilter-1.2.6.10-ghc-7.7.patch46
-rw-r--r--dev-haskell/bloomfilter/files/bloomfilter-1.2.6.10-quickcheck-2.6.patch12
-rw-r--r--dev-haskell/bloomfilter/files/bloomfilter-2.0.1.0-ghc-9_2-fix.patch289
-rw-r--r--dev-haskell/bloomfilter/metadata.xml6
8 files changed, 336 insertions, 106 deletions
diff --git a/dev-haskell/bloomfilter/Manifest b/dev-haskell/bloomfilter/Manifest
index 3ab2760834df..4b77ae077d88 100644
--- a/dev-haskell/bloomfilter/Manifest
+++ b/dev-haskell/bloomfilter/Manifest
@@ -1,2 +1,2 @@
-DIST bloomfilter-1.2.6.10.tar.gz 21533 BLAKE2B fda4bf7f45a1e6a13a6e1e6bdaf76c0a6cd75b7922dedfc9ee62ce5523868ab4b7e9350723a688e0e8489a035586638daef1daf5c7a0eb4d3a7bc937d7bf9c15 SHA512 c3bad38edf59bd59439c24385e300fab90f4ccd1b1faf7bea6c4b25b2bcabdfc806a7274d1cad40a711312b016d6fbb99a0ca9cf8b358ad874bbbabc14e1f454
+DIST bloomfilter-2.0.1.0-rev2.cabal 1806 BLAKE2B 4652a7515577ea06bab01e561d8ccc8127b15b84c0cfeb47ca0fbc1af04e0327022135242752f4a2a6e829dc7b8aa2b1eb3a34a60aeb7430306664d9f1578fbe SHA512 59baafec819dac814a3c6336569fa9f13507976e1899d346ce6ea42a667e3e13fdb12e1b23443d46ef949c6b46ef665f691ad13d1952b41c5fd565f3598a1be6
DIST bloomfilter-2.0.1.0.tar.gz 22100 BLAKE2B c00a904a32c2e16810b19e27d7adef365ecf48b62bcd8da871aa3b33cb9b6e18cb11771da5a7df7209ce048e2fa1176b9c3f015030d0349a10a32375f462df02 SHA512 1031cc28c5e5c1b7687355b709d436ebab1956ffd7591a010fa3852a1bc7412925a365f99937feeacf4b1a5d3c7b34bc0370707ad6e4533280dcac4ea3fa7c21
diff --git a/dev-haskell/bloomfilter/bloomfilter-1.2.6.10-r2.ebuild b/dev-haskell/bloomfilter/bloomfilter-1.2.6.10-r2.ebuild
deleted file mode 100644
index 1552b36d77fa..000000000000
--- a/dev-haskell/bloomfilter/bloomfilter-1.2.6.10-r2.ebuild
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-# ebuild generated by hackport 0.2.18.9999
-
-CABAL_FEATURES="lib profile haddock hoogle hscolour test-suite"
-inherit eutils haskell-cabal
-
-DESCRIPTION="Pure and impure Bloom Filter implementations"
-HOMEPAGE="https://github.com/bos/bloomfilter"
-SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64 ~x86 ~amd64-linux"
-IUSE=""
-
-RDEPEND=">=dev-lang/ghc-6.8.2:="
-DEPEND="${RDEPEND}
- test? ( >=dev-haskell/quickcheck-2.4:2
- <dev-haskell/quickcheck-2.8:2
- dev-haskell/random
- dev-haskell/test-framework
- dev-haskell/test-framework-quickcheck2
- )
- >=dev-haskell/cabal-1.8"
-
-src_prepare() {
- cabal_chdeps \
- 'QuickCheck == 2.4.*' 'QuickCheck >= 2.4 && < 2.8'
-
- if has_version ">=dev-haskell/quickcheck-2.5"; then
- epatch "${FILESDIR}/${PN}-1.2.6.10-quickcheck-2.6.patch"
- fi
- epatch "${FILESDIR}/${PN}-1.2.6.10-ghc-7.7.patch"
-}
diff --git a/dev-haskell/bloomfilter/bloomfilter-2.0.1.0-r1.ebuild b/dev-haskell/bloomfilter/bloomfilter-2.0.1.0-r1.ebuild
new file mode 100644
index 000000000000..89eb41c70f59
--- /dev/null
+++ b/dev-haskell/bloomfilter/bloomfilter-2.0.1.0-r1.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# ebuild generated by hackport 0.8.1.0.9999
+
+CABAL_HACKAGE_REVISION=2
+
+CABAL_FEATURES="lib profile haddock hoogle hscolour test-suite"
+inherit haskell-cabal
+
+DESCRIPTION="Pure and impure Bloom Filter implementations"
+HOMEPAGE="https://github.com/bos/bloomfilter"
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86 ~amd64-linux"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.0.1.0-ghc-9_2-fix.patch"
+)
+
+CABAL_CHDEPS=(
+ 'base >= 4.4 && < 4.16' 'base >= 4.4'
+ 'base >= 4.4 && < 4.16' 'base >= 4.4'
+)
+
+RDEPEND=">=dev-lang/ghc-8.8.1:=
+"
+DEPEND="${RDEPEND}
+ >=dev-haskell/cabal-3.0.0.0
+ test? (
+ >=dev-haskell/quickcheck-2.5
+ dev-haskell/random
+ dev-haskell/test-framework
+ dev-haskell/test-framework-quickcheck2
+ )
+"
diff --git a/dev-haskell/bloomfilter/bloomfilter-2.0.1.0.ebuild b/dev-haskell/bloomfilter/bloomfilter-2.0.1.0.ebuild
index 341f5c9445dd..bce47d8d507f 100644
--- a/dev-haskell/bloomfilter/bloomfilter-2.0.1.0.ebuild
+++ b/dev-haskell/bloomfilter/bloomfilter-2.0.1.0.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=5
+EAPI=8
-# ebuild generated by hackport 0.4.5.9999
+# ebuild generated by hackport 0.6.6.9999
CABAL_FEATURES="lib profile haddock hoogle hscolour test-suite"
inherit haskell-cabal
@@ -14,10 +14,10 @@ SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz"
LICENSE="BSD"
SLOT="0/${PV}"
-KEYWORDS="~amd64 ~x86 ~amd64-linux"
+KEYWORDS="amd64 ~arm64 ~ppc64 ~riscv ~x86 ~amd64-linux"
IUSE=""
-RDEPEND=">=dev-lang/ghc-7.4.1:=
+RDEPEND=">=dev-lang/ghc-7.4.1:= <dev-lang/ghc-9.1
"
DEPEND="${RDEPEND}
>=dev-haskell/cabal-1.8
diff --git a/dev-haskell/bloomfilter/files/bloomfilter-1.2.6.10-ghc-7.7.patch b/dev-haskell/bloomfilter/files/bloomfilter-1.2.6.10-ghc-7.7.patch
deleted file mode 100644
index 899fb4176aa2..000000000000
--- a/dev-haskell/bloomfilter/files/bloomfilter-1.2.6.10-ghc-7.7.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-diff --git a/Data/BloomFilter.hs b/Data/BloomFilter.hs
-index 69711ef..97a8348 100644
---- a/Data/BloomFilter.hs
-+++ b/Data/BloomFilter.hs
-@@ -93,7 +93,8 @@ import Control.Monad (liftM, forM_)
- import Control.Monad.ST (ST, runST)
- import Control.DeepSeq (NFData(..))
- import Data.Array.Base (unsafeAt, unsafeRead, unsafeWrite)
--import Data.Array.ST (STUArray, thaw, unsafeFreeze)
-+import Data.Array.ST (STUArray, thaw)
-+import qualified Data.Array.Unsafe as U (unsafeFreeze)
- import Data.Array.Unboxed (UArray)
- import Data.Bits ((.&.), (.|.))
- import Data.BloomFilter.Array (newArray)
-@@ -336,7 +337,7 @@ notElemB elt ub = any test (hashesU ub elt)
- -- occur. For a safer creation interface, use 'createB'.
- unsafeFreezeMB :: MBloom s a -> ST s (Bloom a)
- unsafeFreezeMB mb = B (hashMB mb) (shiftMB mb) (maskMB mb) `liftM`
-- unsafeFreeze (bitArrayMB mb)
-+ U.unsafeFreeze (bitArrayMB mb)
-
- -- | Copy an immutable Bloom filter to create a mutable one. There is
- -- no non-copying equivalent.
-diff --git a/Data/BloomFilter/Array.hs b/Data/BloomFilter/Array.hs
-index e085bbe..5accde9 100644
---- a/Data/BloomFilter/Array.hs
-+++ b/Data/BloomFilter/Array.hs
-@@ -3,7 +3,8 @@
-
- module Data.BloomFilter.Array (newArray) where
-
--import Control.Monad.ST (ST, unsafeIOToST)
-+import Control.Monad.ST (ST)
-+import qualified Control.Monad.ST.Unsafe as U (unsafeIOToST)
- import Data.Array.Base (MArray, STUArray(..), unsafeNewArray_)
- #if __GLASGOW_HASKELL__ >= 704
- import Foreign.C.Types (CInt(..), CSize(..))
-@@ -18,7 +19,7 @@ newArray :: forall e s. (MArray (STUArray s) e (ST s)) =>
- {-# INLINE newArray #-}
- newArray numElems numBytes = do
- ary@(STUArray _ _ _ marr#) <- unsafeNewArray_ (0, numElems - 1)
-- _ <- unsafeIOToST (memset marr# 0 (fromIntegral numBytes))
-+ _ <- U.unsafeIOToST (memset marr# 0 (fromIntegral numBytes))
- return ary
-
- foreign import ccall unsafe "memset"
diff --git a/dev-haskell/bloomfilter/files/bloomfilter-1.2.6.10-quickcheck-2.6.patch b/dev-haskell/bloomfilter/files/bloomfilter-1.2.6.10-quickcheck-2.6.patch
deleted file mode 100644
index 0b27043aed2f..000000000000
--- a/dev-haskell/bloomfilter/files/bloomfilter-1.2.6.10-quickcheck-2.6.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- bloomfilter-1.2.6.10-orig/tests/QCSupport.hs 2012-06-16 09:59:56.000000000 +1000
-+++ bloomfilter-1.2.6.10/tests/QCSupport.hs 2012-07-14 19:00:06.035731133 +1000
-@@ -20,9 +20,6 @@
- arbitrary = choose (epsilon, 1 - epsilon)
- where epsilon = 1e-6 :: P
-
--instance Arbitrary Ordering where
-- arbitrary = oneof [return LT, return GT, return EQ]
--
- -- For some reason, MIN_VERSION_random doesn't work here :-(
- #if __GLASGOW_HASKELL__ < 704
- integralRandomR :: (Integral a, RandomGen g) => (a, a) -> g -> (a, g)
diff --git a/dev-haskell/bloomfilter/files/bloomfilter-2.0.1.0-ghc-9_2-fix.patch b/dev-haskell/bloomfilter/files/bloomfilter-2.0.1.0-ghc-9_2-fix.patch
new file mode 100644
index 000000000000..d08788f687b8
--- /dev/null
+++ b/dev-haskell/bloomfilter/files/bloomfilter-2.0.1.0-ghc-9_2-fix.patch
@@ -0,0 +1,289 @@
+From fb79b39c44404fd791a3bed973e9d844fb084f1e Mon Sep 17 00:00:00 2001
+From: Simon Jakobi <simon.jakobi@gmail.com>
+From: <https://github.com/bos/bloomfilter/pull/20>
+Date: Fri, 12 Nov 2021 01:37:36 +0100
+Subject: [PATCH 1/2] Fix build with GHC 9.2
+
+The `FastShift.shift{L,R}` methods are replaced with `unsafeShift{L,R}`
+introduced in base-4.5.
+
+Fixes #19.
+---
+ Data/BloomFilter.hs | 16 +++++------
+ Data/BloomFilter/Hash.hs | 15 +++++-----
+ Data/BloomFilter/Mutable.hs | 20 +++++++-------
+ Data/BloomFilter/Util.hs | 55 ++++++-------------------------------
+ bloomfilter.cabal | 2 +-
+ 5 files changed, 34 insertions(+), 74 deletions(-)
+
+diff --git a/Data/BloomFilter.hs b/Data/BloomFilter.hs
+index 2210cef..6b47c21 100644
+--- a/Data/BloomFilter.hs
++++ b/Data/BloomFilter.hs
+@@ -78,8 +78,8 @@ import Control.DeepSeq (NFData(..))
+ import Data.Array.Base (unsafeAt)
+ import qualified Data.Array.Base as ST
+ import Data.Array.Unboxed (UArray)
+-import Data.Bits ((.&.))
+-import Data.BloomFilter.Util (FastShift(..), (:*)(..))
++import Data.Bits ((.&.), unsafeShiftL, unsafeShiftR)
++import Data.BloomFilter.Util ((:*)(..))
+ import qualified Data.BloomFilter.Mutable as MB
+ import qualified Data.BloomFilter.Mutable.Internal as MB
+ import Data.BloomFilter.Mutable.Internal (Hash, MBloom)
+@@ -98,7 +98,7 @@ data Bloom a = B {
+ }
+
+ instance Show (Bloom a) where
+- show ub = "Bloom { " ++ show ((1::Int) `shiftL` shift ub) ++ " bits } "
++ show ub = "Bloom { " ++ show ((1::Int) `unsafeShiftL` shift ub) ++ " bits } "
+
+ instance NFData (Bloom a) where
+ rnf !_ = ()
+@@ -172,7 +172,7 @@ singleton hash numBits elt = create hash numBits (\mb -> MB.insert mb elt)
+ -- | Given a filter's mask and a hash value, compute an offset into
+ -- a word array and a bit offset within that word.
+ hashIdx :: Int -> Word32 -> (Int :* Int)
+-hashIdx mask x = (y `shiftR` logBitsInHash) :* (y .&. hashMask)
++hashIdx mask x = (y `unsafeShiftR` logBitsInHash) :* (y .&. hashMask)
+ where hashMask = 31 -- bitsInHash - 1
+ y = fromIntegral x .&. mask
+
+@@ -191,7 +191,7 @@ hashesU ub elt = hashIdx (mask ub) `map` hashes ub elt
+ -- /still/ some possibility that @True@ will be returned.
+ elem :: a -> Bloom a -> Bool
+ elem elt ub = all test (hashesU ub elt)
+- where test (off :* bit) = (bitArray ub `unsafeAt` off) .&. (1 `shiftL` bit) /= 0
++ where test (off :* bit) = (bitArray ub `unsafeAt` off) .&. (1 `unsafeShiftL` bit) /= 0
+
+ modify :: (forall s. (MBloom s a -> ST s z)) -- ^ mutation function (result is discarded)
+ -> Bloom a
+@@ -255,11 +255,11 @@ insertList elts = modify $ \mb -> mapM_ (MB.insert mb) elts
+ -- is /still/ some possibility that @True@ will be returned.
+ notElem :: a -> Bloom a -> Bool
+ notElem elt ub = any test (hashesU ub elt)
+- where test (off :* bit) = (bitArray ub `unsafeAt` off) .&. (1 `shiftL` bit) == 0
++ where test (off :* bit) = (bitArray ub `unsafeAt` off) .&. (1 `unsafeShiftL` bit) == 0
+
+ -- | Return the size of an immutable Bloom filter, in bits.
+ length :: Bloom a -> Int
+-length = shiftL 1 . shift
++length = unsafeShiftL 1 . shift
+
+ -- | Build an immutable Bloom filter from a seed value. The seeding
+ -- function populates the filter as follows.
+@@ -318,7 +318,7 @@ fromList hashes numBits = unfold hashes numBits convert
+ logPower2 :: Int -> Int
+ logPower2 k = go 0 k
+ where go j 1 = j
+- go j n = go (j+1) (n `shiftR` 1)
++ go j n = go (j+1) (n `unsafeShiftR` 1)
+
+ -- $overview
+ --
+diff --git a/Data/BloomFilter/Hash.hs b/Data/BloomFilter/Hash.hs
+index 132a3a4..d071fd4 100644
+--- a/Data/BloomFilter/Hash.hs
++++ b/Data/BloomFilter/Hash.hs
+@@ -38,8 +38,7 @@ module Data.BloomFilter.Hash
+ ) where
+
+ import Control.Monad (foldM)
+-import Data.Bits ((.&.), (.|.), xor)
+-import Data.BloomFilter.Util (FastShift(..))
++import Data.Bits ((.&.), (.|.), unsafeShiftL, unsafeShiftR, xor)
+ import Data.List (unfoldr)
+ import Data.Int (Int8, Int16, Int32, Int64)
+ import Data.Word (Word8, Word16, Word32, Word64)
+@@ -91,11 +90,11 @@ class Hashable a where
+ -> Word64 -- ^ salt
+ -> IO Word64
+ hashIO64 v salt = do
+- let s1 = fromIntegral (salt `shiftR` 32) .&. maxBound
++ let s1 = fromIntegral (salt `unsafeShiftR` 32) .&. maxBound
+ s2 = fromIntegral salt
+ h1 <- hashIO32 v s1
+ h2 <- hashIO32 v s2
+- return $ (fromIntegral h1 `shiftL` 32) .|. fromIntegral h2
++ return $ (fromIntegral h1 `unsafeShiftL` 32) .|. fromIntegral h2
+
+ -- | Compute a 32-bit hash.
+ hash32 :: Hashable a => a -> Word32
+@@ -149,8 +148,8 @@ cheapHashes :: Hashable a => Int -- ^ number of hashes to compute
+ cheapHashes k v = go 0
+ where go i | i == j = []
+ | otherwise = hash : go (i + 1)
+- where !hash = h1 + (h2 `shiftR` i)
+- h1 = fromIntegral (h `shiftR` 32)
++ where !hash = h1 + (h2 `unsafeShiftR` i)
++ h1 = fromIntegral (h `unsafeShiftR` 32)
+ h2 = fromIntegral h
+ h = hashSalt64 0x9150a946c4a8966e v
+ j = fromIntegral k
+@@ -163,7 +162,7 @@ instance Hashable Integer where
+ (salt `xor` 0x3ece731e)
+ | otherwise = hashIO32 (unfoldr go k) salt
+ where go 0 = Nothing
+- go i = Just (fromIntegral i :: Word32, i `shiftR` 32)
++ go i = Just (fromIntegral i :: Word32, i `unsafeShiftR` 32)
+
+ instance Hashable Bool where
+ hashIO32 = hashOne32
+@@ -224,7 +223,7 @@ instance Hashable Word64 where
+ -- | A fast unchecked shift. Nasty, but otherwise GHC 6.8.2 does a
+ -- test and branch on every shift.
+ div4 :: CSize -> CSize
+-div4 k = fromIntegral ((fromIntegral k :: HTYPE_SIZE_T) `shiftR` 2)
++div4 k = fromIntegral ((fromIntegral k :: HTYPE_SIZE_T) `unsafeShiftR` 2)
+
+ alignedHash :: Ptr a -> CSize -> Word32 -> IO Word32
+ alignedHash ptr bytes salt
+diff --git a/Data/BloomFilter/Mutable.hs b/Data/BloomFilter/Mutable.hs
+index edff1fc..0bb5cc9 100644
+--- a/Data/BloomFilter/Mutable.hs
++++ b/Data/BloomFilter/Mutable.hs
+@@ -65,9 +65,9 @@ module Data.BloomFilter.Mutable
+ import Control.Monad (liftM, forM_)
+ import Control.Monad.ST (ST)
+ import Data.Array.Base (unsafeRead, unsafeWrite)
+-import Data.Bits ((.&.), (.|.))
++import Data.Bits ((.&.), (.|.), unsafeShiftL, unsafeShiftR)
+ import Data.BloomFilter.Array (newArray)
+-import Data.BloomFilter.Util (FastShift(..), (:*)(..), nextPowerOfTwo)
++import Data.BloomFilter.Util ((:*)(..), nextPowerOfTwo)
+ import Data.Word (Word32)
+ import Data.BloomFilter.Mutable.Internal
+
+@@ -86,9 +86,9 @@ new hash numBits = MB hash shft msk `liftM` newArray numElems numBytes
+ | numBits > maxHash = maxHash
+ | isPowerOfTwo numBits = numBits
+ | otherwise = nextPowerOfTwo numBits
+- numElems = max 2 (twoBits `shiftR` logBitsInHash)
+- numBytes = numElems `shiftL` logBytesInHash
+- trueBits = numElems `shiftL` logBitsInHash
++ numElems = max 2 (twoBits `unsafeShiftR` logBitsInHash)
++ numBytes = numElems `unsafeShiftL` logBytesInHash
++ trueBits = numElems `unsafeShiftL` logBitsInHash
+ shft = logPower2 trueBits
+ msk = trueBits - 1
+ isPowerOfTwo n = n .&. (n - 1) == 0
+@@ -109,7 +109,7 @@ logBytesInHash = 2 -- logPower2 (sizeOf (undefined :: Hash))
+ -- | Given a filter's mask and a hash value, compute an offset into
+ -- a word array and a bit offset within that word.
+ hashIdx :: Int -> Word32 -> (Int :* Int)
+-hashIdx msk x = (y `shiftR` logBitsInHash) :* (y .&. hashMask)
++hashIdx msk x = (y `unsafeShiftR` logBitsInHash) :* (y .&. hashMask)
+ where hashMask = 31 -- bitsInHash - 1
+ y = fromIntegral x .&. msk
+
+@@ -125,7 +125,7 @@ insert mb elt = do
+ let mu = bitArray mb
+ forM_ (hashesM mb elt) $ \(word :* bit) -> do
+ old <- unsafeRead mu word
+- unsafeWrite mu word (old .|. (1 `shiftL` bit))
++ unsafeWrite mu word (old .|. (1 `unsafeShiftL` bit))
+
+ -- | Query a mutable Bloom filter for membership. If the value is
+ -- present, return @True@. If the value is not present, there is
+@@ -135,7 +135,7 @@ elem elt mb = loop (hashesM mb elt)
+ where mu = bitArray mb
+ loop ((word :* bit):wbs) = do
+ i <- unsafeRead mu word
+- if i .&. (1 `shiftL` bit) == 0
++ if i .&. (1 `unsafeShiftL` bit) == 0
+ then return False
+ else loop wbs
+ loop _ = return True
+@@ -145,7 +145,7 @@ elem elt mb = loop (hashesM mb elt)
+
+ -- | Return the size of a mutable Bloom filter, in bits.
+ length :: MBloom s a -> Int
+-length = shiftL 1 . shift
++length = unsafeShiftL 1 . shift
+
+
+ -- | Slow, crummy way of computing the integer log of an integer known
+@@ -153,7 +153,7 @@ length = shiftL 1 . shift
+ logPower2 :: Int -> Int
+ logPower2 k = go 0 k
+ where go j 1 = j
+- go j n = go (j+1) (n `shiftR` 1)
++ go j n = go (j+1) (n `unsafeShiftR` 1)
+
+ -- $overview
+ --
+diff --git a/Data/BloomFilter/Util.hs b/Data/BloomFilter/Util.hs
+index 7f695dc..6ade6e5 100644
+--- a/Data/BloomFilter/Util.hs
++++ b/Data/BloomFilter/Util.hs
+@@ -2,15 +2,11 @@
+
+ module Data.BloomFilter.Util
+ (
+- FastShift(..)
+- , nextPowerOfTwo
++ nextPowerOfTwo
+ , (:*)(..)
+ ) where
+
+-import Data.Bits ((.|.))
+-import qualified Data.Bits as Bits
+-import GHC.Base
+-import GHC.Word
++import Data.Bits ((.|.), unsafeShiftR)
+
+ -- | A strict pair type.
+ data a :* b = !a :* !b
+@@ -22,46 +18,11 @@ nextPowerOfTwo :: Int -> Int
+ {-# INLINE nextPowerOfTwo #-}
+ nextPowerOfTwo n =
+ let a = n - 1
+- b = a .|. (a `shiftR` 1)
+- c = b .|. (b `shiftR` 2)
+- d = c .|. (c `shiftR` 4)
+- e = d .|. (d `shiftR` 8)
+- f = e .|. (e `shiftR` 16)
+- g = f .|. (f `shiftR` 32) -- in case we're on a 64-bit host
++ b = a .|. (a `unsafeShiftR` 1)
++ c = b .|. (b `unsafeShiftR` 2)
++ d = c .|. (c `unsafeShiftR` 4)
++ e = d .|. (d `unsafeShiftR` 8)
++ f = e .|. (e `unsafeShiftR` 16)
++ g = f .|. (f `unsafeShiftR` 32) -- in case we're on a 64-bit host
+ !h = g + 1
+ in h
+-
+--- | This is a workaround for poor optimisation in GHC 6.8.2. It
+--- fails to notice constant-width shifts, and adds a test and branch
+--- to every shift. This imposes about a 10% performance hit.
+-class FastShift a where
+- shiftL :: a -> Int -> a
+- shiftR :: a -> Int -> a
+-
+-instance FastShift Word32 where
+- {-# INLINE shiftL #-}
+- shiftL (W32# x#) (I# i#) = W32# (x# `uncheckedShiftL#` i#)
+-
+- {-# INLINE shiftR #-}
+- shiftR (W32# x#) (I# i#) = W32# (x# `uncheckedShiftRL#` i#)
+-
+-instance FastShift Word64 where
+- {-# INLINE shiftL #-}
+- shiftL (W64# x#) (I# i#) = W64# (x# `uncheckedShiftL64#` i#)
+-
+- {-# INLINE shiftR #-}
+- shiftR (W64# x#) (I# i#) = W64# (x# `uncheckedShiftRL64#` i#)
+-
+-instance FastShift Int where
+- {-# INLINE shiftL #-}
+- shiftL (I# x#) (I# i#) = I# (x# `iShiftL#` i#)
+-
+- {-# INLINE shiftR #-}
+- shiftR (I# x#) (I# i#) = I# (x# `iShiftRA#` i#)
+-
+-instance FastShift Integer where
+- {-# INLINE shiftL #-}
+- shiftL = Bits.shiftL
+-
+- {-# INLINE shiftR #-}
+- shiftR = Bits.shiftR
diff --git a/dev-haskell/bloomfilter/metadata.xml b/dev-haskell/bloomfilter/metadata.xml
index 6122d1de3db3..d27a73cfe53f 100644
--- a/dev-haskell/bloomfilter/metadata.xml
+++ b/dev-haskell/bloomfilter/metadata.xml
@@ -1,14 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>haskell@gentoo.org</email>
<name>Gentoo Haskell</name>
</maintainer>
- <longdescription>
- Pure and impure Bloom Filter implementations.
- </longdescription>
<upstream>
+ <remote-id type="hackage">bloomfilter</remote-id>
<remote-id type="github">bos/bloomfilter</remote-id>
</upstream>
</pkgmetadata>