diff options
author | joe <joe@jerkface.net> | 2015-03-29 01:06:34 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2015-03-29 01:06:34 -0400 |
commit | c88a76cb1c6ee7e54628b78a56f1a25415a39c30 (patch) | |
tree | 567ee2accc815e3f2a71c8f8434eefef82e60ef7 /src/Network/BitTorrent/Exchange/Block.hs | |
parent | e569586521be76e0f02137e01af9375d327d461c (diff) |
Updates to build against newer libraries:
* prettyclass instead of deprecated pretty-class
* use pPrint instead of pretty
* backported to iproute-1.2.11 (convenient for debian jessie)
Diffstat (limited to 'src/Network/BitTorrent/Exchange/Block.hs')
-rw-r--r-- | src/Network/BitTorrent/Exchange/Block.hs | 12 |
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 | |||
67 | import Data.Typeable | 67 | import Data.Typeable |
68 | import Numeric | 68 | import Numeric |
69 | import Text.PrettyPrint as PP hiding ((<>)) | 69 | import Text.PrettyPrint as PP hiding ((<>)) |
70 | import Text.PrettyPrint.Class | 70 | import Text.PrettyPrint.HughesPJClass hiding ((<>),($$)) |
71 | 71 | ||
72 | import Data.Torrent | 72 | import Data.Torrent |
73 | 73 | ||
@@ -138,7 +138,7 @@ instance Serialize BlockIx where | |||
138 | {-# INLINE put #-} | 138 | {-# INLINE put #-} |
139 | 139 | ||
140 | instance Pretty BlockIx where | 140 | instance 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. |
171 | instance Pretty (Block BL.ByteString) where | 171 | instance 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. |
176 | blockSize :: Block BL.ByteString -> BlockSize | 176 | blockSize :: Block BL.ByteString -> BlockSize |
@@ -241,8 +241,8 @@ valid = check Nothing | |||
241 | check (Just False) xs | 241 | check (Just False) xs |
242 | 242 | ||
243 | instance Pretty Bucket where | 243 | instance 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 |