Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data SnapshotStore a = SnapshotStore {
- ssWriteSnapshot :: UUID -> Snapshot a -> IO ()
- ssReadSnapshot :: UUID -> IO (Maybe (Snapshot a))
- applyPrism :: (a -> b, b -> Maybe a) -> SnapshotStore b -> SnapshotStore a
- nullSnapshotStore :: SnapshotStore a
Documentation
data SnapshotStore a Source
A snapshot store is used for storing snapshots.
SnapshotStore | |
|
applyPrism :: (a -> b, b -> Maybe a) -> SnapshotStore b -> SnapshotStore a Source
Transform an implementation of 'SnapshotStore a' to an
implementation of 'SnapshotStore b' via a prism. This is typically
used to add serialization/deserialization to snapshot stores which
do not support storing anything other than binary data. Note that
the prism is allowed to return Nothing
to indicate that data could
not be transformed. This can be used to avoid the need for complicated
versioning of snapshot data by using simple version tags/hashes to
determine compatibility with stored snapshots.
nullSnapshotStore :: SnapshotStore a Source
The "null" snapshot store, i.e. a snapshot store which never actually stores any snapshots.