wide-word 0.1.1.1 → 0.1.1.2
raw patch · 5 files changed
+28/−7 lines, 5 filesdep ~QuickCheckdep ~basedep ~semiringsPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: QuickCheck, base, semirings
API changes (from Hackage documentation)
- Data.WideWord.Int128: instance GHC.Arr.Ix Data.WideWord.Int128.Int128
- Data.WideWord.Word128: instance GHC.Arr.Ix Data.WideWord.Word128.Word128
- Data.WideWord.Word256: instance GHC.Arr.Ix Data.WideWord.Word256.Word256
+ Data.WideWord.Int128: instance GHC.Generics.Generic Data.WideWord.Int128.Int128
+ Data.WideWord.Int128: instance GHC.Ix.Ix Data.WideWord.Int128.Int128
+ Data.WideWord.Word128: instance GHC.Generics.Generic Data.WideWord.Word128.Word128
+ Data.WideWord.Word128: instance GHC.Ix.Ix Data.WideWord.Word128.Word128
+ Data.WideWord.Word256: instance GHC.Generics.Generic Data.WideWord.Word256.Word256
+ Data.WideWord.Word256: instance GHC.Ix.Ix Data.WideWord.Word256.Word256
Files
- ChangeLog.md +5/−0
- src/Data/WideWord/Int128.hs +8/−2
- src/Data/WideWord/Word128.hs +6/−1
- src/Data/WideWord/Word256.hs +6/−1
- wide-word.cabal +3/−3
ChangeLog.md view
@@ -1,5 +1,10 @@ # Revision history for wide-word +## 0.1.1.2 -- 2020-12-26++* Derive Generic for Int128, Word128 and Word256.+* Fix Bits.isSigned instance for Int128.+ ## 0.1.1.1 -- 2020-03-22 * Make `sizeOf` and `alignment` methods of `Word256` `Prim` and `Storable`
src/Data/WideWord/Int128.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE StrictData #-}@@ -51,17 +52,22 @@ , subWordC#, timesWord#, timesWord2#, word2Int#, xor#) import GHC.Enum (predError, succError) import GHC.Exts ((+#), (*#), State#, Int#, Addr#, ByteArray#, MutableByteArray#)+import GHC.Generics import GHC.Int (Int64 (..)) import GHC.Real ((%)) import GHC.Word (Word64 (..), Word32, byteSwap64) +#if WORD_SIZE_IN_BITS < 64+import GHC.IntWord64+#endif+ import Data.Primitive.Types (Prim (..), defaultSetByteArray#, defaultSetOffAddr#) data Int128 = Int128 { int128Hi64 :: !Word64 , int128Lo64 :: !Word64 }- deriving (Eq, Data, Ix, Typeable)+ deriving (Eq, Data, Generic, Ix, Typeable) byteSwapInt128 :: Int128 -> Int128 byteSwapInt128 (Int128 a1 a0) = Int128 (byteSwap64 a0) (byteSwap64 a1)@@ -116,7 +122,7 @@ bitSize _ = 128 bitSizeMaybe _ = Just 128- isSigned _ = False+ isSigned _ = True testBit = testBit128 bit = bit128
src/Data/WideWord/Word128.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE UnboxedTuples #-}@@ -46,9 +47,13 @@ , quotRemWord2#, subWordC#, timesWord#, timesWord2#, xor#) import GHC.Enum (predError, succError) import GHC.Exts ((*#), (+#), Int#, State#, ByteArray#, MutableByteArray#, Addr#)+import GHC.Generics import GHC.Real ((%), divZeroError) import GHC.Word (Word64 (..), Word32, byteSwap64) +#if WORD_SIZE_IN_BITS < 64+import GHC.IntWord64+#endif import Numeric (showHex) @@ -58,7 +63,7 @@ { word128Hi64 :: !Word64 , word128Lo64 :: !Word64 }- deriving (Eq, Data, Ix, Typeable)+ deriving (Eq, Data, Generic, Ix, Typeable) byteSwapWord128 :: Word128 -> Word128 byteSwapWord128 (Word128 a1 a0) = Word128 (byteSwap64 a0) (byteSwap64 a1)
src/Data/WideWord/Word256.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE UnboxedTuples #-}@@ -45,9 +46,13 @@ , subWordC#, timesWord#, timesWord2#, xor#) import GHC.Enum (predError, succError) import GHC.Exts ((*#), (+#), Int#, State#, ByteArray#, MutableByteArray#, Addr#)+import GHC.Generics import GHC.Real ((%)) import GHC.Word (Word64 (..), Word32) +#if WORD_SIZE_IN_BITS < 64+import GHC.IntWord64+#endif import Numeric (showHex) @@ -59,7 +64,7 @@ , word256m0 :: !Word64 , word256lo :: !Word64 }- deriving (Eq, Data, Ix, Typeable)+ deriving (Eq, Data, Generic, Ix, Typeable) showHexWord256 :: Word256 -> String showHexWord256 (Word256 a3 a2 a1 a0)
wide-word.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: wide-word-version: 0.1.1.1+version: 0.1.1.2 synopsis: Data types for large but fixed width signed and unsigned integers description: A library to provide data types for large (ie > 64 bits) but fixed width signed@@ -25,7 +25,7 @@ stability: provisional cabal-version: >= 1.10 tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4,- GHC == 8.6.5, GHC == 8.8.3+ GHC == 8.6.5, GHC == 8.8.3, GHC == 8.10.1 library default-language: Haskell2010@@ -38,7 +38,7 @@ Data.WideWord.Word256 Data.WideWord.Int128 - build-depends: base >= 4.9 && < 4.14+ build-depends: base >= 4.9 && < 4.15 , deepseq >= 1.3 && < 1.5 , primitive >= 0.6.4.0 && < 0.8