Skip to content

Instantly share code, notes, and snippets.

@theSeafarer
Created October 2, 2018 00:03
Show Gist options
  • Save theSeafarer/159c7884b5a8761d4d699894bf1c9560 to your computer and use it in GitHub Desktop.
Save theSeafarer/159c7884b5a8761d4d699894bf1c9560 to your computer and use it in GitHub Desktop.
Stupid JSON pretty-printer thingy
{-# LANGUAGE TypeApplications #-}
module Main where
import System.Environment
import Data.Aeson
import Data.Aeson.Encode.Pretty
import Data.Maybe ( fromJust )
import qualified Data.ByteString.Lazy as LBS
main = LBS.putStr
. encodePretty
. fromJust
. decode @(Maybe Value)
=<< LBS.readFile
. head
=<< getArgs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment