Safe Haskell | None |
---|---|
Language | Haskell98 |
- class (Eq (SessionKey s), Hashable (SessionKey s)) => IsSession s where
- type SessionKey s :: *
- getSessionKey :: s -> SessionKey s
- newtype SessionVault s = SessionVault {
- unSessionVault :: Map (SessionKey s) s
- newSessionVault :: IsSession s => STM (SessionVault s)
- loadSession :: IsSession s => SessionKey s -> SessionVault s -> STM (Maybe s)
- storeSession :: IsSession s => s -> SessionVault s -> STM ()
- deleteSession :: IsSession s => SessionKey s -> SessionVault s -> STM ()
- toList :: IsSession s => SessionVault s -> STM [s]
- filterSessions :: IsSession s => (s -> Bool) -> SessionVault s -> STM ()
Documentation
class (Eq (SessionKey s), Hashable (SessionKey s)) => IsSession s where Source
type SessionKey s :: * Source
getSessionKey :: s -> SessionKey s Source
newtype SessionVault s Source
SessionVault | |
|
newSessionVault :: IsSession s => STM (SessionVault s) Source
Create a new session vault
loadSession :: IsSession s => SessionKey s -> SessionVault s -> STM (Maybe s) Source
Load a session
storeSession :: IsSession s => s -> SessionVault s -> STM () Source
Store a session, overwriting any previous values
deleteSession :: IsSession s => SessionKey s -> SessionVault s -> STM () Source
Removea session
toList :: IsSession s => SessionVault s -> STM [s] Source
Get all sessions as list
filterSessions :: IsSession s => (s -> Bool) -> SessionVault s -> STM () Source
Remove all sessions that do not match the predicate