summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent
diff options
context:
space:
mode:
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