Add Debug module for easier testing
This commit is contained in:
parent
10ab319620
commit
8a81cd9e77
2 changed files with 19 additions and 0 deletions
|
|
@ -22,6 +22,7 @@ library
|
|||
exposed-modules:
|
||||
Propa.Lambda.Display
|
||||
Propa.Lambda.Term
|
||||
Propa.Prolog.Debug
|
||||
Propa.Prolog.Display
|
||||
Propa.Prolog.Example
|
||||
Propa.Prolog.Parse
|
||||
|
|
|
|||
18
src/Propa/Prolog/Debug.hs
Normal file
18
src/Propa/Prolog/Debug.hs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module Propa.Prolog.Debug
|
||||
( parseAndRun
|
||||
) where
|
||||
|
||||
import qualified Data.Text as T
|
||||
import qualified Data.Text.IO as T
|
||||
|
||||
import Propa.Prolog.Display
|
||||
import Propa.Prolog.Parse
|
||||
import Propa.Prolog.Unify
|
||||
|
||||
parseAndRun :: T.Text -> T.Text -> IO ()
|
||||
parseAndRun dbText termsText = T.putStrLn $ either id id $ do
|
||||
db <- parseDb "<input>" dbText
|
||||
terms <- parseTerms "<input>" termsText
|
||||
pure $ T.intercalate "\n" $ map displayResult $ run db terms
|
||||
Loading…
Add table
Add a link
Reference in a new issue