cabal
only doing this because Data.Set is not in the stdlib
This commit is contained in:
parent
30941456a2
commit
dff5b9f365
19 changed files with 101 additions and 16 deletions
23
src/Main.hs
Normal file
23
src/Main.hs
Normal file
|
@ -0,0 +1,23 @@
|
|||
module Main where
|
||||
|
||||
import Logic.Parse (eof, mkInput, ParseError(..))
|
||||
import Logic.Statement.Parse (stmt)
|
||||
import Logic.Statement.Eval (bucket)
|
||||
import Logic.Statement.Serialize (serializeLatexTruthTable)
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
line <- getLine
|
||||
case eof stmt $ mkInput line of
|
||||
Left err -> fail err
|
||||
Right statement -> do
|
||||
putStrLn $ show statement
|
||||
putStrLn $ show $ bucket statement
|
||||
putStr $ serializeLatexTruthTable statement
|
||||
where
|
||||
fail (ParseError pos message) =
|
||||
putStrLn $
|
||||
"parse error at position "
|
||||
<> show pos
|
||||
<> ": "
|
||||
<> message
|
Loading…
Add table
Add a link
Reference in a new issue