summaryrefslogtreecommitdiff
path: root/src/Control/Funflow/ContentHashable.hs
diff options
context:
space:
mode:
authornclarke <>2019-10-09 08:30:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2019-10-09 08:30:00 (GMT)
commit31eaf2c2a3b07a6553aef61572aa685426d9f5c2 (patch)
tree0b6efd77935436a69661949149e6f7534abe8a95 /src/Control/Funflow/ContentHashable.hs
parent3ceb65118bcf26cd628c9e0a0aba32cde5e9b4bf (diff)
version 1.5.01.5.0
Diffstat (limited to 'src/Control/Funflow/ContentHashable.hs')
-rw-r--r--src/Control/Funflow/ContentHashable.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Control/Funflow/ContentHashable.hs b/src/Control/Funflow/ContentHashable.hs
index 6fb41fa..53a6aca 100644
--- a/src/Control/Funflow/ContentHashable.hs
+++ b/src/Control/Funflow/ContentHashable.hs
@@ -52,6 +52,7 @@ module Control.Funflow.ContentHashable
import Control.Exception.Safe (catchJust)
import Control.Funflow.Orphans ()
import Control.Monad (foldM, mzero, (>=>))
+import Control.Monad.IO.Class (MonadIO, liftIO)
import Crypto.Hash (Context, Digest, SHA256,
digestFromByteString,
hashFinalize, hashInit,
@@ -459,9 +460,9 @@ instance ContentHashable IO FileContent where
-- The path to the directory is ignored.
newtype DirectoryContent = DirectoryContent (Path.Path Path.Abs Path.Dir)
-instance ContentHashable IO DirectoryContent where
+instance MonadIO m => ContentHashable m DirectoryContent where
- contentHashUpdate ctx0 (DirectoryContent dir0) = do
+ contentHashUpdate ctx0 (DirectoryContent dir0) = liftIO $ do
(dirs, files) <- Path.IO.listDir dir0
ctx' <- foldM hashFile ctx0 (sort files)
foldM hashDir ctx' (sort dirs)