More GHC 7.8 fixes: DeriveDataTypeable, imports, (Functor m).
This commit is contained in:
parent
a731cb2a8a
commit
d967f2b4a7
@ -26,7 +26,7 @@ module Web.ServerSession.Backend.Redis.Internal
|
|||||||
, throwRS
|
, throwRS
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Applicative ((<$))
|
import Control.Applicative ((<$), (<$>))
|
||||||
import Control.Arrow (first)
|
import Control.Arrow (first)
|
||||||
import Control.Monad (void, when)
|
import Control.Monad (void, when)
|
||||||
import Control.Monad.IO.Class (liftIO)
|
import Control.Monad.IO.Class (liftIO)
|
||||||
|
|||||||
@ -32,6 +32,7 @@ library
|
|||||||
Web.ServerSession.Frontend.Snap
|
Web.ServerSession.Frontend.Snap
|
||||||
Web.ServerSession.Frontend.Snap.Internal
|
Web.ServerSession.Frontend.Snap.Internal
|
||||||
extensions:
|
extensions:
|
||||||
|
DeriveDataTypeable
|
||||||
FlexibleContexts
|
FlexibleContexts
|
||||||
OverloadedStrings
|
OverloadedStrings
|
||||||
TypeFamilies
|
TypeFamilies
|
||||||
|
|||||||
@ -36,7 +36,7 @@ import qualified Web.Cookie as C
|
|||||||
-- that uses 'WS.withSession', 'createState', 'sessionStore',
|
-- that uses 'WS.withSession', 'createState', 'sessionStore',
|
||||||
-- 'getCookieName' and 'createCookieTemplate'.
|
-- 'getCookieName' and 'createCookieTemplate'.
|
||||||
withServerSession
|
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.
|
=> 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.
|
-> (State sto -> State sto) -- ^ Set any options on the @serversession@ state.
|
||||||
-> sto -- ^ Storage backend.
|
-> sto -- ^ Storage backend.
|
||||||
@ -58,7 +58,7 @@ withServerSession key opts storage = liftIO $ do
|
|||||||
-- return an empty @ByteString@ when the empty session was not
|
-- return an empty @ByteString@ when the empty session was not
|
||||||
-- saved.
|
-- saved.
|
||||||
sessionStore
|
sessionStore
|
||||||
:: (MonadIO m, Storage sto, KeyValue (SessionData sto))
|
:: (Functor m, MonadIO m, Storage sto, KeyValue (SessionData sto))
|
||||||
=> State sto -- ^ @serversession@ state, incl. storage backend.
|
=> State sto -- ^ @serversession@ state, incl. storage backend.
|
||||||
-> WS.SessionStore m (Key (SessionData sto)) (Value (SessionData sto))
|
-> WS.SessionStore m (Key (SessionData sto)) (Value (SessionData sto))
|
||||||
-- ^ @wai-session@ session store.
|
-- ^ @wai-session@ session store.
|
||||||
@ -75,7 +75,7 @@ sessionStore state =
|
|||||||
|
|
||||||
-- | Build a 'WS.Session' from an 'I.IORef' containing the
|
-- | Build a 'WS.Session' from an 'I.IORef' containing the
|
||||||
-- session data.
|
-- 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 =
|
mkSession sessionRef =
|
||||||
-- We need to use atomicModifyIORef instead of readIORef
|
-- We need to use atomicModifyIORef instead of readIORef
|
||||||
-- because latter may be reordered (cf. "Memory Model" on
|
-- because latter may be reordered (cf. "Memory Model" on
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user