From 5887ba194fad3c7c4319737164c60045f3b565d3 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 8 Mar 2018 12:50:00 -0500 Subject: [PATCH] Generalize the parser helper over the parser. --- src/Semantic/Util.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Semantic/Util.hs b/src/Semantic/Util.hs index 25436b209..b6a06fd97 100644 --- a/src/Semantic/Util.hs +++ b/src/Semantic/Util.hs @@ -54,13 +54,13 @@ type PythonTracer = TracingAnalysis [] (Evaluating Python.Term PythonValue (Dead evaluateDeadTracePythonFile path = run @(DeadCodeAnalysis PythonTracer) . evaluateModule <$> (file path >>= runTask . parse pythonParser) -evaluatePythonFile path = evaluate @PythonValue . snd <$> parsePythonFile path +evaluatePythonFile path = evaluate @PythonValue . snd <$> parseFile pythonParser path evaluatePythonFiles paths = do - pair:pairs <- traverse parsePythonFile paths + pair:pairs <- traverse (parseFile pythonParser) paths pure $ evaluates @PythonValue pairs pair -parsePythonFile path = runTask (file path >>= fmap . (,) <*> parse pythonParser) +parseFile parser path = runTask (file path >>= fmap . (,) <*> parse parser) -- Diff helpers