| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
HashAddressed.Directory
Contents
Synopsis
- data ContentAddressedDirectory
- init :: HashFunction -> FilePath -> ContentAddressedDirectory
- writeLazy :: ContentAddressedDirectory -> ByteString -> IO WriteResult
- writeStreaming :: ContentAddressedDirectory -> (forall m. MonadIO m => (ByteString -> m ()) -> m ()) -> IO WriteResult
- writeEither :: ContentAddressedDirectory -> (forall m. MonadIO m => (ByteString -> m ()) -> m (Either bad good)) -> IO (Either bad (good, WriteResult))
- data WriteResult = WriteResult {}
- data WriteType
Type
Arguments
| :: HashFunction | Which hash function to use |
| -> FilePath | Directory where content-addressed files are stored |
| -> ContentAddressedDirectory |
Specification of a content-addressed directory
Write operations
Arguments
| :: ContentAddressedDirectory | The content-addressed file store to write to; see |
| -> ByteString | The content to write to the store |
| -> IO WriteResult | The file path where the contents of the lazy byte string now reside. This path includes the store directory. |
Write a lazy byte string to a content-addressed directory
This is a simplified variant of writeStreaming.
Arguments
| :: ContentAddressedDirectory | The content-addressed file store to write to; see |
| -> (forall m. MonadIO m => (ByteString -> m ()) -> m ()) | Monadic action which is allowed to emit |
| -> IO WriteResult |
Write a stream of strict byte strings to a content-addressed directory
This is a simplified variant of writeEither.
Arguments
| :: ContentAddressedDirectory | The content-addressed file store to write to; see |
| -> (forall m. MonadIO m => (ByteString -> m ()) -> m (Either bad good)) | Monadic action which is allowed to emit |
| -> IO (Either bad (good, WriteResult)) |
Write a stream of strict byte strings to a content-addressed directory
data WriteResult Source #
Constructors
| WriteResult | |
Fields
| |
Constructors
| AlreadyPresent | |
| NewContent |