| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Effectful.FileSystem.File.OsPath
Description
Lifted System.File.OsPath.
Synopsis
- data FileSystem :: Effect
- runFileSystem :: (HasCallStack, IOE :> es) => Eff (FileSystem : es) a -> Eff es a
- data IOMode
- data Handle
- openBinaryFile :: FileSystem :> es => OsPath -> IOMode -> Eff es Handle
- withFile :: FileSystem :> es => OsPath -> IOMode -> (Handle -> Eff es a) -> Eff es a
- withBinaryFile :: FileSystem :> es => OsPath -> IOMode -> (Handle -> Eff es a) -> Eff es a
- withFile' :: FileSystem :> es => OsPath -> IOMode -> (Handle -> Eff es a) -> Eff es a
- withBinaryFile' :: FileSystem :> es => OsPath -> IOMode -> (Handle -> Eff es a) -> Eff es a
- readFile :: FileSystem :> es => OsPath -> Eff es ByteString
- readFile' :: FileSystem :> es => OsPath -> Eff es ByteString
- writeFile :: FileSystem :> es => OsPath -> ByteString -> Eff es ()
- writeFile' :: FileSystem :> es => OsPath -> ByteString -> Eff es ()
- appendFile :: FileSystem :> es => OsPath -> ByteString -> Eff es ()
- appendFile' :: FileSystem :> es => OsPath -> ByteString -> Eff es ()
- openFile :: FileSystem :> es => OsPath -> IOMode -> Eff es Handle
- openExistingFile :: FileSystem :> es => OsPath -> IOMode -> Eff es Handle
- openTempFile :: FileSystem :> es => OsPath -> OsString -> Eff es (OsPath, Handle)
- openBinaryTempFile :: FileSystem :> es => OsPath -> OsString -> Eff es (OsPath, Handle)
- openTempFileWithDefaultPermissions :: FileSystem :> es => OsPath -> OsString -> Eff es (OsPath, Handle)
- openBinaryTempFileWithDefaultPermissions :: FileSystem :> es => OsPath -> OsString -> Eff es (OsPath, Handle)
Effect
data FileSystem :: Effect Source #
An effect for interacting with the filesystem.
Instances
| type DispatchOf FileSystem Source # | |
Defined in Effectful.FileSystem.Effect type DispatchOf FileSystem = 'Static 'WithSideEffects | |
| data StaticRep FileSystem Source # | |
Defined in Effectful.FileSystem.Effect | |
Handlers
runFileSystem :: (HasCallStack, IOE :> es) => Eff (FileSystem : es) a -> Eff es a Source #
Run the FileSystem effect.
Files
See openFile
Constructors
| ReadMode | |
| WriteMode | |
| AppendMode | |
| ReadWriteMode |
Haskell defines operations to read and write characters from and to files,
represented by values of type Handle. Each value of this type is a
handle: a record used by the Haskell run-time system to manage I/O
with file system objects. A handle has at least the following properties:
- whether it manages input or output or both;
- whether it is open, closed or semi-closed;
- whether the object is seekable;
- whether buffering is disabled, or enabled on a line or block basis;
- a buffer (whose length may be zero).
Most handles will also have a current I/O position indicating where the next
input or output operation will occur. A handle is readable if it
manages only input or both input and output; likewise, it is writable if
it manages only output or both input and output. A handle is open when
first allocated.
Once it is closed it can no longer be used for either input or output,
though an implementation cannot re-use its storage while references
remain to it. Handles are in the Show and Eq classes. The string
produced by showing a handle is system dependent; it should include
enough information to identify the handle for debugging. A handle is
equal according to == only to itself; no attempt
is made to compare the internal state of different handles for equality.
Instances
openBinaryFile :: FileSystem :> es => OsPath -> IOMode -> Eff es Handle Source #
Lifted openBinaryFile.
withFile :: FileSystem :> es => OsPath -> IOMode -> (Handle -> Eff es a) -> Eff es a Source #
Lifted withFile.
withBinaryFile :: FileSystem :> es => OsPath -> IOMode -> (Handle -> Eff es a) -> Eff es a Source #
Lifted withBinaryFile.
withFile' :: FileSystem :> es => OsPath -> IOMode -> (Handle -> Eff es a) -> Eff es a Source #
Lifted withFile'.
withBinaryFile' :: FileSystem :> es => OsPath -> IOMode -> (Handle -> Eff es a) -> Eff es a Source #
Lifted withBinaryFile'.
readFile :: FileSystem :> es => OsPath -> Eff es ByteString Source #
Lifted readFile.
readFile' :: FileSystem :> es => OsPath -> Eff es ByteString Source #
Lifted readFile'.
writeFile :: FileSystem :> es => OsPath -> ByteString -> Eff es () Source #
Lifted writeFile.
writeFile' :: FileSystem :> es => OsPath -> ByteString -> Eff es () Source #
Lifted writeFile'.
appendFile :: FileSystem :> es => OsPath -> ByteString -> Eff es () Source #
Lifted appendFile.
appendFile' :: FileSystem :> es => OsPath -> ByteString -> Eff es () Source #
Lifted appendFile'.
openExistingFile :: FileSystem :> es => OsPath -> IOMode -> Eff es Handle Source #
Lifted openExistingFile.
openTempFile :: FileSystem :> es => OsPath -> OsString -> Eff es (OsPath, Handle) Source #
Lifted openTempFile.
openBinaryTempFile :: FileSystem :> es => OsPath -> OsString -> Eff es (OsPath, Handle) Source #
Lifted openBinaryTempFile.
openTempFileWithDefaultPermissions :: FileSystem :> es => OsPath -> OsString -> Eff es (OsPath, Handle) Source #
Lifted openTempFileWithDefaultPermissions.
openBinaryTempFileWithDefaultPermissions :: FileSystem :> es => OsPath -> OsString -> Eff es (OsPath, Handle) Source #
Lifted openBinaryTempFileWithDefaultPermissions.