diff options
Diffstat (limited to 'examples/pp.hs')
-rw-r--r-- | examples/pp.hs | 14 |
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 @@ | |||
1 | module Main (main) where | ||
2 | |||
3 | import Data.BEncode | ||
4 | import qualified Data.ByteString as B | ||
5 | import System.IO | ||
6 | import System.Environment | ||
7 | |||
8 | main :: IO () | ||
9 | main = 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 | ||