!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ ` a b c d e f g hijklmnopqrstuvwxyz{|}~Safe'(+>gA generalized Authentication combinator. Use this if you have a non-standard authentication technique.5NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE.Safe+&Endpoint for plugging in your own Wai  Applications. The given  ApplicationY will get the request as received by the server, potentially with a modified (stripped) pathInfo if the  Application is being routed with .:In addition to just letting you plug in your existing WAI  Applications, this can also be used with  ghttps://hackage.haskell.org/package/servant-server/docs/Servant-Utils-StaticFiles.html#v:serveDirectoryserveDirectoryK to serve static files stored in a particular directory on your filesystemNone&'(+0357>KLN"A type that can be converted from !application/x-www-form-urlencoded#, with the possibility of failure. A type that can be converted to !application/x-www-form-urlencoded*A type for responses without content-body.&YInstantiate this class to register a way of deserializing a type based on the request's  Content-Type header.)import Network.HTTP.Media hiding (Accept)2import qualified Data.ByteString.Lazy.Char8 as BSC)data MyContentType = MyContentType String:{#instance Accept MyContentType whereE contentType _ = "example" // "prs.me.mine" /: ("charset", "utf-8"):}:{5instance Read a => MimeUnrender MyContentType a where- mimeUnrender _ bs = case BSC.take 12 bs ofC "MyContentType" -> return . read . BSC.unpack $ BSC.drop 12 bs8 _ -> Left "didn't start with the magic incantation":}Ftype MyAPI = "path" :> ReqBody '[MyContentType] Int :> Get '[JSON] Int*MInstantiate this class to register a way of serializing a type based on the Accept header.Example: data MyContentType instance Accept MyContentType where contentType _ = "example" // "prs.me.mine" /: ("charset", "utf-8") instance Show a => MimeRender MyContentType where mimeRender _ val = pack ("This is MINE! " ++ show val) type MyAPI = "path" :> Get '[MyContentType] Int. Instances of .> represent mimetypes. They are used for matching against the Accept2 HTTP header of the request, and for setting the  Content-Type header of the responseExample:&import Network.HTTP.Media ((//), (/:)) data HTML:{instance Accept HTML where; contentType _ = "text" // "html" /: ("charset", "utf-8"):}5Like @ but allows all JSON values instead of just objects and arrays.;Will handle trailing whitespace, but not trailing junk. ie.-eitherDecodeLenient "1 " :: Either String IntRight 11eitherDecodeLenient "1 junk" :: Either String Int1Left "trailing junk after valid JSON: endOfInput" Right . toStrict  Right . id Right . BC.unpack (left show . TextS.decodeUtf8' . toStrict left show . TextL.decodeUtf8'+decodeFormUrlEncoded >=> fromFormUrlEncoded Note that the *mimeUnrender p (mimeRender p x) == Right x> law only holds if every element of x is non-null (i.e., not ("", "")) eitherDecode id BC.pack fromStrict . TextS.encodeUtf8'encodeFormUrlEncoded . toFormUrlEncoded Note that the *mimeUnrender p (mimeRender p x) == Right x> law only holds if every element of x is non-null (i.e., not ("", "")) application/octet-stream text/plain;charset=utf-8 !application/x-www-form-urlencoded application/json> !"#$%&'()*+,-./012345 !"#$%&'()*+,-./0123453210./*+&',-()$%"# !542 !"#$%&'()*+,-./012345Safe'(+>6=A simple datatype to hold data required to decorate a request:Combinator for  -https://tools.ietf.org/html/rfc2617#section-2Basic Access Authentication.6IMPORTANT*: Only use Basic Auth over HTTPS! Credentials are not hashed or encrypted. Note also that because the same credentials are sent on every request, Basic Auth is not as secure as some alternatives. Further, the implementation in servant-server does not protect against some types of timing attacks.QIn Basic Auth, username and password are base64-encoded and transmitted via the  AuthorizationF header. Handshakes are not required, making it relatively efficient.6789:6789::67896789:Safe'(+0>= with 206 status code.> with 205 status code.? with 205 status code.@ with 205 status code.A with 205 status code.B with 205 status code.C with 204 status code.D with 204 status code.E with 204 status code.F with 204 status code.G with 204 status code.H with 203 status code.I with 203 status code.J with 203 status code.K with 203 status code.L with 203 status code.M with 202 status code.N with 202 status code.O with 202 status code.P with 202 status code.Q with 202 status code.R with 201 status code.S with 200 status code.T with 200 status code.U with 200 status code.V with 200 status code.W with 200 status code.XVerb is a general type for representing HTTP verbs (a.k.a. methods). For convenience, type synonyms for each verb with a 200 response code are provided, but you are free to define your own:;type Post204 contentTypes a = Verb 'POST 204 contentTypes a$;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^( ;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX.XWVUTSRQPONMLKJIHGFEDCBA@?>=;<^]\[ZY #;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^ Safe(>__V names a specific tagged context to use for the combinators in the API. (See also in servant-server, Servant.Server.Context.) For example: ntype UseNamedContextAPI = WithNamedContext "myContext" '[String] ( ReqBody '[JSON] Int :> Get '[JSON] Int) Both the ReqBody and Get combinators will use the _- with type tag "myContext" as their context.Contexts are only relevant for servant-server.'For more information, see the tutorial.____None Safe+`-Was this request made over an SSL connection?UNote that this value will not tell you if the client originally made this request over SSL, but rather whether the current connection is SSL. The distinction lies with reverse proxies. In many cases, the client will connect to a load balancer over SSL, but connect to the WAI handler without SSL. In such a case, the handlers would get b=, but from a user perspective, there is a secure connection.a1the connection to the server is secure (HTTPS)b4the connection to the server is not secure (HTTP)`ab`ab`ab`ab Safe+cRProvides access to the host or IP address from which the HTTP request was sent.cccc Safe'(+>d,Extract the request body as a value of type a.Example:-- POST /booksAtype MyApi = "books" :> ReqBody '[JSON] Book :> Post '[JSON] Bookdddd Safe'(+>KLe]Lookup a potentially value-less query string parameter with boolean semantics. If the param sym] is there without any value, or if it's there with value "true" or "1", it's interpreted as ". Otherwise, it's interpreted as .Example:-- /books?publishedCtype MyApi = "books" :> QueryFlag "published" :> Get '[JSON] [Book]f$Lookup the values associated to the symB query string parameter and try to extract it as a value of type [a]K. This is typically meant to support query string parameters of the form param[]=val1&param[]=val2< and so on. Note that servant doesn't actually require the [],s and will fetch the values just fine with param=val1&param=val2, too.Example:5-- /books?authors[]=<author1>&authors[]=<author2>&...Htype MyApi = "books" :> QueryParams "authors" Text :> Get '[JSON] [Book]g#Lookup the value associated to the symB query string parameter and try to extract it as a value of type a.Example:-- /books?author=<author name>Ftype MyApi = "books" :> QueryParam "author" Text :> Get '[JSON] [Book]efgefgegfefgNone  Safe'(+->h4Extract the given header's value as a value of type a.Example:2newtype Referer = Referer Text deriving (Eq, Show)-- GET /view-my-refererNtype MyApi = "view-my-referer" :> Header "from" Referer :> Get '[JSON] RefererhijkhijkhijkhijkNone!"'(-34579>KLNqNote: if there are multiple occurences of a header in the argument, the values are interspersed with commas before deserialization (see  <http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2RFC2616 Sec 4.2)vXResponse Header objects. You should never need to construct one directly. Instead, use m.xThe underlying value of a vyHList of headers.lm3N.B.: The same header can't be added multiple timesnopqrstuvwxylmnopqrstuvwxyvwxylmpqnorstulmnopqrstuvwxySafe'(+>z;Capture a value from the request path under a certain type a.Example:-- GET /books/:isbn?type MyApi = "books" :> Capture "isbn" Text :> Get '[JSON] BookzzzzSafe+-./KL{=Union of two APIs, first takes precedence in case of overlap.Example::{8type MyApi = "books" :> Get '[JSON] [Book] -- GET /booksM :<|> "books" :> ReqBody '[JSON] Book :> Post '[JSON] () -- POST /books:}{|{|{|{|{|Safe'+>KL}7The contained API (second argument) can be found under  ("/" ++ path)" (path being the first argument).Example:-- GET /hello/world'-- returning a JSON encoded World value4type MyApi = "hello" :> "world" :> Get '[JSON] World}}}}} None&'(3579>KLN ~#Construct a toLink for an endpoint. Query param3Closed type family, check if endpoint is within apiYou may use this type family to tell the type checker that your custom type may be skipped as part of a link. This is useful for things like gH that are optional in a URI and do not affect them if they are omitted.data CustomThing7type instance IsElem' e (CustomThing :> s) = IsElem e s Note that 0 is called, which will mutually recurse back to ) if it exhausts all other options again.NOnce you have written a HasLink instance for CustomThing you are ready to go.HIf both a or b produce an empty constraint, produce an empty constraint.JIf either a or b produce an empty constraint, produce an empty constraint.6A safe link datatype. The only way of constructing a  is using , which means any / is guaranteed to be part of the mentioned API.-Segments of "foo/bar" would be ["foo", "bar"]@Create a valid (by construction) relative URI with query params.%This function will only typecheck if endpoint is part of the API api!~+The API endpoint you would like to point to-The whole API that this endpoint is a part of+The API endpoint you would like to point to~~~Nonet &'*+./01236789:;<=ABCDEFGHIJKLMNOPQRSTUVWX_`abcdefghijklmnopqstuvwxyz{|}~None(KL !"#$%$&$'$'()*()+(),()-().()/()/01234567899:;<=>?@ABCDEFGHHIJKLMNOPQQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwx y z { | } ~   "serva_C1v0Nh535Td9dpDIYf2YzcServant.API.VerbsServant.API.HttpVersionServant.Utils.LinksServant.API.VaultServant.API.Experimental.AuthServant.API.RawServant.API.ContentTypesServant.API.BasicAuthServant.API.WithNamedContextServant.API.IsSecureServant.API.RemoteHostServant.API.ReqBodyServant.API.QueryParamServant.API.HeaderServant.API.ResponseHeadersServant.API.CaptureServant.API.AlternativeServant.API.Sub*Servant.API.Internal.Test.ComprehensiveAPI:> Data.Aeson eitherDecode Servant.APIhttpt_2kqnYpPBpbH1f4ygoPM6quNetwork.HTTP.Types.MethodPATCHOPTIONSCONNECTTRACEDELETEPUTHEADPOSTGET StdMethodNetwork.HTTP.Types.Version httpMinor httpMajor HttpVersionnetwo_DarCcUHK1BCJHlIYOjXe67 Network.URI uriFragmenturiQueryuriPath uriAuthority uriSchemeURIvault_Ds02DFWDupK8kyaJ6uM5fAData.Vault.LazyVault AuthProtectRawFromFormUrlEncodedfromFormUrlEncodedToFormUrlEncodedtoFormUrlEncoded NoContentAllMimeUnrenderallMimeUnrender AllMimeRender allMimeRenderAllMimeallMime AllCTUnrender handleCTypeH MimeUnrender mimeUnrender AllCTRender handleAcceptH MimeRender mimeRender AcceptHeaderAccept contentType OctetStreamFormUrlEncoded PlainTextJSONcanHandleAcceptHeitherDecodeLenient BasicAuthDatabasicAuthUsernamebasicAuthPassword BasicAuth ReflectMethod reflectMethodGetPartialContentPutResetContentPatchResetContentDeleteResetContentPostResetContentGetResetContent PutNoContentPatchNoContentDeleteNoContent PostNoContent GetNoContentPutNonAuthoritativePatchNonAuthoritativeDeleteNonAuthoritativePostNonAuthoritativeGetNonAuthoritative PutAccepted PatchAcceptedDeleteAccepted PostAccepted GetAccepted PostCreatedPatchDeletePutPostGetVerb$fReflectMethodStdMethodHEAD$fReflectMethodStdMethodPATCH$fReflectMethodStdMethodDELETE$fReflectMethodStdMethodPUT$fReflectMethodStdMethodPOST$fReflectMethodStdMethodGETWithNamedContextIsSecureSecure NotSecure RemoteHostReqBody QueryFlag QueryParams QueryParamHeader MissingHeaderUndecodableHeader AddHeader addHeader GetHeaders getHeadersBuildHeadersTobuildHeadersTo HeaderValMapHListHNilHConsHeaders getResponsegetHeadersHListCapture:<|>HasLinkMkLinktoLinkIsElemIsElem'OrLinklinkURIsafeLinkComprehensiveAPIcomprehensiveAPI$$fMimeUnrender*OctetStreamByteString%$fMimeUnrender*OctetStreamByteString0$fMimeUnrender*PlainText[]$fMimeUnrender*PlainTextText$fMimeUnrender*PlainTextText0$fMimeUnrender*FormUrlEncodeda$fMimeUnrender*JSONa"$fMimeRender*OctetStreamByteStringbytes_6VWy06pWzJq9evDvK2d4w6Data.ByteString.Lazy fromStrict#$fMimeRender*OctetStreamByteString0$fMimeRender*PlainText[]$fMimeRender*PlainTextText$fMimeRender*PlainTextText0text_HmqVQnZSpjaC156ABqPhneData.Text.Lazy.Encoding encodeUtf8$fMimeRender*FormUrlEncodeda$fMimeRender*JSONaaeson_FnADcKFoDWeK9YK1YvshsyData.Aeson.Encode.Functionsencode$fAccept*OctetStream$fAccept*PlainText$fAccept*FormUrlEncoded $fAccept*JSONencodeFormUrlEncodeddecodeFormUrlEncoded$fFromFormUrlEncoded[]$fToFormUrlEncoded[]$fAllMimeUnrender:a$fAllMimeUnrender[]a$fAllMimeRender:NoContent$fAllMimeRender:NoContent0$fAllMimeRender:a$fAllMimeRender:a0 $fAllMime: $fAllMime[]$fAllCTUnrenderctypsa$fAllCTRender:aghc-prim GHC.TypesTrueFalseContains$fAddHeaderSymbolhvanew!$fAddHeaderSymbolhvHeadersHeaders$fGetHeadersHeaders$fGetHeadersHeaders0$fGetHeadersHList$fGetHeadersHList0$fBuildHeadersTo:$fBuildHeadersTo[] $fMonoid:<|>ParamAnd _segments SingleParamArrayElemParam FlagParamQueryElem IsSubList _queryParams addSegment addQueryParamescape $fHasLink*Raw$fHasLink*Verb $fHasLink*:> $fHasLink*:>0 $fHasLink*:>1 $fHasLink*:>2 $fHasLink*:>3 $fHasLink*:>4 $fHasLink*:>5$fToHttpApiDataLinkhttpa_3kiLcpdXTUe4CYRpIoinpPWeb.HttpApiData.Internal toQueryParamtoHeader toUrlPiece ToHttpApiDataparseQueryParam parseHeader parseUrlPieceFromHttpApiData