fs-effectful
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
PrintfArg Text #

Since: text-1.2.2.0

Instance details

Defined in Data.Text

Binary Text #

Since: text-1.2.1.0

Instance details

Defined in Data.Text

Methods

put :: Text -> Put #

get :: Get Text #

putList :: [Text] -> Put #

NFData Text # 
Instance details

Defined in Data.Text

Methods

rnf :: Text -> () #

Monoid Text # 
Instance details

Defined in Data.Text

Methods

mempty :: Text #

mappend :: Text -> Text -> Text #

mconcat :: [Text] -> Text #

Semigroup Text #

Beware: stimes will crash if the given number does not fit into an Int.

Since: text-1.2.2.0

Instance details

Defined in Data.Text

Methods

(<>) :: Text -> Text -> Text #

sconcat :: NonEmpty Text -> Text #

stimes :: Integral b => b -> Text -> Text #

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 Data.Set.Set and Data.Map.Map. If you feel a mistake has been made, please feel free to submit improvements.

The original discussion is archived here: could we get a Data instance for Data.Text.Text?

The followup discussion that changed the behavior of Set and Map is archived here: Proposal: Allow gunfold for Data.Map, ...

Instance details

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 #

toConstr :: Text -> Constr #

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:

>>> :set -XOverloadedStrings
>>> "\55555" :: Text
"\65533"
Instance details

Defined in Data.Text

Methods

fromString :: String -> Text #

IsList Text #

Performs replacement on invalid scalar values:

>>> :set -XOverloadedLists
>>> ['\55555'] :: Text
"\65533"

Since: text-1.2.0.0

Instance details

Defined in Data.Text

Associated Types

type Item Text 
Instance details

Defined in Data.Text

type Item Text = Char

Methods

fromList :: [Item Text] -> Text #

fromListN :: Int -> [Item Text] -> Text #

toList :: Text -> [Item Text] #

Read Text # 
Instance details

Defined in Data.Text

Show Text # 
Instance details

Defined in Data.Text.Show

Methods

showsPrec :: Int -> Text -> ShowS #

show :: Text -> String #

showList :: [Text] -> ShowS #

Eq Text # 
Instance details

Defined in Data.Text

Methods

(==) :: Text -> Text -> Bool #

(/=) :: Text -> Text -> Bool #

Ord Text # 
Instance details

Defined in Data.Text

Methods

compare :: Text -> Text -> Ordering #

(<) :: Text -> Text -> Bool #

(<=) :: Text -> Text -> Bool #

(>) :: Text -> Text -> Bool #

(>=) :: Text -> Text -> Bool #

max :: Text -> Text -> Text #

min :: Text -> Text -> Text #

Lift Text #

Since: text-1.2.4.0

Instance details

Defined in Data.Text

Methods

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

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

type Item Text # 
Instance details

Defined in Data.Text

type Item Text = Char