summaryrefslogtreecommitdiff
path: root/src/Data/Torrent/Magnet.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Data/Torrent/Magnet.hs')
-rw-r--r--src/Data/Torrent/Magnet.hs5
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
43import Data.Text.Encoding as T 43import Data.Text.Encoding as T
44import Network.URI 44import Network.URI
45import Text.Read 45import Text.Read
46import Text.PrettyPrint as PP
47import Text.PrettyPrint.Class
46 48
47import Data.Torrent 49import Data.Torrent
48import Data.Torrent.InfoHash 50import 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
153instance 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.
152nullMagnet :: InfoHash -> Magnet 157nullMagnet :: InfoHash -> Magnet
153nullMagnet u = Magnet 158nullMagnet u = Magnet