summaryrefslogtreecommitdiff
path: root/src/Data
diff options
context:
space:
mode:
Diffstat (limited to 'src/Data')
-rw-r--r--src/Data/Torrent.hs6
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
615instance NFData (Piece a) 615instance 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.
618instance Pretty (Piece a) where 619instance 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.
654makeLensesFor [("piPieceHashes", "pieceHashes")] ''PieceInfo 655makeLensesFor [("piPieceHashes", "pieceHashes")] ''PieceInfo
655 656
656instance NFData PieceInfo 657instance NFData PieceInfo where
658 rnf (PieceInfo a (HashList b)) = rnf a `seq` rnf b
657 659
658instance Default PieceInfo where 660instance Default PieceInfo where
659 def = PieceInfo 1 def 661 def = PieceInfo 1 def