largeword 1.2.3 → 1.2.4
raw patch · 3 files changed
+11/−9 lines, 3 files
Files
- Data/LargeWord.hs +4/−1
- Tests/Properties.hs +4/−0
- largeword.cabal +3/−8
Data/LargeWord.hs view
@@ -127,7 +127,7 @@ -- Define larger keys from smaller ones. data LargeKey a b = LargeKey a b- deriving (Eq, Ord)+ deriving (Eq) {-# INLINE loHalf #-} loHalf :: LargeKey a b -> a@@ -289,6 +289,9 @@ instance (Binary a, Binary b) => Binary (LargeKey a b) where put (LargeKey lo hi) = put hi >> put lo get = flip LargeKey <$> get <*> get++instance (Ord a, Ord b) => Ord (LargeKey a b) where+ compare a b = compare (hiHalf a, loHalf a) (hiHalf b, loHalf b) type Word96 = LargeKey Word32 Word64 type Word128 = LargeKey Word64 Word64
Tests/Properties.hs view
@@ -86,6 +86,9 @@ u6 :: Assertion u6 = rotate ((2^95) :: Word96) (1) @?= 1 +u7 :: Assertion+u7 = (2^64 :: Word128) < (2 :: Word128) @?= False+ tests :: [Test] tests = [ testProperty "largeword shift left then right" pShiftRightShiftLeft@@ -107,6 +110,7 @@ , testProperty "Word192 encode/decode loop" (encodeDecode::Word192 -> Bool) , testProperty "Word224 encode/decode loop" (encodeDecode::Word224 -> Bool) , testProperty "Word256 encode/decode loop" (encodeDecode::Word256 -> Bool)+ , testCase "largeword Ord test" u7 ] main :: IO ()
largeword.cabal view
@@ -1,5 +1,5 @@ name: largeword-version: 1.2.3+version: 1.2.4 license: BSD3 copyright: Dominic Steinitz <dominic@steinitz.org> author: Dominic Steinitz <dominic@steinitz.org>@@ -10,8 +10,8 @@ category: Data stability: stable build-type: Simple-cabal-version: >= 1.9.2-tested-with: GHC == 7.6.2, GHC == 7.8.2+cabal-version: >= 1.8+tested-with: GHC >= 6.12.3 && < 7.9 -- Tests/Properties.hs shouldn't have to go here, but the source files -- for the test-suite stanzas don't get picked up by `cabal sdist`. Extra-source-files: Tests/Properties.hs@@ -38,8 +38,3 @@ QuickCheck >= 2.4.0.1, HUnit >= 1.2.2.3, largeword == 1.2.3-----