module System.AtomicWrite.Writer.Text (atomicWriteFile, atomicWriteFileWithMode) where
import System.AtomicWrite.Internal (atomicWriteFileMaybeModeText)
import Data.Text (Text)
import Data.Text.IO (hPutStr)
import System.Posix.Types (FileMode)
atomicWriteFile ::
FilePath
-> Text
-> IO ()
atomicWriteFile :: FilePath -> Text -> IO ()
atomicWriteFile =
Maybe FileMode -> FilePath -> Text -> IO ()
atomicWriteFileMaybeMode Maybe FileMode
forall a. Maybe a
Nothing
atomicWriteFileWithMode ::
FileMode
-> FilePath
-> Text
-> IO ()
atomicWriteFileWithMode :: FileMode -> FilePath -> Text -> IO ()
atomicWriteFileWithMode =
Maybe FileMode -> FilePath -> Text -> IO ()
atomicWriteFileMaybeMode (Maybe FileMode -> FilePath -> Text -> IO ())
-> (FileMode -> Maybe FileMode)
-> FileMode
-> FilePath
-> Text
-> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FileMode -> Maybe FileMode
forall a. a -> Maybe a
Just
atomicWriteFileMaybeMode ::
Maybe FileMode
-> FilePath
-> Text
-> IO ()
atomicWriteFileMaybeMode :: Maybe FileMode -> FilePath -> Text -> IO ()
atomicWriteFileMaybeMode Maybe FileMode
mmode FilePath
path = Maybe FileMode
-> FilePath -> (Handle -> Text -> IO ()) -> Text -> IO ()
forall a.
Maybe FileMode -> FilePath -> (Handle -> a -> IO ()) -> a -> IO ()
atomicWriteFileMaybeModeText Maybe FileMode
mmode FilePath
path Handle -> Text -> IO ()
hPutStr