From def432df1b4f9c16953d1ad144f432e1f23dddc7 Mon Sep 17 00:00:00 2001
From: Jaseem Abid <jaseemabid@gmail.com>
Date: Sat, 21 Mar 2015 22:06:28 +0530
Subject: [PATCH] Rename getPeers -> peers

---
 src/FuncTorrent.hs      | 1 -
 src/FuncTorrent/Peer.hs | 4 ----
 src/Main.hs             | 4 ++--
 3 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/FuncTorrent.hs b/src/FuncTorrent.hs
index acd679e..c05be76 100644
--- a/src/FuncTorrent.hs
+++ b/src/FuncTorrent.hs
@@ -10,7 +10,6 @@ module FuncTorrent
      decode,
      encode,
      getPeerResponse,
-     getPeers,
      handShakeMsg,
      info,
      infoHash,
diff --git a/src/FuncTorrent/Peer.hs b/src/FuncTorrent/Peer.hs
index b9334ba..105994d 100644
--- a/src/FuncTorrent/Peer.hs
+++ b/src/FuncTorrent/Peer.hs
@@ -1,7 +1,6 @@
 module FuncTorrent.Peer
     (Peer,
      PeerResp(..),
-     getPeers,
      getPeerResponse,
      handShakeMsg
     ) where
@@ -35,9 +34,6 @@ data PeerResp = PeerResponse { interval :: Maybe Integer
 toInt :: String -> Integer
 toInt = read
 
-getPeers :: PeerResp -> [Peer]
-getPeers = peers
-
 getPeerResponse :: ByteString -> PeerResp
 getPeerResponse body = case decode body of
                         Right (Bdict peerM) ->
diff --git a/src/Main.hs b/src/Main.hs
index 8656d47..17bd053 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -10,7 +10,7 @@ import Text.ParserCombinators.Parsec (ParseError)
 import FuncTorrent.Bencode (decode, BVal(..))
 import FuncTorrent.Logger (initLogger, logMessage, logStop)
 import FuncTorrent.Metainfo (announce, lengthInBytes, mkMetaInfo, info, name)
-import FuncTorrent.Peer (getPeers, getPeerResponse, handShakeMsg)
+import FuncTorrent.Peer (peers, getPeerResponse, handShakeMsg)
 import FuncTorrent.Tracker (connect, prepareRequest)
 
 logError :: ParseError -> (String -> IO ()) -> IO ()
@@ -53,7 +53,7 @@ main = do
               -- TODO: Write to ~/.functorrent/caches
               writeFile (name (info m) ++ ".cache") body
 
-              let peerResponse = show $ getPeers $ getPeerResponse body
+              let peerResponse = show $ peers $ getPeerResponse body
               logMsg $ "Peers List : " ++ peerResponse
 
               let hsMsgLen = show $ length $ handShakeMsg d' peerId
-- 
2.45.2