Skip to content

Instantly share code, notes, and snippets.

Created February 6, 2014 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/8844775 to your computer and use it in GitHub Desktop.
Save anonymous/8844775 to your computer and use it in GitHub Desktop.
Trying to echo JSON AST from STDIN
module MountJSON where
-- import Prelude hiding (getContents)
import qualified Data.Aeson as JSON
import qualified Data.ByteString.Lazy.Char8 as Char
main :: IO ()
main = do
input <- Char.getContents
case JSON.eitherDecode input of
Left err -> putStrLn $ "Bad JSON: " ++ err
Right value -> do
putStrLn "Got:"
putStrLn value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment