summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2013-09-27 23:52:37 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2013-09-27 23:52:37 +0400
commitde857a4b8e96c2a9ea4cec974442f08a93cb0098 (patch)
treed99774167528adc782e978bc36baf233aa8543d9 /examples
parentb62c9e3e603a068a9ecfd215c1aeceb74da4dbef (diff)
~ Move pp executable to examples
Diffstat (limited to 'examples')
-rw-r--r--examples/pp.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/pp.hs b/examples/pp.hs
new file mode 100644
index 0000000..7163754
--- /dev/null
+++ b/examples/pp.hs
@@ -0,0 +1,14 @@
1module Main (main) where
2
3import Data.BEncode
4import qualified Data.ByteString as B
5import System.IO
6import System.Environment
7
8main :: IO ()
9main = do
10 path : _ <- getArgs
11 content <- B.readFile path
12 case decode content of
13 Left e -> hPutStrLn stderr e
14 Right be -> print $ ppBEncode be \ No newline at end of file