h&:u/      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Safe-Inferred "%1?'mig Server configmigValues convertible to lazy textmigSize of the input bodymigServer type. It is a function fron request to response. Some servers does not return valid value. We use it to find right path.Example: server :: Server IO server = "api" /. "v1" /. mconcat [ "foo" /. (\(Query @"name" arg) -> Get @Json (handleFoo arg) , "bar" /. Post @Json handleBar ] handleFoo :: Int -> IO Text handleBar :: IO TextNote that server is monoid and it can be constructed with Monoid functions and path constructor (/.). To pass inputs for handler we can use special newtype wrappers:Query - for required query parametersOptional - for optional query parametersCapture - for parsing elements of URIBody - fot JSON-body inputRawBody - for raw ByteString inputHeader - for headersTo distinguish by HTTP-method we use corresponding constructors: Get, Post, Put, etc. Let's discuss the structure of the constructor. Let's take Get for example: newtype Get ty m a = Get (m a)&Let's look at the arguments of he typety - type of the response. it can be: Text, Html, Json, ByteStringm - underlying server monada - result type. It should be convertible to the type of the response.also result can be wrapped to special data types to modify Http-response. we have wrappers: SetStatus - to set status AddHeaders - to append headersEither (Error err) - to response with errors mig'Map of query parameters for fast-access migErrorsmig Http requestmigURI pathmigquery parametersmigrequest headersmigrequest methodmiglazy body reader. Error can happen if size is too big (configured on running the server)migHttp response bodymig Http responsemigstatusmigheaders mig response body!migBad request response"migReplies to any http-method#migSpecify which method to reply$mig"Reads full body as lazy bytestring%migReads URL-encoded form datamigRead request body in chunks&migMatch path prefix'migReads capture URL-piece element(migMatch on path prefix)migRead info from header*migreads path info+migHeaders to set content type,migSets response status-migJson response constructor.migText response constructor/migHtml response constructor0mig#Raw bytestring response constructor1migRespond with ok 200-status2mig Handle errors3mig!Convert server to WAI-application4mig*Convert response to low-level WAI-response5migRead request from low-level WAI-request First argument limits the size of input body. The body is read in chunks.6  !"#$%&'()*+,-./0123456   "#$'&)%*.-/01!+3,245( Safe-Inferred "%1?>@migReads current path infoBmigReads input header. Example: "api" /. (\(Header @"Trace-Id" traceId) -> Post @Json (handleFoo traceId)) handleFoo :: Maybe ByteString -> IO FooResponseDmig Reads the URL encoded Form inputFmigReads raw body as lazy bytestring. We can limit the body size with server config. Example: "api" /. "upload" /. (\(RawBody content) -> handleUpload content)HmigReads Json body (lazy). We can limit the body size with server config. Example: >"api" /. "search" /. (\(Body request) -> handleSearch request)JmigCaptureLmigOptional query parameter. Name is encoded as type-level string. Example: "api" /. handleFoo handleFoo :: Optional "name" -> Server IO handleFoo (Optional maybeArg) = ...NmigMandatary query parameter. Name is encoded as type-level string. Example: "api" /. handleFoo handleFoo :: Query "name" Int -> Server IO handleFoo (Query arg) = ...PmigOptions methodRmig Patch methodTmig Delete methodVmig Put methodXmig Post methodZmigGet method. Note that we can not use body input with Get-method, use Post for that. So with Get we can use only URI inputs (Query, Optional, Capture)\migValues convertible to Html^migValues convertible to Json`mig!Values convertible to Text (lazy)bmigAttach headers to response. It can be used inside any ToXxxResp value. Example: "api" /. handleFoo handleFoo :: Get Text IO (AddHeaders Text) handleFoo = Get $ pure $ AddHeaders headers "Hello foo"fmigSet status to response. It can be ised inside any ToXxxResp value. Example: "api" /. handleFoo handleFoo :: Get Text IO (SetStatus Text) handleFoo = Get $ pure $ SetStatus status500 "Bad request"jmig0Class ToServer contains anything convertible to Server m. We use it for flexuble composition of servers from functions with arbitrary number of arguments. Arguments can be of specific types: Query, Body, Optional, Capture, Header, etc. We use type-level strings to encode query-names. Example: "api" /. "foo" /. (\(Query @"argA" argA) (Optional @"argB" argB) (Body jsonRequest) -> Post @Json $ handleFoo argA argB jsonRequest) handleFoo :: Int -> Maybe Text -> FooRequest -> IO FooResponse handleFoo = ...Note that we can use any amount of arguments. And type of the input is decoded fron newtype wrapper which is used with argument of the handler function.Also we can return pure errors with Either. Anything which can be returned from function can be wrapped to Either (Error err).For example in previous case we can use function which returns errors as values: type ServerError = Error Text handleFoo :: Int -> Maybe Text -> FooRequest -> IO (Either ServerError FooResponse) handleFoo = ...the result of error response is automatically matched with normal response of the server and standard Error type lets us pass status to response and some details.mmigType tag of Json-response.nmigClass contains types which can be converted to IO-based server to run as with WAI-interface.We can run plain IO-servers and ReaderT over IO based servers. Readers can be wrapped in newtypes. In that case we can derive automatically  HasServer instance.qmigAything convertible from textsmig.Path constructor (right associative). Example: server :: Server IO server = "api" /. "v1" /. mconcat [ "foo" /. Get @Json handleFoo , "bar" /. Post @Json handleBar ] handleFoo, handleBar :: IO Textmig Map internal monad of the servertmig'Render reader server to IO-based serverumig&Sets status for response of the servervmig'Adds headers for response of the serverwmigAppends action to the serverxmigRun server on port !23@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcedfgihjklmnopqrstuvwxmZ[XYVWTURSPQsJKNOLMHIFGBCDE@Abcedfgihuv 2x3nopt`a^_\]qr!jklws4 Safe-Inferred "%1?!d !23@ABCDEFGHIJKLMNO\]bcedfgihjklnopqrstuvwx7\]qrjklwsJKNOLMHIFGBCDE@Abcedfgihuv 2nopt3x! Safe-Inferred "%1?$vmigOptions methodmig Patch methodmig Delete methodmig Put methodmig Post methodmigGet method. Note that we can not use body input with Get-method, use Post for that. So with Get we can use only URI inputs (Query, Optional, Capture) !23@ABCDEFGHIJKLMNO\]bdcefhgijklknopoqrstuvwx  Safe-Inferred "%1?'migOptions methodmig Patch methodmig Delete methodmig Put methodmig Post methodmigGet method. Note that we can not use body input with Get-method, use Post for that. So with Get we can use only URI inputs (Query, Optional, Capture) !23@ABCDEFGHIJKLMNO\]bdcefhgijklknopoqrstuvwx  Safe-Inferred "%1?*migOptions methodmig Patch methodmig Delete methodmig Put methodmig Post methodmigGet method. Note that we can not use body input with Get-method, use Post for that. So with Get we can use only URI inputs (Query, Optional, Capture) !23@ABCDEFGHIJKLMNO\]bdcefhgijklknopoqrstuvwx  Safe-Inferred "%1?-migOptions methodmig Patch methodmig Delete methodmig Put methodmig Post methodmigGet method. Note that we can not use body input with Get-method, use Post for that. So with Get we can use only URI inputs (Query, Optional, Capture) !23@ABCDEFGHIJKLMNO\]bdcefhgijklknopoqrstuvwx  Safe-Inferred "%1?/       !!"#$%&'()*+,-./0123456789:;<=>?@ABCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRSTUVWXXYZ[[\]^_`abcdefghijklmnopqrstuvwxyz{|}~LLMMNNOOPPQQLLMMNNOOPPQQLLMMNNOOPPQQLLMMNNOOPPQQ"mig-0.1.0.3-JWrYTPTLLWb4ZUi0QT4MjEMig.Internal.TypesMig Mig.Html.IOMig.HtmlMig.Json Mig.Json.IO Mig.Common Paths_mig ServerConfig$sel:maxBodySize:ServerConfigToTexttoText KilobytesServer$sel:unServer:ServerQueryMapError$sel:status:Error$sel:body:ErrorReq $sel:path:Req$sel:query:Req$sel:headers:Req$sel:method:Req$sel:readBody:ReqRespBodyTextRespHtmlRespJsonRespFileResp StreamRespRawRespResp$sel:status:Resp$sel:headers:Resp$sel:body:Resp badRequesttoConsttoMethod toWithBodytoWithFormData toWithPath toWithCapturepathHead toWithHeadertoWithPathInfo setContent setRespStatusjsontexthtmlrawok handleError toApplication toResponse fromRequest$fIsStringResp$fExceptionError$fMonoidServer$fSemigroupServer $fToText[] $fToTextFloat $fToTextInt $fToTextText $fToTextText0 $fShowErrorPathInfoHeaderFormBodyRawBodyBodyCaptureOptionalQueryOptionsPatchDeletePutPostGet ToHtmlResp toHtmlResp ToJsonResp toJsonResp ToTextResp toTextResp AddHeaders$sel:headers:AddHeaders$sel:content:AddHeaders SetStatus$sel:status:SetStatus$sel:content:SetStatusToServer ServerMonadtoServerJson HasServer ServerResult renderServerFromTextfromText/. fromReader setStatus addHeaderswithServerAction runServer$fFromTextFloat$fFromTextBool$fFromTextInteger $fFromTextInt$fFromTextWord$fFromTextText$fFromTextText0 $fFromText[]$fFromTextByteString$fHasServerReaderT$fHasServerReaderT0 $fHasServerIO$fToServerServer$fToTextRespEither$fToTextRespSetStatus$fToTextRespAddHeaders$fToTextRespInt$fToTextRespText$fToTextRespText0$fToJsonRespEither$fToJsonRespSetStatus$fToJsonRespAddHeaders $fToJsonRespa$fToHtmlRespEither$fToHtmlRespSetStatus$fToHtmlRespAddHeaders $fToHtmlRespa $fToServerGet$fToServerGet0$fToServerGet1$fToServerGet2$fToServerGet3$fToServerPost$fToServerPost0$fToServerPost1 $fToServerPut$fToServerPut0$fToServerPut1$fToServerDelete$fToServerDelete0$fToServerDelete1$fToServerPatch$fToServerPatch0$fToServerPatch1$fToServerOptions$fToServerOptions0$fToServerOptions1 $fToServerFUN$fToServerFUN0$fToServerFUN1$fToServerFUN2$fToServerFUN3$fToServerFUN4$fToServerFUN5$fToServerFUN6$fIsStringQueryName $fEqQueryName$fOrdQueryName$fShowQueryNamereadRequestBody hoistServer*http-api-data-0.5.1-3cH5JPod6lIJkh64t7RllOWeb.Internal.FormUrlEncodeddefaultFormOptions parseUnique parseMaybeparseAll lookupUnique lookupMaybe lookupAllurlEncodeAsFormStableurlEncodeAsFormurlDecodeAsFormurlDecodeParams urlDecodeFormurlEncodeParamsurlEncodeFormStable urlEncodeFormgenericFromFormtoEntriesByKeyStabletoEntriesByKey genericToFormfromEntriesByKey toListStable ToFormKey toFormKey FromFormKey parseFormKeyFormunFormToFormtoFormFromFormfromForm FormOptionsfieldLabelModifierWeb.Internal.HttpApiData readTextDataparseBoundedHeaderparseBoundedQueryParamparseBoundedUrlPieceparseBoundedEnumOfIparseBoundedEnumOfparseBoundedTextDataparseQueryParamWithPrefixparseHeaderWithPrefixparseUrlPieceWithPrefix showTextDataparseQueryParamMaybeparseHeaderMaybeparseUrlPieceMaybeparseQueryParams toQueryParamsparseUrlPieces toUrlPieces ToHttpApiDatatoEncodedQueryParam toQueryParamtoHeader toUrlPiecetoEncodedUrlPieceFromHttpApiDataparseQueryParam parseUrlPiece parseHeader LenientDatagetLenientData(http-types-0.12.3-JlXMXDo7mr8Ke1ukSqfJrBNetwork.HTTP.Types.StatusstatusIsServerErrorstatusIsClientErrorstatusIsRedirectionstatusIsSuccessfulstatusIsInformational networkAuthenticationRequired511 status511httpVersionNotSupported505 status505gatewayTimeout504 status504serviceUnavailable503 status503 badGateway502 status502notImplemented501 status501internalServerError500 status500requestHeaderFieldsTooLarge431 status431tooManyRequests429 status429preconditionRequired428 status428upgradeRequired426 status426unprocessableEntity422 status422 imATeapot418 status418expectationFailed417 status417requestedRangeNotSatisfiable416 status416unsupportedMediaType415 status415requestURITooLong414 status414requestEntityTooLarge413 status413preconditionFailed412 status412lengthRequired411 status411gone410 status410 conflict409 status409requestTimeout408 status408proxyAuthenticationRequired407 status407notAcceptable406 status406methodNotAllowed405 status405 notFound404 status404 forbidden403 status403paymentRequired402 status402unauthorized401 status401 badRequest400 status400permanentRedirect308 status308temporaryRedirect307 status307 useProxy305 status305notModified304 status304 seeOther303 status303found302 status302movedPermanently301 status301multipleChoices300 status300partialContent206 status206resetContent205 status205 noContent204 status204nonAuthoritative203 status203 accepted202 status202 created201 status201ok200 status200switchingProtocols101 status101 continue100 status100mkStatusStatus statusMessage statusCodeversiongetDataFileName getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDir