1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 23:11:50 +03:00

We don’t need to runReaderT inside the ReaderT.

This commit is contained in:
Rob Rix 2017-03-31 14:28:23 -04:00
parent 8647329cc7
commit f0c288ab43

View File

@ -72,7 +72,7 @@ fetchDiff :: Arguments -> FilePath -> IO (Both SourceBlob, SyntaxDiff Text '[Ran
fetchDiff args@Arguments{..} filepath = withRepository lgFactory gitDir $ do fetchDiff args@Arguments{..} filepath = withRepository lgFactory gitDir $ do
repo <- getRepository repo <- getRepository
for_ alternateObjectDirs (liftIO . odbBackendAddPath repo . toS) for_ alternateObjectDirs (liftIO . odbBackendAddPath repo . toS)
lift $ runReaderT (go args filepath) repo go args filepath
where where
go :: Arguments -> FilePath -> ReaderT LgRepo IO (Both SourceBlob, SyntaxDiff Text '[Range, Category, SourceSpan]) go :: Arguments -> FilePath -> ReaderT LgRepo IO (Both SourceBlob, SyntaxDiff Text '[Range, Category, SourceSpan])
go Arguments{..} filepath = do go Arguments{..} filepath = do
@ -90,7 +90,7 @@ pathsToDiff :: Arguments -> Both String -> IO [FilePath]
pathsToDiff Arguments{..} shas = withRepository lgFactory gitDir $ do pathsToDiff Arguments{..} shas = withRepository lgFactory gitDir $ do
repo <- getRepository repo <- getRepository
for_ alternateObjectDirs (liftIO . odbBackendAddPath repo . toS) for_ alternateObjectDirs (liftIO . odbBackendAddPath repo . toS)
lift $ runReaderT (go shas) repo go shas
where where
go :: Both String -> ReaderT LgRepo IO [FilePath] go :: Both String -> ReaderT LgRepo IO [FilePath]
go shas = do go shas = do