fs-effectful-0.1: FileSystem effects
Safe HaskellNone
LanguageGHC2021

Effectful.FileSystem.FileWriter.Dynamic

Description

Provides a dynamic effect for writing files.

Since: 0.1

Synopsis

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

Instances details
ShowEffect FileWriter Source #

Since: 0.1

Instance details

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

Instance details

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

Instances details
NFData ByteString 
Instance details

Defined in Data.ByteString.Internal.Type

Methods

rnf :: ByteString -> () #

Monoid ByteString 
Instance details

Defined in Data.ByteString.Internal.Type

Semigroup ByteString 
Instance details

Defined in Data.ByteString.Internal.Type

Data ByteString 
Instance details

Defined in Data.ByteString.Internal.Type

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ByteString -> c ByteString #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ByteString #

toConstr :: ByteString -> Constr #

dataTypeOf :: ByteString -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ByteString) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ByteString) #

gmapT :: (forall b. Data b => b -> b) -> ByteString -> ByteString #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ByteString -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ByteString -> r #

gmapQ :: (forall d. Data d => d -> u) -> ByteString -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ByteString -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ByteString -> m ByteString #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteString -> m ByteString #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteString -> m ByteString #

IsString ByteString

Beware: fromString truncates multi-byte characters to octets. e.g. "枯朶に烏のとまりけり秋の暮" becomes �6k�nh~�Q��n�

Instance details

Defined in Data.ByteString.Internal.Type

IsList ByteString

Since: bytestring-0.10.12.0

Instance details

Defined in Data.ByteString.Internal.Type

Associated Types

type Item ByteString 
Instance details

Defined in Data.ByteString.Internal.Type

Read ByteString 
Instance details

Defined in Data.ByteString.Internal.Type

Show ByteString 
Instance details

Defined in Data.ByteString.Internal.Type

Eq ByteString 
Instance details

Defined in Data.ByteString.Internal.Type

Ord ByteString 
Instance details

Defined in Data.ByteString.Internal.Type

Lift ByteString

Since: bytestring-0.11.2.0

Instance details

Defined in Data.ByteString.Internal.Type

Methods

lift :: Quote m => ByteString -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => ByteString -> Code m ByteString #

type Item ByteString 
Instance details

Defined in Data.ByteString.Internal.Type

type OsPath = OsString #

Type representing filenames/pathnames.

This type doesn't add any guarantees over OsString.

data Text #

A space efficient, packed, unboxed Unicode text type.

Instances

Instances details
type Item Text 
Instance details

Defined in Data.Text

type Item Text = Char