diff options
Diffstat (limited to 'src/Data/Torrent/Magnet.hs')
-rw-r--r-- | src/Data/Torrent/Magnet.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Data/Torrent/Magnet.hs b/src/Data/Torrent/Magnet.hs index 01f28a76..791537b1 100644 --- a/src/Data/Torrent/Magnet.hs +++ b/src/Data/Torrent/Magnet.hs | |||
@@ -43,6 +43,8 @@ import Data.Text as T | |||
43 | import Data.Text.Encoding as T | 43 | import Data.Text.Encoding as T |
44 | import Network.URI | 44 | import Network.URI |
45 | import Text.Read | 45 | import Text.Read |
46 | import Text.PrettyPrint as PP | ||
47 | import Text.PrettyPrint.Class | ||
46 | 48 | ||
47 | import Data.Torrent | 49 | import Data.Torrent |
48 | import Data.Torrent.InfoHash | 50 | import Data.Torrent.InfoHash |
@@ -148,6 +150,9 @@ instance URLEncode Magnet where | |||
148 | urlEncode = toQuery | 150 | urlEncode = toQuery |
149 | {-# INLINE urlEncode #-} | 151 | {-# INLINE urlEncode #-} |
150 | 152 | ||
153 | instance Pretty Magnet where | ||
154 | pretty = PP.text . renderMagnet | ||
155 | |||
151 | -- | Set exact topic only, other params are empty. | 156 | -- | Set exact topic only, other params are empty. |
152 | nullMagnet :: InfoHash -> Magnet | 157 | nullMagnet :: InfoHash -> Magnet |
153 | nullMagnet u = Magnet | 158 | nullMagnet u = Magnet |