eoc/bin/Parse.hs

18 lines
353 B
Haskell

module Main where
import Data.Either (isRight)
import qualified Data.ByteString.Lazy as B
import System.Exit
import Bril
main :: IO ()
main = do
json <- B.getContents
let parsed = parseBrilJSON json
if isRight parsed
then do
B.putStr json
exitWith ExitSuccess
else
exitWith (ExitFailure 1)