!wi      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Safe&'.=>?@AHUVX* servant-snapyNormally context entries are accessed by their types. In case you need to have multiple values of the same type in your & and need to access them, we provide -. You can think of it as sub-namespaces for s. servant-snap0This class is used to access context entries in s. 1 returns the first value where the type matches:7getContextEntry (True :. False :. EmptyContext) :: BoolTrueIf the G does not contain an entry of the requested type, you'll get an error:9getContextEntry (True :. False :. EmptyContext) :: String.../...No instance for (HasContextEntry '[] [Char])... servant-snap4s are used to pass values to combinators. (They are nota meant to be used to pass parameters to your handlers, i.e. they should not replace any custom   %-monad-stack that you're using with T.) If you don't use combinators that require any context entries, you can just use   as always.6If you are using combinators that require a non-empty  you have to use   and pass it a 8 that contains all the values your combinators need. A [ is essentially a heterogenous list and accessing the elements is being done by type (see ). The parameter of the type Z is a type-level list reflecting the types of the contained context entries. To create a ! with entries, use the operator (): :type True :. () :. EmptyContext1True :. () :. EmptyContext :: Context '[Bool, ()]  servant-snap  allows you to access Qs. Usually you won't have to use it yourself but instead use a combinator like . This is how   works::set -XFlexibleContexts%let subContext = True :. EmptyContext:type subContextsubContext :: Context '[Bool]klet parentContext = False :. (NamedContext subContext :: NamedContext "subContext" '[Bool]) :. EmptyContext:type parentContextCparentContext :: Context '[Bool, NamedContext "subContext" '[Bool]]VdescendIntoNamedContext (Proxy :: Proxy "subContext") parentContext :: Context '[Bool]True :. EmptyContext  5None1 servant-snapBLike `null . pathInfo`, but works with redundant trailing slashes. servant-snap.Returns a processed pathInfo from the request.In order to handle matrix parameters in the request correctly, the raw pathInfo needs to be processed, so routing works as intended. Therefor this function should be used to access the pathInfo for routing purposes.  None"#2! servant-snap"Terminate request handling with a  ServantErr via  finishWith' !"#$%&'()*+,-./0123456789:;<=>?' !"#$%&'()*+,-./0123456789:;<=>?None4XCDEFGHIJKLMNOPCDEFGHIJKLMNOPNone"#&'4=?@AHMSUVXU_ servant-snap8The result of matching against a path in the route tree.` servant-snapKeep trying other paths. The  ServantErr! should only be 404, 405 or 406.a servant-snapDon't try other paths.g servant-snapA T without any stored checks.h servant-snap Fail with the option to recover.i servant-snap2Fail fatally, i.e., without any option to recover.j servant-snap$Gain access to the incoming request.k servant-snap.Add a capture to the end of the capture block.l servant-snap4Add a parameter check to the end of the params blockm servant-snap2Add a header check to the end of the headers blockn servant-snap2Add a method check to the end of the method block.o servant-snap/Add an auth check to the end of the auth block.p servant-snap;Add a content type and body checks around parameter checks.We'll report failed content type check (415), before trying to parse query parameters (400). Which, in turn, happens before request body parsing.q servant-snapAdd an accept header check before handling parameters. In principle, we'd like to take a bad body (400) response take precedence over a failed accept check (406). BUT to allow streaming the body, we cannot run the body check and then still backtrack. We therefore do the accept check before the body check, when we can still backtrack. There are other solutions to this, but they'd be more complicated (such as delaying the body check further so that it can still be run in a situation where we'd otherwise report 406).r servant-snapyMany combinators extract information that is passed to the handler without the possibility of failure. In such a case, r can be used.s servant-snapRun a delayed server. Performs all scheduled operations in order, and passes the results from the capture and body blocks on to the actual handler.wThis should only be called once per request; otherwise the guarantees about effect and HTTP error ordering break down.c servant-snapthe request, the field pathInfo may be modified by url routingp servant-snapcontent type check servant-snap body check#QRSTU^]\[ZYXWV_ab`cdefghijklmnopqrs#c_ab`defTU^]\[ZYXWVQRSghijklmnopqrsNone4Hcr servant-snap$Internal representation of a router. servant-snap]Smart constructor for the choice between routers. We currently optimize the following cases:7Two static routers can be joined by joining their maps.=Two dynamic routers can be joined by joining their codomains.Two  WithRequestY routers can be joined by passing them the same request and joining their codomains.A  WithRequest router can be joined with anything else by passing the same request to both but ignoring it in the component that does not need it. servant-snap%Compare the structure of two routers. servant-snap?Provide a textual representation of the structure of a router. servant-snap,Apply a transformation to the response of a . servant-snap%Interpret a router as an application.None247Xm- servant-snap:Datatype wrapping a function used to check authentication. servant-snapservant-server's current implementation of basic authentication is not immune to certian kinds of timing attacks. Decoding payloads does not take a fixed amount of time.*The result of authentication/authorization servant-snap.Internal method to make a basic-auth challenge servant-snapFind and decode an  Authorization& header from the request as Basic Auth servant-snapWRun and check basic authentication, returning the appropriate http error per the spec. None-.47=>?@AHMPSUVXk’ servant-snap>Singleton type representing a server that serves an empty API. servant-snap Server for  servant-snapBasic Authentication servant-snapIgnore  in server handlers. servant-snapIgnore  in server handlers. servant-snap+Make sure the incoming request starts with "/path"5, strip it and pass the rest of the request path to api. servant-snap If you use ReqBody in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of the type specified by ReqBody. The  Content-Typep header is inspected, and the list provided is used to attempt deserialization. If the request does not have a  Content-Type header, it is treated as application/octet-stream (as specified in  3https://tools.ietf.org/html/rfc7231#section-3.1.1.4RFC7231u. This lets servant worry about extracting it from the request and turning it into a value of the type you specify.All it asks is for a FromJSON instance.Example: type MyApi = "books" :> ReqBody '[JSON] Book :> Post '[JSON] Book server :: Server MyApi server = postBook where postBook :: Book -> EitherT ServantErr IO Book postBook book = ...insert into your db... servant-snapKJust pass the request to the underlying application and serve its response.Example: ^type MyApi = "images" :> Raw server :: Server MyApi server = serveDirectory "/var/www/images" servant-snap If you use  "published" in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of type .Example: &type MyApi = "books" :> QueryFlag "published" :> Get '[JSON] [Book] server :: Server MyApi server = getBooks where getBooks :: Bool -> EitherT ServantErr IO [Book] getBooks onlyPublished = ...return all books, or only the ones that are already published, depending on the argument... servant-snap If you use  "authors" Text in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of type [].]This lets servant worry about looking up 0 or more values in the query string associated to authors@ and turning each of them into a value of the type you specify.=You can control how the individual values are converted from 2 to your type by simply providing an instance of  for your type.Example: type MyApi = "books" :> QueryParams "authors" Text :> Get '[JSON] [Book] server :: Server MyApi server = getBooksBy where getBooksBy :: [Text] -> EitherT ServantErr IO [Book] getBooksBy authors = ...return all books by these authors... servant-snap If you use  QueryParam "author" Text in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of type  .This lets servant worry about looking it up in the query string and turning it into a value of the type you specify, enclosed in ?, because it may not be there and servant would then hand you .,You can control how it'll be converted from 2 to your type by simply providing an instance of  for your type.Example: 7type MyApi = "books" :> QueryParam "author" Text :> Get '[JSON] [Book] server :: Server MyApi server = getBooksBy where getBooksBy :: Maybe Text -> EitherT ServantErr IO [Book] getBooksBy Nothing = ...return all books... getBooksBy (Just author) = ...return books by the given author... servant-snap If you use Header in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of the type specified by Headeru. This lets servant worry about extracting it from the request and turning it into a value of the type you specify.All it asks is for a  instance.Example: Vnewtype Referer = Referer Text deriving (Eq, Show, FromText, ToText) -- GET /view-my-referer type MyApi = "view-my-referer" :> Header "Referer" Referer :> Get '[JSON] Referer server :: Server MyApi server = viewReferer where viewReferer :: Referer -> EitherT ServantErr IO referer viewReferer referer = return referer servant-snap If you use Capture in one of the endpoints for your API, this automatically requires your server-side handler to be a function that takes an argument of the type specified by the Capturen. This lets servant worry about getting it from the URL and turning it into a value of the type you specify.,You can control how it'll be converted from 2 to your type by simply providing an instance of  for your type.Example: type MyApi = "books" :> Capture "isbn" Text :> Get '[JSON] Book server :: Server MyApi server = getBook where getBook :: Text -> EitherT ServantErr IO Book getBook isbn = ... servant-snap A server for a  bF first tries to match the request against the route represented by a and if it fails tries b7. You must provide a request handler for each route. type MyApi = "books" :> Get '[JSON] [Book] -- GET /books :<|> "books" :> ReqBody Book :> Post '[JSON] Book -- POST /books server :: Server MyApi server = listAllBooks :<|> postBook where listAllBooks = ... postBook book = ... servant-snapThe server for an  is emptyAPIServer. Rtype MyApi = "nothing" :> EmptyApi server :: Server MyApi server = emptyAPIServer !"#$%&'()*+,-./0123456789:;<=>?QRSTUVWXYZ[\]^_`bacdefghijklmnopqrs None .>HSVX servant-snapserve2 allows you to implement an API and produce a wai C.Example: type MyApi = "books" :> Get '[JSON] [Book] -- GET /books :<|> "books" :> ReqBody Book :> Post '[JSON] Book -- POST /books server :: Server MyApi server = listAllBooks :<|> postBook where listAllBooks = ... postBook book = ... myApi :: Proxy MyApi myApi = Proxy app :: Application app = serve myApi server main :: IO () main = Network.Wai.Handler.Warp.run 8080 app? !"#$%&'()*+,-./0123456789:;<=>?,!"#$%&'()*+,-./0123456789:;<=>? None servant-snap2Serve anything under the specified directory as a  endpoint. Xtype MyApi = "static" :> Raw server :: Server MyApi server = serveDirectory "/var/www" would capture any request to /static/<something> and look for  <something> under /var/www.kIt will do its best to guess the MIME type for that file, based on the extension, and send an appropriate  Content-Type header if possible.If your goal is to serve HTML, CSS and Javascript files that use the rest of the API as a webapp backend, you will most likely not want the static files to be hidden behind a /static/+ prefix. In that case, remember to put the ( handler in the last position, because servant* will try to match the handlers in order.None]      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>? !"#$%&'()*+,--./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcddeffghijklmnopqrstuvwxyz{|}~                                  !"#$%$&$'$($)$*$+$,$-$.$/$0$1$2$3$4$5$6$7$8$9$:$;$<=>=?=@=A=B=C=D=E=F=G=H=I=J=K=L=M=NOPOQOROSOTOUOVOWOXOYOZO[O\O]O^_`_a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z_{|}~~~~~~~~~~~~~~~~~~~~)servant-snap-0.8.4-CA4GotB0kHl2KiDgNVbTb8ServantServant.Server.Internal.Context Servant.Server.Internal.PathInfo"Servant.Server.Internal.ServantErr!Servant.Server.Internal.SnapShims*Servant.Server.Internal.RoutingApplicationServant.Server.Internal.Router!Servant.Server.Internal.BasicAuthServant.Server.InternalServant.ServerServant.Utils.StaticFilesControl.Monad.Trans.ReaderReaderT Servant.UtilsEnterserveserveWithContextServant.API.WithNamedContextWithNamedContextbase Data.ProxyProxy NamedContextHasContextEntrygetContextEntryContext EmptyContext:.descendIntoNamedContext $fEqContext $fEqContext0 $fShowContext$fShowContext0$fHasContextEntry:val$fHasContextEntry:val0rqPathpathInfo pathSafeTail reqSafeTail reqNoPath pathIsEmptysplitMatrixParameters parsePathInfoprocessedPathInfo ServantErr errHTTPCodeerrReasonPhraseerrBody errHeaders setHeadersresponseServantErr throwErrorerr300err301err302err303err304err305err307err400err401err402err403err404err405err406err407err409err410err411err412err413err414err415err416err417err500err501err502err503err504err505$fShowServantErr$fEqServantErr$fReadServantErr ApplicationsnapToApplicationsnapToApplication'applicationToSnap addHeaders unSnapMethodok200 noContent204 created201 badRequest400 notFound404methodNotAllowed405unsupportedMediaType415 initThunkDelayedM runDelayedMDelayed capturesDmethodDauthDacceptDcontentDparamsDheadersDbodyDserverD RouteResultFail FailFatalRouteRoutingApplication toApplication responseLBS runAction emptyDelayed delayedFaildelayedFailFatal withRequest addCaptureaddParameterCheckaddHeaderCheckaddMethodCheck addAuthCheck addBodyCheckaddAcceptCheck passToServer runDelayed$fMonadTransDelayedM$fAlternativeDelayedM$fMonadIODelayedM$fMonadDelayedM$fApplicativeDelayedM$fFunctorDelayedM$fFunctorDelayed$fEqRouteResult$fShowRouteResult$fReadRouteResult$fFunctorRouteResultRouterStructureStaticRouterStructureCaptureRouterStructureRawRouterStructureChoiceStructureRouter' StaticRouter CaptureRouterCaptureAllRouter RawRouterChoiceRouter pathRouter leafRouterchoicerouterStructure sameStructure routerLayout tweakResponse runRouter runRouterEnv runChoice worseHTTPCode$fFunctorRouter'$fEqRouterStructure$fShowRouterStructureBasicAuthCheckunBasicAuthCheckBasicAuthResult Unauthorized BadPassword NoSuchUser AuthorizedmkBAChallengerHdr decodeBAHdr runBasicAuth$fEqBasicAuthResult$fShowBasicAuthResult$fReadBasicAuthResult$fGenericBasicAuthResult$fFunctorBasicAuthResult$fGenericBasicAuthCheck$fFunctorBasicAuthCheck EmptyServerServer HasServerServerTroutehoistServerWithContextcapturedallowedMethodHead allowedMethodprocessMethodRouter methodCheck acceptCheck methodRoutermethodRouterHeaders emptyServer ct_wildcard streamRouter$fHasServerTYPEStreamcontextm$fHasServerTYPEStreamcontextm0$fHasServerTYPE:>contextm$fHasServerTYPE:>ctxm$fHasServerTYPE:>ctxm0$fHasServerTYPE:>contextm0$fHasServerTYPE:>contextm1$fHasServerTYPE:>contextm2$fHasServerTYPE:>contextm3$fHasServerTYPE:>contextm4$fHasServerTYPERawcontextm$fHasServerTYPE:>contextm5$fHasServerTYPE:>contextm6$fHasServerTYPE:>contextm7$fHasServerTYPE:>contextm8$fHasServerTYPEVerbcontextm$fHasServerTYPEVerbcontextm0$fHasServerTYPE:>contextm9$fHasServerTYPE:>contextm10$fHasServerTYPE:<|>ctxm$fHasServerTYPEEmptyAPIcontextm$fEqEmptyServer$fShowEmptyServer$fBoundedEmptyServer$fEnumEmptyServerserveSnapWithContext serveSnapserveDirectory'servant-0.16.0.1-6gjVq14swQSHxQZIureovhServant.API.EmptyEmptyAPIServant.API.Description DescriptionSummaryServant.API.QueryParam QueryFlagghc-prim GHC.TypesBool QueryParams text-1.2.3.1Data.Text.InternalText(http-api-data-0.4-GagWuJv90xwCD8ujM2l031Web.Internal.HttpApiDataFromHttpApiData GHC.MaybeMaybeNothingServant.API.Alternative:<|>serveApplicationServant.API.RawRawData.Type.BoolIf ToHttpApiData toUrlPiecetoEncodedUrlPiecetoHeader toQueryParam parseUrlPiece parseHeaderparseQueryParam(http-types-0.12.3-E5KSR7WXSnOHFYucAejn4UNetwork.HTTP.Types.Version HttpVersion httpMajor httpMinorNetwork.HTTP.Types.Method StdMethodGETPOSTHEADPUTDELETETRACECONNECTOPTIONSPATCH*network-uri-2.6.1.0-K75fCYvLQE41EntOQ30cqK Network.URIURI uriScheme uriAuthorityuriPathuriQuery uriFragment Servant.LinksallFieldLinks' allFieldLinks fieldLink' fieldLink allLinks'allLinks safeLink'safeLinklinkURI'linkURIlinkQueryParams linkSegmentsLinkParam SingleParamArrayElemParam FlagParamLinkArrayElementStyleLinkArrayElementBracketLinkArrayElementPlainAsLinkHasLinkMkLinktoLinkServant.API.StreamStream StreamGet StreamPost StreamBody StreamBody'SourceIO ToSourceIO toSourceIO FromSourceIO fromSourceIO FramingRender framingRenderFramingUnrenderframingUnrender NoFramingNewlineFramingNetstringFramingServant.API.TypeLevel EndpointsIsElem'IsElemIsSubAPI AllIsElemIsInIsStrictSubAPIAllIsInMapSub AppendList IsSubListElemElemGoOrAndServant.API.VerbsVerbGetPostPutDeletePatch PostCreated PutCreated GetAccepted PostAcceptedDeleteAccepted PatchAccepted PutAcceptedGetNonAuthoritativePostNonAuthoritativeDeleteNonAuthoritativePatchNonAuthoritativePutNonAuthoritative GetNoContent PostNoContentDeleteNoContentPatchNoContent PutNoContentGetResetContentPostResetContentGetPartialContent ReflectMethod reflectMethodServant.API.Sub:>Servant.API.ResponseHeaderslookupResponseHeadernoHeader addHeaderHeaders getResponsegetHeadersHListResponseHeaderHeader MissingHeaderUndecodableHeaderHListHNilHConsBuildHeadersTobuildHeadersTo GetHeaders getHeaders AddHeaderHasResponseHeaderServant.API.ReqBodyReqBodyReqBody'Servant.API.RemoteHost RemoteHost QueryParam QueryParam'Servant.API.HeaderHeader'Servant.API.ModifiersRequiredOptionalLenientStrictServant.API.IsSecureIsSecureSecure NotSecureServant.API.Experimental.Auth AuthProtectServant.API.ContentTypesJSON PlainTextFormUrlEncoded OctetStreamAccept contentType contentTypes MimeRender mimeRender MimeUnrender mimeUnrendermimeUnrenderWithType NoContentServant.API.CaptureCaptureCapture' CaptureAllServant.API.BasicAuth BasicAuth BasicAuthDatabasicAuthUsernamebasicAuthPassword$vault-0.3.1.2-BfwcwbpgFp1KiEPoPJbmwYData.Vault.LazyVault+singleton-bool-0.1.4-BswWCJ6C1foFLbVlo6nj0aData.Singletons.BoolSBoolIsboolSBoolSFalseSTrue