handleStatements :: [Term] -> IO ()
handleStatements statements = do
let (queries, clauses) = partition isQuery statements
mapM_ (clausesEntailProof clauses) queries
--apply clauses to queries and ignore result
handleArgs :: String-> IO ()
handleArgs args = do
contents <- readFile $ args
case parseInput contents of
Left err -> print err
Right statements -> handleStatements statements
main :: IO ()
main = do
handleStatements(input)
where input = getLine >>= (\str -> ((readIO str)::IO[Term]))
I got error. Couldn't match expected type ‘[Term]’ with actual type ‘IO Term’. How can I fix this?
wherelike this. - Willem Van Onsem>>=in the body (as ininput >>= handleStatements). - Daniel Wagnerwheresomehow performs theIOand then sets the result toinput. You can indeed useinput >>= handleStatements- Willem Van Onsem