OrderedBits 0.0.1.0 → 0.0.1.1
raw patch · 5 files changed
+66/−56 lines, 5 filesdep +tastydep +tasty-quickcheckdep +tasty-thdep −test-frameworkdep −test-framework-quickcheck2dep −test-framework-thdep ~QuickCheckdep ~basedep ~bitsPVP ok
version bump matches the API change (PVP)
Dependencies added: tasty, tasty-quickcheck, tasty-th
Dependencies removed: test-framework, test-framework-quickcheck2, test-framework-th
Dependency ranges changed: QuickCheck, base, bits, criterion
API changes (from Hackage documentation)
Files
- OrderedBits.cabal +16/−17
- bench/Benchmark.hs +0/−36
- changelog.md +5/−0
- tests/benchmark.hs +40/−0
- tests/properties.hs +5/−3
OrderedBits.cabal view
@@ -1,7 +1,7 @@ name: OrderedBits-version: 0.0.1.0+version: 0.0.1.1 author: Christian Hoener zu Siederdissen-copyright: Christian Hoener zu Siederdissen, 2014 - 2015+copyright: Christian Hoener zu Siederdissen, 2014 - 2016 homepage: https://github.com/choener/OrderedBits bug-reports: https://github.com/choener/OrderedBits/issues maintainer: choener@bioinf.uni-leipzig.de@@ -11,7 +11,7 @@ build-type: Simple stability: experimental cabal-version: >= 1.10.0-tested-with: GHC == 7.8.4, GHC == 7.10.2+tested-with: GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.1 synopsis: Efficient ordered (by popcount) enumeration of bits description: This library provides efficient methods to enumerate all@@ -31,11 +31,11 @@ library- build-depends: base >= 4.7 && < 4.9- , bits >= 0.4 && < 0.5- , primitive >= 0.5 && < 0.7- , vector >= 0.10 && < 0.12- , vector-algorithms >= 0.6 && < 0.7.1+ build-depends: base >= 4.7 && < 5.0+ , bits >= 0.4 && < 0.6+ , primitive >= 0.5 && < 0.7+ , vector >= 0.10 && < 0.12+ , vector-algorithms >= 0.6 && < 0.7.1 default-language: Haskell2010 default-extensions: BangPatterns@@ -50,17 +50,17 @@ -benchmark BenchmarkOrderedBits+benchmark benchmark build-depends: base- , criterion >= 1.0.2 && < 1.1.1+ , criterion >= 1.0.2 && < 1.2 , OrderedBits , vector default-language: Haskell2010 hs-source-dirs:- bench+ tests main-is:- Benchmark.hs+ benchmark.hs type: exitcode-stdio-1.0 ghc-options:@@ -84,11 +84,10 @@ , ScopedTypeVariables build-depends: base , OrderedBits- , QuickCheck- , QuickCheck >= 2.7 && < 2.9- , test-framework >= 0.8 && < 0.9- , test-framework-quickcheck2 >= 0.3 && < 0.4- , test-framework-th >= 0.2 && < 0.3+ , QuickCheck >= 2.7 && < 2.9+ , tasty >= 0.11+ , tasty-quickcheck >= 0.8+ , tasty-th >= 0.1 , vector
− bench/Benchmark.hs
@@ -1,36 +0,0 @@--module Main where--import Criterion.Main-import qualified Data.Vector.Unboxed as VU-import Data.Word (Word(..))--import Data.Bits.Ordered----main = defaultMain- [ bgroup "Int" [ bench "08" $ whnf (VU.sum . popCntSorted :: Int -> Int ) 8- , bench "16" $ whnf (VU.sum . popCntSorted :: Int -> Int ) 16- , bench "20" $ whnf (VU.sum . popCntSorted :: Int -> Int ) 20--- , bench "24" $ whnf (VU.sum . popCntSorted :: Int -> Int ) 24- ]- , bgroup "Word" [ bench "08" $ whnf (VU.sum . popCntSorted :: Int -> Word) 8- , bench "16" $ whnf (VU.sum . popCntSorted :: Int -> Word) 16- , bench "20" $ whnf (VU.sum . popCntSorted :: Int -> Word) 20--- , bench "24" $ whnf (VU.sum . popCntSorted :: Int -> Word) 24- ]- , bgroup "MemoInt" [ bench "08" $ whnf (VU.sum . popCntMemoInt :: Int -> Int ) 8- , bench "16" $ whnf (VU.sum . popCntMemoInt :: Int -> Int ) 16- , bench "20" $ whnf (VU.sum . popCntMemoInt :: Int -> Int ) 20--- , bench "24" $ whnf (VU.sum . popCntMemoInt :: Int -> Int ) 24- ]- , bgroup "MemoWord" [ bench "08" $ whnf (VU.sum . popCntMemoWord :: Int -> Word) 8- , bench "16" $ whnf (VU.sum . popCntMemoWord :: Int -> Word) 16- , bench "20" $ whnf (VU.sum . popCntMemoWord :: Int -> Word) 20--- , bench "24" $ whnf (VU.sum . popCntMemoWord :: Int -> Word) 24- ]--- , bgroup "small ops" [ bench "--- ]- ]-
changelog.md view
@@ -1,3 +1,8 @@+0.0.1.1+-------++- move to tasty framework for property tests+ 0.0.1.0 -------
+ tests/benchmark.hs view
@@ -0,0 +1,40 @@++module Main where++import Criterion.Main+import qualified Data.Vector.Unboxed as VU+import Data.Word (Word(..))++import Data.Bits.Ordered++++main = defaultMain+ [ bgroup "Int" [ bench "08" $ whnf (VU.sum . popCntSorted :: Int -> Int ) 8+ , bench "12" $ whnf (VU.sum . popCntSorted :: Int -> Int ) 12+ , bench "16" $ whnf (VU.sum . popCntSorted :: Int -> Int ) 16+-- , bench "20" $ whnf (VU.sum . popCntSorted :: Int -> Int ) 20+-- , bench "24" $ whnf (VU.sum . popCntSorted :: Int -> Int ) 24+ ]+ , bgroup "Word" [ bench "08" $ whnf (VU.sum . popCntSorted :: Int -> Word) 8+ , bench "12" $ whnf (VU.sum . popCntSorted :: Int -> Word) 12+ , bench "16" $ whnf (VU.sum . popCntSorted :: Int -> Word) 16+-- , bench "20" $ whnf (VU.sum . popCntSorted :: Int -> Word) 20+-- , bench "24" $ whnf (VU.sum . popCntSorted :: Int -> Word) 24+ ]+ , bgroup "MemoInt" [ bench "08" $ whnf (VU.sum . popCntMemoInt :: Int -> Int ) 8+ , bench "12" $ whnf (VU.sum . popCntMemoInt :: Int -> Int ) 12+ , bench "16" $ whnf (VU.sum . popCntMemoInt :: Int -> Int ) 16+-- , bench "20" $ whnf (VU.sum . popCntMemoInt :: Int -> Int ) 20+-- , bench "24" $ whnf (VU.sum . popCntMemoInt :: Int -> Int ) 24+ ]+ , bgroup "MemoWord" [ bench "08" $ whnf (VU.sum . popCntMemoWord :: Int -> Word) 8+ , bench "12" $ whnf (VU.sum . popCntMemoWord :: Int -> Word) 12+ , bench "16" $ whnf (VU.sum . popCntMemoWord :: Int -> Word) 16+-- , bench "20" $ whnf (VU.sum . popCntMemoWord :: Int -> Word) 20+-- , bench "24" $ whnf (VU.sum . popCntMemoWord :: Int -> Word) 24+ ]+-- , bgroup "small ops" [ bench "+-- ]+ ]+
tests/properties.hs view
@@ -10,9 +10,10 @@ import Data.Word (Word) import Debug.Trace import qualified Data.Vector.Unboxed as VU-import Test.Framework.Providers.QuickCheck2-import Test.Framework.TH import Test.QuickCheck hiding ((.&.))+import Test.Tasty+import Test.Tasty.QuickCheck (testProperty)+import Test.Tasty.TH import Data.Bits.Ordered @@ -24,10 +25,11 @@ -- prop> \(n :: Int16) -> let b = popCount n in memoSorted b == enumSorted b -- -prop_PopCountSet (NonZero (n :: Int16)) = memo == enum+prop_PopCountSet (NonZero (n' :: Int16)) = memo == enum where b = popCount n memo = memoSorted b enum = enumSorted b+ n = n' `mod` 12 memoSorted, enumSorted :: Int -> [[Int]]