?g      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ $types and tools for making responsesNoneEOpair of media type to match and a function that produces a builder for a valueCinstances of this class produce content-negotiated response bodies.if you're in a situation where there are performance concerns around building a lazy bytestring for the response, you should consider instead building ,s by hand (i.e. by using the WAI functions).specify the conversion. this is supposed to fail if and only if there is no way for the instance to satisfy the accept header. otherwise. a successful conversion will include both a bytestring to use as the body and the value to use for the content type header9contains both the content type header value and the body.<the type of the responder callback that is handed to a WAI Mconverts a media type matcher into a pair of media type and response body...Qyes, what it does is duplicate the media type and apply the builder to the valuefind the media type matcher that matches the passed Accept header value, and use it to produce a ResponseBuilder for the passed value. fail with Nothing if no builder can be found given the header. see try to match using matchToContentsU; if that fails, use the response body generated by the defaul matcher (first input)(the content type parameter charset=utf-8 takes a text producer and produces a media type matcher that'll encode the text as utf-8 and annotate the content type with that parameteryou can use this in K and render your type into lazy Text; this will make sure it gets encoded. 8take a ResponseBody instance and turn it into a response ztry to produce a Response object for an instance of ToResponseBody. the last input must be the value of the accept header *make a MediaTypeMatcher that produces JSON 1matches only if client accepts "application/json"builds an html matchermatches only html acceptancethe value to convertBthe http accept header. will be "*/*" if the client didn't set it.content type header, body    $types and tools for reporting errorsNoneHMunewtype wrapper for the error messages produced while parsing json so we can have a ReportableError instance for it.,type class for responses that report errors.lan error report is something that can be sent back as a response without having to worry about it too much.^the reason for the error. should describe the type of error that occurred to the api consumer.4a message that might explain why the error occurred.0any details about the error that could be useful)constructor for the simplest error report4constructor for error report with reason and message4constructor for error report with reason and details !error report with all the fixings!:construct a single-key json object if the value is present"%format a Status into a single string.)for example, "200 OK", or "404 Not Found"#i am not sure what the type means, but you pass this a default string and a format for a thing, and it gives you a formatter for maybe that thing.$"build a format for an error report'Eformat a JSON value in a simple way. let Aeson handle the formatting.(!the plaintext error report formattries to be somewhat yaml)"renders error report as plain text+the html format,renders error report as HTML/this instance constructs an  for the exception and uses -1the ErrorReport json representation has the fields "reason", "message", and "details". Absent message and details values are represented as null in json.#the http error code that'll be sentthe error to be reported&the Accept header on the receiving endthe http body to send. !"#$format for the reason'format for the message, if there is oneformat for the details, if any%&'()*+,-./01 !"#$%&'()*+,-1 !"#$%&'()*+,0-/. !"#$%&'()*+,-./01 defines the > typeclassNone682?newtype for things that should be encoded as or parsed as Json.the > instance uses the immediate  parser.5?newtype for things that should be encoded as or parsed as Json.the FromBody instance uses  - the lazy version.>Rsomething that can be pulled from the body, restricted to a ReportableError type.?parse the body. note that the body is provided as a lazy ByteString. how that ByteString is loaded depends on the caller of fromBody.23456789:;<=>?@ABCDE23456789:;<=>?>?;<=E89:D567CB234A@ 23456789:;<=>?@ABCDE path consumerNoneF4stores the path and how much of it has been consumedHthe consumed part of the path.Ithe unconsumed partL4build a path consumer starting with nothing consumedMget the next path elementNmove forward in the path FGHIJKLMNO FGHIJKLMNO FGHIKJLMNOFGHIJKLMNO)simple utilities for working with HLists.None (=BHJKMPHList with one element.Q`empty HList (useful for keeping other modules from needing to add several language extensions).RUthis type family represents functions that can take all of the elements of an HList.S@uncurrys a function by applying it to the elements of the HList.Tuncurrys the function by applying it to the HList, then returns the result of that uncurrying as a single-element HList. useful for transforming PathExtractors.PQRSTPQRSTRQPSTPQRSTdefault warp server setupNoneUsets up the app using V then uses  to run it.V9combines the application with the middleware created by WW7combines gzip middleware and request logging middlewaresee !; uses the default values for it.-the request logger is set up with the format  , and uses the  as the destination. see .UVWUVWUVWUVW base types NoneE  !"#$%&'()*+,-23456789:;<=>?FGHIJKLMNO the monad and all of its supportNone(246=BHJKMXVrecord containing responders that request matching tools can use when failures occur.Z1what to do if the request method is not supported[-what to do if the request path has no matches\&what to do if the body failed to parse]$what to do when authentication fails^#what to do when authorization fails_,what to do when an exception has been caught`+what to do when no media type is acceptablea0this class is the api for building your handler.bVperform the WAI application respond action (after converting the value to a response)cget out the request.dget the X.erun an inner action that will see an updates set of error handlers. this is useful when you know that inner actions will need to do resource cleanup or something.f*get the path as it's been consumed so far.g0run the inner action with an updated path state.Zthis is the environment data used by RespondT. you probably don't want to mess with this.oxRespondT is a monad transformer that provides an implementation of MonadRespond. you build your application using this.pFrun the RespondT action with failure handlers and request information.7XYZ[\]^_`abcdefghijklmnopqXYZ[\]^_`abcdefghijklmnopqabcdefgopqXYZ[\]^_`nmjihklXYZ[\]^_`abcdefghijklmnopqresponse utilitiesNoneEt\get the value of the Accept header, falling back to "*/*" if it was not sent in the requestuQresponding with an empty body means not having to worry about the Accept header.v*respond by getting the information from a wrespond by using the ToResponseBody instance for the value and determining if it can be converted into an acceptable response body.calls ~4 if an acceptable content type cannot be produced..x"respond with no additional headersyrespond with 200 Okz>respond using a ReportableError to generate the response body.{$respond that something was not found|gan action that gets the currently installed unsupported method handler and applies it to the arguments}Dan action that gets the installed unmatched path handler and uses it~3get and use handler for unacceptable response types7generic handler-getter for things that use ErrorReportsLan action that gets the installed body parse failure handler and applies it)get and use installed auth failed handler!get and use access denied handler*get and use handler for caught exceptions.get a specific handler. getHandler = (<$> getHandlers))a way to use Maybe values to produce 404s+catch Exceptions using MonadCatch, and use " to respond with an error report.rstuvwxyz{|}~@a handler-getter that gets a handler that takes an error report the errorrstuvwxyz{|}~rstuvwxyz{|}~rstuvwxyz{|}~ response utilitiesNoneEAdefault failure handlers. uses the defaultXHandler for each fielddefault unsupported method handler sends back an EmptyBody with status 405 and an Allowed header listing the allowed methods in the first path'respond with status404 and nothing elseBrespond with status 400 and a message about the body parse failurerespond with 401respond with 403respond with 500respond with 406 $building and running a RespondT app.NoneEHM ?RespondT stacked on top of IO; the simplest stack for handlers. build an  from a o router stack.it's  with  passed in."serve a RespondT router app using U on ."serve a RespondT router app using U on /build an Application out of a RespondM handler.Obuild an Application out of a RespondM handler using the default error handlersserve a RespondM handler9serve a RespondM handler using the default error handlers !however you want failures handledhow to unpeel your monad to  your api - must respond.give this to warp or something helpers for matching requestsNoneE 6gets the body as a lazy ByteString using lazy IO (see  ))gets the body as a lazy ByteString using strict IO (see  )0use a FromBody instance to parse the body. uses  to lazily load the body data.1uses a FromBody instance to parse the body. uses  to load the body strictly.extracts the body using . runs the inner action only if the body could be loaded and parseda using the FromBody instance; otherwise responds with the reportable error by calling .extracts the body using . runs the inner action only if the body could be loaded and parseda using the FromBody instance; otherwise responds with the reportable error by calling .authenticate uses the result of the authentication action (if it succssfully produced a result) to run the inner action function. otherwise, it uses .|reauthenticate tries to use a prior authentication value to run the inner action; if it's not availalble, it falls back to 4 to apply the auth action and run the inner action.=if given an error report value , respond immediately using  handleDenied!. otherwise, run the inner route.Hif the bool is true, run the inner. otherwise, handleDenied the report.4authorize using an Either; if it's Left, fail using  handleDeniedc on the contained ReportableError. if it's right, run the inner action using the contained value,selects action by accept headerxdefends the inner routes by first checking the Accept header and failing if it cannot accept any media type in the list +default action - do this if nothing matches/actions to perform for each accepted media type chosen action *utilties for matching HTTP request methodsNone-Map from method to thing. use it as a monoid. onGET action1 <> onPUT action2Vlook up the request method in the MethodMatcher map and run the action; fall back on |6 if the method cannot be parsed or is not in the map.map a StdMethod to a thing.Jshortcut for when you want to run an inner action for just one http method ,matchOnlyMethod m = matchMethod . onMethod m shortcut for  GET path matching utilityNone 246=BK @natural numbers starting with 1. you can get this out of a path.;a path extractor that extracts a single value from the path4a path extractor that extracts nothing, just matchesthe path extractor matches the path and extracts values; it is useful for building PathMatchers. it is built on both MState and Maybe - if it succeeds, it can modify the state to represent the path it has consumed.Othe PathMatcher makes it easy to provide actions for different paths. you use  to run it.Hyou can use this as a monad, but tbh you probably just want to use the   and especially   instances.run a path matcher containing a respond action against the current path. uses the currently installed unmatched path handler if the match fails.see }+wrap the action within a path matcher with P; this way all paths below this can be restricted to a single method properly. pathWithMethod GET0takes a Maybe and makes it into a path extractorruns a  against a F. create a S by providing a path extractor and an action that consumes the extracted elements. note that R? is just a function from the types extracted to something else path ((value :: PathExtractor1 String) </> seg "whatever" </> (value :: PathExtractor1 Integer)) $ \string integer -> -- some actionxan action that runs the action (HListElim l (m a)) with the new path consumer state if an extracted value is provided. "this mainly exists for the use of .2a simple matcher for being at the end of the path.  pathEndOrSlash = path endOrSlash/a simple matcher for the last segment of a path +pathLastSeg s = path (seg s </> endOrSlash)(combine two path extractors in sequence.Omatch only when the PathConsumer in the path state has no unconsumed elements.zbuild a path matcher that runs an extractor function on a single element and then advances the path state if it matched. Hbuild an extractor from a function that does not produce any real valueconvert a predicate into a rWAI represents a trailing slash by having a null text as the last element in the list. this matches it. it's just  slashEnd =   )best way to match the path end. it's just  endOrSlash =    +require that a segment be a certain string.Jan extractor that takes a single path element and produces a single valueif you have a ; instance for some type, you can extract it from the path.)path extraction matcher transformed with Opath extraction matcher with action wrapped so that it only matches GET method2utility method for conditionally providing a value+run the inner action with a set path state. usePath = withPath . const5get the part of the path that's been consumed so far. )getConsumedPath = _pcConsumed <$> getPath5get the part of the path that has yet to be consumed. -getUnconsumedPath = _pcUnconsumed <$> getPath4get the next unconsumed path segment if there is one .getNextSegment = headMay <$> getUnconsumedPath9run the inner action with the next path segment consumed. 0withNextSegmentConsumed = withPath pcConsumeNext*%*%,main module for library. exports everything.None  !"#$%&'()*+,-23456789:;<=>?FGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !"#$%%&'())*+,-./0123456789:;<=>?@ABBCDDEFFGHHIJKLMNOPQRRSTUVWXYZ[\]^_`abccdefghijklmnopqrstuvwxyz{|}~            y      !" !# !$%&'( respond-1.0.0Web.Respond.Types.ResponseWeb.Respond.Types.ErrorsWeb.Respond.Types.RequestWeb.Respond.Types.PathWeb.Respond.HListUtilsWeb.Respond.DefaultServerWeb.Respond.MonadWeb.Respond.ResponseWeb.Respond.DefaultHandlersWeb.Respond.RunWeb.Respond.RequestWeb.Respond.MethodWeb.Respond.PathWeb.Respond.Types Data.Textnull Web.RespondMediaTypeMatcherToResponseBodytoResponseBody ResponseBody ResponderprepMediaTypeMatchermatchToContentTypesmatchToContentTypesDefault charsetUtf8textUtf8mkResponseForBody mkResponse jsonMatchermatchAcceptJson htmlMatchermatchAcceptHtmltextPlainMatchermatchTextPlain$fToResponseBodyValueJsonParseErrorjsonParseErrorMsgReportableError reportError ErrorReporterReason erMessage erDetailssimpleErrorReporterrorReportWithMessageerrorReportWithDetailsfullErrorReportsingle statusFormat maybeFormaterrorReportFormat boolFormatmkIndentsimpleJsonValueplaintextErrorReportFormatrenderPlainTextErrorReportpFormathtmlErrorReportFormatrenderHTMLErrorReportreportAsErrorReport$fReportableErrorJsonParseError!$fReportableErrorUnicodeException$fReportableErrorErrorReport$fToJSONErrorReportJsonSgetJsonSJsongetJson TextBodyS getTextBodySTextBody getTextBodyFromBodyfromBody$fToResponseBodyJsonS$fFromBodyJsonParseErrorJsonS$fToResponseBodyJson$fFromBodyJsonParseErrorJson#$fFromBodyUnicodeExceptionTextBodyS"$fFromBodyUnicodeExceptionTextBody PathConsumer _pcConsumed _pcUnconsumed pcConsumed pcUnconsumedmkPathConsumer pcGetNext pcConsumeNext getFullPathHList1HList0 HListElim hListUncurry hListMapTo1 runWaiAppprepApp mkMiddlewareFailureHandlers_unsupportedMethod_unmatchedPath_bodyParseFailed _authFailed _accessDenied_caughtException_unacceptableResponse MonadRespondrespond getRequest getHandlers withHandlersgetPathwithPath accessDenied authFailedbodyParseFailedcaughtExceptionunacceptableResponse unmatchedPathunsupportedMethodRespondT runRespondT mapRespondT findHeaderfindHeaderDefaultgetAcceptHeaderrespondEmptyBodyrespondUsingBody respondWithrespondStdHeaders respondOkrespondReportErrorrespondNotFoundhandleUnsupportedMethodhandleUnmatchedPathhandleUnacceptableResponseuseHandlerForReporthandleBodyParseFailurehandleAuthFailedhandleAccessDeniedhandleCaughtException getHandler maybeNotFound catchResponddefaultHandlersdefaultUnsupportedMethodHandlerdefaultUnmatchedPathHandlerdefaultBodyParseFailureHandlerdefaultAuthFailedHandlerdefaultAccessDeniedHandlerdefaultCaughtExceptionHandler"defaultUnacceptableResponseHandlerRespondM respondApprespondAppDefault serveRespondserveRespondDefaultsimpleRespondAppsimpleRespondAppDefaultserveSimpleRespondserveSimpleRespondDefault getBodyLazy getBodyStrictextractBodyLazyextractBodyStrictwithRequiredBodywithRequiredBody' authenticatereauthenticate authorize authorizeBool authorizeE routeAccept checkAccepts MethodMatchergetMethodMatcher matchMethodonMethodonGETonPOSTonHEADonPUTonDELETEonTRACE onCONNECT onOPTIONSonPATCHmatchOnlyMethodmatchGET$fMonoidMethodMatcherNaturalPathExtractor1PathExtractor0 PathExtractorrunPathExtractor PathMatcherrunPathMatcher matchPathmatchPathWithMethodmatchPathWithGETasPathExtractor pathExtractpathuseNextPathStatepathEndOrSlash pathLastSegpathEndsingleSegExtractor unitExtractorpredicateExtractorslashEnd endOrSlashsegsingleItemExtractorvalue pathMethodpathGETmayWhenusePathgetConsumedPathgetUnconsumedPathgetNextSegmentwithNextSegmentConsumed$fPathPieceNatural$fMonadPathMatcher$fAlternativePathMatcher$fApplicativePathMatcher$fFunctorPathMatcher wai-3.0.2Network.Wai.InternalResponse Network.Wai Application aeson-0.8.0.2 Data.Aeson eitherDecode' eitherDecodeTFCo:R:HListElim:aTFCo:R:HListElim[]a warp-3.0.4Network.Wai.Handler.Warp.Runrunwai-extra-3.0.3Network.Wai.Middleware.Gzipgzip$Network.Wai.Middleware.RequestLoggerApachewai-logger-2.2.3Network.Wai.Logger.Apache FromSocketfast-logger-2.2.3System.Log.FastLogger LoggerSetmkRequestLogger RespondData$fMonadRespondMaybeT$fMonadRespondExceptT _handlers_request _responder _pathConsumer unRespondTStMTunStMT StRespond unStRespondhandlers pathConsumerrequest responder$fMonadLoggerRespondTTFCo:R:StMRespondTa$fMonadBaseControlbRespondTTFCo:R:StTRespondTa$fMonadTransControlRespondT$fMonadBasebRespondT$fMonadCatchRespondT$fMonadThrowRespondT$fMonadIORespondT$fMonadTransRespondT$fMonadRespondRespondTghc-prim GHC.TypesIOlazyRequestBodystrictRequestBodybaseControl.Applicative Applicative Alternative<|>path-pieces-0.1.4Web.PathPieces PathPiece