HORIZON HASKELLDocslts/ghc-10.0.x8c2f8e82026-10-19Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19

Moduleacid-state-0.16.1.4Haskell2010

Data.Acid.Abstract

  • 1 type
  • 8 values
  • Packageacid-state-0.16.1.4
  • Exports9
  • LanguageHaskell2010
  • LicenceLicenseRef-PublicDomain
  • SourceAbstract.hs
datadata AcidState st
#

State container offering full ACID (Atomicity, Consistency, Isolation and Durability) guarantees.

Atomicity

State changes are all-or-nothing. This is what you'd expect of any state variable in Haskell and AcidState doesn't change that.

Consistency

No event or set of events will break your data invariants.

Isolation

Transactions cannot interfere with each other even when issued in parallel.

Durability

Successful transaction are guaranteed to survive unexpected system shutdowns (both those caused by hardware and software).

Constructors

valuescheduleUpdate
  1. :: UpdateEvent event
  2. => AcidState (EventState event)
  3. -> event
  4. -> IO (MVar (EventResult event))
#

Issue an Update event and return immediately. The event is not durable before the MVar has been filled but the order of events is honored. The behavior in case of exceptions is exactly the same as for update.

If EventA is scheduled before EventB, EventA will be executed before EventB:

do scheduleUpdate acid EventA
   scheduleUpdate acid EventB
   
valuegroupUpdates
  1. :: UpdateEvent event
  2. => AcidState (EventState event)
  3. -> [event]
  4. -> IO ()
#

Schedule multiple Update events and wait for them to be durable, but throw away their results. This is useful for importing existing datasets into an AcidState.

valueupdate
  1. :: UpdateEvent event
  2. => AcidState (EventState event)
  3. -> event
  4. -> IO (EventResult event)
#

Issue an Update event and wait for its result. Once this call returns, you are guaranteed that the changes to the state are durable. Events may be issued in parallel.

It's a run-time error to issue events that aren't supported by the AcidState.