From 3d2408eb3f680117d841e5f90e120ff018009f03 Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Sun, 16 Feb 2014 23:37:45 +0400 Subject: Remove askOption --- src/Network/BitTorrent/DHT/Query.hs | 2 +- src/Network/BitTorrent/DHT/Session.hs | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Network/BitTorrent/DHT/Query.hs b/src/Network/BitTorrent/DHT/Query.hs index abe1ef5f..627bc096 100644 --- a/src/Network/BitTorrent/DHT/Query.hs +++ b/src/Network/BitTorrent/DHT/Query.hs @@ -137,5 +137,5 @@ publish ih p = do republish :: DHT ip ThreadId republish = fork $ do - i <- askOption optReannounce + i <- asks (optReannounce . options) error "DHT.republish: not implemented" diff --git a/src/Network/BitTorrent/DHT/Session.hs b/src/Network/BitTorrent/DHT/Session.hs index 33832aac..cbdc9ff8 100644 --- a/src/Network/BitTorrent/DHT/Session.hs +++ b/src/Network/BitTorrent/DHT/Session.hs @@ -20,17 +20,17 @@ module Network.BitTorrent.DHT.Session , K , Options (..) - -- * Node + -- * Session , Node , options , LogFun , NodeHandler , startNode - -- * Session + -- * DHT + -- | Use @asks options@ to get options passed to 'startNode'. , DHT , runDHT - , askOption -- * Tokens , grantToken @@ -292,10 +292,6 @@ runDHT :: Node ip -> DHT ip a -> ResIO a runDHT node action = runReaderT (unDHT action) node {-# INLINE runDHT #-} -askOption :: (Options -> a) -> DHT ip a -askOption f = asks (f . options) -{-# INLINE askOption #-} - {----------------------------------------------------------------------- -- Routing -----------------------------------------------------------------------} -- cgit v1.2.3