HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Moduleacid-state-0.16.1.4Haskell2010

Data.Acid.Log

A log is a stack of entries that supports efficient pushing of new entries and fetching of old. It can be considered an extendible array of entries.

Synopsis
  • Packageacid-state-0.16.1.4
  • Exports16
  • LanguageHaskell2010
  • LicenceLicenseRef-PublicDomain
  • SourceLog.hs
valuepushEntry :: FileLog object -> object -> IO () -> IO ()

Schedule a new log entry. This call does not block. The given IO action runs once the object is durable. The IO action blocks the serialization of events so it should be swift.

valuerollbackWhile
  1. :: LogKey object
  2. -> (object -> Bool)

    the filter function

  3. -> IO ()

Obliterate log entries as long as the filter function returns True.

valuenewestEntry :: LogKey object -> IO (Maybe object)

Finds the newest entry in the log. Doesn't work on open logs. Do not use after the log has been opened.

Implementation:

  • Search the newest log files first.

  • Once a file containing at least one valid entry is found, return the last entry in that file.