YR(_      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^ .needs dynamic exceptions and deriving Typeable experimental$Niklas Broberg, nibro@cs.chalmers.se_1User tried to do an irrefutable parameter lookup  that failed.  | ... I'*m sure there should be more exceptions, we'!ll add them when we get to them. `_a`__a Haskell 98 experimental$Niklas Broberg, nibro@cs.chalmers.seMA record representing an interface to an HTTP request. This allows us to use N many different underlying types for these requests, all we need is to supply O conversions to this interface. This is useful for when we run as CGI, or when  we run inside a server app. DGet a parameter from the request query string (GET) or body (POST).  | Returns Nothing if the parameter is not set. QUnsafe version of getParameter, essentially fromJust.(getParameter r) but throws @ a ParameterLookupFailed exception if the parameter is not set. $Return a value instead of a string. @Return a list of values read from their string representations.  Unsafe version of readParameter     'The runtime environment for HSP pages.       Haskell 98 experimental$Niklas Broberg, nibro@cs.chalmers.sePTake a normal string and transform it to PCDATA by escaping special characters.  calls  with   See also:  PTake a normal string and transform it to PCDATA by escaping special characters.  See also: ,  NTake a PCDATA string and translate all escaped characters in it to the normal  characters they represent. Q Does no error checking of input string, will fail if input is not valid PCDATA.  calls  with   See also:  NTake a PCDATA string and translate all escaped characters in it to the normal  characters they represent. Q Does no error checking of input string, will fail if input is not valid PCDATA.  See also: ,   Haskell 98 experimental$Niklas Broberg, nibro@cs.chalmers.seRepresents an attribue value. The XMLMetaData datatype FSpecify the DOCTYPE, content-type, and preferred render for XML data.  See also: HSP.Monad.setMetaData and HSP.Monad.withMetaData .(show doctype when rendering, DOCTYPE string) @The XML datatype representation. Is either an Element or CDATA. '1Test whether an XML value is an Element or CDATA )&Embeds a string as a CDATA XML value. +(Create an attribue value from a string. ,Pretty-prints XML values.  !"#$%&'()*+,! %$#")(*+,&'! !"#$%&'()*+, Haskell 98 experimental$Niklas Broberg, nibro@cs.chalmers.se-Pretty-prints HTML values. Error Handling: CSome tags (such as img) can not contain children in HTML. However, ? there is nothing to stop the caller from passing in XML which B contains an img tag with children. There are three basic ways to  handle this: $1. drop the bogus children silently 2. call b  / raise an exception A3. render the img tag with children -- even though it is invalid !Currently we are taking approach #3, since no other attempts to C validate the data are made in this function. Instead, you can run @ the output through a full HTML validator to detect the errors. #C1 seems like a poor choice, since it makes is easy to overlook the  fact that data went missing. ?We could raising errors, but you have to be in the IO monad to E catch them. Also, you have to use evaluate if you want to check for A errors. This means you can not start sending the page until the D whole page has been rendered. And you have to store the whole page < in RAM at once. Similar problems occur if we return Either C instead. We mostly care about catching errors and showing them in B the browser during testing, so perhaps this can be configurable. @Another solution would be a compile time error if an empty-only  tag contained children. .FIXME: also verify that the domain is correct 0FIXME: what to do if a namespace is encountered -./0-./0-./0 Grequires undecidable and overlapping instances, and forall in datatypes experimental$Niklas Broberg, nibro@cs.chalmers.se3)The HSP monad is a reader wrapper around : the IO monad, but extended with an XMLGenerator wrapper. type HSP' = ReaderT HSPEnv IO type HSP = XMLGenT HSP' 4RRuns a HSP computation in a particular environment. Since HSP wraps the IO monad, 5 the result of running it will be an IO computation. cVRuns a HSP computation without an environment. Will work if the page in question does R not touch the environment. Not sure about the usefulness at this stage though... 80Execute an IO computation within the HSP monad. ;Supples the HSP environment. >Catch a user-caused exception. 1234567c89:;<=>1234567c89:;<=> 0defghijklmnopqrstuvwxyz{|}~?@A?@@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^CDEBFGHIKLMNOPQRSTUVWXYZ[\]^JBCDEFGHIJKLMNOPQRSTUVWXYZ[\]^defghijklmnopqrstuvwxyz{|}~  !"#%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^3124756;<=8>9:?@A !"#$%%&'()*+,-./0123456789: ; <  = > ? @ A B C D E F G H I JKLMNOPQRSTUVWXYZ[\]^_`abcdefg h i j kl mnopnoqnornosnotnounovnownoxnoynozno{no|no}no}no.no~nononononononononononononononononononononononononononono hsp-0.4.5HSP.Env.NumberGenHSP.Env.RequestHSP.EnvHSP.XML.PCDATAHSP.XMLHSP.HTMLHSP HSP.HJScript HSP.ExceptionbasePrelude HSP.MonadHSP.XMLGenerator NumberGen incNumberRequest getParameterL getHeaders getParameter getParameter_ readParameterreadParameterLreadParameter_HSPEnvgetReqgetNG mkSimpleEnvescapeescaperxmlEscapeCharsunescape unescaper AttrValueValue AttributeMkAttr XMLMetaDatadoctype contentTypepreferredRendererXMLCDATAElementChildren AttributesNameDomain isElementisCDATAcdatapcdataattrValpAttrVal renderXML renderAsHTMLhtmlEscapeChars html4Stricthtml4StrictFragHSPTHSPT'runHSPrunHSPTevalHSPTevalHSPdoIO setMetaData withMetaDatagetEnvgetParam getIncNumbercatch IsAttrValue toAttrValueextractElemRef newGlobalVarnewGlobalVarWithnewGlobVarNamegenIdrefsetIdonEventonAbortonBluronChangeonClick onDblClickonErroronFocus onKeyDown onKeyPressonKeyUponLoad onMouseDown onMouseMove onMouseOut onMouseOver onMouseUponResetonResizeonSelectonSubmitonUnloadParameterLookupFailed ExceptionthrowHSPGHC.Errerror unsafeRunHSP hsx-0.4.8HSX.XMLGeneratorAttr:=asAttrasChild genElement genEElement<<:<:app<<@<@set unXMLGenTXMLGenTGenXML GenXMLListGenChild GenChildList GenAttributeGenAttributeList EmbedAsChild EmbedAsAttr XMLGeneratorsetAllsetAttrSetAttrappAllappChild AppendChildtoNameIsNametypeCastTypeCast typeCast' TypeCast' typeCast'' TypeCast'' typeCastM TypeCastM typeCastM' TypeCastM' typeCastM'' TypeCastM''