diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2014-02-21 02:43:42 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2014-02-21 02:43:42 +0400 |
commit | a1b4c8f9ed0034fd383cfc3d5162135fc81f49c9 (patch) | |
tree | 5cae7e0dbf01ef9f7b0b511ab37cbb850eb2274c /src | |
parent | 8c790322bbb09364b38b8667f63511eeb943796b (diff) |
Document some BitTorrent instances
Diffstat (limited to 'src')
-rw-r--r-- | src/Network/BitTorrent/Client/Types.hs | 4 |
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 | |||
78 | class MonadBitTorrent m where | 78 | class MonadBitTorrent m where |
79 | liftBT :: BitTorrent a -> m a | 79 | liftBT :: BitTorrent a -> m a |
80 | 80 | ||
81 | -- | NOP. | ||
81 | instance MonadBitTorrent BitTorrent where | 82 | instance 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' | ||
84 | instance MonadResource BitTorrent where | 87 | instance 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. | ||
89 | instance MonadDHT BitTorrent where | 93 | instance MonadDHT BitTorrent where |
90 | liftDHT action = BitTorrent $ do | 94 | liftDHT action = BitTorrent $ do |
91 | node <- asks clientNode | 95 | node <- asks clientNode |