ה=w      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvNone%  !"#$%&%  !"#$%&%  !"#$%&   !"#$%&None+2468=HJKM'A natural transformation from m to n . Used to + particular datatypes.,Like w.0Log the contents of xP with the function provided as the first argument, and return the value of the WriterT computation1Like 0, but for strict WriterT.3Like mmorph's y.4Like mmorph's z.5Like mmorph's {.6Like mmorph's |.'()*+,-./0123456789:'()*+,-./0123456*+:9'()87,-./0123456'()*+,-./0123456789:None'(234=JKM@A wrapper around } C a.DAan even even more informative arbitrary HTTP response code error.EDan even more informative "your json request body wasn't valid" errorF'request body has unsupported media typeG=a more informative "you just got the HTTP method wrong" errorHthe usual "not found" errorQBLike `null . pathInfo`, but works with redundant trailing slashes.T.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.X+Make sure the incoming request starts with "/path"5, strip it and pass the rest of the request path to  sublayout.Y If you use ~ 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  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-streamu. 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 (Int, String) IO Book postBook book = ...insert into your db...ZKJust pass the request to the underlying application and serve its response.Example: ^type MyApi = "images" :> Raw server :: Server MyApi server = serveDirectory "/var/www/images"[ 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" :> MatrixFlag "published" :> Get [Book] server :: Server MyApi server = getBooks where getBooks :: Bool -> EitherT (Int, String) IO [Book] getBooks onlyPublished = ...return all books, or only the ones that are already published, depending on the argument...\ 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" :> MatrixParams "authors" Text :> Get [Book] server :: Server MyApi server = getBooksBy where getBooksBy :: [Text] -> EitherT (Int, String) IO [Book] getBooksBy authors = ...return all books by these authors...] If you use  "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: 3type MyApi = "books" :> MatrixParam "author" Text :> Get [Book] server :: Server MyApi server = getBooksBy where getBooksBy :: Maybe Text -> EitherT (Int, String) IO [Book] getBooksBy Nothing = ...return all books... getBooksBy (Just author) = ...return books by the given author...^ 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 (Int, String) IO [Book] getBooks onlyPublished = ...return all books, or only the ones that are already published, depending on the argument..._ 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 (Int, String) IO [Book] getBooksBy authors = ...return all books by these authors...` If you use  "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: :type MyApi = "books" :> QueryParam "author" Text :> Get '[JSON] [Book] server :: Server MyApi server = getBooksBy where getBooksBy :: Maybe Text -> EitherT (Int, String) IO [Book] getBooksBy Nothing = ...return all books... getBooksBy (Just author) = ...return books by the given author...c$When implementing the handler for a  endpoint, just like for ,    and    , the handler code runs in the EitherT (Int, String) IO monad, where the % represents the status code and the D a message, returned in case of failure. You can quite handily use  1 to quickly fail if some conditions are not met.HIf successfully returning a value, we just require that its type has a ToJSONa instance and servant takes care of encoding it for you, yielding status code 200 along the way.f$When implementing the handler for a  endpoint, just like for ,    and  , the handler code runs in the EitherT (Int, String) IO monad, where the % represents the status code and the D a message, returned in case of failure. You can quite handily use  1 to quickly fail if some conditions are not met.\If successfully returning a value, we use the type-level list, combined with the request's AcceptX header, to encode the value for you (returning a status code of 200). If there was no Accept header or it was */*#, we return encode using the first  Content-Type type on the list.i$When implementing the handler for a  endpoint, just like for ,    and    , the handler code runs in the EitherT (Int, String) IO monad, where the % represents the status code and the D a message, returned in case of failure. You can quite handily use  1 to quickly fail if some conditions are not met.\If successfully returning a value, we use the type-level list, combined with the request's AcceptX header, to encode the value for you (returning a status code of 201). If there was no Accept header or it was */*#, we return encode using the first  Content-Type type on the list.j If you use  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 u. 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: Ynewtype 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 (Int, String) IO referer viewReferer referer = return refererm$When implementing the handler for a  endpoint, just like for ,  and    , the handler code runs in the EitherT (Int, String) IO monad, where the % represents the status code and the D a message, returned in case of failure. You can quite handily use  1 to quickly fail if some conditions are not met.\If successfully returning a value, we use the type-level list, combined with the request's AcceptX header, to encode the value for you (returning a status code of 200). If there was no Accept header or it was */*#, we return encode using the first  Content-Type type on the list.pIf you have a U endpoint in your API, the handler for this endpoint is meant to delete a resource.-The code of the handler will, just like for   ,  and    , run in EitherT (Int, String) IO (). The $ represents the status code and the ( a message to be returned. You can use S to painlessly error out if the conditions for a successful deletion are not met.q If you use  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 n. 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 (Int, String) IO Book getBook isbn = ...r 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 = ...s If we get a ), it has precedence over everything else.6This in particular means that if we could get several <s, only the first we encounter would be taken into account.:;<=>?the request, the field  may be modified by url routing@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrst;<=>?@ABCDEFGHIJKLMNOPQRSTUVW:ILKJMCHGFEDt@ABNOPQs?RST<=>;rUqponmlkjihgfedcba`_^V]\[ZYXW.;<=>?@ABCHGFEDILKJMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstNone3=Kuu2 allows you to implement an API and produce a wai .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 appu9  !"#$%&'()+,-./0123456;<=>Mu9uM<=>;+'(),-./1023456  !"#$%&uNonev2Serve 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 v( handler in the last position, because servant* will try to match the handlers in order.vvvvNone~  !"#$%&'()+,-./0123456;<=>Muv !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~    servant-server-0.4.0Servant"Servant.Server.Internal.ServantErrServant.Server.Internal.EnterServant.Server.InternalServant.ServerServant.Utils.StaticFilesServant.API.DeleteDeleteServant.API.GetGetServant.API.PutPutControl.Monad.Trans.EitherTleftServant.API.PostPostControl.Monad.Trans.Eitherbase Data.ProxyProxy ServantErr errHTTPCodeerrReasonPhraseerrBody errHeadersresponseServantErrerr300err301err302err303err304err305err307err400err401err402err403err404err405err406err407err409err410err411err412err413err414err415err416err417err500err501err502err503err504err505:~>NatunNatEnterenterliftNat runReaderTNatevalStateTLNatevalStateTSNatlogWriterTSNatlogWriterTLNat fromExceptThoistNatembedNat squashNat generalizeNat $fEnterm:~>n$fCategory(->):~>$fEnter(->)arg(->)$fEnter:<|>arg1:<|>Server HasServerServerTrouteRoutingApplication RouteResultRR routeResult RouteMismatch HttpError InvalidBodyUnsupportedMediaType WrongMethodNotFound ReqBodyStateDoneCalledUncalled toApplicationfailWith succeedWith isMismatch pathIsEmptysplitMatrixParameters parsePathInfoprocessedPathInfocapturedparseMatrixText ct_wildcard$fHasServer*:>$fHasServer*:>0$fHasServer*Raw$fHasServer*:>1$fHasServer*:>2$fHasServer*:>3$fHasServer*:>4$fHasServer*:>5$fHasServer*:>6$fHasServer*Patch$fHasServer*Patch0$fHasServer*Patch1$fHasServer*Put$fHasServer*Put0$fHasServer*Put1$fHasServer*Post$fHasServer*Post0$fHasServer*Post1$fHasServer*:>7$fHasServer*Get$fHasServer*Get0$fHasServer*Get1$fHasServer*Delete$fHasServer*Delete0$fHasServer*Delete1$fHasServer*:>8$fHasServer*:<|>$fMonoidRouteResult$fMonoidRouteMismatchserveserveDirectorytransformers-0.4.3.0Control.Monad.Trans.Classlift!Control.Monad.Trans.Writer.StrictWriterT mmorph-1.0.4Control.Monad.Morphhoistembedsquash generalize Data.EitherEither servant-0.4.0Servant.API.ReqBodyReqBodyServant.API.MatrixParam MatrixFlagghc-prim GHC.TypesBool MatrixParams text-1.2.0.4Data.Text.InternalTextServant.Common.TextFromText MatrixParam Data.MaybeMaybeNothingServant.API.QueryParam QueryFlag QueryParams QueryParamServant.API.PatchPatchIntGHC.BaseStringServant.API.HeaderHeaderServant.API.CaptureCaptureServant.API.Alternative:<|>Right wai-3.0.2.3Network.Wai.InternalpathInfo Network.Wai ApplicationServant.API.RawRawnetwork-uri-2.6.0.3 Network.URI uriFragmenturiQueryuriPath uriAuthority uriSchemeURIServant.Utils.LinkssafeLinklinkURILinkOrIsElem'IsElemtoLinkMkLinkHasLinkServant.API.Sub:>Servant.API.ResponseHeadersgetHeadersHList getResponseHeadersHNilHConsHListbuildHeadersToBuildHeadersTo getHeaders GetHeaders addHeader AddHeader MissingHeaderUndecodableHeaderServant.API.ContentTypesJSON PlainTextFormUrlEncoded OctetStream contentTypeAccept mimeRender MimeRender mimeUnrender MimeUnrendertoFormUrlEncodedToFormUrlEncodedfromFormUrlEncodedFromFormUrlEncodedfromTexttoTextToText