A bytestring that represents an entry in an archive.
Moduleacid-state-0.16.1.4Haskell2010
Data.Acid.Archive
- 3 types
- 6 values
- Packageacid-state-0.16.1.4
- Exports9
- LanguageHaskell2010
- LicenceLicenseRef-PublicDomain
- SourceArchive.hs
Convert Entries to a normal list, silently ignoring a failure to unpack the archive and instead returning a truncated list.
Interface for the lowest level of the serialisation layer, which handles packing lists of Entry elements (essentially just bytestrings) into a single bytestring, perhaps with error-checking.
Any Archiver{archiveWrite, archiveRead} must satisfy the
round-trip property:
forall xs . entriesToList (archiveRead (archiveWrite xs)) == xsMoreover, archiveWrite must be a monoid homomorphism, so that concatenating archives is equivalent to concatenating the lists of entries that they represent:
archiveWrite [] == empty
forall xs ys . archiveWrite xs <> archiveWrite ys == archiveWrite (xs ++ ys)Constructors
ArchiverarchiveWrite :: [Entry] -> ByteStringPack a list of entries into a bytestring.
archiveRead :: ByteString -> EntriesUnpack a bytestring as a list of Entries, including the possibility of failure if the format is invalid.
Standard (and historically the only) implementation of the Archiver interface. This represents each entry in the following format:
| entry length | crc16 | entry |
| 8 bytes | 2 bytes | n bytes |