summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Exchange/Block.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/BitTorrent/Exchange/Block.hs')
-rw-r--r--src/Network/BitTorrent/Exchange/Block.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Network/BitTorrent/Exchange/Block.hs b/src/Network/BitTorrent/Exchange/Block.hs
index ccc7a0a9..bc9a3d24 100644
--- a/src/Network/BitTorrent/Exchange/Block.hs
+++ b/src/Network/BitTorrent/Exchange/Block.hs
@@ -67,7 +67,7 @@ import Data.Serialize as S
67import Data.Typeable 67import Data.Typeable
68import Numeric 68import Numeric
69import Text.PrettyPrint as PP hiding ((<>)) 69import Text.PrettyPrint as PP hiding ((<>))
70import Text.PrettyPrint.Class 70import Text.PrettyPrint.HughesPJClass hiding ((<>),($$))
71 71
72import Data.Torrent 72import Data.Torrent
73 73
@@ -138,7 +138,7 @@ instance Serialize BlockIx where
138 {-# INLINE put #-} 138 {-# INLINE put #-}
139 139
140instance Pretty BlockIx where 140instance Pretty BlockIx where
141 pretty BlockIx {..} = 141 pPrint BlockIx {..} =
142 ("piece = " <> int ixPiece <> ",") <+> 142 ("piece = " <> int ixPiece <> ",") <+>
143 ("offset = " <> int ixOffset <> ",") <+> 143 ("offset = " <> int ixOffset <> ",") <+>
144 ("length = " <> int ixLength) 144 ("length = " <> int ixLength)
@@ -169,8 +169,8 @@ data Block payload = Block {
169 169
170-- | Payload is ommitted. 170-- | Payload is ommitted.
171instance Pretty (Block BL.ByteString) where 171instance Pretty (Block BL.ByteString) where
172 pretty = pretty . blockIx 172 pPrint = pPrint . blockIx
173 {-# INLINE pretty #-} 173 {-# INLINE pPrint #-}
174 174
175-- | Get size of block /payload/ in bytes. 175-- | Get size of block /payload/ in bytes.
176blockSize :: Block BL.ByteString -> BlockSize 176blockSize :: Block BL.ByteString -> BlockSize
@@ -241,8 +241,8 @@ valid = check Nothing
241 check (Just False) xs 241 check (Just False) xs
242 242
243instance Pretty Bucket where 243instance Pretty Bucket where
244 pretty Nil = nilInvFailed 244 pPrint Nil = nilInvFailed
245 pretty bkt = go bkt 245 pPrint bkt = go bkt
246 where 246 where
247 go Nil = PP.empty 247 go Nil = PP.empty
248 go (Span sz xs) = "Span" <+> PP.int sz <+> go xs 248 go (Span sz xs) = "Span" <+> PP.int sz <+> go xs