Created
February 6, 2014 14:04
-
-
Save anonymous/8844775 to your computer and use it in GitHub Desktop.
Trying to echo JSON AST from STDIN
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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