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

Safe HaskellNone

Data.Acid.TemplateHaskell

Synopsis

Documentation

makeAcidic :: Name -> [Name] -> Q [Dec]Source

Create the control structures required for acid states using Template Haskell.

This code:

myUpdate :: Argument -> Update State Result
myUpdate arg = ...

myQuery :: Argument -> Query State Result
myQuery arg = ...

$(makeAcidic ''State ['myUpdate, 'myQuery])

will make State an instance of IsAcidic and provide the following events:

data MyUpdate = MyUpdate Argument
data MyQuery  = MyQuery Argument