packages feed

bits-extra 0.0.1.2 → 0.0.1.3

raw patch · 6 files changed

+61/−59 lines, 6 filesdep ~basenew-uploaderPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base

API changes (from Hackage documentation)

Files

ChangeLog.md view
@@ -1,3 +1,7 @@ # Changelog for bits-extra +# 0.0.1.3++* Support GHC 7.10+ ## Unreleased changes
README.md view
@@ -1,4 +1,6 @@ # bits-extra+[![CircleCI](https://circleci.com/gh/haskell-works/bits-extra.svg?style=svg)](https://circleci.com/gh/haskell-works/bits-extra)+[![Travis](https://travis-ci.org/haskell-works/bits-extra.svg?branch=master)](https://travis-ci.org/haskell-works/bits-extra)  Useful bitwise operations. 
bench/Main.hs view
@@ -1,9 +1,10 @@ module Main where  import Criterion.Main-import Data.Bits import Data.Bits.Pdep+import Data.Bits.Pdep.Slow import Data.Bits.Pext+import Data.Monoid         ((<>)) import Data.Word  import qualified Data.Vector.Storable as DVS@@ -12,46 +13,32 @@ mkVector w = return $ DVS.unfoldrN 1024 gen w   where gen b = let a = b + 1 in Just (a, a) -benchPopCount :: [Benchmark]-benchPopCount =-  [ env (mkVector (0 :: Word64)) $ \_ -> bgroup "popCount-single"-    [ bench "popCount64"  (whnf popCount (0 :: Word64))-    ]-  , env (mkVector (0 :: Word32)) $ \_ -> bgroup "popCount-single"-    [ bench "popCount32"  (whnf popCount (0 :: Word32))-    ]-  , env (mkVector (0 :: Word64)) $ \v -> bgroup "pdep-vector"-    [ bench "popCount64"  (whnf (DVS.map popCount) v)-    ]-  , env (mkVector (0 :: Word32)) $ \v -> bgroup "pdep-vector"-    [ bench "popCount32"  (whnf (DVS.map popCount) v)-    ]-  ]--benchPlus :: [Benchmark]-benchPlus =-  [ env (mkVector (0 :: Word64)) $ \v -> bgroup "plus-vector"-    [ bench "plus64"    (whnf (DVS.foldr (\a b -> (+) a 0 + b) 0) v)-    ]-  , env (mkVector (0 :: Word32)) $ \v -> bgroup "plus-vector"-    [ bench "plus32"    (whnf (DVS.foldr (\a b -> (+) a 0 + b) 0) v)-    ]-  ]- benchPdep :: [Benchmark] benchPdep =   [ env (mkVector (0 :: Word64)) $ \_ -> bgroup "pdep-single"-    [ bench "pdep64"    (whnf (pdep 0) (63 :: Word64))+    [ bench "pdep64"      (whnf (pdep       0) (63 :: Word64))+    , bench "pdep32"      (whnf (pdep       0) (63 :: Word32))     ]-  , env (mkVector (0 :: Word32)) $ \_ -> bgroup "pdep-single"-    [ bench "pdep32"    (whnf (pdep 0) (63 :: Word32))+  , env (mkVector (0 :: Word64)) $ \_ -> bgroup "pdep-slow"+    [ bench "slowPdep64  8-bits"  (whnf (slowPdep  0x00000000000000ff) (0xff00000000000000 :: Word64))+    , bench "slowPdep64 16-bits"  (whnf (slowPdep  0x000000000000ffff) (0xffff000000000000 :: Word64))+    , bench "slowPdep64 32-bits"  (whnf (slowPdep  0x00000000ffffffff) (0xffffffff00000000 :: Word64))+    , bench "slowPdep64 48-bits"  (whnf (slowPdep  0x0000ffffffffffff) (0xffffffffffff0000 :: Word64))+    , bench "slowPdep64 64-bits"  (whnf (slowPdep  0xffffffffffffffff) (0xffffffffffffffff :: Word64))     ]-  , env (mkVector (0 :: Word64)) $ \v -> bgroup "pdep-vector"+  ]++benchPdepVector :: [Benchmark]+benchPdepVector =+  [ env (mkVector (0 :: Word64)) $ \v -> bgroup "pdep-vector"     [ bench "pdep64"    (whnf (DVS.foldr (\a b -> pdep a 0 + b) 0) v)     ]   , env (mkVector (0 :: Word32)) $ \v -> bgroup "pdep-vector"     [ bench "pdep32"    (whnf (DVS.foldr (\a b -> pdep a 0 + b) 0) v)     ]+  , env (mkVector (0 :: Word64)) $ \v -> bgroup "pdep-vector"+    [ bench "pdep64"    (whnf (DVS.foldr (\a b -> pdep a 0 + b) 0) v)+    ]   ]  benchPext :: [Benchmark]@@ -62,7 +49,11 @@   , env (mkVector (0 :: Word32)) $ \_ -> bgroup "pext-single"     [ bench "pext32"    (whnf (pext 0) (63 :: Word64))     ]-  , env (mkVector (0 :: Word64)) $ \v -> bgroup "pext-vector"+  ]++benchPextVector :: [Benchmark]+benchPextVector =+  [ env (mkVector (0 :: Word64)) $ \v -> bgroup "pext-vector"     [ bench "pext64"    (whnf (DVS.foldr (\a b -> pext a 0 + b) 0) v)     ]   , env (mkVector (0 :: Word32)) $ \v -> bgroup "pext-vector"@@ -71,7 +62,11 @@   ]  benchAll :: [Benchmark]-benchAll = benchPopCount <> benchPdep <> benchPext <> benchPlus+benchAll = mempty+  <> benchPdep+  <> benchPext+  <> benchPdepVector+  <> benchPextVector  main :: IO () main = do
bits-extra.cabal view
@@ -1,12 +1,14 @@--- This file has been generated from package.yaml by hpack version 0.20.0.+-- This file has been generated from package.yaml by hpack version 0.27.0. -- -- see: https://github.com/sol/hpack ----- hash: dbcbb459a6eb5b7d8dadf5907153e09aeafa1d85fbef3d1cfcf6c02f025f0348+-- hash: 2b570cc02c2669976f9b6116039e2b03b4942f905bf19228b08ea28cae3edcca  name:           bits-extra-version:        0.0.1.2+version:        0.0.1.3+synopsis:       Useful bitwise operations description:    Please see the README on Github at <https://github.com/haskell-works/bits-extra#readme>+category:       Data, Serialization homepage:       https://github.com/haskell-works/bits-extra#readme bug-reports:    https://github.com/haskell-works/bits-extra/issues author:         John Ky@@ -16,6 +18,7 @@ license-file:   LICENSE build-type:     Simple cabal-version:  >= 1.10+tested-with:    GHC == 8.4.2, GHC == 8.2.2, GHC == 8.0.2, GHC == 7.10.3  extra-source-files:     ChangeLog.md@@ -31,17 +34,6 @@   default: False  library-  hs-source-dirs:-      src-  other-extensions: TypeApplications-  ghc-options: -Wall -O2-  build-depends:-      base >=4.7 && <5-    , ghc-prim-    , vector-  if (flag(bmi2)) && (impl(ghc >=8.4.1))-    ghc-options: -mbmi2 -msse4.2-    cpp-options: -DBMI2_ENABLED   exposed-modules:       Data.Bits.BitSize       Data.Bits.Pdep@@ -52,16 +44,30 @@       Data.Bits.Pdep.Prim       Data.Bits.Pext.Prim       Paths_bits_extra+  hs-source-dirs:+      src+  ghc-options: -Wall -O2+  build-depends:+      base >=4.8 && <5+    , ghc-prim+    , vector+  if (flag(bmi2)) && (impl(ghc >=8.4.1))+    ghc-options: -mbmi2 -msse4.2+    cpp-options: -DBMI2_ENABLED   default-language: Haskell2010  test-suite bits-extra-test   type: exitcode-stdio-1.0   main-is: Spec.hs+  other-modules:+      Data.Bits.PdepSpec+      Data.Bits.PextSpec+      Paths_bits_extra   hs-source-dirs:       test   ghc-options: -threaded -rtsopts -with-rtsopts=-N   build-depends:-      base >=4.11 && <5+      base >=4.8 && <5     , bits-extra     , ghc-prim     , hedgehog@@ -70,26 +76,23 @@     , hw-hspec-hedgehog   if (flag(bmi2)) && (impl(ghc >=8.4.1))     ghc-options: -mbmi2 -msse4.2-  other-modules:-      Data.Bits.PdepSpec-      Data.Bits.PextSpec-      Paths_bits_extra   default-language: Haskell2010+  build-tool-depends: hspec-discover:hspec-discover  benchmark bench   type: exitcode-stdio-1.0   main-is: Main.hs+  other-modules:+      Paths_bits_extra   hs-source-dirs:       bench   ghc-options: -Wall -O2   build-depends:-      base >=4 && <5+      base >=4.8 && <5     , bits-extra     , criterion     , ghc-prim     , vector   if (flag(bmi2)) && (impl(ghc >=8.4.1))     ghc-options: -mbmi2 -msse4.2-  other-modules:-      Paths_bits_extra   default-language: Haskell2010
src/Data/Bits/BitSize.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE TypeApplications    #-}  module Data.Bits.BitSize where @@ -78,5 +77,5 @@   {-# INLINE bitSize #-}  instance forall a. (BitSize a, DVS.Storable a) => BitSize (DVS.Vector a) where-  bitSize v = DVS.length v * bitSize @a undefined+  bitSize v = DVS.length v * bitSize (undefined :: a)   {-# INLINE bitSize #-}
src/Data/Bits/Pdep.hs view
@@ -1,5 +1,4 @@-{-# LANGUAGE CPP       #-}-{-# LANGUAGE MagicHash #-}+{-# LANGUAGE CPP #-}  module Data.Bits.Pdep   ( Pdep(..)