acid-state- Add ACID guarantees to any serializable Haskell data structure.

Safe HaskellNone




type Entry = ByteString Source #

A bytestring that represents an entry in an archive.

data Entries Source #

Result of unpacking an archive. This is essentially a list of Entry, but may terminate in Fail if the archive format is incorrect.


Next Entry Entries 
Fail String 
Show Entries Source # 
Instance details

Defined in Data.Acid.Archive

entriesToList :: Entries -> [Entry] Source #

Convert Entries to a normal list, calling error if there was a failure in unpacking the archive.

entriesToListNoFail :: Entries -> [Entry] Source #

Convert Entries to a normal list, silently ignoring a failure to unpack the archive and instead returning a truncated list.

data Archiver Source #

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)) == xs

Moreover, 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)




defaultArchiver :: Archiver Source #

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 |