diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-01-06 18:33:00 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-01-06 18:33:00 +0100 |
commit | bbc2631c76db01e85ac5c4e75b1babb6c5b05697 (patch) | |
tree | 331dda3a0f45efee866db2a03fb5aa2858e826a8 /src/Hakyll/Core/Store.hs | |
parent | e477ea753b59657ba8d185986c646cc45c66fcec (diff) | |
download | hakyll-bbc2631c76db01e85ac5c4e75b1babb6c5b05697.tar.gz |
Add TmpFile utilities
Diffstat (limited to 'src/Hakyll/Core/Store.hs')
-rw-r--r-- | src/Hakyll/Core/Store.hs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/Hakyll/Core/Store.hs b/src/Hakyll/Core/Store.hs index 231da2a..63dd64c 100644 --- a/src/Hakyll/Core/Store.hs +++ b/src/Hakyll/Core/Store.hs @@ -9,6 +9,7 @@ module Hakyll.Core.Store , set , get , delete + , hash ) where @@ -144,12 +145,13 @@ delete store identifier = do -------------------------------------------------------------------------------- -hash :: [String] -> String -hash = concatMap (printf "%02x") . B.unpack . - MD5.hash . T.encodeUtf8 . T.pack . intercalate "/" - - --------------------------------------------------------------------------------- -- | Delete a file unless it doesn't exist... deleteFile :: FilePath -> IO () deleteFile = handle (\(_ :: IOException) -> return ()) . removeFile + + +-------------------------------------------------------------------------------- +-- | Mostly meant for internal usage +hash :: [String] -> String +hash = concatMap (printf "%02x") . B.unpack . + MD5.hash . T.encodeUtf8 . T.pack . intercalate "/" |