Safe Haskell | None |
---|---|
Language | GHC2021 |
Effects.FileSystem.FileWriter
Contents
Description
Provides the MonadFileWriter effect.
Since: 0.1
Synopsis
- class Monad m => MonadFileWriter (m :: Type -> Type) where
- writeBinaryFile :: OsPath -> ByteString -> m ()
- appendBinaryFile :: OsPath -> ByteString -> m ()
- type OsPath = OsString
- writeFileUtf8 :: (HasCallStack, MonadFileWriter m) => OsPath -> Text -> m ()
- appendFileUtf8 :: (HasCallStack, MonadFileWriter m) => OsPath -> Text -> m ()
- encodeUtf8 :: Text -> ByteString
- data ByteString
- data Text
Effect
class Monad m => MonadFileWriter (m :: Type -> Type) where Source #
Represents file-system writer effects.
Since: 0.1
Methods
writeBinaryFile :: OsPath -> ByteString -> m () Source #
Writes to a file.
Since: 0.1
appendBinaryFile :: OsPath -> ByteString -> m () Source #
Appends to a file.
Since: 0.1
Instances
MonadFileWriter IO Source # | Since: 0.1 |
Defined in Effects.FileSystem.FileWriter Methods writeBinaryFile :: OsPath -> ByteString -> IO () Source # appendBinaryFile :: OsPath -> ByteString -> IO () Source # | |
MonadFileWriter m => MonadFileWriter (ReaderT env m) Source # | Since: 0.1 |
Defined in Effects.FileSystem.FileWriter Methods writeBinaryFile :: OsPath -> ByteString -> ReaderT env m () Source # appendBinaryFile :: OsPath -> ByteString -> ReaderT env m () Source # |
Type representing filenames/pathnames.
This type doesn't add any guarantees over OsString
.
UTF-8 Utils
writeFileUtf8 :: (HasCallStack, MonadFileWriter m) => OsPath -> Text -> m () Source #
Writes to a file as UTF-8.
Since: 0.1
appendFileUtf8 :: (HasCallStack, MonadFileWriter m) => OsPath -> Text -> m () Source #
Appends to a file as UTF-8.
Since: 0.1
encodeUtf8 :: Text -> ByteString #
Encode text using UTF-8 encoding.
Reexports
data ByteString #
A space-efficient representation of a Word8
vector, supporting many
efficient operations.
A ByteString
contains 8-bit bytes, or by using the operations from
Data.ByteString.Char8 it can be interpreted as containing 8-bit
characters.