module Tonalude.Prelude.IO
( withLazyFile
, readFileBinary
, writeFileBinary
, readFileUtf8
, writeFileUtf8
, hPutBuilder
) where
import RIO hiding
( withLazyFile
, readFileBinary
, writeFileBinary
, readFileUtf8
, writeFileUtf8
, hPutBuilder
)
import qualified RIO
import qualified Data.ByteString as B ()
import qualified Data.ByteString.Lazy as BL
withLazyFile :: FilePath -> (BL.ByteString -> RIO env a) -> RIO env a
withLazyFile :: FilePath -> (ByteString -> RIO env a) -> RIO env a
withLazyFile = FilePath -> (ByteString -> RIO env a) -> RIO env a
forall (m :: * -> *) a.
MonadUnliftIO m =>
FilePath -> (ByteString -> m a) -> m a
RIO.withLazyFile
writeFileUtf8 :: FilePath -> Text -> RIO env ()
writeFileUtf8 :: FilePath -> Text -> RIO env ()
writeFileUtf8 = FilePath -> Text -> RIO env ()
forall (m :: * -> *). MonadIO m => FilePath -> Text -> m ()
RIO.writeFileUtf8
hPutBuilder :: Handle -> Builder -> RIO env ()
hPutBuilder :: Handle -> Builder -> RIO env ()
hPutBuilder = Handle -> Builder -> RIO env ()
forall (m :: * -> *). MonadIO m => Handle -> Builder -> m ()
RIO.hPutBuilder
readFileBinary :: FilePath -> RIO env ByteString
readFileBinary :: FilePath -> RIO env ByteString
readFileBinary = FilePath -> RIO env ByteString
forall (m :: * -> *). MonadIO m => FilePath -> m ByteString
RIO.readFileBinary
writeFileBinary :: FilePath -> ByteString -> RIO env ()
writeFileBinary :: FilePath -> ByteString -> RIO env ()
writeFileBinary = FilePath -> ByteString -> RIO env ()
forall (m :: * -> *). MonadIO m => FilePath -> ByteString -> m ()
RIO.writeFileBinary
readFileUtf8 :: FilePath -> RIO env Text
readFileUtf8 :: FilePath -> RIO env Text
readFileUtf8 = FilePath -> RIO env Text
forall (m :: * -> *). MonadIO m => FilePath -> m Text
RIO.readFileUtf8