From 13b0204c0391697b41cdfb80e96da6945808e25d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 20 Aug 2019 07:09:16 +0100 Subject: chore(tazblog): Introduce dependency on 'cache' --- services/tazblog/src/BlogStore.hs | 33 ++++++++++++++++++--------------- services/tazblog/tazblog.cabal | 1 + services/tazblog/tazblog.nix | 8 ++++---- 3 files changed, 23 insertions(+), 19 deletions(-) (limited to 'services/tazblog') diff --git a/services/tazblog/src/BlogStore.hs b/services/tazblog/src/BlogStore.hs index 5ed67ac93864..e4c7a64b2634 100644 --- a/services/tazblog/src/BlogStore.hs +++ b/services/tazblog/src/BlogStore.hs @@ -15,33 +15,36 @@ -- -- This module implements logic for assembling a post out of these -- fragments and caching it based on the TTL of its `_meta` record. - module BlogStore where -import Data.Text (Text) -import Locales (BlogLang(..)) -import Data.Time (UTCTime) import Control.Monad.IO.Class (MonadIO) +import Data.Text (Text) +import Data.Time (UTCTime) +import Locales (BlogLang (..)) -newtype EntryId = EntryId { unEntryId :: Integer } - deriving (Eq, Ord) +newtype EntryId = EntryId {unEntryId :: Integer} + deriving (Eq, Ord) instance Show EntryId where + show = show . unEntryId -data Entry = Entry { - entryId :: EntryId, - lang :: BlogLang, - author :: Text, - title :: Text, - btext :: Text, - mtext :: Text, - edate :: UTCTime -} deriving (Eq, Ord, Show) +data Entry + = Entry + { entryId :: EntryId, + lang :: BlogLang, + author :: Text, + title :: Text, + btext :: Text, + mtext :: Text, + edate :: UTCTime + } + deriving (Eq, Ord, Show) data BlogCache type Offset = Integer + type Count = Integer newCache :: String -> IO BlogCache diff --git a/services/tazblog/tazblog.cabal b/services/tazblog/tazblog.cabal index ac0c418e32fa..3a946e01baef 100644 --- a/services/tazblog/tazblog.cabal +++ b/services/tazblog/tazblog.cabal @@ -19,6 +19,7 @@ library text, blaze-html, blaze-markup, + cache, crypto-api, cryptohash, old-locale, diff --git a/services/tazblog/tazblog.nix b/services/tazblog/tazblog.nix index cb6238382667..9708346590e4 100644 --- a/services/tazblog/tazblog.nix +++ b/services/tazblog/tazblog.nix @@ -1,7 +1,7 @@ { mkDerivation, acid-state, base, base64-bytestring, blaze-html -, blaze-markup, bytestring, crypto-api, cryptohash, hamlet -, happstack-server, ixset, markdown, mtl, network, network-uri -, old-locale, options, rss, safecopy, shakespeare, stdenv, text +, blaze-markup, bytestring, cache, crypto-api, cryptohash, hamlet +, happstack-server, markdown, mtl, network, network-uri +, old-locale, options, rss, shakespeare, stdenv, text , time, transformers }: mkDerivation { @@ -12,7 +12,7 @@ mkDerivation { isExecutable = true; libraryHaskellDepends = [ base base64-bytestring blaze-html blaze-markup bytestring - crypto-api cryptohash hamlet happstack-server markdown mtl + cache crypto-api cryptohash hamlet happstack-server markdown mtl network network-uri old-locale rss shakespeare text time transformers ]; -- cgit 1.4.1