serokell-util-0.1.2.4: General-purpose functions by Serokell

Safe HaskellNone
LanguageHaskell2010

Serokell.AcidState.Util

Description

Some useful functions to work with Data.Acid.

Synopsis

Documentation

Simple helpers

exceptStateToUpdateGeneric :: Exception exc => (e -> exc) -> ExceptT e (State s) a -> Update s a Source #

Utilities

createAndDiscardArchive :: MonadIO m => AcidState st -> FilePath -> m () Source #

Archive unnecessary data (see createArchive docs for details) and discard it. Works for local state.

tidyLocalState :: MonadIO m => AcidState st -> FilePath -> m () Source #

Apply all updates and remove all data from local state which is unnecessary for state restoration.