1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 08:25:19 +03:00

Pathtype comes with a shim for withBinaryFile.

This commit is contained in:
Patrick Thomson 2019-10-08 18:57:28 -04:00
parent 4110353b63
commit c12eca0c00

View File

@ -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