h&&O%      Safe-Inferred"1 !This module provides access to cookie data, in the form of a SessionMap. Safe-Inferred"1 }servant-combinators HasCookies and HasCookiesMaybe9 are internal utitily types. You should only need to use ProvideCookies and  WithCookies.servant-combinators HasCookies and HasCookiesMaybe9 are internal utitily types. You should only need to use ProvideCookies and  WithCookies.As an aside, they're separate types (rather than a single type with a (mods :: [Type]) ) phantom type because the term-level values show up in the instances, and I didn't see a clean way to separate them out by case, and only covering one value from the sum type made Haskell (rightly) complain.servant-combinatorsAs mentioned above, the  WithCookies combinator provides already-parsed cookies to the handler as a SessionMap.7The cookie values are assumed to be encrypted with a Web.ClientSession.Key . Likewise,  updateCookies encrypts the cookies on the outbound side via this mechanism.Example: import Control.Monad.IO.Class (liftIO) import Servant import ServantExtras.Cookies import qualified Data.Map.Strict as Map type MyAPI = "my-cookie-enabled-endpoint" :> ProvideCookies '[Required] :> WithCookies '[Required] :> Get '[JSON] NoContent myServer :: Server MyAPI myServer = cookieEndpointHandler where cookieEndpointHandler :: SessionMap -> Handler NoContent cookieEndpointHandler sMap = let mCookieValue = lookup  MerlinWasHere $ Map.toList sMap in case mCookieValue of Nothing -> do liftIO $ print "Merlin was *NOT* here!" throwError err400 { errBody = "Clearly you've missed something." } Just message -> do liftIO $ do print "Merlin WAS here, and he left us a message!" print message pure NoContent servant-combinatorsThe ProvideCookies and  WithCookies- combinator work in tandem together -- the ProvideCookies combinator parses the cookies from the request and stores them in the WAI request Vault, the  WithCookies combinator provides the cookies as a hash map to the handler.servant-combinatorsA SetCookieHeader is a convenience type for adding a "Set-Cookie" header that expects a SetCookie record type.I wanted to have the header name be NTH.hSetCookie for extra "use the known correct value" goodness, but that breaks the type magic Servant relies upon.servant-combinators:A SessionMap is a hash map of session data from a request.servant-combinatorsThis function takes a SessionMap and provides a "Set-Cookie" header to set the SessionData to a newly minted value of your choice. servant-combinatorsThis function clears session data, for a fresh, minty-clean experience. The archetypal use case is when a user logs out from your server.   This module provides a way to get _all_ the headers from a request, rather than asking for them piecemeal. Safe-Inferred"1servant-combinators/The HeaderList combinator provides a list of  Network.HTTP.Types.Header.Header values from the WAI request.Example: import Control.Monad.IO.Class (liftIO) import Servant import ServantExtras.HeaderList import qualified Network.HTTP.Types.Header as NTH (Header) type MyAPI = "my-header-endpoint" :> HeaderList :> Get '[JSON] NoContent myServer :: Server MyAPI myServer = headerEndpointHandler where headerEndpointHandler :: [NTH.Header] -> Handler NoContent headerEndpointHandler headers = let mCookieValue = lookup "merlinWasHere" headers in case mCookieValue of Nothing -> do liftIO $ print "Merlin was *NOT* here!" throwError err400 { errBody = "Clearly you've missed something." } Just message -> do liftIO $ do print "Merlin WAS here, and he left us a message!" print message pure NoContent Combinator for Servant to allow Handlers access to the raw path from the WAI request. Safe-Inferred"1servant-combinatorsPathInfo provides handlers access to the path segments from the request, without the domain name or query parameters. We re-generate this from the rawPathInfo via %Network.HTTP.Types.decodePathSegments/ because Servant removes all fields from the pathInfo field of a request as part of routing the request to the appropriate handler.Example: import Data.ByteString (ByteString) import Control.Monad.IO.Class (liftIO) import Servant import ServantExtras.RawPathInfo type MyAPI = "merlin" :> "my-path-info-endpoint" :> PathInfo :> Get '[JSON] NoContent myServer :: Server MyAPI myServer = pathInfoEndpointHandler where pathInfoEndpointHandler :: [Text] -> Handler NoContent pathInfoEndpointHandler pInfo = do case (elem "merlin" pInfo) of False -> do liftIO $ print "This example has a bug!" throwError err400 { errBody = "Patches accepted!" } True -> do liftIO $ print "Hopefully this demonstrates how path info works." pure NoContent Combinator for Servant to allow Handlers access to the full query string from the WAI request. Safe-Inferred"1servant-combinators QueryString provides handlers access to the full query string from the WAI request, rather than pulling each element explicitly. This allows for dynamic query management, or to simply take in many queries in one argument.Example: import Control.Monad.IO.Class (liftIO) import Network.HTTP.Types (Query, renderQuery) import Servant import ServantExtras.QueryString type MyAPI = "my-cookie-enabled-endpoint" :> QueryString :> Get '[JSON] NoContent myServer :: Server MyAPI myServer = queryEndpointHandler where queryEndpointHandler :: Query -> Handler NoContent queryEndpointHandler query = do liftIO $ print $ renderQuery True query let mCookieValue = lookup "merlinWasHere" query in case mCookieValue of Nothing -> do liftIO $ print "Merlin was *NOT* here!" throwError err400 { errBody = "Clearly you've missed something." } Just message -> do liftIO $ do print "Merlin WAS here, and he left us a message!" print message pure NoContent Combinator for Servant to allow Handlers access to the raw path from the WAI request. Safe-Inferred"1servant-combinators RawPathInfo provides handlers access to the raw, unparsed path information the WAI request.?If you wish to get the path segments, you can either use the PathInfo combinator in Servant.API.PathInfo or parse it yourself with %Network.HTTP.Types.decodePathSegmentsExample: import Data.ByteString (ByteString) import Control.Monad.IO.Class (liftIO) import Servant import ServantExtras.RawPathInfo type MyAPI = "my-path-info-endpoint" :> RawPathInfo :> Get '[JSON] NoContent myServer :: Server MyAPI myServer = queryEndpointHandler where queryEndpointHandler :: ByteString -> Handler NoContent queryEndpointHandler rawPath = do case rawPath of "/my-path-info-endpoint" -> do liftIO $ print "Servant routed us to the right place!" pure NoContent _ -> do liftIO $ print "My example has a bug!" throwError err400 { errBody = "Patches accepted!" } Provides a combinator to access the Query String in its raw form, from the WAI request. Safe-Inferred"1"servant-combinatorsRawQueryString gives handler authors a combinator to access the raw (that is, un-parsed) query string from the WAI request, as a ByteString.1Generally speaking, you should prefer to use the  QueryString combinator, but if you need access to the raw value, this combinator provides it.Example: import Control.Monad.IO.Class (liftIO) import Servant import ServantExtras.RawQueryString import qualified Network.HTTP.Types.Header as NTH (Header) type MyAPI = "my-query-endpoint" :> RawQueryString :> Get '[JSON] NoContent myServer :: Server MyAPI myServer = queryEndpointHandler where queryEndpointHandler :: ByteString -> Handler NoContent queryEndpointHandler queryStr = -- do something with the ByteString, like pass it to a -- sub-process Provide a combinator to give handlers access to the raw WAI request. Safe-Inferred"1%servant-combinators RawRequest provides the " field from the WAI request.Example: import Control.Monad.IO.Class (liftIO) import Network.Wai import Servant import ServantExtras.RawRequest type MyAPI = "my-request-endpoint" :> RawRequest :> Get '[JSON] NoContent myServer :: Server MyAPI myServer = requestEndpointHandler where requestEndpointHandler :: Request -> Handler NoContent requestEndpointHandler req = -- Do something clever with the request pure NoContent #        !"#$%&0servant-combinators-0.0.2-ATOKVzUWx9x3tqyrALrkylServant.API.CookiesServant.API.HeaderListServant.API.PathInfoServant.API.QueryStringServant.API.RawPathInfoServant.API.RawQueryStringServant.API.RawRequestPaths_servant_combinatorsHasCookiesMaybe HasCookies WithCookiesProvideCookiesSetCookieHeader SessionMap updateCookies clearSession$fHasServerTYPE:>ctx$fHasServerTYPE:>ctx0$fHasServerTYPE:>ctx1$fHasServerTYPE:>ctx2 HeaderListPathInfo QueryString RawPathInfoRawQueryString RawRequestversiongetDataFileName getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDir wai-3.2.3-4cXy7zNNy7HCJv6kZNIp8hNetwork.Wai.InternalRequest