From 41c4f64231037f70d7cd6a0c2611b2c6a1d517d9 Mon Sep 17 00:00:00 2001 From: joe Date: Sun, 16 Jul 2017 23:31:31 -0400 Subject: Refactored, renamed, Table -> BucketList. --- Kademlia.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Kademlia.hs') diff --git a/Kademlia.hs b/Kademlia.hs index 63c2b494..4a811fa2 100644 --- a/Kademlia.hs +++ b/Kademlia.hs @@ -114,10 +114,10 @@ contramapIR f ir = InsertionReporter -- | All the IO operations neccessary to maintain a Kademlia routing table. data TableStateIO nid ni = TableStateIO { -- | Write the routing table. Typically 'writeTVar'. - tblWrite :: R.Table ni -> STM () + tblWrite :: R.BucketList ni -> STM () -- | Read the routing table. Typically 'readTVar'. - , tblRead :: STM (R.Table ni) + , tblRead :: STM (R.BucketList ni) -- | Issue a ping to a remote node and report 'True' if the node -- responded within an acceptable time and 'False' otherwise. @@ -136,7 +136,7 @@ data TableStateIO nid ni = TableStateIO , tblChanged :: RoutingTableChanged ni -> STM (IO ()) } -vanillaIO :: TVar (Table ni) -> (ni -> IO Bool) -> TableStateIO nid ni +vanillaIO :: TVar (BucketList ni) -> (ni -> IO Bool) -> TableStateIO nid ni vanillaIO var ping = TableStateIO { tblRead = readTVar var , tblWrite = writeTVar var @@ -152,7 +152,7 @@ data Kademlia nid ni = Kademlia (InsertionReporter ni) {- kademlia :: FiniteBits nid => - TVar (Table nid nid) -> (nid -> IO Bool) -> Kademlia nid nid + TVar (BucketList nid nid) -> (nid -> IO Bool) -> Kademlia nid nid kademlia var ping = Kademlia quietInsertions (KademliaSpace id testIdBit) (vanillaIO var ping) -- cgit v1.2.3