bp      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmno non-portable experimentalbjorn@bringert.net*pqrsA MIME media type value.  The t$ 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. +The top-level media type, the general type $ of the data. Common examples are  "text", "image", "audio", "video",  " multipart", and " application". -The media subtype, the specific data format.  Examples include "plain", "html",  "jpeg", " form-data", etc. ,Media type parameters. On common example is ! the charset parameter for the "text"  top-level type, e.g. ("charset"," ISO-8859-1"). uvwxyz{>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. ~RFC 822 LWSP-char #RFC 822 CRLF (but more permissive)  One line pqrsuvwx ~pqqrssuvwx ~ non-portable experimentalbjorn@bringert.net!Read a multi-part message from a .  Boundary !Read a multi-part message from a .  Fails on parse errors.  Boundary 4Split a multipart message into the multipart parts. )The boundary, without the initial dashes =Drop everything up to and including the first line starting  with the boundary. )The boundary, without the initial dashes +Split a string at the first boundary line. )The boundary, without the initial dashes String to split. 1The part before the boundary, the boundary line, 2 and the part after the boundary line. The CRLF 8 before and the CRLF (if any) after the boundary line 4 are not included in any of the strings returned.  Returns  if there is no boundary. :Check whether a string starts with two dashes followed by  the given boundary string. )The boundary, without the initial dashes !Check whether a string for which  returns true , has two dashes after the boudary string. )The boundary, without the initial dashes 0Checks whether a string starts with two dashes. 4Drop everything up to and including the first CRLF. ESplit a string at the first empty line. The CRLF (if any) before the B empty line is included in the first result. The CRLF after the - empty line is not included in the result. ; If there is no empty line, the entire input is returned  as the first result. ;Split a string at the first CRLF. The CRLF is not included # in any of the returned strings. 5 If there is no CRLF, the entire input is returned  as the first string. String to split. 4Get the index and length of the first CRLF, if any. String to split. 7Drop an initial CRLF, if any. If the string is empty, < nothing is done. If the string does not start with CRLF, # the first character is dropped. pqrsu ~ non-portable experimentalbjorn@bringert.net' 9A string with case insensitive equality and comparisons. The result of a CGI program. 4The value of an input parameter, and some metadata. The input to a CGI action. Environment variables. 9Input parameters. For better laziness in reading inputs,  this is not a Map. )Raw request body. To avoid memory leaks, 7 this is the empty string if the request body has been  interpreted as inputs in  !application/x-www-form-urlencoded or  multipart/form-data format. NRuns a CGI action in a given environment. Uses Handles for input and output. %CGI environment variables, e.g. from . *Handle that input will be read from, e.g. System.IO.stdin. ,Handle that output will be written to, e.g. System.IO.stdout.  CGI action ARuns a CGI action in a given environment. Uses lazy ByteStrings  for input and output. CGI environment variables. Request body.  CGI action.  Response (headers and content). 4Gets and decodes the input according to the request  method and the content-type. CGI environment variables. Request body. ;A list of input variables and values, and the request body  if it was not interpreted.  Builds an  object for a simple value. (The default content-type for variables. CGets the values of all CGI variables from the program environment. "Logs some message using the server's logging facility. 5 FIXME: does this have to be more general to support 8 FastCGI etc? Maybe we should store log messages in the  CGIState? #Gets inputs from the query string. CGI environment variables. Input variables and values. Decodes application/x-www-form-urlencoded inputs. Input variables and values. 'Formats name-value pairs as application/x-www-form-urlencoded. *Converts a single value to the application/ x-www-form-urlencoded encoding. !*Gets the name-value pairs from application/x-www-form-urlencoded data. ""Converts a single value from the  application/ x-www-form-urlencoded encoding. ,Gets input variables from the body, if any. Decodes a POST body. #0Takes the right number of bytes from the input. CGI environment variables. Request body. 'CONTENT_LENGTH bytes from the request , body, or the empty string if there is no  CONTENT_LENGTH. Decodes multipart/form-data input. Content-type parameters  Request body Input variables and values. $>Replaces all instances of a value in a list by another value. Value to look for Value to replace it with  Input list  Output list %Same as  specialized to strings, but - returns the empty string if lookup fails.   !"#$%  # !"%$   !"#$% non-portable experimentalbjorn@bringert.net &8The class of CGI monads. Most CGI actions can be run in B any monad which is an instance of this class, which means that G you can use your own monad transformers to add extra functionality. 'Add a response header. ($Get something from the CGI request. )The CGIT monad transformer. *+,!A simple CGI monad with just IO. -Run a CGI action. .?Throw an exception in a CGI monad. The monad is required to be  a , so that we can use  to guarantee ordering. /BCatches any expection thrown by a CGI action, and uses the given 0 exception handler if an exception is thrown. 0BCatches any exception thrown by an CGI action, and returns either K the exception, or if no exception was raised, the result of the action. 1Deprecated version of /. Use / instead. &'()*+,-./01&'()*+,-./01 &'('()*+*+,-./01uportable General server side HTTP cookie library. Based on <http://wp.netscape.com/newsref/std/cookie_spec.html> experimental#Bjorn Bringert <bjorn@bringert.net>2;Contains all information about a cookie set by the server. 34Name of the cookie. 5Value of the cookie. 6Expiry date of the cookie. If , the 2 cookie expires when the browser sessions ends. 1 If the date is in the past, the client should " delete the cookie immediately. 75The domain suffix to which this cookie will be sent. 8,The path to which this cookie will be sent. 9* if this cookie should only be sent using  secure means. :1Construct a cookie with only name and value set. ; This client will expire when the browser sessions ends, 9 will only be sent to the server and path which set it $ and may be sent using any means. Name Value Cookie ;4Get the value of a cookie from a string on the form  "5cookieName1=cookieValue1;...;cookieName2=cookieValue2".  This is the format of the Cookie HTTP header.  Cookie name -Semicolon separated list of name-value pairs Cookie value, if found <BDelete a cookie from the client by setting the cookie expiry date  to a date in the past. .Cookie to delete. The only fields that matter  are 4, 7 and 8 =HShow a cookie on the format used as the value of the Set-Cookie header. 4Show a name-value pair. FIXME: if the name or value 1 contains semicolons, this breaks. The problem 5 is that the original cookie spec does not mention # how to do escaping or quoting. name value >1Gets all the cookies from a Cookie: header value String to parse !Cookie name - cookie value pairs Return ( is the list is empty, otherwise return ! the last element of the list. 23456789:;<=> 23456789:;<=> 234567893456789:;<=>'non-portable (uses Control.Monad.State) experimentalbjorn@bringert.net ?1Compatibility wrapper for the old CGI interface. > Output the output from a function from CGI environment and ( input variables to an HTML document. @1Compatibility wrapper for the old CGI interface.  Runs a simple CGI server. 2 Note: if using Windows, you might need to wrap Network.withSocketsDo around main. The port to run the server on. A/Note: if using Windows, you might need to wrap Network.withSocketsDo around main. 7Returns the query string, or the request body if it is = a POST request, or the empty string if there is an error. CGI environment variables. Request body. Query string. ?@A?@A?@A'non-portable (uses Control.Monad.State) experimentalbjorn@bringert.net1B9Run a CGI action. Typically called by the main function. 5 Reads input from stdin and writes to stdout. Gets ; CGI environment variables from the program environment. C Output a ". The output is assumed to be text/html, encoded using A ISO-8859-1. To change this, set the Content-type header using  n. The string to output. D Output a ". The output is assumed to be text/html, 6 encoded using ISO-8859-1. To change this, set the  Content-type header using n. The string to output. E)Do not output anything (except headers). FRedirect to some location. A URL to redirect to. G6Catches any exception thrown by the given CGI action, ; returns an error page with a 500 Internal Server Error, : showing the exception information, and logs the error. Typical usage:  cgiMain :: CGI CGIResult  cgiMain = ...   main :: IO () & main = runCGI (handleErrors cgiMain) H9Output a 500 Internal Server Error with information from  an . I1Output an error page to the user, with the given E HTTP status code in the response. Also logs the error information  using . HTTP Status code Status message Error information Create an HTML error page.  Status code Status message Error information JUse I* to output and log a 404 Not Found error. $The name of the requested resource. KUse I3 to output and log a 405 Method Not Allowed error. The allowed methods. LUse I0 to output and log a 500 Internal Server Error. Error information. M6Get the value of a CGI environment variable. Example: $ remoteAddr <- getVar "REMOTE_ADDR" The name of the variable. NThe name of the variable. Default value O4Get all CGI environment variables and their values. P The server'2s hostname, DNS alias, or IP address as it would $ appear in self-referencing URLs. Q/The port number to which the request was sent. R-The method with which the request was made.  For HTTP, this is "GET", "HEAD", "POST", etc. S4The extra path information, as given by the client. 9 This is any part of the request path that follows the  CGI program path. 9 If the string returned by this function is not empty, $ it is guaranteed to start with a '/'. 5Note that this function returns an unencoded string. , Make sure to percent-encode any characters > that are not allowed in URI paths before using the result of # this function to construct a URI.  See ^, _ and ` for a higher-level  interface. TThe path returned by S, but with virtual-to-physical  mapping applied to it. U/A virtual path to the script being executed, " used for self-referencing URIs. 5Note that this function returns an unencoded string. , Make sure to percent-encode any characters > that are not allowed in URI paths before using the result of # this function to construct a URI.  See ^, _ and ` for a higher-level  interface. VAThe information which follows the ? in the URL which referenced @ this program. This is the percent-encoded query information.  For most normal uses, a and friends are probably  more convenient. W=The hostname making the request. If the server does not have 3 this information, Nothing is returned. See also X. X6The IP address of the remote host making the request. Y?If the server supports user authentication, and the script is A protected, this is the protocol-specific authentication method  used to validate the user. Z?If the server supports user authentication, and the script is ? protected, this is the username they have authenticated as. [6For queries which have attached information, such as < HTTP POST and PUT, this is the content type of the data.  You can use   to get a structured 1 representation of the the content-type value. \6For queries which have attached information, such as 9 HTTP POST and PUT, this is the length of the content  given by the client. ]:Gets the value of the request header with the given name. ( The header name is case-insensitive.  Example:  requestHeader "User-Agent" ^;Attempts to reconstruct the absolute URI of this program.  This does not include 7 any extra path information or query parameters. See  _ for that. 9 If the server is rewriting request URIs, this URI can 6 be different from the one requested by the client.  See also `. >Characters in the components of the returned URI are escaped  when needed, as required by  Network.URI. _Like ^, but the returned  also includes 9 any extra path information, and any query parameters. 9 If the server is rewriting request URIs, this URI can 6 be different from the one requested by the client.  See also `. >Characters in the components of the returned URI are escaped  when needed, as required by  Network.URI. 9Does percent-encoding as needed for URI path components. `BAttempts to reconstruct the absolute URI requested by the client, : including extra path information and query parameters. F If no request URI rewriting is done, or if the web server does not B provide the information needed to reconstruct the request URI, + this function returns the same value as _. >Characters in the components of the returned URI are escaped  when needed, as required by  Network.URI. a=Get the value of an input variable, for example from a form. C If the variable has multiple values, the first one is returned.  Example:  query <- getInput "query" The name of the variable. The value of the variable, " or Nothing, if it was not set. bLike a, but returns a . The name of the variable. The value of the variable, " or Nothing, if it was not set. cBGet all the values of an input variable, for example from a form. ; This can be used to get all the values from form controls - which allow multiple values to be selected.  Example: ' vals <- getMultiInput "my_checkboxes" The name of the variable. The values of the variable, 0 or the empty list if the variable was not set. dSame as c but using s. The name of the variable. The values of the variable, 0 or the empty list if the variable was not set. eGet the file name of an input. The name of the variable. #The file name corresponding to the  input, if there is one. f<Get the content-type of an input, if the input exists, e.g.  image/jpeg. . For non-file inputs, this function returns  text/plain.  You can use   to get a structured 1 representation of the the content-type value. The name of the variable. )The content type, formatted as a string. gSame as a3, but tries to read the value to the desired type. The name of the variable.  if the variable does not exist , or if the value could not be interpreted  at the desired type. h(Get the names and values of all inputs. ? Note: the same name may occur more than once in the output, - if there are several values for the name. i&Get the names of all input variables. jGet the value of a cookie. The name of the cookie.  if the cookie does not exist. kSame as j3, but tries to read the value to the desired type. The name of the cookie.  if the cookie does not exist , or if the value could not be interpreted  at the desired type. lSet a cookie. m Delete a cookie from the client nAdd a response header.  Example: ' setHeader "Content-type" "text/plain"  Header name. Header value. oSet the HTTP response status. HTTP status code, e.g. 404 HTTP status message, e.g.  Not Found Q  !"&),./0123456789:?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnoN&) ,B./01GCDEFnoIHJKLabghicdefMNOPQRSTUVWXYZ[\]^_` 23456789:jklm !".BCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmno    !"#$%&'()*+,-./011234567899:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrBstuuvvwxyz{|}~wwwwwwwcgi-3001.1.5.2 Network.CGINetwork.CGI.CompatNetwork.CGI.ProtocolNetwork.CGI.MonadNetwork.CGI.CookieNetwork.CGI.RFC822HeadersNetwork.CGI.Multipart mtl-1.1.1.0Control.Monad.TransliftIOMonadIOxhtml-3000.2.0.0Text.XHtml.InternalsHtml ContentTypectType ctSubtype ctParametersshowContentTypeparseContentType HeaderNameHeaders CGIResult CGINothing CGIOutputInput inputValue inputFilenameinputContentType CGIRequestcgiVars cgiInputscgiRequestBodyhRunCGI runCGIEnvFPS decodeInput getCGIVarslogCGI formEncode urlEncode formDecode urlDecode takeInputreplace maybeReadMonadCGI cgiAddHeadercgiGetCGITunCGITCGIrunCGITthrowCGIcatchCGItryCGIhandleExceptionCGICookie cookieName cookieValue cookieExpires cookieDomain cookiePath cookieSecure newCookie findCookie deleteCookie showCookie readCookieswrapperpwrapperconnectToCGIScriptrunCGIoutput outputFPS outputNothingredirect handleErrorsoutputException outputErroroutputNotFoundoutputMethodNotAllowedoutputInternalServerErrorgetVargetVarWithDefaultgetVars serverName serverPort requestMethodpathInfopathTranslated scriptName queryString remoteHost remoteAddrauthType remoteUserrequestContentTyperequestContentLength requestHeaderprogURIqueryURI requestURIgetInput getInputFPS getMultiInputgetMultiInputFPSgetInputFilenamegetInputContentType readInput getInputs getInputNames getCookie readCookie setCookie setHeader setStatusContentDispositionContentTransferEncodingbaseGHC.ShowShowHeaderpHeaders parseHeaderspHeaderextraFieldLineshowParameters p_parameter pContentTypeGHC.BasefailgetContentTypepContentTransferEncodingparseContentTransferEncodinggetContentTransferEncodingpContentDispositionparseContentDispositiongetContentDispositionshowContentDispositionparseMlookupMws1lexemecrLf lineString literalStringbuggyLiteralStringheaderNameChar especials tokencharp_token text_charsp_text quoted_pairBodyPart MultiPartparseMultipartBodybytestring-0.9.1.7Data.ByteString.Lazy.Internal ByteStringhGetMultipartBodyGHC.IO.Handle.TypesHandle parseBodyPartshowMultipartBody showBodyPart splitParts dropPreamblesplitAtBoundary Data.MaybeNothing isBoundaryisClosestartsWithDashescrlf unlinesCRLFdropLinesplitAtEmptyLine splitAtCRLFfindCRLF findCRorLFstartsWithCRLFdropCRLFformatResponsedefaultContentType simpleInputdefaultInputType queryInput formInput bodyInput decodeBodymultipartDecodebodyPartToInput lookupOrNilGHC.ListlookupGHC.IOthrowIOghc-primGHC.BoolTrueshowPair maybeLastacceptConnectionsaccept'rungetRequestInputabortsendBackStringControl.OldException Exception errorPagenetwork-2.2.1.7 Network.URIURI escapePath getInput_