diff options
Diffstat (limited to 'src/Data')
-rw-r--r-- | src/Data/Torrent.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Data/Torrent.hs b/src/Data/Torrent.hs index 94506d1c..d6f141a8 100644 --- a/src/Data/Torrent.hs +++ b/src/Data/Torrent.hs | |||
@@ -612,7 +612,8 @@ data Piece a = Piece | |||
612 | , pieceData :: !a | 612 | , pieceData :: !a |
613 | } deriving (Show, Read, Eq, Functor, Typeable) | 613 | } deriving (Show, Read, Eq, Functor, Typeable) |
614 | 614 | ||
615 | instance NFData (Piece a) | 615 | instance NFData a => NFData (Piece a) where |
616 | rnf (Piece a b) = rnf a `seq` rnf b | ||
616 | 617 | ||
617 | -- | Payload bytes are omitted. | 618 | -- | Payload bytes are omitted. |
618 | instance Pretty (Piece a) where | 619 | instance Pretty (Piece a) where |
@@ -653,7 +654,8 @@ makeLensesFor [("piPieceLength", "pieceLength")] ''PieceInfo | |||
653 | -- | Concatenation of all 20-byte SHA1 hash values. | 654 | -- | Concatenation of all 20-byte SHA1 hash values. |
654 | makeLensesFor [("piPieceHashes", "pieceHashes")] ''PieceInfo | 655 | makeLensesFor [("piPieceHashes", "pieceHashes")] ''PieceInfo |
655 | 656 | ||
656 | instance NFData PieceInfo | 657 | instance NFData PieceInfo where |
658 | rnf (PieceInfo a (HashList b)) = rnf a `seq` rnf b | ||
657 | 659 | ||
658 | instance Default PieceInfo where | 660 | instance Default PieceInfo where |
659 | def = PieceInfo 1 def | 661 | def = PieceInfo 1 def |