Make parseAndRun nicer to use in ghci
It now no longer requires -XOverloadedStrings
This commit is contained in:
parent
54214ed10c
commit
bf50628483
1 changed files with 4 additions and 4 deletions
|
|
@ -11,13 +11,13 @@ import Propa.Prolog.Display
|
|||
import Propa.Prolog.Parse
|
||||
import Propa.Prolog.Unify
|
||||
|
||||
parseAndRun :: T.Text -> T.Text -> IO ()
|
||||
parseAndRun dbText statsText = T.putStrLn $ case results of
|
||||
parseAndRun :: String -> String -> IO ()
|
||||
parseAndRun dbStr statsStr = T.putStrLn $ case results of
|
||||
Left e -> e
|
||||
Right [] -> "No."
|
||||
Right rs -> T.intercalate "\n" rs
|
||||
where
|
||||
results = do
|
||||
db <- parseDb "<input>" dbText
|
||||
stats <- parseStats "<input>" statsText
|
||||
db <- parseDb "<db>" $ T.pack dbStr
|
||||
stats <- parseStats "<query>" $ T.pack statsStr
|
||||
pure $ map displayResult $ run db stats
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue