summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2014-02-21 02:43:42 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2014-02-21 02:43:42 +0400
commita1b4c8f9ed0034fd383cfc3d5162135fc81f49c9 (patch)
tree5cae7e0dbf01ef9f7b0b511ab37cbb850eb2274c /src/Network/BitTorrent
parent8c790322bbb09364b38b8667f63511eeb943796b (diff)
Document some BitTorrent instances
Diffstat (limited to 'src/Network/BitTorrent')
-rw-r--r--src/Network/BitTorrent/Client/Types.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Network/BitTorrent/Client/Types.hs b/src/Network/BitTorrent/Client/Types.hs
index c2f79460..fa345e4b 100644
--- a/src/Network/BitTorrent/Client/Types.hs
+++ b/src/Network/BitTorrent/Client/Types.hs
@@ -78,14 +78,18 @@ newtype BitTorrent a = BitTorrent
78class MonadBitTorrent m where 78class MonadBitTorrent m where
79 liftBT :: BitTorrent a -> m a 79 liftBT :: BitTorrent a -> m a
80 80
81-- | NOP.
81instance MonadBitTorrent BitTorrent where 82instance MonadBitTorrent BitTorrent where
82 liftBT = id 83 liftBT = id
83 84
85-- | Registered but not closed manually resources will be
86-- automatically closed at 'Network.BitTorrent.Client.closeClient'
84instance MonadResource BitTorrent where 87instance MonadResource BitTorrent where
85 liftResourceT m = BitTorrent $ do 88 liftResourceT m = BitTorrent $ do
86 s <- asks clientResources 89 s <- asks clientResources
87 liftIO $ runInternalState m s 90 liftIO $ runInternalState m s
88 91
92-- | Run DHT operation, only if the client node is running.
89instance MonadDHT BitTorrent where 93instance MonadDHT BitTorrent where
90 liftDHT action = BitTorrent $ do 94 liftDHT action = BitTorrent $ do
91 node <- asks clientNode 95 node <- asks clientNode