Q      !"#$%&'()* + , - . / 0 1 2 3 4 5 6789:;<=>?@ABCDEFGHIJKLMNOP Safe-Inferred24pFor putting values in paths and query string parameters Instances should obey: > fromText (toText a) == Just a yFor getting values from url captures and query string parameters Instances should obey: > fromText (toText a) == Just aQ toText True"true" toText False"false"R%fromText ("true"::Text) :: Maybe Bool Just True&fromText ("false"::Text) :: Maybe Bool Just False.fromText ("anything else"::Text) :: Maybe BoolNothing% STUVWXYZ[\]^_`abcdefghijklmQRnopq  #  STUVWXYZ[\]^_`abcdefghijklmQRnopq Safe-Inferred+ &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 K to serve static files stored in a particular directory on your filesystem    None&'(+246=JKM "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-urlencodedYInstantiate 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] IntMInstantiate 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"):}%Like @ 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"r Right . toStricts  Right . idt (left show . TextS.decodeUtf8' . toStrictu left show . TextL.decodeUtf8'v+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 ("", ""))w eitherDecodexyz id{ 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/json5  !"#$%rstuvwxz{|~  !"#$%$#"!  %+   !"#$%rstuvwxz{|~ Safe-Inferred(+=&tEndpoint for PATCH requests. The type variable represents the type of the response body (not the request body, use   for that).4If the HTTP response is empty, only () is supported.Example:-- PATCH /books/-- with a JSON encoded Book as the request body"-- returning the just-created BookBtype MyApi = "books" :> ReqBody '[JSON] Book :> Patch '[JSON] Book&&&& Safe-Inferred(+='IEndpoint for PUT requests, usually used to update a ressource. The type a2 is the type of the response body that's returned.Example:-- PUT /books/:isbn:-- with a Book as request body, returning the updated BookWtype MyApi = "books" :> Capture "isbn" Text :> ReqBody '[JSON] Book :> Put '[JSON] Book'''' Safe-Inferred(+=(Combinator for DELETE requests.Example:-- DELETE /books/:isbn5type MyApi = "books" :> Capture "isbn" Text :> Delete(((( Safe-Inferred(+=)sEndpoint for POST requests. The type variable represents the type of the response body (not the request body, use   for that).Example:-- POST /books/-- with a JSON encoded Book as the request body"-- returning the just-created BookAtype MyApi = "books" :> ReqBody '[JSON] Book :> Post '[JSON] Book))))  Safe-Inferred(+=*<Endpoint for simple GET requests. Serves the result as JSON.Example:*type MyApi = "books" :> Get '[JSON] [Book]**** None'(+=+^Lookup a potentially value-less matrix 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;publishedDtype MyApi = "books" :> MatrixFlag "published" :> Get '[JSON] [Book],$Lookup the values associated to the symC matrix string parameter and try to extract it as a value of type [a]L. This is typically meant to support matrix 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>;...Itype MyApi = "books" :> MatrixParams "authors" Text :> Get '[JSON] [Book]-#Lookup the value associated to the symC matrix string parameter and try to extract it as a value of type a.Example:-- /books;author=<author name>Gtype MyApi = "books" :> MatrixParam "author" Text :> Get '[JSON] [Book]+,-+,-+-,+,-  Safe-Inferred'(+=.,Extract the request body as a value of type a.Example:-- POST /booksAtype MyApi = "books" :> ReqBody '[JSON] Book :> Post '[JSON] Book.... None'(+=JK/]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]0$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]1#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]/01/01/10/01 None'(+-=24Extract 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] Referer2345234525432543None!"'(-23468=JKM;Note: 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)@XResponse Header objects. You should never need to construct one directly. Instead, use 7.BThe underlying value of a @CHList of headers.673N.B.: The same header can't be added multiple times89:;<=>?@ABC6789:;<=>?@ABC@ABC67:;89<=?>6789:;<=?>@ABCNone'(+=D;Capture a value from the request path under a certain type a.Example:-- GET /books/:isbn?type MyApi = "books" :> Capture "isbn" Text :> Get '[JSON] BookDDDD Safe-Inferred+JKE=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:}EFEFEFEFEF Safe-Inferred'+=JKG7The 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] WorldGGGGG None&'(2468=JKM H#Construct a toLink for an endpoint.Query/Matrix paramK3Closed type family, check if endpoint is within apiLYou 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 1H 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 K0 is called, which will mutually recurse back to L) 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.MJIf either a or b produce an empty constraint, produce an empty constraint.N6A safe link datatype. The only way of constructing a N is using P, which means any N/ is guaranteed to be part of the mentioned API.-Segments of "foo/bar" would be ["foo", "bar"]P@Create a valid (by construction) relative URI with query params.%This function will only typecheck if endpoint is part of the API api'HIJ+The API endpoint you would like to point toKLMNOP-The whole API that this endpoint is a part of+The API endpoint you would like to point toHIJKLMNOPPHIJONLKMHIJKLMNOPNone=JKA  !"#$&'()*+,-./0123456789:;=>?@ABCDEFGHIJKLP  !"#$%&'()*+,-./01234567789:;<=>?@AB C D E F  G H I J K L JMNOPQRSTUVWWXYZ[[\]^_`abcdefghijklmnopqrstuvwxyz{|}~bservant-0.4.4.3Servant.Utils.LinksServant.Common.TextServant.API.RawServant.API.ContentTypesServant.API.PatchServant.API.PutServant.API.DeleteServant.API.PostServant.API.GetServant.API.MatrixParamServant.API.ReqBodyServant.API.QueryParamServant.API.HeaderServant.API.ResponseHeadersServant.API.CaptureServant.API.AlternativeServant.API.Sub:>Servant.Utils.StaticFilesserveDirectory Data.Aeson eitherDecodeReqBody Servant.APInetwork-uri-2.6.0.3 Network.URI uriFragmenturiQueryuriPath uriAuthority uriSchemeURIToTexttoTextFromTextfromTextRawFromFormUrlEncodedfromFormUrlEncodedToFormUrlEncodedtoFormUrlEncoded IsNonEmptyAllMimeUnrenderallMimeUnrender AllMimeRender allMimeRender AllCTUnrender handleCTypeH MimeUnrender mimeUnrender AllCTRender handleAcceptH MimeRender mimeRender AcceptHeaderAccept contentType OctetStreamFormUrlEncoded PlainTextJSONeitherDecodeLenientPatchPutDeletePostGet MatrixFlag MatrixParams MatrixParam QueryFlag QueryParams QueryParamHeaderUndecodableHeader MissingHeader AddHeader addHeader GetHeaders getHeadersBuildHeadersTobuildHeadersTo HeaderValMapHListHConsHNilHeaders getResponsegetHeadersHListCapture:<|>HasLinkMkLinktoLinkIsElemIsElem'OrLinklinkURIsafeLink $fToTextBool$fFromTextBool runReader $fToTextFloat$fFromTextFloat$fToTextDouble$fFromTextDouble$fToTextInteger$fFromTextInteger$fToTextWord64$fFromTextWord64$fToTextWord32$fFromTextWord32$fToTextWord16$fFromTextWord16 $fToTextWord8$fFromTextWord8 $fToTextWord$fFromTextWord $fToTextInt64$fFromTextInt64 $fToTextInt32$fFromTextInt32 $fToTextInt16$fFromTextInt16 $fToTextInt8$fFromTextInt8 $fToTextInt $fFromTextInt $fToText[] $fFromText[] $fToTextText$fFromTextText$$fMimeUnrender*OctetStreamByteString%$fMimeUnrender*OctetStreamByteString0$fMimeUnrender*PlainTextText$fMimeUnrender*PlainTextText0$fMimeUnrender*FormUrlEncodeda$fMimeUnrender*JSONa"$fMimeRender*OctetStreamByteStringbytestring-0.10.4.0Data.ByteString.Lazy fromStrict#$fMimeRender*OctetStreamByteString0$fMimeRender*PlainTextText$fMimeRender*PlainTextText0 text-1.2.1.3Data.Text.Lazy.Encoding encodeUtf8$fMimeRender*FormUrlEncodeda$fMimeRender*JSONaaeson-0.10.0.0Data.Aeson.Encode.Functionsencode$fAccept*OctetStream$fAccept*PlainText$fAccept*FormUrlEncoded $fAccept*JSONencodeFormUrlEncodeddecodeFormUrlEncoded$fFromFormUrlEncoded[]$fToFormUrlEncoded[]$fAllMimeUnrender:a$fAllMimeUnrender[]a$fAllMimeRender[]a$fAllMimeRender:a$fAllMimeRender:a0$fAllCTUnrenderctypsa$fAllCTRenderctypsaghc-prim GHC.TypesTrueFalseContains$fAddHeaderSymbolhvanew!$fAddHeaderSymbolhvHeadersHeaders$fGetHeadersHeaders$fGetHeadersHeaders0$fGetHeadersHList$fGetHeadersHList0$fBuildHeadersTo:$fBuildHeadersTo[] $fMonoid:<|>ParamAnd _segments FlagParamArrayElemParam SingleParamQueryMatrix IsSubList _queryParams addSegment addQueryParamaddMatrixParamescape $fHasLink*Raw$fHasLink*Delete $fHasLink*Put$fHasLink*Post $fHasLink*Get $fHasLink*:> $fHasLink*:>0 $fHasLink*:>1 $fHasLink*:>2 $fHasLink*:>3 $fHasLink*:>4 $fHasLink*:>5 $fHasLink*:>6 $fHasLink*:>7 $fHasLink*:>8