Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- type SessionMapEmbedding a = Embedding (MapOperations Text ByteString) () a
- class (Monad m, Ord k) => MapOperations k v m | m -> k v where
- bsKeyEmbedding :: k -> Embedding (MapOperations k a) e a
- showReadKeyEmbedding :: (Read a, Show a) => k -> Embedding (MapOperations k ByteString) () a
Documentation
type SessionMapEmbedding a = Embedding (MapOperations Text ByteString) () a Source #
Specifies how we represent some value within a SessionMap
We use this to sort of abuse the session; key rotation and freezing are done by embedding special values among the session data. These special values are extracted from the map before persisting to storage and are never actually saved.
class (Monad m, Ord k) => MapOperations k v m | m -> k v where Source #
A monadic context with operations over some Map
-like state
This allows us to generalize between pure operations over Map
and
the more limited session manipulation utilities afforded by Yesod.
(See the instance list for this class.)
Instances
MapOperations Text ByteString (HandlerFor site) Source # | |
Defined in Yesod.Session.Embedding.Map lookup :: Text -> HandlerFor site (Maybe ByteString) Source # assign :: Text -> Maybe ByteString -> HandlerFor site () Source # | |
(Monad m, Ord k) => MapOperations k v (StateT (Map k v) m) Source # | |
bsKeyEmbedding :: k -> Embedding (MapOperations k a) e a Source #
An embedding which stores a value at some particular key in a map-like structure
showReadKeyEmbedding :: (Read a, Show a) => k -> Embedding (MapOperations k ByteString) () a Source #
Represents a value in a SessionMap
by storing the
UTF-8 encoding of its show
representation at the given key