split Logic.Statement into files, simpler serialization

This commit is contained in:
hi 2025-08-08 04:36:22 +00:00
parent 0fa510e31a
commit d781334419
5 changed files with 276 additions and 217 deletions

View file

@ -1,12 +1,17 @@
module Main where
import Logic.Parse (eof, mkInput, ParseError(..))
import Logic.Statement (stmt)
import Logic.Statement.Parse (stmt)
import Logic.Statement.Serialize (serializeLatexTruthTable)
main :: IO ()
main = do
line <- getLine
either fail print $ eof stmt $ mkInput line
case eof stmt $ mkInput line of
Left err -> fail err
Right statement -> do
putStrLn $ show statement
putStr $ serializeLatexTruthTable statement
where
fail err@(ParseError pos message) =
putStrLn $