| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Effectful.FileSystem.FileWriter.Static
Description
Provides a static effect for writing files.
Since: 0.1
Synopsis
- data FileWriter (a :: Type -> Type) b
- writeBinaryFile :: forall (es :: [Effect]). (FileWriter :> es, HasCallStack) => OsPath -> ByteString -> Eff es ()
- appendBinaryFile :: forall (es :: [Effect]). (FileWriter :> es, HasCallStack) => OsPath -> ByteString -> Eff es ()
- runFileWriter :: forall (es :: [Effect]) a. (HasCallStack, IOE :> es) => Eff (FileWriter ': es) a -> Eff es a
- writeFileUtf8 :: forall (es :: [Effect]). (FileWriter :> es, HasCallStack) => OsPath -> Text -> Eff es ()
- appendFileUtf8 :: forall (es :: [Effect]). (FileWriter :> es, HasCallStack) => OsPath -> Text -> Eff es ()
- data ByteString
- type OsPath = OsString
- data Text
Effect
data FileWriter (a :: Type -> Type) b Source #
Static effect for reading files.
Since: 0.1
Instances
| type DispatchOf FileWriter Source # | |
Defined in Effectful.FileSystem.FileWriter.Static | |
| data StaticRep FileWriter Source # | |
Defined in Effectful.FileSystem.FileWriter.Static | |
writeBinaryFile :: forall (es :: [Effect]). (FileWriter :> es, HasCallStack) => OsPath -> ByteString -> Eff es () Source #
Writes a ByteString to a file.
Since: 0.1
appendBinaryFile :: forall (es :: [Effect]). (FileWriter :> es, HasCallStack) => OsPath -> ByteString -> Eff es () Source #
Appends a ByteString to a file.
Since: 0.1
Handlers
runFileWriter :: forall (es :: [Effect]) a. (HasCallStack, IOE :> es) => Eff (FileWriter ': es) a -> Eff es a Source #
Runs FileWriter in IO.
Since: 0.1
UTF-8 Utils
writeFileUtf8 :: forall (es :: [Effect]). (FileWriter :> es, HasCallStack) => OsPath -> Text -> Eff es () Source #
Writes the Text to the file, encoding as UTF-8.
Since: 0.1
appendFileUtf8 :: forall (es :: [Effect]). (FileWriter :> es, HasCallStack) => OsPath -> Text -> Eff es () Source #
Appends the Text to the file, encoding as UTF-8.
Since: 0.1
Re-exports
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.
Instances
Type representing filenames/pathnames.
This type doesn't add any guarantees over OsString.