effects-fs
Safe HaskellNone
LanguageGHC2021

Effects.FileSystem.FileWriter

Description

Provides the MonadFileWriter effect.

Since: 0.1

Synopsis

Effect

class Monad m => MonadFileWriter (m :: Type -> Type) where Source #

Represents file-system writer effects.

Since: 0.1

Methods

writeBinaryFile :: OsPath -> ByteString -> m () Source #

Writes to a file.

Since: 0.1

appendBinaryFile :: OsPath -> ByteString -> m () Source #

Appends to a file.

Since: 0.1

Instances

Instances details
MonadFileWriter IO Source #

Since: 0.1

Instance details

Defined in Effects.FileSystem.FileWriter

MonadFileWriter m => MonadFileWriter (ReaderT env m) Source #

Since: 0.1

Instance details

Defined in Effects.FileSystem.FileWriter

type OsPath = OsString #

Type representing filenames/pathnames.

This type doesn't add any guarantees over OsString.

UTF-8 Utils

writeFileUtf8 :: (HasCallStack, MonadFileWriter m) => OsPath -> Text -> m () Source #

Writes to a file as UTF-8.

Since: 0.1

appendFileUtf8 :: (HasCallStack, MonadFileWriter m) => OsPath -> Text -> m () Source #

Appends to a file as UTF-8.

Since: 0.1

encodeUtf8 :: Text -> ByteString #

Encode text using UTF-8 encoding.

Reexports

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

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