1
1
mirror of https://github.com/aelve/guide.git synced 2024-11-23 12:15:06 +03:00

Migrate to newer versions

This commit is contained in:
Artyom 2016-07-25 17:55:10 +03:00
parent 519211ac2e
commit e810f1997d
2 changed files with 3 additions and 8 deletions

View File

@ -42,7 +42,7 @@ executable guide
-- other-extensions: -- other-extensions:
build-depends: MonadRandom == 0.4.* build-depends: MonadRandom == 0.4.*
, Spock , Spock
, Spock-lucid == 0.2.* , Spock-lucid == 0.3.*
, acid-state == 0.14.* , acid-state == 0.14.*
, aeson == 0.11.* , aeson == 0.11.*
, aeson-pretty == 0.7.* , aeson-pretty == 0.7.*
@ -65,7 +65,6 @@ executable guide
, http-types , http-types
, ilist , ilist
, iproute == 1.7.* , iproute == 1.7.*
, list-t
, lucid >= 2.9.5 && < 3 , lucid >= 2.9.5 && < 3
, megaparsec == 4.4.* , megaparsec == 4.4.*
, microlens-platform >= 0.3.2 , microlens-platform >= 0.3.2
@ -79,7 +78,7 @@ executable guide
, safecopy , safecopy
, shortcut-links >= 0.4.2 , shortcut-links >= 0.4.2
, split , split
, stm-containers == 0.2.10.* , stm-containers >= 0.2.14 && < 0.3
, template-haskell , template-haskell
, text-all == 0.3.* , text-all == 0.3.*
, time >= 1.5 , time >= 1.5

View File

@ -26,7 +26,6 @@ import qualified Data.ByteString.Lazy as BSL
-- Concurrent map -- Concurrent map
import qualified STMContainers.Map as STMMap import qualified STMContainers.Map as STMMap
import Data.Hashable import Data.Hashable
import qualified ListT
-- Lucid -- Lucid
import Lucid.Base import Lucid.Base
@ -110,11 +109,8 @@ invalidateCache gs key = liftIO $ atomically $ do
for_ (cacheDepends gs key) $ \k -> for_ (cacheDepends gs key) $ \k ->
STMMap.delete k cache STMMap.delete k cache
-- TODO: Should be easier once
-- https://github.com/nikita-volkov/stm-containers/issues/6 is closed.
emptyCache :: MonadIO m => m () emptyCache :: MonadIO m => m ()
emptyCache = liftIO $ atomically $ emptyCache = liftIO $ atomically $ STMMap.deleteAll cache
ListT.traverse_ (\(k,_) -> STMMap.delete k cache) (STMMap.stream cache)
cached :: MonadIO m => CacheKey -> HtmlT m () -> HtmlT m () cached :: MonadIO m => CacheKey -> HtmlT m () -> HtmlT m ()
cached key gen = do cached key gen = do