!|      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTU V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  Safe.linnetContent-Type literal for application/json encodinglinnetContent-Type literal for  text/plain encodinglinnetContent-Type literal for  text/html encodingNone.=?@AHlinnetEncoding of some type a- into payload of HTTP response Phantom type ct= guarantees that compiler checks support of encoding of some a into content of given  Content-Type by looking for specific Encode instance.SafeSafel  None .8=?@AHk(linnet0Decoding of HTTP request payload into some type a. Phantom type ct: guarantees that compiler checks support of decoding some a from content of given  Content-Type by looking for specific Decode instance.$%&'()()&'$%None?6linnetAContainer for the reminder of the request path and request itself6789:;6789;:Safe&'.=>?@ACHVXk{=linnetFlatten nested coproductlinnetReverse coproductlinnetExtend coproduct cs' on right with coproduct cs%, somewhat similar to appending list cs to cs'linnetExtend coproduct cs' on left with coproduct cs&, somewhat similar to prepending list cs to cs'=>?@AB?@AB=> Safe&'.=?@ACHUVXkqUVWXY[ZY[ZWXUV[6 None.=?@AHVXk!klinnet&Type-class to convert a value of type a$ into Response with Content-Type of ctklkl None 1>EXkBx!slinnet Payload of w that could be:tlinnetPayload with some value aulinnetRepresents empty responsevlinnet'Failed payload with an exception insidewlinnet Output of Endpoint that carries some s a* together with response status and headers|linnetAdd header to given w}linnetTransform payload of output~linnetCreate w with s a and status OK 200linnetCreate w with s a and status  CREATED 201linnetCreate w with  NoPayload and status  ACCEPTED 202linnetCreate w with  NoPayload and status NO CONTENT 202linnetCreate w with ErrorPayload e and status BAD REQUEST 400linnetCreate w with ErrorPayload e and status UNAUTHORIZED 401linnetCreate w with ErrorPayload e and status PAYMENT REQUIRED 402linnetCreate w with ErrorPayload e and status  FORBIDDEN 403linnetCreate w with ErrorPayload e and status  NOT FOUND 404linnetCreate w with ErrorPayload e and status METHOD NOT ALLOWED 405linnetCreate w with ErrorPayload e and status NOT ACCEPTABLE 406linnetCreate w with ErrorPayload e and status  CONFLICT 409linnetCreate w with ErrorPayload e and status GONE 410linnetCreate w with ErrorPayload e and status LENGTH REQUIRED 411linnetCreate w with ErrorPayload e and status PRECONDITIONED FAILED 412linnetCreate w with ErrorPayload e and status REQUEST ENTITY TOO LARGE 413linnetCreate w with ErrorPayload e and status UNPROCESSABLE ENTITY 422linnetCreate w with ErrorPayload e and status TOO MANY REQUESTS 422linnetCreate w with ErrorPayload e and status INTERNAL SERVER ERROR 500linnetCreate w with ErrorPayload e and status NOT IMPLEMENTED 501linnetCreate w with ErrorPayload e and status BAD GATEWAY 502linnetCreate w with ErrorPayload e and status SERVICE UNAVAILABLE 503linnetCreate w with ErrorPayload e and status GATEWAY TIMEOUT 504linnetCreate successful w with payload a and given statuslinnetCreate failed w with exception e and given statuslinnet Create empty w with given status&stuvwxyz{|}~&wxyz{stuv~}| None .>HUVXk|linnetrBasic Linnet data type that abstracts away operations over HTTP communication. While WAI Application has type of CRequest -> (Response -> IO ResponseReceived) -> IO ResponseReceived<, it's practical to treat web applications as functions of 'Request -> BusinessLogic -> IO Response where  BusinessLogic is usually a function of a -> m b where a and b@ are data to be decoded from the request / encoded to response, mI is some monad, and this is the most interesting part of an application.Endpoint's purpose is exactly to abstract details of encoding and decoding, along with routing and the rest, and provide simple interface to encapsulate  BusinessLogic into a final web application./Business logic is encoded as transformation in fmap,  mapOutput,  mapOutputM, mapM: and the like. Usual way to transform endpoint is to use  and  operators: 5get (path @Text) ~> (\segment -> return $ ok segment)Here,  is just an inverted alias for I function. Often, endpoint is a product of multiple endpoints, and here  proves to be very handy: Oget (p' "sum" // path @Int // path @Int) ~>> (\i1 i2 -> return $ ok (i1 + i2) )The trick is that  defines sequential AND= combination of endpoints that is represented as endpoint of YG, so instead of dealing with heterogeneous list, it's possible to use 7 instead and map with a function of multiple arguments.*Endpoints are also composable in terms of OR logic with % operator that is useful for routing: getUsers = get (p' "users") ~>> (ok <$> fetchUsers) newUser = post (p' "users" // jsonBody @User) ~>> (\user -> ok <$> createUser user) usersApi = getUsers |+| newUser(An endpoint might be converted into WAI  Application using  and @TypeApplications language pragma: Ymain = run 9000 app where app = bootstrap @TextPlain usersApi & compile & toApp idlinnetResult of returned by  that could be either:Matched0 containing reminder of the input together with w inside of monad m NotMatched) in case endpoint doesn't match the inputlinnet Map over the w/ of endpoint with function returning new value a lifted in monad mlinnetMap over the value of  with function returning new Output blinnetMap over the value of  with function returning new  m (Output b)linnetHandle exception in monad m= of Endpoint result using provided function that returns new wlinnetHandle all exceptions in monad m of Endpoint resultlinnetLift an exception of type e into linnetInversed alias for linnetAdvanced version of  operator that allows to map Endpoint m (HList ls) over a function of arity N equal to N elements of HList. General rule of thumb when to use this operator is whenever there is an Y on the left side.linnetLift monadic value m a into  that always matcheslinnetLift monadic output  m (Output a) into  that always matcheslinnetCreate product of two {s that sequentially match a request. | If some of endpoints doesn't match a request, the final result is also non-matchinglinnetCreate product of two As that sequentially match a request and values are adjoined into YV. If some of endpoints doesn't match a request, the final result is also non-matchinglinnet Create new ) of two endpoints, adjoining values into ?; During request resolution the following logic is applied:CIf none of endpoints match, resulting endpoint is also non-matchingRIf both endpoints match, the more specific one is selected (with shorter reminder)linnet8Endpoint that always matches and returns a request from 6linnet<Endpoint that always matches and doesn't change any reminder0022 None.XkLlinnetuEndpoint that tries to decode head of the current path reminder into specific type. It consumes head of the reminder.)If path is empty, Endpoint is not matched/If decoding has failed, Endpoint is not matchedlinnetEndpoint that matches only if the head of current path reminder is equal to some given constant value. It consumes head of the reminder.PIf value matches the provided constant, saves the tail of the path as a reminder,Otherwise, resulting endpoint is not matchedlinnetShort alias for pathConstlinnet6Endpoint that matches only against empty path reminderlinnetkEndpoint that consumes the rest of the path reminder and decode it using provided DecodePath for some type alinnet4Endpoint that matches any path and discards reminderNoneX_plinnet(Endpoint that tries to decode parameter nameT from the request query string. Always matches, but may throw an exception in case:+Parameter is not presented in request query$There was a parameter decoding errorlinnet(Endpoint that tries to decode parameter nameT from the request query string. Always matches, but may throw an exception in case:$There was a parameter decoding errorlinnet-Endpoint that tries to decode all parameters nameT from the request query string. Always matches, but may throw an exception in case:DThere was a parameter decoding error of at least one parameter valuelinnet-Endpoint that tries to decode all parameters nameT from the request query string. Always matches, but may throw an exception in case:DThere was a parameter decoding error of at least one parameter value4All parameters are empty or missing in request queryNone@ linnet9Turn endpoint into one that matches only for GET requestslinnet:Turn endpoint into one that matches only for POST requestslinnet9Turn endpoint into one that matches only for PUT requestslinnet;Turn endpoint into one that matches only for PATCH requestslinnet<Turn endpoint into one that matches only for DELETE requestslinnet:Turn endpoint into one that matches only for HEAD requestslinnet;Turn endpoint into one that matches only for TRACE requestslinnet=Turn endpoint into one that matches only for CONNECT requestslinnet=Turn endpoint into one that matches only for OPTIONS requests NoneXClinnet%Endpoint that tries to decode header nameE from a request. Always matches, but may throw an exception in case:'Headers is not presented in the request!There was a header decoding errorlinnet%Endpoint that tries to decode header nameE from a request. Always matches, but may throw an exception in case:!There was a header decoding errorNone.Xlinnet%Endpoint that tries to decode cookie nameE from a request. Always matches, but may throw an exception in case:&Cookie is not presented in the request!There was a cookie decoding errorlinnet%Endpoint that tries to decode cookie nameE from a request. Always matches, but may throw an exception in case:!There was a cookie decoding errorNone>Xklinnet=Endpoint that tries to decode body of request into some type a using corresponding (J instance. Matches if body isn't chunked. May throw an exception in case: Body is emptyThere was a body decoding errorlinnet=Endpoint that tries to decode body of request into some type a using corresponding (J instance. Matches if body isn't chunked. May throw an exception in case:There was a body decoding errorlinnet Alias for body @TextPlainlinnet Alias for bodyMaybe @TextPlainlinnet Alias for body @ApplicationJsonlinnet Alias for bodyMaybe @ApplicationJsonNoneNone&'.=>?@AUVXkNone&'.>@AHSUVXklinnetCreate  out of single  and some given Content-Type: !bootstrap @TextPlain (pure "foo")linnetAdd another endpoint to I for purpose of serving multiple Content-Types with *different* endpoints Hbootstrap @TextPlain (pure "foo") & server @ApplicationJson (pure "bar")linnetCompile  into ReaderT Request m Responsea for further combinations. Might be useful to implement middleware in context of the same monad m: +bootstrap @TextPlain (pure "foo") & compilelinnetConvert ReaderT Request m Response into WAI  Application 6bootstrap @TextPlain (pure "foo") & compile & toApp id8The first parameter here is a natural transformation of s monad m into IO . In case if selected monad is IO already then id is just enough. Otherwise, it's a good place to define how to "start" custom monad for each request to come and convert it to IO.As an example:ReaderT RequestContext IOB could be used to pass some data as local context for the request.$Some monad for logging (i.e. co-log)&Lightweight HTTP library on top of WAI(c) Sergey Kolbasov, 2019Apache License 2.0None˱M()wxyz{~M()wxyz{~SafeW !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPPQRSTUVWXYZ[\]^_`abcdefghijklm n o p q r s t u v w x y z { | } ~                 %linnet-0.1.0.0-KfUv5NSEDDZH3reXw9oex5LinnetLinnet.ContentTypes Linnet.EncodeLinnet.Endpoints.Entity Linnet.Errors Linnet.Decode Linnet.InputLinnet.Internal.CoproductLinnet.Internal.HListLinnet.ToResponse Linnet.OutputLinnet.EndpointLinnet.Endpoints.PathsLinnet.Endpoints.ParamsLinnet.Endpoints.MethodsLinnet.Endpoints.HeadersLinnet.Endpoints.CookiesLinnet.Endpoints.BodiesLinnet.CompileLinnet.Bootstrap bootstrapLinnet.Endpoints Paths_linnet"warp-3.2.28-GhoIt0lRhjIFi7tvLCnwtkNetwork.Wai.Handler.Warp.RunrunApplicationJson TextPlainTextHtmlEncodeencode$fEncode"text/plain"Float$fEncode"text/plain"Double$fEncode"text/plain"Integer$fEncode"text/plain"Int$fEncode"text/plain"Text$fEncode"text/plain"Text0$fEncode"text/plain"ByteString$fEncode"text/plain"ByteString0EntityParamHeaderBodyCookie entityName $fEqEntity $fShowEntity LinnetError MissingEntityEntityNotParsed LinnetErrors DecodeError missingEntitynotParsedEntityentityParsingError linnetErrors decodeError$fExceptionLinnetError$fSemigroupLinnetError$fEqLinnetError$fShowLinnetError DecodeEntity decodeEntity DecodePath decodePathDecodedecode$fDecodePathFloat$fDecodePathDouble$fDecodePathInt$fDecodePathInteger$fDecodePathByteString$fDecodePathText$fDecodeEntityFloat$fDecodeEntityDouble$fDecodeEntityInt$fDecodeEntityInteger$fDecodeEntityText$fDecodeEntityByteStringInputreminderrequestinputFromRequestinputGet $fShowInputAdjoinCoproductadjoinCoproduct CoproductInlInrCNil$fEqCNil$fExtendLeftBy'Coproductrout$fExtendLeftBy'CNilaa$fExtendRightBylCNill$fExtendBylrout$fExtendRightBylCoproductout'&$fExtendRight'FalseCoproductaCoproduct%$fExtendRight'TrueCoproductaCoproduct$fExtendRightcstout$fExtendLeftBylrout$fReverse'accCoproductout$fReverse'accCNilacc$fReversecsout#$fAdjoinCoproduct'TrueCoproductout')$fAdjoinCoproduct'FalseCoproductCoproduct$fAdjoinCoproduct'FalseCNilCNil$fAdjoinCoproductcsc $fEqCoproduct FnToProduct fromFunction AdjoinHListadjoinHListHNil::: $fEqHList $fEqHList0 $fShowHList $fShowHList0$fPrepend'NoneHNil:::$fPrepend'RightHNila[]a$fPrepend'LeftHNil[]bb$fPrepend'BothHNil[][][] $fPrependabab$fAdjoinHList'True:po$fAdjoinHList'False::$fAdjoinHList'False[][]$fAdjoinHListlsl$fFnToProduct->:out$fFnToProductfn[]v ToResponse toResponse&$fToResponse'CoproductValuectCoproduct$fToResponse'CNilValuectCNil$fToResponse'UnitValuect()$$fToResponse'ResponseValuectResponse$fToResponse'Valuecta$fToResponsectaPayload NoPayload ErrorPayloadOutput outputStatus outputPayload outputHeaders withHeader transformMokcreatedaccepted noContent badRequest unauthorizedpaymentRequired forbiddennotFoundmethodNotAllowed notAcceptableconflictgonelengthRequiredpreconditionFailedrequestEntityTooLargeunprocessableEntitytooManyRequestsinternalServerErrornotImplemented badGatewayserviceUnavailablegatewayTimeout payloadOutput payloadError payloadEmptyoutputToResponse$fTraversableOutput$fFoldableOutput$fMonadThrowOutput $fMonadOutput$fApplicativeOutput$fFunctorOutput $fShowOutput $fShowPayloadEndpoint runEndpointtoStringEndpointResultMatched NotMatchedmatchedReminder matchedOutput isMatched maybeRemindermapM' mapOutput mapOutputMtransformOutput transformhandle handleAlltry~>~>>lift liftOutputM productWith//|+|rootzero$fFunctorEndpointResult$fShowEndpointResult$fAlternativeEndpoint$fApplicativeEndpoint$fFunctorEndpoint$fShowEndpointpath pathConstp' pathEmptypathspathAnyparam paramMaybeparams paramsNelgetpostputpatchdeletehead'trace'connectoptionsheader headerMaybecookie cookieMaybebody bodyMaybetextBody textBodyMaybejsonBody jsonBodyMaybeCompilecompile$fCompileCoproductmHList$fCompileCNilmHListservetoAppReverse ExtendRightBy ExtendLeftBybase Data.EitherEither Bootstrapversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName