summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-07-07 03:00:03 +0400
committerSam T <pxqr.sta@gmail.com>2013-07-07 03:00:03 +0400
commit0fe7e4ebd2f7ffd9f71738d6683427a110e58497 (patch)
treea708a5c5526d1432bded5f739a72fb630a7b1338 /examples
parenta572f188af8f7d05f37f9b85162759499c3965a8 (diff)
~ Yet Yet Another Literate Haskell Test.
Diffstat (limited to 'examples')
-rw-r--r--examples/Main.lhs14
1 files changed, 3 insertions, 11 deletions
diff --git a/examples/Main.lhs b/examples/Main.lhs
index 1a7b5b12..4d1c4eef 100644
--- a/examples/Main.lhs
+++ b/examples/Main.lhs
@@ -1,28 +1,20 @@
1A very helpful and literate comment.
2A very helpful comment for very helpful and very literate comment.
3
4> module Main (main) where 1> module Main (main) where
5 2>
6> import Control.Monad 3> import Control.Monad
7> import Network.BitTorrent 4> import Network.BitTorrent
8> import System.Environment 5> import System.Environment
9> import Control.Monad.Trans 6> import Control.Monad.Trans
10 7>
11 8>
12> main :: IO () 9> main :: IO ()
13> main = do 10> main = do
14> [path] <- getArgs 11> [path] <- getArgs
15> torrent <- fromFile path 12> torrent <- fromFile path
16>
17> print (contentLayout "./" (tInfo torrent)) 13> print (contentLayout "./" (tInfo torrent))
18>
19> client <- newClient 2 [] 14> client <- newClient 2 []
20> swarm <- newLeecher client torrent 15> swarm <- newLeecher client torrent
21>
22> storage <- swarm `bindTo` "/tmp/" 16> storage <- swarm `bindTo` "/tmp/"
23>
24> ppStorage storage >>= print 17> ppStorage storage >>= print
25>
26> discover swarm $ do 18> discover swarm $ do
27> liftIO $ print "connected to peer" 19> liftIO $ print "connected to peer"
28> forever $ do 20> forever $ do