Safe Haskell | None |
---|---|
Language | GHC2021 |
Effectful.FileSystem.FileWriter.Dynamic
Description
Provides a dynamic effect for writing files.
Since: 0.1
Synopsis
- data FileWriter (a :: Type -> Type) b where
- WriteBinaryFile :: forall (a :: Type -> Type). OsPath -> ByteString -> FileWriter a ()
- AppendBinaryFile :: forall (a :: Type -> Type). OsPath -> ByteString -> FileWriter a ()
- 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 where Source #
Dynamic effect for reading files.
Since: 0.1
Constructors
WriteBinaryFile :: forall (a :: Type -> Type). OsPath -> ByteString -> FileWriter a () | |
AppendBinaryFile :: forall (a :: Type -> Type). OsPath -> ByteString -> FileWriter a () |
Instances
ShowEffect FileWriter Source # | Since: 0.1 |
Defined in Effectful.FileSystem.FileWriter.Dynamic Methods showEffectCons :: forall (m :: Type -> Type) a. FileWriter m a -> String Source # | |
type DispatchOf FileWriter Source # | Since: 0.1 |
Defined in Effectful.FileSystem.FileWriter.Dynamic |
writeBinaryFile :: forall (es :: [Effect]). (FileWriter :> es, HasCallStack) => OsPath -> ByteString -> Eff es () Source #
Since: 0.1
appendBinaryFile :: forall (es :: [Effect]). (FileWriter :> es, HasCallStack) => OsPath -> ByteString -> Eff es () Source #
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 to a file.
Since: 0.1
appendFileUtf8 :: forall (es :: [Effect]). (FileWriter :> es, HasCallStack) => OsPath -> Text -> Eff es () Source #
Appends to a file.
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
.