diff options
-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 |