diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-11-23 03:37:15 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-11-23 03:37:15 +0400 |
commit | ed25a297094b483dce06e14d52ced2f93f6dca41 (patch) | |
tree | 3df60d8b30af29345de021f251903a175e78c70c /src/Network/BitTorrent/Core/PeerId.hs | |
parent | 708938679954a5d5f9def82e1fa873c19ed662df (diff) |
Use pretty-class package
Diffstat (limited to 'src/Network/BitTorrent/Core/PeerId.hs')
-rw-r--r-- | src/Network/BitTorrent/Core/PeerId.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Network/BitTorrent/Core/PeerId.hs b/src/Network/BitTorrent/Core/PeerId.hs index a212df3d..6aebe8d4 100644 --- a/src/Network/BitTorrent/Core/PeerId.hs +++ b/src/Network/BitTorrent/Core/PeerId.hs | |||
@@ -16,7 +16,6 @@ | |||
16 | module Network.BitTorrent.Core.PeerId | 16 | module Network.BitTorrent.Core.PeerId |
17 | ( -- * PeerId | 17 | ( -- * PeerId |
18 | PeerId (getPeerId) | 18 | PeerId (getPeerId) |
19 | , ppPeerId | ||
20 | 19 | ||
21 | -- * Generation | 20 | -- * Generation |
22 | , genPeerId | 21 | , genPeerId |
@@ -57,6 +56,7 @@ import Data.Version (Version(Version), versionBranch) | |||
57 | import System.Entropy (getEntropy) | 56 | import System.Entropy (getEntropy) |
58 | import System.Locale (defaultTimeLocale) | 57 | import System.Locale (defaultTimeLocale) |
59 | import Text.PrettyPrint hiding ((<>)) | 58 | import Text.PrettyPrint hiding ((<>)) |
59 | import Text.PrettyPrint.Class | ||
60 | import Text.Read (readMaybe) | 60 | import Text.Read (readMaybe) |
61 | import Paths_bittorrent (version) | 61 | import Paths_bittorrent (version) |
62 | 62 | ||
@@ -83,9 +83,8 @@ instance IsString PeerId where | |||
83 | where | 83 | where |
84 | bs = fromString str | 84 | bs = fromString str |
85 | 85 | ||
86 | -- | Format peer id in human readable form. | 86 | instance Pretty PeerId where |
87 | ppPeerId :: PeerId -> Doc | 87 | pretty = text . BC.unpack . getPeerId |
88 | ppPeerId = text . BC.unpack . getPeerId | ||
89 | 88 | ||
90 | {----------------------------------------------------------------------- | 89 | {----------------------------------------------------------------------- |
91 | -- Encoding | 90 | -- Encoding |