Îõ³h$#,!ð9      !"#$%&'()*+,-./012345678None#$Dwai›A special datatype to indicate that the WAI handler has received the response. This is to avoid the need for Rank2Types in the definition of Application.It is highlyØ advised that only WAI handlers import and use the data constructor for this data type. Since 3.0.0waiïInformation on which part to be sent. Sophisticated application handles Range (and If-Range) then create .waiÙThe size of the request body. In the case of chunked bodies, the size will not be known. Since 1.4.0 waiåRepresents a streaming HTTP response body. It's a function of two parameters; the first parameter provides a means of sending another chunk of data, and the second parameter provides a means of flushing the data to the client. Since 3.0.0waiñInformation on the request sent by the client. This abstracts away the details of the underlying implementation.waiRequest method such as GET.waiHTTP version such as 1.1.waiŸExtra path information sent by the client. The meaning varies slightly depending on backend; in a standalone server setting, this is most likely all information after the domain name. In a CGI application, this would be the information following the path to the CGI executable itself.âMiddlewares and routing tools should not modify this raw value, as it may be used for such things as creating redirect destinations by applications. Instead, if you are writing a middleware or routing framework, modify the pathInfoÅ instead. This is the approach taken by systems like Yesod subsites.NoteÌ: At the time of writing this documentation, there is at least one system (Network.Wai.UrlMap from  wai-extraŠ) that does not follow the above recommendation. Therefore, it is recommended that you test the behavior of your application when using  rawPathInfo0 and any form of library that might modify the Request.waiÄIf no query string was specified, this should be empty. This value willß include the leading question mark. Do not modify this raw value - modify queryString instead.wai?A list of headers (a pair of key and value) in an HTTP request.wai-Was this request made over an SSL connection?Note that this value will not  tell you if the client originally made this request over SSL, but rather whether the current connection is SSL. The distinction lies with reverse proxies. In many cases, the client will connect to a load balancer over SSL, but connect to the WAI handler without SSL. In such a case,  will be 9=, but from a user perspective, there is a secure connection.waiThe client's host information.wai÷Path info in individual pieces - the URL without a hostname/port and without a query string, split on forward slashes.wai Parsed query string information.wai(Get the next chunk of the body. Returns :Ï when the body is fully consumed. Since 3.2.2, this is deprecated in favor of ".waiÊA location for arbitrary data to be shared by applications and middleware.waiÚThe size of the request body. In the case of a chunked request body, this may be unknown. Since 1.4.0wai/The value of the Host header in a HTTP request. Since 2.0.0wai0The value of the Range header in a HTTP request. Since 2.0.0 wai2The value of the Referer header in a HTTP request. Since 3.2.0!wai5The value of the User-Agent header in a HTTP request. Since 3.2.0"wai(Get the next chunk of the body. Returns :" when the body is fully consumed.#   ! "#! "   None!Œ&wai÷Middleware is a component that sits between the server and application. It can do such tasks as GZIP encoding or response caching. What follows is the general definition of middleware, though a middleware author should feel free to modify this.¡As an example of an alternate type for middleware, suppose you write a function to load up session information. The session information is simply a string map (String, String)9. A logical type signature for this middleware might be:  loadSession :: ([(String, String)] -> Application) -> Application#Here, instead of taking a standard 'è as its first argument, the middleware takes a function which consumes the session information as well.'waiThe WAI application.²Note that, since WAI 3.0, this type is structured in continuation passing style to allow for proper safe resource handling. This was handled in the past via other means (e.g.,  ResourceT). As a demonstration: ®app :: Application app req respond = bracket_ (putStrLn "Allocating scarce resource") (putStrLn "Cleaning up") (respond $ responseLBS status200 [] "Hello World") (wai Creating   from a file.)wai Creating   from ;..Some questions and answers about the usage of ; here:ñQ1. Shouldn't it be at the user's discretion to use Builders internally and then create a stream of ByteStrings?äA1. That would be less efficient, as we wouldn't get cheap concatenation with the response headers.êQ2. Isn't it really inefficient to convert from ByteString to Builder, and then right back to ByteString?åA2. No. If the ByteStrings are small, then they will be copied into a larger buffer, which should be a performance gain overall (less system calls). If they are already large, then an insert operation is used to avoid copying.ÚQ3. Doesn't this prevent us from creating comet-style servers, since data will be cached?ìA3. You can force a Builder to output a ByteString before it is an optimal size by sending a flush command.*wai Creating   from <. This is a wrapper for ).+wai Creating   from a stream of values.ÍIn order to allocate resources in an exception-safe manner, you can use the bracket pattern outside of the call to responseStream. As a trivial example: app :: Application app req respond = bracket_ (putStrLn "Allocating scarce resource") (putStrLn "Cleaning up") $ respond $ responseStream status200 [] $ \write flush -> do write $ byteString "Hello\n" flush write $ byteString "World\n" $Note that in some cases you can use bracket from inside responseStream„ as well. However, placing the call on the outside allows your status value and response headers to depend on the scarce resource. Since 3.0.0,wai³Create a response for a raw application. This is useful for "upgrade" situations such as WebSockets, where an application requests for the server to grant it raw network access.–This function requires a backup response to be provided, for the case where the handler in question does not support such upgrading (e.g., CGI apps).ÅIn the event that you read from the request body before returning a  responseRaw, behavior is undefined. Since 2.1.0-wai Accessing = in  ..wai Accessing > in  ./wai#Converting the body information in   to a  .0waiÈApply the provided function to the response header list of the Response.1waiÃApply the provided function to the response status of the Response.2waiA default, blank request. Since 2.0.03wai/apply a function that modifies a response as a &4waiconditionally apply a &5wai7Get the request body as a lazy ByteString. However, do notÉ use any lazy I/O, instead reading the entire body into memory strictly.åNote: Since this function consumes the request body, future calls to it will return the empty string. Since 3.0.16wai Synonym for 5Æ. This function name is meant to signal the non-idempotent nature of 5.7waiŽGet the request body as a lazy ByteString. This uses lazy I/O under the surface, and therefore all typical warnings regarding lazy I/O apply.åNote: Since this function consumes the request body, future calls to it will return the empty string. Since 1.4.18wai Synonym for 7Æ. This function name is meant to signal the non-idempotent nature of 7.0 ! "&'()*+,-./0123456780'&2 " !5678 ()*+,-./0143?      !"#$%&'()*+,-./0123456789:;<=>