Hand-rolling a Bittorrent client in Haskell