!F2      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ None1;<hextream:A function that describes how to expand entity references.hextream 1https://www.w3.org/TR/REC-xml/#sec-predefined-enthextream +https://www.w3.org/TR/xhtml1/dtds.html#h-A2hextreamICan be combined with '(<>)' to try multiple decoders, from left to right.NoneChextreamA qualified name. ,https://www.w3.org/TR/xml-names/#dt-qualname hextream )https://www.w3.org/TR/xml-names/#NT-QName$parseOnly tokenQualifiedName "price"4Right (QName {namePrefix = "", nameLocal = "price"})(parseOnly tokenQualifiedName "edi:price"7Right (QName {namePrefix = "edi", nameLocal = "price"})hextream /https://www.w3.org/TR/REC-xml/#NT-NameStartCharhextream *https://www.w3.org/TR/REC-xml/#NT-NameChar hextream *https://www.w3.org/TR/xml-names/#NT-NCNameparseOnly tokenNCName "price" Right "price"parse tokenNCName "edi:price"Done ":price" "edi" hextream &https://www.w3.org/TR/REC-xml/#NT-NameparseOnly tokenName "price" Right "price"parseOnly tokenName "edi:price"Right "edi:price"hextreamGBuild a qualified name in a concise way. Prefix is assumed to be empty."foo" :: QName*QName {namePrefix = "", nameLocal = "foo"}  None/hextream)Entity reference, or character reference.hextreamRaw text or reference.hextream!Expand content reference, if any.hextreamSame as *, but on a list. Provided for convenience.hextream Resolve reference into raw text.hextreamSame as (expandReference decodePredefinedEntities, provided for convenience.hextream 'hextream "hextreamSingle or double quote. hextream #https://www.w3.org/TR/REC-xml/#NT-S!hextream $https://www.w3.org/TR/REC-xml/#NT-Eq"hextream +https://www.w3.org/TR/REC-xml/#NT-Reference!parseOnly tokenReference "&#x3C;"Right (CharRef '<')$parseOnly tokenReference "&docdate;"Right (EntityRef "docdate")$hextream <!ENTITY%hextream#Return processing instruction name.&parseOnly tokenInstructionOpen "<?php" Right "php"&hextream ?>'hextream  <![CDATA[ )https://www.w3.org/TR/REC-xml/#NT-CDStart(hextream ]]> 'https://www.w3.org/TR/REC-xml/#NT-CDEnd)hextream <!--*hextream -->+hextream  <!DOCTYPE,hextream <?xml-hextream ?>.hextream />/hextreamReturn tag name."parseOnly tokenStartTagOpen "<foo"2Right (QName {namePrefix = "", nameLocal = "foo"})0hextreamReturn tag name.!parseOnly tokenEndTagOpen "</foo"2Right (QName {namePrefix = "", nameLocal = "foo"})1hextream >+  !"#$%&'()*+,-./01 !"#$%&'()*+,-./01None 14;<=?HMV8:hextreamHow to parse tag names.=hextreamMatch any qualified name.>hextream5Match any qualified name, except for the given value.XparseOnly (runTokenParser $ tag' (anyNameExcept "foo") anyAttr anyContent) "<foo></foo>"Left ...XparseOnly (runTokenParser $ tag' (anyNameExcept "foo") anyAttr anyContent) "<bar></bar>"Right ()?hextreamMatch a single  in a concise way.HparseOnly (runTokenParser $ tag' "foo" anyAttr anyContent) "<foo></foo>"Right ()@hextreamCan be combined with <|>:;<=>:;<=>None14;<=?ML{ChextreamHow to parse tag attributes.FhextreamParse any set of attributes.IparseOnly (runTokenParser $ tag' anyName anyAttr noContent) "<tag></tag>"Right ()UparseOnly (runTokenParser $ tag' anyName anyAttr noContent) "<tag key='value'></tag>"Right ()Ghextream Assert that no attributes exist.HparseOnly (runTokenParser $ tag' anyName noAttr noContent) "<tag></tag>"Right ()TparseOnly (runTokenParser $ tag' anyName noAttr noContent) "<tag key='value'></tag>"Left ...Hhextream.Parse attribute by name, and return its value.SparseOnly (runTokenParser $ tag' anyName (attrValue "foo") noContent) "<tag></tag>"Left ...]parseOnly (runTokenParser $ tag' anyName (attrValue "foo") noContent) "<tag foo='bar'></tag>"Right ()Ihextream;Assert that an attribute exists, with given name and value.WparseOnly (runTokenParser $ tag' anyName (hasAttr "foo" "bar") noContent) "<tag></tag>"Left ...aparseOnly (runTokenParser $ tag' anyName (hasAttr "foo" "bar") noContent) "<tag foo='baz'></tag>"Left ...aparseOnly (runTokenParser $ tag' anyName (hasAttr "foo" "bar") noContent) "<tag foo='bar'></tag>"Right ()JhextreamCan be combined with >>=-. Attributes map is forwarded without change.KhextreamCan be combined with <|>CDEFGHICDEFGHINonePuNhextream &https://www.w3.org/TR/REC-xml/#dt-attrPhextream +https://www.w3.org/TR/REC-xml/#NT-Attribute$parseOnly attribute "name = 'value'"URight (Attribute (QName {namePrefix = "", nameLocal = "name"}) [ContentText "value"])NOPNOPNonegUhextream )https://www.w3.org/TR/REC-xml/#dt-doctypeWhextream )https://www.w3.org/TR/REC-xml/#gen-entityYhextreamExternal entity identifier (https://www.w3.org/TR/REC-xml/#dt-extent\hextream (https://www.w3.org/TR/REC-xml/#NT-GEDecl8parseOnly generalEntityDeclaration "<!ENTITY d '&#xD;'>"FRight (GeneralEntityDeclaration "d" [ContentReference (CharRef '\r')])>parseOnly generalEntityDeclaration "<!ENTITY da '&#xD;&#xA;'>"gRight (GeneralEntityDeclaration "da" [ContentReference (CharRef '\r'),ContentReference (CharRef '\n')])gparseOnly generalEntityDeclaration "<!ENTITY Pub-Status 'This is a pre-release of the specification.'>"iRight (GeneralEntityDeclaration "Pub-Status" [ContentText "This is a pre-release of the specification."])]hextream ,https://www.w3.org/TR/REC-xml/#NT-ExternalIDparseOnly externalID "PUBLIC '-//Textuality//TEXT Standard open-hatch boilerplate//EN' 'http://www.textuality.com/boilerplate/OpenHatch.xml'"Right (PublicID "-//Textuality//TEXT Standard open-hatch boilerplate//EN" "http://www.textuality.com/boilerplate/OpenHatch.xml")7parseOnly externalID "SYSTEM '../grafix/OpenHatch.gif'"*Right (SystemID "../grafix/OpenHatch.gif")^hextream -https://www.w3.org/TR/REC-xml/#NT-doctypedecl:parseOnly doctype "<!DOCTYPE greeting SYSTEM 'hello.dtd'>";Right (Doctype "greeting" (Just (SystemID "hello.dtd")) [])9parseOnly doctype "<!DOCTYPE foo [ <!ENTITY x '&lt;'> ]>"`Right (Doctype "foo" Nothing [GeneralEntityDeclaration "x" [ContentReference (EntityRef "lt")]]) UVWXY[Z\]^ Y[Z]WX\UV^None 14=>?@AMSXkhextreamA parser that consumes whole us.mhextream 'https://www.w3.org/TR/REC-xml/#dt-eetagohextream &https://www.w3.org/TR/REC-xml/#dt-stagqhextream )https://www.w3.org/TR/REC-xml/#dt-xmldeclshextreamProcessing instruction. $https://www.w3.org/TR/REC-xml/#dt-pihextream -https://www.w3.org/TR/REC-xml/#NT-doctypedeclPparseOnly (runTokenParser tokenDoctype) "<!DOCTYPE greeting SYSTEM 'hello.dtd'>";Right (Doctype "greeting" (Just (SystemID "hello.dtd")) [])OparseOnly (runTokenParser tokenDoctype) "<!DOCTYPE foo [ <!ENTITY x '&lt;'> ]>"`Right (Doctype "foo" Nothing [GeneralEntityDeclaration "x" [ContentReference (EntityRef "lt")]])hextream $https://www.w3.org/TR/REC-xml/#dt-piaparseOnly (runTokenParser tokenInstruction) "<?xml-stylesheet type='text/xsl' href='style.xsl'?>"GRight (Instruction "xml-stylesheet" "type='text/xsl' href='style.xsl'")hextream )https://www.w3.org/TR/REC-xml/#NT-CommentSparseOnly (runTokenParser tokenComment) "<!-- declarations for <head> & <body> -->"*Right " declarations for <head> & <body> ">parseOnly (runTokenParser tokenComment) "<!-- B+, B, or B--->"Right " B+, B, or B-"hextream +https://www.w3.org/TR/REC-xml/#dt-cdsectionVparseOnly (runTokenParser tokenCdata) "<![CDATA[<greeting>Hello, world!</greeting>]]>"*Right "<greeting>Hello, world!</greeting>"hextream )https://www.w3.org/TR/REC-xml/#NT-XMLDeclhparseOnly (runTokenParser tokenXmlDeclaration) "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>"7Right (XMLDeclaration "1.0" (Just "UTF-8") (Just True))hextream &https://www.w3.org/TR/REC-xml/#NT-STagKparseOnly (runTokenParser tokenStartTag) "<termdef id='dt-dog' term='dog'>"Right (StartTag (QName {namePrefix = "", nameLocal = "termdef"}) [Attribute (QName {namePrefix = "", nameLocal = "id"}) [ContentText "dt-dog"],Attribute (QName {namePrefix = "", nameLocal = "term"}) [ContentText "dog"]])Nparse (runTokenParser tokenStartTag) "<updated>2003-12-13T18:30:02Z</updated>"dDone "2003-12-13T18:30:02Z</updated>" (StartTag (QName {namePrefix = "", nameLocal = "updated"}) [])hextream &https://www.w3.org/TR/REC-xml/#NT-ETag3parseOnly (runTokenParser tokenEndTag) "</termdef>"6Right (QName {namePrefix = "", nameLocal = "termdef"})hextream .https://www.w3.org/TR/REC-xml/#NT-EmptyElemTagqparseOnly (runTokenParser tokenEmptyElementTag) "<IMG align='left' src='http://www.w3.org/Icons/WWW/w3c_home' />"Right (EmptyElementTag (QName {namePrefix = "", nameLocal = "IMG"}) [Attribute (QName {namePrefix = "", nameLocal = "align"}) [ContentText "left"],Attribute (QName {namePrefix = "", nameLocal = "src"}) [ContentText "http://www.w3.org/Icons/WWW/w3c_home"]])hextream *https://www.w3.org/TR/REC-xml/#NT-CharData6parseOnly (runTokenParser tokenData) "Rock &amp; roll"RRight [ContentText "Rock ",ContentReference (EntityRef "amp"),ContentText " roll"]hextream Parse any u.+NOPUVWXY[Z\]^klmnopqrstuvwxyz{|}~stqropmnuvwxyz{|}~kl None 14=?HMPSVX6hextreamHow to parse tag content.hextreamA parser that consumes whole s.hextreamXML document prolog.hextreamHAssert that content is not empty, and parse it using given token parser.jparseOnly (runTokenParser $ tag' anyName anyAttr (withContent textContent')) "<tag key='value'>body</tag>" Right "body"fparseOnly (runTokenParser $ tag' anyName anyAttr (withContent textContent')) "<tag key='value'></tag>"Left ...aparseOnly (runTokenParser $ tag' anyName anyAttr (withContent textContent')) "<tag key='value'/>"Left ...^parseOnly (runTokenParser $ tag' anyName anyAttr (withContent $ pure ())) "<tag key='value'/>"Left ...hextreamAssert that content is empty.YparseOnly (runTokenParser $ tag' anyName anyAttr noContent) "<tag key='value'>body</tag>"Left ...UparseOnly (runTokenParser $ tag' anyName anyAttr noContent) "<tag key='value'></tag>"Right ()PparseOnly (runTokenParser $ tag' anyName anyAttr noContent) "<tag key='value'/>"Right ()hextream,Accept any content, including empty content.ZparseOnly (runTokenParser $ tag' anyName anyAttr anyContent) "<tag key='value'>body</tag>"Right ()VparseOnly (runTokenParser $ tag' anyName anyAttr anyContent) "<tag key='value'></tag>"Right ()QparseOnly (runTokenParser $ tag' anyName anyAttr anyContent) "<tag key='value'/>"Right ()hextreamParse a processing instruction. $https://www.w3.org/TR/REC-xml/#dt-piFparseOnly (runTokenParser instruction) "<?php echo 'Hello World!'; ?>"1Right (Instruction "php" "echo 'Hello World!'; ")tparseOnly (runTokenParser instruction) "<!-- comments and whitespace are ignored --> <?php echo 'Hello World!'; ?>"1Right (Instruction "php" "echo 'Hello World!'; ")hextream (https://www.w3.org/TR/REC-xml/#NT-prologLparseOnly (runTokenParser prolog) "<?xml version='1.0'?><!DOCTYPE greeting>"Right (Prolog {prologXmlDeclaration = Just (XMLDeclaration "1.0" ...), prologInstructions = [], prologDoctype = Just (Doctype "greeting" ...)})zparseOnly (runTokenParser prolog) "<?xml version='1.0'?> <!-- comments and whitespace are ignored --><!DOCTYPE greeting>"Right (Prolog {prologXmlDeclaration = Just (XMLDeclaration "1.0" ...), prologInstructions = [], prologDoctype = Just (Doctype "greeting" ...)})hextream0Parse textual content of a tag, including CDATA.hextreamSame as <textContent (decodePredefinedEntities <> decodeHtmlEntities), provided for convenience.parseOnly (runTokenParser $ tag' anyName anyAttr (withContent textContent')) "<tag>body<!-- Ignored comment --><![CDATA[<innertag>innerbody</innertag>]]></tag>"*Right "body<innertag>innerbody</innertag>"hextreamGeneric tag parser.hextreamSimplified version of :@no state forwarding between name, attributes and content parsersuses .decodePredefinedEntities <> decodeHtmlEntities to expand entity referenceshextream:Parse a tag with any name, any attributes and any content.?parseOnly (runTokenParser anyTag) "<tag key='value'>body</tag>"Right ()6parseOnly (runTokenParser anyTag) "<tag key='value'/>"Right ()NparseOnly (runTokenParser anyTag) "<!-- ignored comment --><tag key='value'/>"Right ()WparseOnly (runTokenParser anyTag) "<tag key='value'>body<!-- ignored comment --></tag>"Right ()hextream Parse any .hextreamSame as 9anyToken (decodePredefinedEntities <> decodeHtmlEntities), provided for convenience.hextreamHow to expand entity referenceshextreamHow to parse tag namehextreamHow to parse tag attributeshextreamHow to parse tag contenthextreamHow to parse tag namehextreamHow to parse tag attributeshextreamHow to parse tag content%:;<=>CDEFGHI      !"#$%&'()*+,-./0123456789:;<=>?@ABBCDEFGHIJJKLMNOPQRSTTUVWXYZZ[[\]^_`abcdefghijklmnoppqqrrsstuvwxyz{|}~  n o t  w     'hextream-0.1.0.1-HpyNUiwnuC9CE6GyRq5PvqData.XML.Parser.Low.EntityData.XML.Parser.Low.NameData.XML.Parser.LowData.XML.Parser.High.NameParserData.XML.Parser.High.AttrParserData.XML.Parser.Mid.AttributeData.XML.Parser.Mid.DoctypeData.XML.Parser.MidData.XML.Parser.High EntityDecoderrunEntityDecoderdecodePredefinedEntitiesdecodeHtmlEntities$fMonoidEntityDecoder$fSemigroupEntityDecoderQName namePrefix nameLocaltokenQualifiedName tokenNCName tokenName$fIsStringQName $fEqQName $fOrdQName $fReadQName $fShowQName Reference EntityRefCharRefContent ContentTextContentReference expandContentexpandContentsexpandReferenceexpandReference'tokenSingleQuotetokenDoubleQuote tokenQuotetokenWhitespace tokenEqualtokenReference tokenContenttokenEntityDeclarationOpentokenInstructionOpentokenInstructionClosetokenCdataOpentokenCdataClosetokenCommentOpentokenCommentClosetokenDoctypeOpentokenXmlDeclarationOpentokenXmlDeclarationClosetokenEmptyElementTagClosetokenStartTagOpentokenEndTagOpentokenElementClose $fEqReference$fOrdReference$fReadReference$fShowReference $fEqContent $fOrdContent $fReadContent $fShowContent NameParser runNameParseranyName anyNameExcept$fIsStringNameParser$fAlternativeNameParser$fApplicativeNameParser$fFunctorNameParser AttrParser runAttrParseranyAttrnoAttr attrValuehasAttr$fMonadAttrParser$fAlternativeAttrParser$fApplicativeAttrParser$fFunctorAttrParser Attribute attribute $fEqAttribute$fOrdAttribute$fReadAttribute$fShowAttributeDoctypeGeneralEntityDeclaration ExternalIDPublicIDSystemIDgeneralEntityDeclaration externalIDdoctype$fEqExternalID$fOrdExternalID$fReadExternalID$fShowExternalID$fEqGeneralEntityDeclaration$fOrdGeneralEntityDeclaration$fReadGeneralEntityDeclaration$fShowGeneralEntityDeclaration $fEqDoctype $fOrdDoctype $fReadDoctype $fShowDoctype TokenParserrunTokenParserEmptyElementTagStartTagXMLDeclaration InstructionTokenTokenXMLDeclaration TokenDoctypeTokenInstruction TokenStartTag TokenEndTagTokenEmptyElementTag TokenData TokenComment TokenCDATA tokenDoctypetokenInstruction tokenComment tokenCdatatokenXmlDeclaration tokenStartTag tokenEndTagtokenEmptyElementTag tokenDataanyToken$fMonadFailTokenParser$fEqInstruction$fOrdInstruction$fReadInstruction$fShowInstruction$fEqXMLDeclaration$fOrdXMLDeclaration$fReadXMLDeclaration$fShowXMLDeclaration $fEqStartTag $fOrdStartTag$fReadStartTag$fShowStartTag$fEqEmptyElementTag$fOrdEmptyElementTag$fReadEmptyElementTag$fShowEmptyElementTag $fEqToken $fOrdToken $fShowToken$fMonadTokenParser$fAlternativeTokenParser$fApplicativeTokenParser$fFunctorTokenParser ContentParser TokenPrologTokenTagTokenTextContentPrologprologXmlDeclarationprologInstructions prologDoctype withContent noContent anyContent instructionprolog textContent textContent'tagtag'anyTag anyToken' $fEqProlog $fOrdProlog $fReadProlog $fShowProlog $fReadToken$fFunctorContentParserisNameStartChar isNameChar