Skip to content

Commit d6f94a0

Browse files
marinellierikd
authored andcommitted
Reintroduce Data instances
1 parent cb0b3db commit d6f94a0

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Revision history for wide-word
22

3+
## 0.1.8.1 -- 2025-??-??
4+
5+
* Reintroduce Data instances.
6+
37
## 0.1.8.0 -- 2025-09-08
48

59
* Fix bug in Word256 implementions (minus).

src/Data/WideWord/Int128.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{-# LANGUAGE BangPatterns #-}
22
{-# LANGUAGE CPP #-}
3+
{-# LANGUAGE DeriveDataTypeable #-}
34
{-# LANGUAGE DeriveGeneric #-}
45
{-# LANGUAGE MagicHash #-}
5-
{-# LANGUAGE MultiParamTypeClasses #-}
66
{-# LANGUAGE StrictData #-}
77
{-# LANGUAGE UnboxedTuples #-}
88
{-# OPTIONS_GHC -funbox-strict-fields #-}
@@ -32,6 +32,7 @@ module Data.WideWord.Int128
3232
import Control.DeepSeq (NFData (..))
3333

3434
import Data.Bits (Bits (..), FiniteBits (..), shiftL)
35+
import Data.Data (Data, Typeable)
3536
import Data.Ix (Ix)
3637
#if ! MIN_VERSION_base(4,11,0)
3738
import Data.Semigroup ((<>))
@@ -68,7 +69,7 @@ data Int128 = Int128
6869
{ int128Hi64 :: !Word64
6970
, int128Lo64 :: !Word64
7071
}
71-
deriving (Eq, Generic, Ix)
72+
deriving (Eq, Data, Generic, Ix)
7273

7374
instance Hashable Int128 where
7475
hashWithSalt s (Int128 a1 a2) = s `hashWithSalt` a1 `hashWithSalt` a2

src/Data/WideWord/Word128.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{-# LANGUAGE BangPatterns #-}
22
{-# LANGUAGE CPP #-}
3+
{-# LANGUAGE DeriveDataTypeable #-}
34
{-# LANGUAGE DeriveGeneric #-}
45
{-# LANGUAGE MagicHash #-}
56
{-# LANGUAGE StrictData #-}
@@ -33,6 +34,7 @@ module Data.WideWord.Word128
3334
import Control.DeepSeq (NFData (..))
3435

3536
import Data.Bits (Bits (..), FiniteBits (..), shiftL)
37+
import Data.Data (Data)
3638
import Data.Ix (Ix)
3739
#if ! MIN_VERSION_base(4,11,0)
3840
import Data.Semigroup ((<>))
@@ -60,7 +62,7 @@ data Word128 = Word128
6062
{ word128Hi64 :: !Word64
6163
, word128Lo64 :: !Word64
6264
}
63-
deriving (Eq, Generic, Ix)
65+
deriving (Eq, Data, Generic, Ix)
6466

6567
instance Hashable Word128 where
6668
hashWithSalt s (Word128 a1 a2) = s `hashWithSalt` a1 `hashWithSalt` a2

src/Data/WideWord/Word256.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{-# LANGUAGE BangPatterns #-}
22
{-# LANGUAGE CPP #-}
3+
{-# LANGUAGE DeriveDataTypeable #-}
34
{-# LANGUAGE DeriveGeneric #-}
45
{-# LANGUAGE MagicHash #-}
56
{-# LANGUAGE StrictData #-}
@@ -30,6 +31,7 @@ module Data.WideWord.Word256
3031
import Control.DeepSeq (NFData (..))
3132

3233
import Data.Bits (Bits (..), FiniteBits (..), shiftL)
34+
import Data.Data (Data)
3335
import Data.Ix (Ix)
3436
#if ! MIN_VERSION_base(4,11,0)
3537
import Data.Semigroup ((<>))
@@ -61,7 +63,7 @@ data Word256 = Word256
6163
, word256m0 :: !Word64
6264
, word256lo :: !Word64
6365
}
64-
deriving (Eq, Generic, Ix)
66+
deriving (Eq, Data, Generic, Ix)
6567

6668
instance Hashable Word256 where
6769
hashWithSalt s (Word256 a1 a2 a3 a4) =

wide-word.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
-- documentation, see http://haskell.org/cabal/users-guide/
33

44
name: wide-word
5-
version: 0.1.8.0
5+
version: 0.1.8.1
66
synopsis: Data types for large but fixed width signed and unsigned integers
77
description:
88
A library to provide data types for large (ie > 64 bits) but fixed width signed

0 commit comments

Comments
 (0)