{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
module Imm.Hooks where
import Imm.Feed
import qualified Imm.Logger as Logger
import Imm.Logger hiding(Handle)
import Imm.Prelude
import Imm.Pretty
newtype Handle m = Handle
{ processNewElement :: Feed -> FeedElement -> m ()
}
onNewElement :: Monad m => Logger.Handle m -> Handle m -> Feed -> FeedElement -> m ()
onNewElement logger handle feed element = do
log logger Debug $ "Unread element:" <+> pretty (getTitle element)
processNewElement handle feed element