writeTempFile :: String -- ^ Content
  -> FilePath -- ^ Directory in which to create the file
  -> String   -- ^ File name template
  -> IO FilePath -- ^ create file
writeTempFile str tmpDir file = do
  (tmpFile, hdl) <- openTempFile tmpDir file
  hPutStr hdl str
  hFlush hdl
  hClose hdl
  return tmpFile

-- | create file in temporary directory (the first argument is the content)
writeTempFile :: String -- ^ Content
  -> FilePath -- ^ Directory in which to create the file
  -> String   -- ^ File name template
  -> IO FilePath
writeTempFile str tmpDir file = do
  (tmpFile, hdl) <- openTempFile tmpDir file
  hPutStr hdl str
  hFlush hdl
  hClose hdl
  return tmpFile

-- | create file in temporary directory (the first argument is the content)
writeTempFile str tmpDir file = do
  (tmpFile, hdl) <- openTempFile tmpDir file
  hPutStr hdl str
  hFlush hdl
  hClose hdl
  return tmpFile

-- | create file in temporary directory (the first argument is the content)