summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/pjson.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/pjson.hs b/examples/pjson.hs
new file mode 100644
index 00000000..a515febb
--- /dev/null
+++ b/examples/pjson.hs
@@ -0,0 +1,12 @@
1import Data.Aeson.Encode.Pretty
2import qualified Data.Aeson as J
3import Data.ByteString.Lazy.Char8 as B
4import Control.Monad
5import System.Environment
6
7main = do
8 args <- getArgs
9 forM_ args $ \fn -> do
10 v <- J.decode <$> B.readFile fn
11 let _ = v :: Maybe J.Value
12 mapM_ B.putStrLn (fmap encodePretty v)