More GHC 7.8 fixes: DeriveDataTypeable, imports, (Functor m).

This commit is contained in:
Felipe Lessa 2015-05-31 14:53:26 -03:00
parent a731cb2a8a
commit d967f2b4a7
3 changed files with 5 additions and 4 deletions

View File

@ -26,7 +26,7 @@ module Web.ServerSession.Backend.Redis.Internal
, throwRS
) where
import Control.Applicative ((<$))
import Control.Applicative ((<$), (<$>))
import Control.Arrow (first)
import Control.Monad (void, when)
import Control.Monad.IO.Class (liftIO)

View File

@ -32,6 +32,7 @@ library
Web.ServerSession.Frontend.Snap
Web.ServerSession.Frontend.Snap.Internal
extensions:
DeriveDataTypeable
FlexibleContexts
OverloadedStrings
TypeFamilies

View File

@ -36,7 +36,7 @@ import qualified Web.Cookie as C
-- that uses 'WS.withSession', 'createState', 'sessionStore',
-- 'getCookieName' and 'createCookieTemplate'.
withServerSession
:: (MonadIO m, MonadIO n, Storage sto, SessionData sto ~ SessionMap)
:: (Functor m, MonadIO m, MonadIO n, Storage sto, SessionData sto ~ SessionMap)
=> V.Key (WS.Session m Text ByteString) -- ^ 'V.Vault' key to use when passing the session through.
-> (State sto -> State sto) -- ^ Set any options on the @serversession@ state.
-> sto -- ^ Storage backend.
@ -58,7 +58,7 @@ withServerSession key opts storage = liftIO $ do
-- return an empty @ByteString@ when the empty session was not
-- saved.
sessionStore
:: (MonadIO m, Storage sto, KeyValue (SessionData sto))
:: (Functor m, MonadIO m, Storage sto, KeyValue (SessionData sto))
=> State sto -- ^ @serversession@ state, incl. storage backend.
-> WS.SessionStore m (Key (SessionData sto)) (Value (SessionData sto))
-- ^ @wai-session@ session store.
@ -75,7 +75,7 @@ sessionStore state =
-- | Build a 'WS.Session' from an 'I.IORef' containing the
-- session data.
mkSession :: (MonadIO m, KeyValue sess) => I.IORef sess -> WS.Session m (Key sess) (Value sess)
mkSession :: (Functor m, MonadIO m, KeyValue sess) => I.IORef sess -> WS.Session m (Key sess) (Value sess)
mkSession sessionRef =
-- We need to use atomicModifyIORef instead of readIORef
-- because latter may be reordered (cf. "Memory Model" on