From b8216c9557b34e24d259da833545c5557b5947eb Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 2 Aug 2018 13:53:36 -0400 Subject: [PATCH] Define parseModule locally to parsePackage. --- src/Semantic/Graph.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Semantic/Graph.hs b/src/Semantic/Graph.hs index d91792d00..8db4fcdbd 100644 --- a/src/Semantic/Graph.hs +++ b/src/Semantic/Graph.hs @@ -227,13 +227,13 @@ parsePackage parser project = do parseModules :: (Member Distribute effs, Member (Exc SomeException) effs, Member Task effs) => Parser term -> Project -> Eff effs [Module term] parseModules parser p@Project{..} = distributeFor (projectFiles p) (parseModule p parser) --- | Parse a file into a 'Module'. -parseModule :: (Member (Exc SomeException) effs, Member Task effs) => Project -> Parser term -> File -> Eff effs (Module term) -parseModule proj parser file = do - mBlob <- readFile proj file - case mBlob of - Just blob -> moduleForBlob (Just (projectRootDir proj)) blob <$> parse parser blob - Nothing -> throwError (SomeException (FileNotFound (filePath file))) + -- | Parse a file into a 'Module'. + parseModule :: (Member (Exc SomeException) effs, Member Task effs) => Project -> Parser term -> File -> Eff effs (Module term) + parseModule proj parser file = do + mBlob <- readFile proj file + case mBlob of + Just blob -> moduleForBlob (Just (projectRootDir proj)) blob <$> parse parser blob + Nothing -> throwError (SomeException (FileNotFound (filePath file))) withTermSpans :: ( HasField fields Span , Member (Reader Span) effects