imm-1.3.0.0: Execute arbitrary actions for each unread element of RSS/Atom feeds

Safe HaskellNone
LanguageHaskell98

Imm.Database

Contents

Description

Database module abstracts over a key-value database that supports CRUD operations.

Synopsis

Types

class (Ord (Key t), Show (Key t), Show (Entry t), Typeable t, Show t, Pretty t, Pretty (Key t)) => Table t Source #

Generic database table

Associated Types

type Key t :: * Source #

type Entry t :: * Source #

Instances

Table FeedTable Source # 

Associated Types

type Key FeedTable :: * Source #

type Entry FeedTable :: * Source #

class MonadThrow m => MonadDatabase t m where Source #

Monad capable of interacting with a key-value store.

Methods

_describeDatabase :: t -> m (Doc a) Source #

_fetchList :: t -> [Key t] -> m (Map (Key t) (Entry t)) Source #

_fetchAll :: t -> m (Map (Key t) (Entry t)) Source #

_update :: t -> Key t -> (Entry t -> Entry t) -> m () Source #

_insertList :: t -> [(Key t, Entry t)] -> m () Source #

_deleteList :: t -> [Key t] -> m () Source #

_purge :: t -> m () Source #

_commit :: t -> m () Source #

Instances

(Table t, FromJSON (Key t), FromJSON (Entry t), ToJSON (Key t), ToJSON (Entry t)) => MonadDatabase t (ReaderT * (MVar (JsonFileDatabase t)) IO) Source # 
(MonadThrow m, MonadDatabase FeedTable (ReaderT * b m)) => MonadDatabase FeedTable (ReaderT * (Modules a b c d e) m) Source # 

Primitives

fetch :: (MonadDatabase t m, Table t, MonadThrow m) => t -> Key t -> m (Entry t) Source #

fetchList :: (MonadDatabase t m, MonadThrow m) => t -> [Key t] -> m (Map (Key t) (Entry t)) Source #

fetchAll :: (MonadThrow m, MonadDatabase t m) => t -> m (Map (Key t) (Entry t)) Source #

update :: (MonadDatabase t m, MonadThrow m) => t -> Key t -> (Entry t -> Entry t) -> m () Source #

insert :: (MonadThrow m, MonadDatabase t m, MonadLog m) => t -> Key t -> Entry t -> m () Source #

insertList :: (MonadThrow m, MonadDatabase t m, MonadLog m) => t -> [(Key t, Entry t)] -> m () Source #

delete :: (MonadThrow m, MonadDatabase t m, MonadLog m) => t -> Key t -> m () Source #

deleteList :: (MonadThrow m, MonadDatabase t m, MonadLog m) => t -> [Key t] -> m () Source #

purge :: (MonadThrow m, MonadDatabase t m, MonadLog m) => t -> m () Source #

commit :: (MonadThrow m, MonadDatabase t m, MonadLog m) => t -> m () Source #