packages feed

raft-0.3.11.0: src/Data/Journal/Empty.hs

-----------------------------------------------------------------------------
--
-- Module      :  Data.Journal.Empty
-- Copyright   :  (c) 2017 Brian W Bush
-- License     :  MIT
--
-- Maintainer  :  Brian W Bush <consult@brianwbush.info>
-- Stability   :  Stable
-- Portability :  Portable
--
-- | A journal that does no logging.
--
-----------------------------------------------------------------------------


module Data.Journal.Empty (
  -- * Types
  EmptyJournal(..)
) where


import Data.Journal (Journal(..))


-- | A journal that does no logging.
data EmptyJournal =
  EmptyJournal
    deriving (Eq, Read, Show)

instance Journal EmptyJournal where
  append = const . const $ return ()
  erase  = const . const $ return ()
  replay = const . const $ return []
  clear = const $ return ()
  close = const $ return ()