@@ -200,6 +200,7 @@ import qualified Dhall.Map
200
200
import qualified Dhall.Parser
201
201
import qualified Dhall.Pretty.Internal
202
202
import qualified Dhall.TypeCheck
203
+ import qualified System.AtomicWrite.Writer.ByteString
203
204
import qualified System.Environment
204
205
import qualified System.Info
205
206
import qualified System.IO
@@ -554,7 +555,7 @@ writeToSemanticCache :: Dhall.Crypto.SHA256Digest -> Data.ByteString.ByteString
554
555
writeToSemanticCache hash bytes = do
555
556
_ <- Maybe. runMaybeT $ do
556
557
cacheFile <- getCacheFile " dhall" hash
557
- liftIO (Data. ByteString.writeFile cacheFile bytes)
558
+ liftIO (System.AtomicWrite.Writer. ByteString.atomicWriteFile cacheFile bytes)
558
559
return ()
559
560
560
561
-- Check the "semi-semantic" disk cache, otherwise typecheck and normalise from
@@ -669,7 +670,7 @@ writeToSemisemanticCache :: Dhall.Crypto.SHA256Digest -> Data.ByteString.ByteStr
669
670
writeToSemisemanticCache semisemanticHash bytes = do
670
671
_ <- Maybe. runMaybeT $ do
671
672
cacheFile <- getCacheFile " dhall-haskell" semisemanticHash
672
- liftIO (Data. ByteString.writeFile cacheFile bytes)
673
+ liftIO (System.AtomicWrite.Writer. ByteString.atomicWriteFile cacheFile bytes)
673
674
return ()
674
675
675
676
-- Fetch source code directly from disk/network
0 commit comments