z      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                         !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~)Nonenon-portable (not tested) experimentalbjorn@bringert.netNoneAllows stream logging.  Refer to  below. ?Streams should make layering of TLS protocol easier in future,  they allow reading/$writing to files etc for debugging, + they allow use of protocols other than TCP/IP  and they allow customisation. (Instances of this class should not trim - the input in any way, e.g. leave LF on line 3 endings etc. Unless that is exactly the behaviour ) you want from your twisted instances ;) >This is the type returned by many exported network functions. Wraps a stream with logging I/ O, the first 7 argument is a filename which is opened in AppendMode.  non-portable (not tested) experimentalbjorn@bringert.netNoneThe 4 object allows input buffering, and maintenance of  some admin-type data. The - newtype is a wrapper that allows us to make ( connections an instance of the StreamIn/%Out classes, without ghc extensions. D While this looks sort of like a generic reference to the transport = layer it is actually TCP specific, which can be seen in the  implementation of the 'Stream Connection' instance. /Open a connection to port 80 on a remote host. 3This function establishes a connection to a remote  host, it uses  getHostByName which interrogates the 5 DNS system, hence may trigger a network connection. Add a  persistant) option? Current persistant is default.  Use Result+ type for synchronous exception reporting? 4Checks both that the underlying Socket is connected 0 and that the connection peer matches the given ( host name (which is recorded locally).  NoneNoneEalternative implementation of accept to work around EAI_AGAIN errors None?Format the time as describe in the Apache combined log format.  http:httpd.apache.orgdocs2.2/ logs.html# combined The format is:  [daymonthyear:hour:minute:second zone]  day = 2*digit  month = 3*letter  year = 4*digit  hour = 2*digit  minute = 2*digit  second = 2*digit  zone = ( |  ) 4*digit BFormat the request as describe in the Apache combined log format.  http:httpd.apache.orgdocs2.2/ logs.html# combined The format is: 5%h - %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i" i %h: This is the IP address of the client (remote host) which made the request to the server. o %u: This is the userid of the person requesting the document as determined by HTTP authentication. 8 %t: The time that the request was received. L %r: The request line from the client is given in double quotes. R %>s: This is the status code that the server sends back to the client. { %b: The last part indicates the size of the object returned to the client, not including the response headers.  %{Referer}: The Referer (sic) HTTP request header. 5 %{User-agent}: The User-Agent HTTP request header. NoneA timeout manager      None =TimeoutIO is a record which abstracts out all the network IO C functions needed by the request handling loop. This allows use to . use the same event loop for handle both http: and https:.     NoneConnected socket Data received  NoneNone 4Convenience class for converting data types to URIs !*Retrieves the path component from the URI "+Retrieves the query component from the URI #,Retrieves the scheme component from the URI $EModifies the scheme component of the URI using the provided function %CModifies the path component of the URI using the provided function &%Sets the scheme component of the URI '#Sets the path component of the URI +$Returns true if the URI is absolute ,/Render should be used for prettyprinting URIs. -9Parses a URI from a String. Returns Nothing on failure.  !"#$%&'()*+,- !"#$%&'()*+,-!"#$%&'*()+ ,- !"#$%&'()*+,-!portable experimental lemmih@vo.comNone.A MIME media type value.  The $ instance is derived automatically.  Use  to obtain the standard  string representation.  See  #http://www.ietf.org/rfc/rfc2046.txt for more ' information about MIME media types. 0+The top-level media type, the general type $ of the data. Common examples are  "text", "image", "audio", "video",  " multipart", and " application". 1-The media subtype, the specific data format.  Examples include "plain", "html",  "jpeg", " form-data", etc. 2,Media type parameters. On common example is ! the charset parameter for the "text"  top-level type, e.g. ("charset"," ISO-8859-1"). >Produce the standard string representation of a content-type,  e.g. "text/html; charset=ISO-8859-1". 5Parse the standard representation of a content-type. 6 If the input cannot be parsed, this function calls  / with a (hopefully) informative error message. ./012./012./012"None#None   None 3"Specify the lifetime of a cookie. @Note that we always set the max-age and expires headers because < internet explorer does not honor max-age. You can specific 6  or 58 and the other will be calculated for you. Choose which # ever one makes your life easiest. 4cookie already expired 5cookie expiration date 6life time of cookie in seconds 70session cookie - expires when browser is closed 8/a type for HTTP cookies. Usually created using B. B>Creates a cookie with a default version of 1, empty domain, a  path of /(, secure == False and httpOnly == False  see also:  addCookie CSet a Cookie in the Result. ? The values are escaped as per RFC 2109, but some browsers may 0 have buggy support for cookies containing e.g. '"' or ' '. AAlso, it seems that chrome, safari, and other webkit browsers do A not like cookies which have double quotes around the domain and  reject/6ignore the cookie. So, we no longer quote the domain. Ainternet explorer does not honor the max-age directive so we set  both max-age and expires. See 3 and A% for a convenient way of calculating & the first argument to this function. D9Not an supported api. Takes a cookie header and returns = either a String error message or an array of parsed cookies E4not a supported api. A parser for RFC 2109 cookies FLGet all cookies from the HTTP request. The cookies are ordered per RFC from I the most specific to the least specific. Multiple cookies with the same  name are allowed to exist. GLGet the most specific cookie with the given name. Fails if there is no such F cookie or if the browser did not escape cookies in a proper fashion. @ Browser support for escaping cookies properly is very diverse. 3456789:;<=>?@AB cookie name  cookie value CDEFGHI3456789:;<=>?@ABCDEFGHI89:;<=>?@37654ABCFGHIDE 3765489:;<=>?@ABCDEFGHINoneEJThis class is used by !" to parse a path component into a  value.  The instances for number types ( ,   , etc) use  to  parse the path component. The instance for  !, on the other hand, returns the  unmodified path component. <See the following section of the Happstack Crash Course for + detailed instructions using and extending J:  Fhttp://www.happstack.com/docs/crashcourse/RouteFilters.html#FromReqURI LThe body of an HTTP O Oan HTTP request Qrequest uses https:// Rrequest method Sthe uri, split on /, and then decoded Tthe raw rqUri Uthe QUERY_STRING Vthe QUERY_STRING decoded as key/ value pairs Wthe request body decoded as key/value pairs (when appropriate) Xcookies Y HTTP version Zthe HTTP request headers [ the raw, undecoded request body \2(hostname, port) of the client making the request ]an HTTP Response _file handle to send from `offset to start at anumber of bytes to send h hostname & port ia value extract from the  QUERY_STRING or O body UIf the input value was a file, then it will be saved to a temporary file on disk and k will contain Left pathToTempFile. n Result flags qA flag value set in the ] which controls how the  Content-Length- header is set, and whether *chunked* output  encoding is used.  see also: , notContentLength, and  r do not set Content-Length or chunked output encoding. s do not add a Content-Length header. Do use chunked output encoding tautomatically add a Content-Length header to the ] ua Map of HTTP headers 1the Map key is the header converted to lowercase van HTTP header x header name yJheader value (or values if multiple occurances of the header are present) zHTTP request method HTTP configuration "Port for the server to listen on. -a function to validate the output on-the-fly +function to log access requests (see also: ) <number of seconds to wait before killing an inactive thread +function to log access requests (see also: )  type LogAccess time =  ( String -- ^ host  -> String -- ^ user  -> time -- ^ time ! -> String -- ^ requestLine " -> Int -- ^ responseCode  -> Integer -- ^ size  -> String -- ^ referer  -> String -- ^ userAgent  -> IO ())  HTTP version   if O is HTTP version 1.1   if O is HTTP version 1.0 ?Should the connection be used for further messages after this.  | isHTTP1_0 && hasKeepAlive || isHTTP1_1 && hasNotConnectionClose HDefault configuration contains no validator and the port is set to 8000 Clog access requests using hslogger and apache-style log formatting  see also:  #Default RsFlags: automatically use Transfer-Encoding: Chunked. 7Do not automatically add a Content-Length field to the ] bDo not automatically add a Content-Length header. Do automatically use Transfer-Encoding: Chunked QAutomatically add a Content-Length header. Do not use Transfer-Encoding: Chunked Bget the request body from the Request and replace it with Nothing CIMPORTANT: You can really only call this function once. Subsequent  calls will return . read the request body inputs dThis will only work if the body inputs have already been decoded. Otherwise it will return Nothing. DConverts a Request into a String representing the corresponding URL LSets the Response status code to the provided Int and lifts the computation  into a Monad. CTakes a list of (key,val) pairs and converts it into Headers. The % keys will be converted to lowercase .Lookup header value. Key is case-insensitive. ;Lookup header value. Key is a case-insensitive bytestring. JLookup header value with a case-sensitive key. The key must be lowercase. HReturns True if the associated key is found in the Headers. The lookup  is case insensitive. Acts as  with ByteStrings Acts as . but the key is case sensitive. It should be  in lowercase. Associates the key/1value pair in the headers. Forces the key to be  lowercase. Acts as  but with ByteStrings. ISets the key to the HeaderPair. This is the only way to associate a key L with multiple values via the setHeader* functions. Does not force the key ^ to be in lowercase or guarantee that the given key and the key in the HeaderPair will match.  Add a key/:value pair to the header. If the key already has a value 6 associated with it, then the value will be appended. ! Forces the key to be lowercase. )Acts as addHeader except for ByteStrings  Add a key/>value pair to the header using the underlying HeaderPair data | type. Does not force the key to be in lowercase or guarantee that the given key and the key in the HeaderPair will match. JCreates a Response with the given Int as the status code and the provided $ String as the body of the Response Acts as & but works with ByteStrings directly. 4By default, Transfer-Encoding: chunked will be used Sets the Response'>s status code to the given Int and redirects to the given URI Read in any monad.  convert a 'ReadS a' result to 'Maybe a' {JKLMNOPQRSTUVWXYZ[\]^_`abcdefgh(hostname, port) ijklmnopqrstu%lowercased name -> (realname, value) vwxyz{|}~ !"#$%&'g./012JKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~kOPQRSTUVWXYZ[\]b^cdefgcdeg_`aLMNijklmvwxynopqtsrz~}|{uh./012JKGJKLMNO PQRSTUVWXYZ[\]b^cdefgcdeg_`ahijklmnopqtsruvwxyz~}|{ !"#$%&'None headers body similar to the normal (d function, except the predicate gets the whole rest of the lazy bytestring, not just one character. +TODO: this function has not been profiled. %Packs a string into an Input of type  text/plain (The default content-type for variables. :Check whether a string starts with two dashes followed by  the given boundary string. 0Checks whether a string starts with two dashes. ;Split a string at the first CRLF. The CRLF is not included # in any of the returned strings. %tempdir quota filename of field content to save (truncated?, saved bytes, saved filename )The boundary, without the initial dashes String to split. Returns  if there is no CRLF. %% None see  )maximum bytes for files uploaded in this O -maximum bytes for all non-file values in the O body )maximum bytes of overhead for headers in  multipart/ form-data  create a  for use with decodeBody Decodes application/x-www-form-urlencoded inputs.  TODO: should any of the [] be error conditions? Decodes multipart/form-data input. 'Get the path components from a String. JRepeadly splits a list by the provided separator and collects the results 2Repeatedly splits a list and collects the results :Split is like break, but the matching element is dropped. %temporary directory for file uploads )maximum bytes for files uploaded in this O -maximum bytes for all non-file values in the O body )maximum bytes of overhead for headers in  multipart/ form-data Content-type parameters  Request body Input variables and values.   None=Unserializes the bytestring into a response. If there is an  error it will return Left msg. +Serializes the request to the given handle  NoneBind and listen port &Use a previously bind port and listen @IP address to listen on (must be an IP address not a host name) port number to listen on $Nonen./012JKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~%non-portable (not tested) experimentalbjorn@bringert.netNone)An HTTP Response.  The : instance of this type is used for message serialisation, B which means no body data is output, additionally the output will D show an HTTP version of 1.1 instead of the actual version returned  by a server. *An HTTP Request.  The : instance of this type is used for message serialisation, % which means no body data is output. +might need changing in future  1) to support , uri in OPTIONS request + 2) transparent support for both relative  &% absolute uris, although this should  already work (leave scheme & host parts empty). -+The HTTP request method, to be used in the * object. = We are missing a few of the stranger methods, but these are - not really necessary until we add full TLS. .DThis class allows us to write generic header manipulation functions  for both * and ) data types. /HTTP Header Name type: 0 Why include this at all? I have some reasons / 1) prevent spelling errors of header names, 5 2) remind everyone of what headers are available, 4 3) might speed up searches for specific headers. Arguments against: / 1) makes customising header names laborious  2) increases code volume. 01Allows for unrecognised or experimental headers. 1(The Header data type pairs header names & values. 20Inserts a header with the given name and value.  Allows duplicate header names. 36Adds the new header only if no previous header shares  the same name. 4)Removes old headers with duplicate name. 5Inserts multiple headers. 6)Gets a list of headers with a particular /. 7<Lookup presence of specific HeaderName in a list of Headers 3 Returns the value from the first matching header. 8ASimple way to get a resource across a non-persistant connection.  Headers that may be altered: > Host Altered only if no Host header is supplied, HTTP/1.1 & requires a Host header. D Connection Where no allowance is made for persistant connections 3 the Connection header will be set to close 9Like 8*, but acting on an already opened stream. :HReceive and parse a HTTP request from the given Stream. Should be used ! for server side interactions. ;HVery simple function, send a HTTP response over the given stream. This 9 could be improved on to use different transfer types. `)<=>?@*A+BCD-EFGHIJK./0LMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|1}234567~89:;w)<=>?@*A+BCD-EFGHIJK./0LMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|1}234567~89:;)<=>?@*A+BCD-KJIHGFE./2|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONML01}234567~89:; None@Sends the serialized request to the host defined in the request . and attempts to parse response upon arrival. &Nonef./012JKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~jOPQRSTUVWXYZ[\]b^cdefgcdeg_`aLMNijklmvwxynopqtsrz~}|{uh./012JK None1 provides a means to end the current computation  and return a ] immediately. This provides an ? alternate escape route. In particular it has a monadic value # of any type. And unless you call   first your , response filters will be applied normally. Extremely useful when you'"re deep inside a monad and decide > that you want to return a completely different content type,  since it doesn'0t force you to convert all your return types to  ]! early just to accommodate this.  see also:   and   ! is almost exclusively used with  . If you  are not using # then you do not need to wrap your D head around this type. If you are -- the type is not as complex as  it first appears. 1It is worth discussing the unpacked structure of  a bit as  it' s exposed in  and . A fully unpacked " has a structure that looks like:  J ununWebT $ WebT m a :: m (Maybe (Either Response a, FilterFun Response))  So, ignoring m, as it is just the containing , the  outermost layer is a  . This is  if  was  called or  ( ] a,  (  ])) if  wasn't called. Inside the , there D is a pair. The second element of the pair is our filter function   ].  ] is a type  alias for  ( ( ])) . This is  just a wrapper for a ] -> ] function with a  particular  behavior. The value   Append (Dual (Endo f)) Causes f* to be composed with the previous filter.   Set (Dual (Endo f)) Causes f. to not be composed with the previous filter. 1Finally, the first element of the pair is either   ] or  a. AAnother way of looking at all these pieces is from the behaviors  they control. The  controls the  behavior.   ( f) comes from the  behavior. Likewise,   ( f) is from .   ] is what you get when you call  and   a is the normal exit. &An example case statement looks like:  ex1 webt = do  val <- ununWebT webt  case val of N Nothing -> Nothing -- this is the interior value when mzero was used a Just (Left r, f) -> Just (Left r, f) -- r is the value that was passed into "finishWith" I -- f is our filter function P Just (Right a, f) -> Just (Right a, f) -- a is our normal monadic value Q -- f is still our filter function  The basic ] building object. /A set of functions for manipulating filters.  implements  ] so these methods * are the fundamental ways of manipulating ] values. 0Ignores all previous alterations to your filter As an example:   do  composeFilter f  setFilter g  return "Hello World" The  g will cause the first  f to  be ignored. 7Composes your filter function with the existing filter  function. +Retrieves the filter from the environment.  is a lot more fun to type than  (  ( a)). "A monoid operation container. If a is a monoid, then  + is a monoid with the following behaviors:  7 Set x `mappend` Append y = Set (x `mappend` y) 7 Append x `mappend` Append y = Append (x `mappend` y) & _ `mappend` Set y = Set y :A simple way of summarizing this is, if the right side is , ? then the right is appended to the left. If the right side is  !, then the left side is ignored. The / class provides methods for reading or locally  modifying the O-. It is essentially a specialized version of  the $ class. Providing the unique names,  and   makes it easier to use  and   together. 3 is a rich, featureful monad for web development.  see also:  simpleHTTP, , , , and  HasRqData  An alias for    An alias for  when using . 'Particularly useful when combined with runWebT to produce  a m ( ]) from a O. )function for lifting WebT to ServerPartT ANOTE: This is mostly for internal use. If you want to access the  O in user-code see  from .  do request <- askRq  ... A constructor for a  when you don't care about the request. DNOTE: This is mostly for internal use. If you think you need to use D it in your own code, you might consider asking on the mailing list 9 or IRC to find out if there is an alternative solution. 1Apply a function to transform the inner monad of   m. *Often used when transforming a monad with , since   simpleHTTP requires a   a . Refer to  3 for an explanation of the structure of the monad. 2Here is an example. Suppose you want to embed an  into your   to enable  and  in your .  7 type MyServerPartT e m a = ServerPartT (ErrorT e m) a Now suppose you want to pass  MyServerPartT into a function that  demands a   a (e.g.  simpleHTTP ). You can  provide the function:  L unpackErrorT :: (Monad m, Show e) => UnWebT (ErrorT e m) a -> UnWebT m a  unpackErrorT et = do  eitherV <- runErrorT et  return $ case eitherV of 1 Left err -> Just (Left $ toResponse $ G "Catastrophic failure " ++ show err @ , filterFun $ \r -> r{rsCode = 500})  Right x -> x With  unpackErrorT you can now call  simpleHTTP. Just wrap your   list.  T simpleHTTP nullConf $ mapServerPartT unpackErrorT (myPart `catchError` myHandler) Or alternatively:  D simpleHTTP' unpackErrorT nullConf (myPart `catchError` myHandler)  Also see '* for a more sophisticated version of this  function.  A variant of % where the first argument also takes  a O. Useful if you want to  on a different   inside your monad (see spUnwrapErrorT). Extract the value from a .  Note that a  is actually a  CoPointed from:   hhttp://hackage.haskell.org/packages/archive/category-extras/latest/doc/html/Control-Functor-Pointed.html . But lets not drag in that dependency. yet...  turn a function into a . Primarily used with   &Resets all your filters. An alias for  .  8Used to ignore all your filters and immediately end the  computation. A combination of   and .  An alternate form of  % that can be easily used within a do  block.  %For when you really need to unpack a  entirely (and not " just unwrap the first layer with ). For wrapping a  back up.  .   =  See $ for a discussion of this function. 'This is kinda like a very oddly shaped  or . . You probably want one or the other of those. Deprecated: use . !What is this for, exactly? I don't understand why Show a is E even in the context Deprecated: This function appears to do nothing ( at all. If it use it, let us know why. avalue to return (For , a will always be the type ])      :     .     S     NoneAdd the 8 to ]. example   main = simpleHTTP nullConf $ 2 do addCookie Session (mkCookie "name" "value") , ok $ "You now have a session cookie."  see also:   Add the list 8 to the ].  see also:  @Expire the named cookie immediately and set the cookie value to ""  main = simpleHTTP nullConf $  do expireCookie "name" * ok $ "The cookie has been expired." 3456789:;<=>?@B89:;<=>?@37654BNone will convert a value into a ] body,  set the  content-type3, and set the default response code for that type. happstack-server Example:  9 main = simpleHTTP nullConf $ toResponse "hello, world!" will generate a ] with the content-type text/plain,  the response code 200 OK, and the body:  hello, world!.  simpleHTTP will call 2 automatically, so the above can be shortened to:  . main = simpleHTTP nullConf $ "hello, world!" happstack-lite Example:  3 main = serve Nothing $ toResponse "hello, world!" Minimal definition:  (and usually ).  A low-level function to build a ] from a content-type  and a  ByteString.  Creates a ] in a manner similar to the  class, 0 but without requiring an instance declaration.  example:  # import Data.ByteString.Char8 as C ( import Data.ByteString.Lazy.Char8 as L  import Happstack.Server  ^ main = simpleHTTP nullConf $ ok $ toResponseBS (C.pack "text/plain") (L.pack "hello, world") (note: () and @ only work for ascii. For unicode strings you would need to use  utf8-string, text), or something similar to create a valid  ByteString).  alias for: fmap toResponse turns m a into m ] using . @ main = simpleHTTP nullConf $ flatten $ do return "flatten me."   Honor an if-modified-since header in a O.  If the O includes the if-modified-since header and the  ]8 has not been modified, then return 304 (Not Modified),  otherwise return the ]. !/Set an arbitrary return code in your response. AA filter for setting the response code. Generally you will use a  helper function like # or '.  5 main = simpleHTTP nullConf $ do setResponseCode 200 ; return "Everything is OK"  see also: " "Same as ! status >> return val. BUse this if you want to set a response code that does not already  have a helper function. : main = simpleHTTP nullConf $ resp 200 "Everything is OK" # Respond with 200 OK. 4 main = simpleHTTP nullConf $ ok "Everything is OK" $ Respond with 204 No Content A 204 No Contentb response may not contain a message-body. If you try to supply one, it will be dutifully ignored. @ main = simpleHTTP nullConf $ noContent "This will be ignored." % Respond with 301 Moved Permanently. ~ main = simpleHTTP nullConf $ movedPermanently "http://example.org/" "What you are looking for is now at http://example.org/" & Respond with  302 Found. You probably want 'k. This method is not in popular use anymore, and is generally treated like 303 by most user-agents anyway. ' Respond with  303 See Other.  v main = simpleHTTP nullConf $ seeOther "http://example.org/" "What you are looking for is now at http://example.org/" NOTE: The second argument of 'U is the message body which will sent to the browser. According to the HTTP 1.1 spec,  dthe entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s).This is because pre-HTTP/S1.1 user agents do not support 303. However, in practice you can probably just use "" as the second argument. ( Respond with 307 Temporary Redirect.  main = simpleHTTP nullConf $ tempRedirect "http://example.org/" "What you are looking for is temporarily at http://example.org/" ) Respond with 400 Bad Request. 8 main = simpleHTTP nullConf $ badRequest "Bad Request." * Respond with 401 Unauthorized. E main = simpleHTTP nullConf $ unauthorized "You are not authorized." + Respond with  403 Forbidden. B main = simpleHTTP nullConf $ forbidden "Sorry, it is forbidden." , Respond with  404 Not Found. V main = simpleHTTP nullConf $ notFound "What you are looking for has not been found." - Respond with 413 Request Entity Too Large. W main = simpleHTTP nullConf $ requestEntityTooLarge "That's too big for me to handle." . Respond with 500 Internal Server Error. _ main = simpleHTTP nullConf $ internalServerError "Sorry, there was an internal server error." /Responds with 502 Bad Gateway. 8 main = simpleHTTP nullConf $ badGateway "Bad Gateway." 0"A nicely formatted rendering of a ] # content-type response body  mod-time for the ] (MUST NOT be later than server's time of message origination) 7incoming request (used to check for if-modified-since) ,Response to send if there are modifications !response code "response code value to return #$%&'()*+,-./0 !"#$%&'()*+,-./0#$./)*+,0-'&%(!"  !"#$%&'()*+,-./0None%1Used by W and V. Make your preferred data  type an instance of 1 to use those functions. 3#A class for monads which contain a 8 6 lift some 9 into 7 73An applicative functor and monad for looking up key/ value pairs 1 in the QUERY_STRING, Request body, and cookies. 8@the environment used to lookup query parameters. It consists of ? the triple: (query string inputs, body inputs, cookie inputs) 9a list of errors <transform the result of 'RqData a'. This is similar to ) except it also allows you to modify the  9 not just a. =use  to convert a   to a value of type a  + look "key" `checkRq` (unsafeReadRq "key")  use with ? ANOTE: This function is marked unsafe because some Read instances C are vulnerable to attacks that attempt to create an out of memory  condition. For example:  $ read "1e10000000000000" :: Integer  see also: > >use K to convert a   to a value of type a  % look "key" `checkRq` (readRq "key")  use with ? ?convert or validate a value This is similar to & except that the function can fail by C returning Left and an error message. The error will be propagated  by calling 6. :This function is useful for a number of things including:   Parsing a   into another type _ Checking that a value meets some requirements (for example, that is an Int between 1 and 10). Example usage at:  ?http://happstack.com/docs/crashcourse/RqData.html#rqdatacheckrq @like ?' but the check function can be monadic A.Gets the first matching named input parameter 8Searches the QUERY_STRING followed by the Request body.  see also: B B/Gets all matches for the named input parameter 8Searches the QUERY_STRING followed by the Request body.  see also: A C8Gets the first matching named input parameter as a lazy  ByteString 8Searches the QUERY_STRING followed by the Request body.  see also: D D7Gets all matches for the named input parameter as lazy  ByteStrings 8Searches the QUERY_STRING followed by the Request body.  see also: C E3Gets the first matching named input parameter as a   8Searches the QUERY_STRING followed by the Request body. ?This function assumes the underlying octets are UTF-8 encoded.  Example:   handler :: ServerPart Response  handler =  do foo <- look "foo" + ok $ toResponse $ "foo = " ++ foo  see also: F, C, and D F2Gets all matches for the named input parameter as  s 8Searches the QUERY_STRING followed by the Request body. ?This function assumes the underlying octets are UTF-8 encoded.  see also: E and D G8Gets the first matching named input parameter as a lazy  8Searches the QUERY_STRING followed by the Request body. ?This function assumes the underlying octets are UTF-8 encoded.  see also: I, E, F, C, and D H:Gets the first matching named input parameter as a strict  8Searches the QUERY_STRING followed by the Request body. ?This function assumes the underlying octets are UTF-8 encoded.  see also: I, E, F, C, and D I7Gets all matches for the named input parameter as lazy s 8Searches the QUERY_STRING followed by the Request body. ?This function assumes the underlying octets are UTF-8 encoded.  see also: G, F and D J9Gets all matches for the named input parameter as strict s 8Searches the QUERY_STRING followed by the Request body. ?This function assumes the underlying octets are UTF-8 encoded.  see also: H, F and D KGets the named cookie % the cookie name is case insensitive L"gets the named cookie as a string M1gets the named cookie as the requested Read type NCGets the first matching named input parameter and decodes it using  8Searches the QUERY_STRING followed by the Request body. ?This function assumes the underlying octets are UTF-8 encoded.  see also: O OFGets all matches for the named input parameter and decodes them using  8Searches the QUERY_STRING followed by the Request body. ?This function assumes the underlying octets are UTF-8 encoded.  see also: O P#Gets the first matching named file BFiles can only appear in the request body. Additionally, the form  must set enctype=" multipart/ form-data". -This function returns a tuple consisting of:  - The temporary location of the uploaded file , The local filename supplied by the browser * The content-type supplied by the browser DNOTE: You must move the file from the temporary location before the  ]8 is sent. The temporary files are automatically removed  after the ] is sent. Q6gets all the input parameters, and converts them to a   BThe results will contain the QUERY_STRING followed by the Request  body. ?This function assumes the underlying octets are UTF-8 encoded.  see also: R Rgets all the input parameters BThe results will contain the QUERY_STRING followed by the Request  body.  see also: Q SThe POST/8PUT body of a Request is not received or decoded unless  this function is invoked. :It is an error to try to use the look functions for a POST/PUT / request with out first calling this function. It is ok to call S$ at the beginning of every request:   main = simpleHTTP nullConf $ D do decodeBody (defaultBodyPolicy "/tmp/" 4096 4096 4096)  handlers 4You can achieve finer granularity quotas by calling S . with different values in different handlers. Only the first call to S will have any effect. Calling = it a second time, even with different quota values, will do  nothing. Trun 7 in a . Example: a simple GET or POST variable based authentication % guard. It handles the request with  errorHandler if  authentication fails.  U data AuthCredentials = AuthCredentials { username :: String, password :: String }  % isValid :: AuthCredentials -> Bool  isValid = const True  % myRqData :: RqData AuthCredentials  myRqData = do ! username <- look "username" ! password <- look "password" 0 return (AuthCredentials username password)  F checkAuth :: (String -> ServerPart Response) -> ServerPart Response  checkAuth errorHandler = do  d <- getDataFn myRqData  case d of . (Left e) -> errorHandler (unlines e) ( (Right a) | isValid a -> mzero 9 (Right a) | otherwise -> errorHandler "invalid" NOTE: you must call S# prior to calling this function if $ the request method is POST or PUT. U similar to T+, except it calls a sub-handler on success  or  on failure. NOTE: you must call S# prior to calling this function if $ the request method is POST or PUT. V A variant of T that uses 1 to chose your  7 for you. The example from V becomes:  U data AuthCredentials = AuthCredentials { username :: String, password :: String }  % isValid :: AuthCredentials -> Bool  isValid = const True  % myRqData :: RqData AuthCredentials  myRqData = do ! username <- look "username" ! password <- look "password" 0 return (AuthCredentials username password)  * instance FromData AuthCredentials where  fromData = myRqData  F checkAuth :: (String -> ServerPart Response) -> ServerPart Response  checkAuth errorHandler = do  d <- getData  case d of . (Left e) -> errorHandler (unlines e) ( (Right a) | isValid a -> mzero 9 (Right a) | otherwise -> errorHandler "invalid" NOTE: you must call S# prior to calling this function if $ the request method is POST or PUT. W similar to V, except it calls a subhandler on success or  on failure. NOTE: you must call S# prior to calling this function if $ the request method is POST or PUT. X$limit the scope to the Request body  handler :: ServerPart Response  handler = ! do foo <- body $ look "foo" * ok $ toResponse $ "foo = " ++ foo Y$limit the scope to the QUERY_STRING  handler :: ServerPart Response  handler = ( do foo <- queryString $ look "foo" * ok $ toResponse $ "foo = " ++ foo Zlimit the scope to is which produce a  ByteString (aka, not a file) 9123456789:;<=,name of key (only used for error reporting)   to   on error,  on success >,name of key (only used for error reporting)   to   on error,  on success ?@ABCDEFGHIJKLMNOP"name of input field to search for <(temporary file location, uploaded file name, content-type) QRST7 monad to evaluate return  errors or  a UVWXYZ1123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ1EFGHIJCDNOPQRKLMABXYZ?@>=S7<9:;TU12VW834563123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZNone[CA class alias for all the classes a standard server monad (such as t) is expected to have instances for. This allows you to keep your type signatures shorter and easier to understand. \!Get a header out of the request. ]?Add headers into the response. This method does not overwrite 6 any existing header of the same name, hence the name ]. % If you want to replace a header use ^. ^?Set a header into the response. This will replace an existing  header of the same name. Use ] if you want to add more # than one header of the same name. _Run an  action and, if it returns , pass it to the  second argument. `9A variant of require that can run in any monad, not just . [\]^_`    [\]^_`[  ]\^  _` [\]^_`Nonea*A simple HTTP basic authentication guard. -If authentication fails, this part will call .  example:  main = simpleHTTP nullConf $ d msum [ basicAuth "127.0.0.1" (fromList [("happstack","rocks")]) $ ok "You are in the secret club" / , ok "You are not in the secret club."  ] athe realm name the username password map the part to guard aaaNonebFlatten  ( e m) a into a  m  a so that it can be use with  simpleHTTP . Used with  mapServerPartT', e.g.,  h simpleHTTP conf $ mapServerPartT' (spUnWrapErrorT simpleErrorHandler) $ myPart `catchError` errorPart Note that in this example, simpleErrorHandler will only be run if  errorPart" throws an error. You can replace simpleErrorHandler% with your own custom error handler.  see also: c c.A simple error handler which can be used with b. <It returns the error message as a plain text message to the B browser. More sophisticated behaviour can be achieved by calling ( your own custom error handler instead.  see also: b dThis  ServerPart modifier enables the use of  throwError and   catchError inside the  actions, by adding the  ! monad transformer to the stack. -You can wrap the complete second argument to  simpleHTTP in this  function. DEPRECATED: use b instead. bcdbcdbcdbcdNoneee3 is for creating a part that acts as a proxy. The  sole argument [ ]" is a list of allowed domains for @ proxying. This matches the domain part of the request and the  wildcard * can be used. E.g.  "*" to match anything.  " *.example.com"% to match anything under example.com  " example.com" to match just example.com 6TODO: annoyingly enough, this method eventually calls escape, so  any headers you set won'+t be used, and the computation immediately  ends. f Take a proxy O and create a ]. Your basic proxy  building block. See h. *TODO: this would be more useful if it didn't call escape D (e.g. it let you modify the response afterwards, or set additional  headers) g-This is a reverse proxy implementation. See i. *TODO: this would be more useful if it didn't call escape, just  like f. efg defaultHost 9map to look up hostname mappings. For the reverse proxy the result is a  ServerPartT" that will reverse proxy for you. hiefghiefghiefghiNonej;Set the validator which should be used for this particular  ] when validation is enabled. CCalling this function does not enable validation. That can only be ( done by enabling the validation in the  that is passed to   simpleHTTP. >You do not need to call this function if the validator set in   does what you want already. Example: (use o$ instead of the default supplied by  l)  H simpleHTTP validateConf $ ok . setValidator noopValidator =<< htmlPage  See also: l, n, o,  p. k ServerPart version of j. Example: (Set validator to o) K simpleHTTP validateConf $ setValidatorSP noopValidator (dir "ajax" ... ) lExtend $ by enabling validation and setting  n as the default validator for text/html.  Example: 4 simpleHTTP validateConf . anyRequest $ ok htmlPage m%Actually perform the validation on a ]. #Run the validator specified in the ]. If none is provide # use the supplied default instead. =Note: This function will run validation unconditionally. You  probably want j or l. n Validate text/html content with WDG HTML Validator. 1This function expects the executable to be named validate and it  must be in the default PATH.  See also: j, l, p. o#A validator which always succeeds. AUseful for selectively disabling validation. For example, if you @ are sending down HTML fragments to an AJAX application and the 8 default validator only understands complete documents. p Validate the ] using an external application. @If the external application returns 0, the original response is D returned unmodified. If the external application returns non-zero,  a ]5 containing the error messages and original response  body is returned instead. DThis function also takes a predicate filter which is applied to the B content-type of the response. The filter will only be applied if  the predicate returns true. ;NOTE: This function requires the use of -threaded to avoid B blocking. However, you probably need that for Happstack anyway.  See also: n. jklmnopname of executable $arguments to pass to the executable #optional path to working directory )optional environment (otherwise inherit) content-type filter Response to validate jklmnopjklmnopjklmnopNoneqsee  xa ' from file extensions to content-types  example:   myMimeMap :: MimeMap > myMimeMap = Map.fromList [("gz","application/x-gzip"), ... ]  see also:  y?try to guess the content-type of a file based on its extension  see also: z z?try to guess the content-type of a file based on its extension  defaults to application/octet-stream if no match was found. Useful as an argument to   see also: y,  {9returns a specific content type, completely ignoring the  argument. Use this with ' if you want to explicitly specify the  content-type.  see also: z,  |,a list of common index files. Specifically:  index.html,  index.xml,  index.gif !Typically used as an argument to  serveDiretory. }return a simple File not found 404 page. ~Prevents files of the form '.foo' or  'bar/.foo' from being served JReturns True if the given String either starts with a . or is of the form  foo/.bar5, e.g. the typical *nix convention for hidden files. .Use sendFile to send the contents of a Handle 'Send the contents of a Lazy ByteString 'Send the contents of a Lazy ByteString FSend the specified file with the specified mime-type using sendFile() =NOTE: assumes file exists and is readable by the server. See . +WARNING: No security checks are performed. LSend the specified file with the specified mime-type using lazy ByteStrings =NOTE: assumes file exists and is readable by the server. See . +WARNING: No security checks are performed. NSend the specified file with the specified mime-type using strict ByteStrings =NOTE: assumes file exists and is readable by the server. See . +WARNING: No security checks are performed. Serve a single, specified file. The name of the file being served is specified explicity. It is not derived automatically from the O url.  example 1: 6Serve using sendfile() and the specified content-type  T serveFileUsing filePathSendFile (asContentType "image/jpeg") "/srv/data/image.jpg"  example 2: PServe using a lazy ByteString and the guess the content-type from the extension  Q serveFileUsing filePathLazy (guessContentTypeM mimeTypes) "/srv/data/image.jpg" +WARNING: No security checks are performed. Serve a single, specified file. The name of the file being served is specified explicity. It is not derived automatically from the O url.  example 1: "Serve as a specific content-type:  > serveFile (asContentType "image/jpeg") "/srv/data/image.jpg"  example 2: 4Serve guessing the content-type from the extension:  ? serveFile (guessContentTypeM mimeTypes) "/srv/data/image.jpg" QIf the specified path does not exist or is not a file, this function will return . +WARNING: No security checks are performed. NOTE: alias for   NServe files from a directory and its subdirectories (parameterizable version) 5Parameterize this function to create functions like, , , and   You supply:  5 a low-level function which takes a content-type and  and generates a Response 7 a function which determines the content-type from the  ' a list of all the default index files ANOTE: unlike fileServe, there are no index files by default. See |. :Serve files from a directory and its subdirectories using sendFile. Usage:  2 fileServe ["index.html"] "path/to/files/on/disk" * does not support directory browsing. See  DEPRECATED: use  instead. Note: The list of index files [" index.html"] is only used to determine what file to show if the user requests a directory. You *do not* need to explicitly list all the files you want to serve. OServe files from a directory and its subdirectories (lazy ByteString version). 8WARNING: May leak file handles. You should probably use  instead. RServe files from a directory and its subdirectories (strict ByteString version). \WARNING: the entire file will be read into RAM before being served. You should probably use  instead. attempt to serve index files 2try to find an index file, calls mzero on failure Ta function to generate an HTML page showing the contents of a directory on the disk  see also: ,  Ua function to generate an HTML table showing the contents of a directory on the disk 3This function generates most of the content of the  % page. If you want to style the page E differently, or add google analytics code, etc, you can just create / a new page template to wrap around this HTML.  see also: ,  JServe files and directories from a directory and its subdirectories using sendFile. Usage:  F serveDirectory EnableBrowsing ["index.html"] "path/to/files/on/disk" @If the requested path does not match a file or directory on the  disk, then  calls . CIf the requested path is a file then the file is served normally. AIf the requested path is a directory, then the result depends on 3 what the first two arguments to the function are. :The first argument controls whether directory browsing is  enabled. 6The second argument is a list of index files (such as  index.html). When a directory is requested,  will first try to E find one of the index files (in the order they are listed). If that , fails, it will show a directory listing if s is set,  otherwise it will return  forbidden "Directory index forbidden". ?Here is an explicit list of all the possible outcomes when the " argument is a (valid) directory:  r, empty index file list #This will always return, forbidden "Directory index forbidden"  r, non-empty index file list  - If an index file is found it will be shown.  Otherwise returns, forbidden "Directory index forbidden"  s, empty index file list  Always shows a directory index.  s, non-empty index file list  , If an index file is found it will be shown # Otherwise shows a directory index  see also: |,  'Ready collection of common mime types. I Except for the first two entries, the mappings come from an Ubuntu 8.04 /etc/mime.types file. &qrstuvwxyz{the content-type to return |}~content-type string file path for content to send 6mod-time for the handle (MUST NOT be later than server'^s time of message origination), incoming request (used to check for if-modified-since header) offset into Handle number of bytes to send content-type string (e.g. "text/plain; charset=utf-8")  lazy bytestring content to send [mod-time for the bytestring, incoming request (used to check for if-modified-since header) offset into the bytestring dnumber of bytes to send (offset + count must be less than or equal to the length of the bytestring) content-type string (e.g. "text/plain; charset=utf-8")  lazy bytestring content to send [mod-time for the bytestring, incoming request (used to check for if-modified-since header) offset into the bytestring dnumber of bytes to send (offset + count must be less than or equal to the length of the bytestring) content-type string path to file on disk content-type string path to file on disk content-type string path to file on disk  typically , , or  9function for determining content-type of file. Typically { or z path to the file to serve 9function for determining content-type of file. Typically { or z path to the file to serve Ufunction which takes a content-type and filepath and generates a response (typically , , or ) 2function which returns the mime-type for FilePath  -> [FilePath]J -- ^ index file names, in case the requested path is a directory file/directory to serve <index file names, in case the requested path is a directory file/directory to serve <index file names, in case the requested path is a directory file/directory to serve ;index file names, in case the next argument is a directory file/directory to serve $list of possible index files (e.g.,  index.html)  see also  ,directory on disk to search for index files usually  )function to calculate mime type, usually z list of index files. See also | directory to search in path to directory on disk list of entries in that path list of files+meta data, see  allow directory browsing <index file names, in case the requested path is a directory file/directory to serve &qrstuvwxyz{|}~&qsrx{yztwvu~|}!qsrtwvuxyz{|}~*None qrsxz{| qsrx{z|NoneBinstances of this class provide a variety of ways to match on the O method.  Examples:  2 method GET -- match GET or HEAD 8 method [GET, POST] -- match GET, HEAD or POST 9 method HEAD -- match HEAD /but not/ GET 2 method (== GET) -- match GET or HEAD ? method (not . (==) DELETE) -- match any method except DELETE 1 method () -- match any method HAs you can see, GET implies that HEAD should match as well. This is to D make it harder to write an application that uses HTTP incorrectly. J Happstack handles HEAD requests automatically, but we still need to make  sure our handlers don'+t mismatch or a HEAD will result in a 404. 2If you must, you can still do something like this  to match GET without HEAD:  guardRq ((== GET) . rqMethod) )Guard using an arbitrary function on the O. Aguard which checks that an insecure connection was made via http://  Example:  handler :: ServerPart Response  handler =  do https  ... ?guard which checks that a secure connection was made via https://  Example:  handler :: ServerPart Response  handler =  do https  ... -Guard against the method only (as opposed to ).  Example:  handler :: ServerPart Response  handler =  do methodOnly [GET, HEAD]  ... <Guard against the method. This function also guards against $ *any remaining path segments*. See  for the version  that guards only by method.  Example:   handler :: ServerPart Response  handler =  do methodM [GET, HEAD]  ... 6NOTE: This function is largely retained for backwards / compatibility. The fact that implicitly calls  is often E forgotten and leads to confusion. It is probably better to just use   and call  explicitly. 7This function will likely be deprecated in the future. -Guard against the method only (as opposed to ).  Example:  handler :: ServerPart Response  handler =  do methodOnly [GET, HEAD]  ... BGuard against the method. Note, this function also guards against ) any remaining path segments. Similar to & but with a different type signature.  Example:   handler :: ServerPart Response - handler = methodSP [GET, HEAD] $ subHandler @NOTE: This style of combinator is going to be deprecated in the " future. It is better to just use .  handler :: ServerPart Response 7 handler = method [GET, HEAD] >> nullDir >> subHandler Bguard which only succeeds if there are no remaining path segments 8Often used if you want to explicitly assign a route for  BPop a path element and run the supplied handler if it matches the  given string.   handler :: ServerPart Response . handler = dir "foo" $ dir "bar" $ subHandler !The path element can not contain '/' . See also . Guard against a  . Unlike  the  may  contain '/'6. If the guard succeeds, the matched elements will be " popped from the directory stack.   dirs "foo/bar" $ ...  See also: . Guard against the host. This matches against the host" header specified in the incoming O. (Can be used to support virtual hosting,  ,http://en.wikipedia.org/wiki/Virtual_hosting  see also:   Lookup the host< header in the incoming request and pass it to the handler.  see also:  *Pop a path element and parse it using the K in the  J class. >Grab the rest of the URL (dirs + query) and passes it to your  handler. *Pop any path element and run the handler. PSucceeds if a path component was popped. Fails is the remaining path was empty. 0Guard which checks that the Request URI ends in '/' . Useful  for distinguishing between foo and foo/  requires mtl provisional'Happstack team <happs@googlegroups.com>None "Parse command line options into a . 9start the server, and handle requests using the supplied  . AThis function will not return, though it may throw an exception. DNOTE: The server will only listen on IPv4 due to portability issues  in the Network module. For IPv6 support, use   with custom socket. A combination of  and . See  0 for a discussion of the first argument of this  function. =NOTE: This function always binds to IPv4 ports until Network 8 module is fixed to support IPv6 in a portable way. Use  * with custom socket if you want different  behaviour. Generate a result from a  and a O . This is - mainly used by CGI (and fast-cgi) wrappers. Run / with a previously bound socket. Useful if you D want to run happstack as user on port 80. Use something like this:  J import System.Posix.User (setUserID, UserEntry(..), getUserEntryForName)   main = do ' let conf = nullConf { port = 80 }  socket <- bindPort conf $ -- do other stuff as root here 6 getUserEntryForName "www" >>= setUserID . userID 1 -- finally start handling incoming requests C tid <- forkIO $ simpleHTTPWithSocket socket Nothing conf impl Note: It'7s important to use the same conf (or at least the same  port) for  and .  see also: ,  Like  with a socket. -Bind port and return the socket for use with . This C function always binds to IPv4 ports until Network module is fixed $ to support IPv6 in a portable way. 7Bind to ip and port and return the socket for use with .   import Happstack.Server   main = do let conf = nullConf " addr = "127.0.0.1" * s <- bindIPv4 addr (port conf) < simpleHTTPWithSocket s conf $ ok $ toResponse $ 5 "now listening on ip addr " ++ addr ++ . " and port " ++ show (port conf) Wait for a signal. ; On unix, a signal is sigINT or sigTERM (aka Control-C). &On windows, the signal is entering: e  return BIP address to bind to (must be an IP address and not a host name) port number to bind to ./0123456789:;<=>?@BJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnop  None reads the Accept-Encoding header. Then, if possible . will compress the response body with methods gzip or deflate.  main =  simpleHTTP nullConf $ ) do str <- compressedResponseFilter I return $ toResponse ("This response compressed using: " ++ str)  Ignore the Accept-Encoding header in the O7 and attempt to compress the body of the response with gzip. calls  using .  see also:   Ignore the Accept-Encoding header in the O8 and attempt compress the body of the response with zlib's  deflate method calls  using  .  see also:   Ignore the Accept-Encoding header in the OQ and attempt to compress the body of the response using the supplied compressor. 1We can not compress files being transfered using ^. If  identity. is an allowed encoding, then just return the ] ! unmodified. Otherwise we return 406 Not Acceptable.  see also:  and  defaultFilter (a parser for the Accept-Encoding header name of the encoding chosen ,encoding to use for Content-Encoding header "fallback to identity for SendFile ,encoding to use for Content-Encoding header "fallback to identity for SendFile function to compress the body ,encoding to use for Content-Encoding header "fallback to identity for SendFile None parse the 'Accept-Language' header, or [] if not found. deconstruct the  results a return a list of 5 languages sorted by preference in descending order. 6Note: this implementation does not conform to RFC4647 ;Among other things, it does not handle wildcards. A proper = implementation needs to take a list of available languages. +None,'GHC-only, Windows, Linux, FreeBSD, OS X provisional'Happstack team <happs@googlegroups.com>None./0123456789:;<=>?@BJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~     !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrsxz{| -./01234567889:;<=>?@ABCDEFGHIJJKLMNOPQRSTUVWX!Y!Y!Z![!\]^_`abbcdefghijklmnopqrstuvwxxyz{|}~                                       ! " # $ % & ' U ( ) * + , - . / 0 1 23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{'|}~L    ! ! !!!!!!!!!!!!!!""""" "!#"###$#%&'(&')*&'+,-./0123456789:;<=>?@ABCDEFGH%%x%IJ%K%L%M%N%%O%P%Q%R%S%T%%U%V%W%%X%Y%Z%[%x%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%{%|%}%~%%%%%%%%%%%%%%%%%%%%%%B%E%A%C%%,,&'                                                               )      !"#$%&$'&(happstack-server-7.0.0 Happstack.Server.Internal.Socket(Happstack.Server.Internal.TimeoutManager#Happstack.Server.Internal.TimeoutIO'Happstack.Server.Internal.TimeoutSocketHappstack.Server.SURIHappstack.Server.Internal.Types Happstack.Server.Internal.Cookie#Happstack.Server.Internal.Multipart%Happstack.Server.Internal.MessageWrap!Happstack.Server.Internal.Handler Happstack.Server.Internal.ListenHappstack.Server.Client Happstack.Server.Internal.MonadsHappstack.Server.CookieHappstack.Server.ResponseHappstack.Server.RqDataHappstack.Server.MonadsHappstack.Server.AuthHappstack.Server.ErrorHappstack.Server.ProxyHappstack.Server.Validation)Happstack.Server.FileServe.BuildingBlocksHappstack.Server.RoutingHappstack.Server.SimpleHTTP%Happstack.Server.Internal.CompressionHappstack.Server.I18N#Happstack.Server.Internal.LazyLiner"Happstack.Server.HTTPClient.StreamHappstack.Server.HTTPClient.TCP"Happstack.Server.Internal.SocketTH#Happstack.Server.Internal.LogFormatHappstack.Server.SURI.ParseURI'Happstack.Server.Internal.RFC822HeadersPaths_happstack_serverHappstack.Server.Internal.Clock"Happstack.Server.Internal.LowLevel Happstack.Server.HTTPClient.HTTPHappstack.Server.TypesspUnwrapErrorTCpackHappstack.Server.FileServeHappstack.Server.CompressionHappstack.Server acceptLitesockAddrToHostNameHandleManager initializeregisterregisterKillThreadticklepauseresumecancel TimeoutIOtoHandle toPutLazytoPut toGetContents toSendFile toShutdowntoSecuresPutLazyTickle sPutTickle sGetContentssendFileTickle iterTickletimeoutSocketIOFromPathfromPathToSURItoSURISURIsuripathqueryschemeu_schemeu_patha_schemea_path unEscapeQSunEscapeescapeisAbsrenderparse ContentTypectType ctSubtype ctParameters CookieLifeExpiredExpiresMaxAgeSessionCookie cookieVersion cookiePath cookieDomain cookieName cookieValuesecurehttpOnlycalcLifemkCookiemkCookieHeader parseCookies cookiesParser getCookies getCookie getCookies' getCookie' FromReqURI fromReqURIRqBodyBodyunBodyRequestrqSecurerqMethodrqPathsrqUrirqQuery rqInputsQuery rqInputsBody rqCookies rqVersion rqHeadersrqBodyrqPeerResponseSendFile sfFilePathsfOffsetsfCountrsCode rsHeadersrsFlagsrsBody rsValidatorHostInput inputValue inputFilenameinputContentTypeRsFlags rsfLengthLengthNoContentLengthTransferEncodingChunked ContentLengthHeaders HeaderPairhNamehValueMethodCONNECTOPTIONSTRACEDELETEPUTPOSTHEADGETConfport validator logAccesstimeout LogAccess HttpVersion isHTTP1_1 isHTTP1_0 continueHTTPnullConf logMAccess nullRsFlagsnoContentLengthchunked contentLengthtakeRequestBodyreadInputsBodyrqURL setRsCode mkHeaders getHeader getHeaderBSgetHeaderUnsafe hasHeader hasHeaderBShasHeaderUnsafe setHeader setHeaderBSsetHeaderUnsafe addHeader addHeaderBSaddHeaderUnsaferesultresultBSredirectreadDec'readM fromReadS FileSaver InputIter HeaderResult BodyResultFailed InputWorkerWork HeaderWorkBodyWorkBodyPartspanS takeWhileScrlfcrlfcrlf blankLine dropWhileSdefaultFileSaverdefaultInputIter hPutLimit hPutLimit'bodyPartToInputbodyPartsToInputs multipartBody simpleInputdefaultInputTypeparseMultipartBody dropPreambledropLine isBoundarystartsWithDashes splitParts splitPart splitBlank splitBoundarysplitAtEmptyLine splitAtCRLF BodyPolicy inputWorkermaxDiskmaxRAM maxHeader queryInputdefaultBodyPolicy bodyInput formDecode decodeBodymultipartDecodepathEls splitList splitListBysplitrequest parseResponse putRequestlistenOn listenOnIPv4listenlisten' getResponseWebMonad finishWithUnWebTWebTunWebT FilterMonad setFilter composeFilter getFilterFilterT unFilterT FilterFun SetAppendAppendSet ServerMonadaskRqlocalRq ServerPartT unServerPartT ServerPartWebrunServerPartT withRequest anyRequestmapServerPartTmapServerPartT'extract unFilterFun filterFun ignoreFiltersescape'ununWebTmkWebTmapWebT localContextmulti debugFilteroutputTraceMessage mkFailMessagefailHtml escapeString addCookie addCookies expireCookie ToMessage toContentType toMessage toResponse toResponseBSflattenifModifiedSincesetResponseCoderespok noContentmovedPermanentlyfoundseeOther tempRedirect badRequest unauthorized forbiddennotFoundrequestEntityTooLargeinternalServerError badGatewayprettyResponseFromDatafromData HasRqDataaskRqEnv localRqEnv rqDataErrorRqDataRqEnvErrorsunErrors mapRqData unsafeReadRqreadRqcheckRqcheckRqM lookInput lookInputslookBSlookBSslooklookslookText lookText' lookTexts lookTexts' lookCookielookCookieValuereadCookieValuelookRead lookReadslookFile lookPairs lookPairsBS getDataFn withDataFngetDatawithDatabody queryString bytestring Happstack getHeaderM addHeaderM setHeaderMrequirerequireM basicAuthsimpleErrorHandlererrorHandlerSP proxyServe proxyServe' rproxyServe unproxify unrproxify setValidatorsetValidatorSP validateConf runValidatorwdgHTMLValidator noopValidatorlazyProcValidatorBrowsingDisableBrowsingEnableBrowsing EntryKind UnknownKind DirectoryFileMimeMapguessContentTypeguessContentTypeM asContentTypedefaultIxFiles fileNotFound blockDotFilesisDotsendFileResponselazyByteStringResponsestrictByteStringResponsefilePathSendFile filePathLazyfilePathStrictserveFileUsing serveFile fileServe' isSafePath fileServe fileServeLazyfileServeStrictdoIndex doIndexLazy doIndexStrictdoIndex'tryIndex browseIndexrenderDirectoryContentsrenderDirectoryContentsTableserveDirectory mimeTypes MatchMethod matchMethodguardRqhttphttpsmethodmethodM methodOnlymethodSPnullDirdirdirshostwithHosturiRestanyPath trailingSlash parseConfig simpleHTTP simpleHTTP' simpleHTTP''simpleHTTPWithSocketsimpleHTTPWithSocket'bindPortbindIPv4waitForTerminationcompressedResponseFilter gzipFilter deflateFiltercompressWithFilter encodingsacceptLanguage bestLanguageLazynewLinerHandle headerLinesgetBytesStrictgetBytesgetRestbytestring-0.9.2.1Data.ByteString.LazytoChunksDebug debugStreamStreamResultreadLine readBlock writeBlockclose ConnError ErrorMisc ErrorParse ErrorClosed ErrorResetbindEhandleSocketErrormyrecv $fStreamDebug$fStreamSocketConn ConnectionopenTCP openTCPPort isConnectedTo ConnClosedMkConnconnSockconnAddrconnBffrconnHostConnRefgetRef$fStreamConnection supportsIPv6formatTimeCombinedbaseGHC.Num+-formatRequestCombined parseURIRef $fToSURIText $fToSURIText0 $fToSURI[] $fToSURIURI $fToSURISURI $fOrdSURI $fReadSURI $fShowSURIGHC.ShowShowshowContentTypeparseContentTypeGHC.BasefailContentDispositionContentTransferEncodingHeaderpHeaders parseHeaderspHeadergetContentTypeparseContentTransferEncodinggetContentTransferEncodingparseContentDispositiongetContentDispositionparseMversion getBinDir getLibDir getDataDir getLibexecDirgetDataFileNameformatHttpDategetApproximateTimegetApproximatePOSIXTimegetApproximateUTCTimeghc-prim GHC.TypesIntFloatStringTrue Data.MaybeNothing$fFromReqURIBool$fFromReqURIDouble$fFromReqURIFloat$fFromReqURIWord64$fFromReqURIWord32$fFromReqURIWord16$fFromReqURIWord8$fFromReqURIWord$fFromReqURIInteger$fFromReqURIInt64$fFromReqURIInt32$fFromReqURIInt16$fFromReqURIInt8$fFromReqURIInt$fFromReqURIChar$fFromReqURIText$fFromReqURIText0$fFromReqURI[]$fHasHeadersMap$fHasHeadersRequest$fHasHeadersResponse $fShowRequest$fErrorResponse$fShowResponse$fShowHttpVersionGHC.ListspanrqURI* RequestMethod HasHeaders HeaderName HdrCustom insertHeaderinsertHeaderIfMissing replaceHeader insertHeadersretrieveHeaders findHeader simpleHTTP_ receiveHTTP respondHTTPrspCode rspReason rspHeadersrspBodyHdrContentTransferEncodingHdrLastModified HdrExpiresHdrETagHdrContentTypeHdrContentRange HdrContentMD5HdrContentLocationHdrContentLengthHdrContentLanguageHdrContentEncodingHdrContentBaseHdrAllowHdrWWWAuthenticate HdrWarningHdrVary HdrSetCookie HdrServer HdrRetryAfter HdrPublicHdrProxyAuthenticate HdrLocationHdrAge HdrUserAgent HdrRefererHdrRangeHdrProxyAuthorizationHdrMaxForwardsHdrIfUnmodifiedSince HdrIfRangeHdrIfNoneMatch HdrIfMatchHdrIfModifiedSinceHdrHostHdrFrom HdrExpect HdrCookieHdrAuthorizationHdrAcceptLanguageHdrAcceptEncodingHdrAcceptCharset HdrAcceptHdrVia HdrUpgradeHdrTransferEncoding HdrPragmaHdrDate HdrConnectionHdrCacheControl httpVersionsendHTTPsendHTTPPipelined urlDecode urlEncode urlEncodeVars$fShowHeaderName $fShowHeaderidMonadMaybe Control.MonadmzeroJust Data.EitherEither Data.MonoidEndoDualMonoidLeftRight mtl-2.0.1.0Control.Monad.Reader.Class MonadReadertransformers-0.2.2.0Control.Monad.Trans.ReaderReaderTIOControl.Monad.Trans.ErrorErrorTControl.Monad.Error.Class throwError catchErrormsum$fWebMonadaRWST$fFilterMonadresRWST$fServerMonadRWST$fWebMonadaWriterT$fFilterMonadresWriterT$fServerMonadWriterT$fWebMonadaStateT$fFilterMonadresStateT$fServerMonadStateT$fWebMonadaReaderT$fFilterMonadresReaderT$fServerMonadReaderT$fMonadWriterwWebT$fMonadErroreWebT$fMonadStatestWebT$fMonadReaderrWebT$fAlternativeWebT$fApplicativeWebT $fMonoidWebT$fFilterMonadResponseWebT$fMonadPlusWebT$fMonadTransWebT$fWebMonadResponseWebT $fMonadWebT$fMonadBaseControlbWebT$fMonadTransControlWebT $fMonadIOWebT$fMonadBasebWebT$fFilterMonadaFilterT$fMonadBaseControlbFilterT$fMonadTransControlFilterT$fMonadIOFilterT$fMonadBasebFilterT$fFunctorSetAppend$fMonoidSetAppend$fServerMonadErrorT$fServerMonadServerPartT$fWebMonadResponseServerPartT $fFilterMonadResponseServerPartT$fMonadStatesServerPartT$fMonadReaderrServerPartT$fMonadErroreServerPartT$fMonadWriterwServerPartT$fAlternativeServerPartT$fApplicativeServerPartT$fMonoidServerPartT$fMonadTransServerPartT$fMonadBaseControlbServerPartT$fMonadTransControlServerPartT$fMonadIOServerPartT$fMonadBasebServerPartTStMWebunStMWebStWebunStWeb StMFilter unStMFilterStFilter unStFilterStMSPunStMSPStSPunStSPData.ByteString.Lazy.Char8$fToMessageByteString$fToMessageByteString0$fToMessageResponse$fToMessageHtmlM$fToMessageHtml$fToMessageHtml0$fToMessageMaybe$fToMessageInteger$fToMessageText$fToMessageText0 $fToMessage[] $fToMessage()fmap Text.Readreadtext-0.11.1.13Data.Text.InternalTextGHC.ReadRead$fFromDataMaybe$fFromData(,,,)$fFromData(,,) $fFromData(,)$fHasRqDataRWST$fHasRqDataWriterT$fHasRqDataStateT$fHasRqDataReaderT$fHasRqDataServerPartT$fHasRqDataRqData $fErrorErrors$fMonoidErrors$fAlternativeReaderError$fApplicativeReaderError$fMonadReaderrReaderError$fHappstackRWST$fHappstackWriterT$fHappstackReaderT$fHappstackStateT$fHappstackServerPartTcontainers-0.4.2.1Data.MapMapGHC.IOFilePath getMetaDataGHC.Real/$fMatchMethod()$fMatchMethod(->)$fMatchMethod[]$fMatchMethodMethod zlib-0.5.3.3Codec.Compression.GZipcompressCodec.Compression.Zlib