Skip to content

Instantly share code, notes, and snippets.

@AndrewO
Forked from anonymous/Main.hs
Created February 6, 2014 14:05
Show Gist options
  • Select an option

  • Save AndrewO/8844782 to your computer and use it in GitHub Desktop.

Select an option

Save AndrewO/8844782 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Feb 6, 2014.
    15 changes: 15 additions & 0 deletions Main.hs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    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