e      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ non-portable experimentalbjorn@bringert.net+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. +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"). 9A string with case insensitive equality and comparisons. HTTP headers. 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    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.   non-portable experimentalbjorn@bringert.net$ 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 &'('()*+*+,-./0123456789: 23456789: 23345567789:uportable General server side HTTP cookie library. Based on <http://wp.netscape.com/newsref/std/cookie_spec.html> experimental#Bjorn Bringert <bjorn@bringert.net>;;Contains all information about a cookie set by the server. <=Name of the cookie. >Value of the cookie. ?Expiry 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. @5The domain suffix to which this cookie will be sent. A,The path to which this cookie will be sent. B* if this cookie should only be sent using  secure means. C1Construct 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 D4Get 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 EBDelete 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 =, @ and A FHShow 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 G1Gets 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. ;<=>?@ABCDEFG ;<=>?@ABCDEFG ;<=>?@AB<=>?@ABCDEFG'non-portable (uses Control.Monad.State) experimentalbjorn@bringert.net H1Compatibility wrapper for the old CGI interface. > Output the output from a function from CGI environment and ( input variables to an HTML document. I1Compatibility 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. J/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. HIJHIJHIJ'non-portable (uses Control.Monad.State) experimentalbjorn@bringert.net:K9Run 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. L 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  ~. The string to output. M 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 ~. The string to output. N)Do not output anything (except headers). ORedirect to some location. A URL to redirect to. P6Catches 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) Q9Output a 500 Internal Server Error with information from  an . R1Output 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  Status code Status message Error information SUse R* to output and log a 404 Not Found error. $The name of the requested resource. TUse R3 to output and log a 405 Method Not Allowed error. The allowed methods. UUse R0 to output and log a 500 Internal Server Error. Error information. V6Get the value of a CGI environment variable. Example: $ remoteAddr <- getVar "REMOTE_ADDR" The name of the variable. WThe name of the variable. Default value X4Get all CGI environment variables and their values. Y The server'2s hostname, DNS alias, or IP address as it would $ appear in self-referencing URLs. Z/The port number to which the request was sent. [-The method with which the request was made.  For HTTP, this is "GET", "HEAD", "POST", etc. \4The 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 k, l and m for a higher-level  interface. ]The path returned by \, but with virtual-to-physical  mapping applied to it. ^/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 k, l and m for a higher-level  interface. _AThe information which follows the ? in the URL which referenced @ this program. This is the percent-encoded query information.  For most normal uses, n and friends are probably  more convenient. `=The hostname making the request. If the server does not have 3 this information, Nothing is returned. See also a. a6The IP address of the remote host making the request. b?If the server supports user authentication, and the script is A protected, this is the protocol-specific authentication method  used to validate the user. c?If the server supports user authentication, and the script is ? protected, this is the username they have authenticated as. d6For 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. e6For queries which have attached information, such as 9 HTTP POST and PUT, this is the length of the content  given by the client. f:Gets the value of the request header with the given name. ( The header name is case-insensitive.  Example:  requestHeader "User-Agent" ghijk;Attempts to reconstruct the absolute URI of this program.  This does not include 7 any extra path information or query parameters. See  l 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 m. >Characters in the components of the returned URI are escaped  when needed, as required by  Network.URI. lLike k, 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 m. >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. mBAttempts 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 l. >Characters in the components of the returned URI are escaped  when needed, as required by  Network.URI. n=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. oLike n, but returns a . The name of the variable. The value of the variable, " or Nothing, if it was not set. pBGet 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. qSame as p but using s. The name of the variable. The values of the variable, 0 or the empty list if the variable was not set. rGet the file name of an input. The name of the variable. #The file name corresponding to the  input, if there is one. s<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. tSame as n3, 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. u(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. v(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. w&Get the names of all input variables. x/Get the uninterpreted request body as a String y6Get the uninterpreted request body as lazy ByteString zGet the value of a cookie. The name of the cookie.  if the cookie does not exist. {Same as z3, 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. |Set a cookie. } Delete a cookie from the client ~Add a response header.  Example: ' setHeader "Content-type" "text/plain"  Header name. Header value. Set the HTTP response status. HTTP status code, e.g. 404 HTTP status message, e.g.  Not Found a  !"&),./0123456789:;<=>?@ABCHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~^&) ,K./01PLMNO~RQSTUnotxyuvwpqrsVWXYZ[\]^_`abcdefklm89674523ghij: ;<=>?@ABCz{|} !"5KLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~   !"#$%&'()*+,-./01223456789::;;<<=>?@@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~I>cgi-3001.1.7.1 Network.CGINetwork.CGI.CompatNetwork.CGI.ProtocolNetwork.CGI.MonadNetwork.CGI.CookieNetwork.CGI.HeaderNetwork.CGI.MultipartNetwork.CGI.Accept mtl-1.1.1.0Control.Monad.TransliftIOMonadIOxhtml-3000.2.0.0Text.XHtml.InternalsHtml ContentTypectType ctSubtype ctParameters HeaderNameHeadersparseContentTypeshowContentType CGIResult CGINothing CGIOutputInput inputValue inputFilenameinputContentType CGIRequestcgiVars cgiInputscgiRequestBodyhRunCGI runCGIEnvFPS decodeInput getCGIVarslogCGI formEncode urlEncode formDecode urlDecode takeInputreplace maybeReadMonadCGI cgiAddHeadercgiGetCGITunCGITCGIrunCGITthrowCGIcatchCGItryCGIhandleExceptionCGILanguageContentEncodingCharset AcceptableAccept negotiateCookie cookieName cookieValue cookieExpires cookieDomain cookiePath cookieSecure newCookie findCookie deleteCookie showCookie readCookieswrapperpwrapperconnectToCGIScriptrunCGIoutput outputFPS outputNothingredirect handleErrorsoutputException outputErroroutputNotFoundoutputMethodNotAllowedoutputInternalServerErrorgetVargetVarWithDefaultgetVars serverName serverPort requestMethodpathInfopathTranslated scriptName queryString remoteHost remoteAddrauthType remoteUserrequestContentTyperequestContentLength requestHeader requestAcceptrequestAcceptCharsetrequestAcceptEncodingrequestAcceptLanguageprogURIqueryURI requestURIgetInput getInputFPS getMultiInputgetMultiInputFPSgetInputFilenamegetInputContentType readInput getInputs getInputsFPS getInputNamesgetBody getBodyFPS getCookie readCookie setCookie setHeader setStatusContentDispositionContentTransferEncodingbaseGHC.ShowShow HeaderValueparseHeaderValueprettyHeaderValuepHeaderspHeaderextraFieldLinegetHeaderValueshowParameters p_parameterGHC.BasefailgetContentTypegetContentTransferEncodinggetContentDispositionparseMlookupMcaseInsensitiveEqcaseInsensitiveComparews1lexemecrLf lineString literalStringbuggyLiteralStringheaderNameChar tspecials 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.IOthrowIOincludestopQuality starOrEqualToqualitycompareSpecificity hasParameterghc-primGHC.BoolTrueshowPair maybeLastacceptConnectionsaccept'rungetRequestInputabortsendBackStringControl.OldException Exception errorPage errorTextrequestHeaderValuenetwork-2.2.1.7 Network.URIURI escapePath getInput_