Commit 8c6d03ca authored by Hans-Peter Deifel's avatar Hans-Peter Deifel 🐢
Browse files

Use pretty printer to print parsing result

This helps with debugging, because it formats the `show` output with
more newlines and colors.
parent 3aa4ce67
......@@ -44,3 +44,4 @@ executable ma
, text
, vector
, bytestring
, pretty-simple
......@@ -3,6 +3,7 @@
module Main where
import qualified Data.ByteString as BS
import Text.Pretty.Simple (pPrint)
import System.Environment
import System.IO
......@@ -11,7 +12,7 @@ import Parser
main :: IO ()
main = getArgs >>= \case
[file] -> BS.readFile file >>= print . decodeCoalgebra
[file] -> BS.readFile file >>= pPrint . decodeCoalgebra
_ -> do
prog <- getProgName
hPutStrLn stderr ("Usage: " ++ prog ++ " FILE")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment