aboutsummaryrefslogtreecommitdiff
path: root/Utility/TempFile.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-01-21 02:24:12 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-01-21 02:49:32 -0400
commit183bdacca219065e6a888385e3bf309708e827ec (patch)
tree6ee1c6ba8b75de8b182fd969b612a8557f72360c /Utility/TempFile.hs
parenteb9001044f3db682236d1007aded58f47109d6a6 (diff)
treak
Diffstat (limited to 'Utility/TempFile.hs')
-rw-r--r--Utility/TempFile.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Utility/TempFile.hs b/Utility/TempFile.hs
index 3887b422b..469d52e8c 100644
--- a/Utility/TempFile.hs
+++ b/Utility/TempFile.hs
@@ -26,8 +26,10 @@ viaTmp a file content = do
a tmpfile content
renameFile tmpfile file
+type Template = String
+
{- Runs an action with a temp file, then removes the file. -}
-withTempFile :: String -> (FilePath -> Handle -> IO a) -> IO a
+withTempFile :: Template -> (FilePath -> Handle -> IO a) -> IO a
withTempFile template a = bracket create remove use
where
create = do