| 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.
A space efficient, packed, unboxed Unicode text type.
Instances
| PrintfArg Text # | Since: text-1.2.2.0 |
Defined in Data.Text | |
| Binary Text # | Since: text-1.2.1.0 |
| NFData Text # | |
| Monoid Text # | |
| Semigroup Text # | Beware: Since: text-1.2.2.0 |
| Data Text # | This instance preserves data abstraction at the cost of inefficiency. We omit reflection services for the sake of data abstraction. This instance was created by copying the updated behavior of
The original discussion is archived here: could we get a Data instance for Data.Text.Text? The followup discussion that changed the behavior of |
Defined in Data.Text Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Text -> c Text # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Text # dataTypeOf :: Text -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Text) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Text) # gmapT :: (forall b. Data b => b -> b) -> Text -> Text # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Text -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Text -> r # gmapQ :: (forall d. Data d => d -> u) -> Text -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Text -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Text -> m Text # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Text -> m Text # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Text -> m Text # | |
| IsString Text # | Performs replacement on invalid scalar values:
|
Defined in Data.Text Methods fromString :: String -> Text # | |
| IsList Text # | Performs replacement on invalid scalar values:
Since: text-1.2.0.0 |
| Read Text # | |
| Show Text # | |
| Eq Text # | |
| Ord Text # | |
| Lift Text # | Since: text-1.2.4.0 |
| type Item Text # | |