From c12eca0c0023659065e9eb24fb4d7ab9f404a6b0 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Tue, 8 Oct 2019 18:57:28 -0400 Subject: [PATCH] Pathtype comes with a shim for withBinaryFile. --- src/Semantic/Task/Files.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Semantic/Task/Files.hs b/src/Semantic/Task/Files.hs index 3686234e6..16e0e63b8 100644 --- a/src/Semantic/Task/Files.hs +++ b/src/Semantic/Task/Files.hs @@ -30,7 +30,8 @@ import Prelude hiding (readFile) import Prologue hiding (catch) import qualified Semantic.Git as Git import Semantic.IO -import qualified System.IO as IO +import qualified System.IO as IO hiding (withBinaryFile) +import qualified System.Path.IO as IO (withBinaryFile) import qualified System.Path as Path data Source blob where @@ -91,7 +92,7 @@ instance (Member (Error SomeException) sig, Member Catch sig, MonadIO m, Carrier Read (FromPairHandle handle) k -> rethrowing (readBlobPairsFromHandle handle) >>= k ReadProject rootDir dir language excludeDirs k -> rethrowing (readProjectFromPaths rootDir dir language excludeDirs) >>= k FindFiles dir exts excludeDirs k -> rethrowing (findFilesInDir dir exts excludeDirs) >>= k - Write (ToPath path) builder k -> rethrowing (liftIO (IO.withBinaryFile (Path.toString path) IO.WriteMode (`B.hPutBuilder` builder))) >> k + Write (ToPath path) builder k -> rethrowing (liftIO (IO.withBinaryFile path IO.WriteMode (`B.hPutBuilder` builder))) >> k Write (ToHandle (WriteHandle handle)) builder k -> rethrowing (liftIO (B.hPutBuilder handle builder)) >> k readBlob :: (Member Files sig, Carrier sig m) => File -> m Blob