-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Utilities for manipulating XML documents -- -- Haskell utilities for parsing, filtering, transforming and generating -- XML documents. @package HaXml @version 1.13.3 -- | This is another hand-written lexer, this time for the Xtract -- command-language. The entry point is lexXtract. You don't normally -- need to use this module directly - the lexer is called automatically -- by the parser. (We only expose this interface for debugging purposes.) -- -- The Xtract command language is very like the XPath specification. module Text.XML.HaXml.Xtract.Lex lexXtract :: String -> [Token] data Posn Pn :: Int -> Posn data TokenT Symbol :: String -> TokenT TokString :: String -> TokenT TokNum :: Integer -> TokenT type Token = Either String (Posn, TokenT) instance Eq Posn instance Eq TokenT instance Show TokenT instance Show Posn -- | You don't normally need to use this Lex module directly - it is called -- automatically by the parser. (This interface is only exposed for -- debugging purposes.) -- -- This is a hand-written lexer for tokenising the text of an XML -- document so that it is ready for parsing. It attaches position -- information in (line,column) format to every token. The main entry -- point is xmlLex. A secondary entry point, xmlReLex, is -- provided for when the parser needs to stuff a string back onto the -- front of the text and re-tokenise it (typically when expanding -- macros). -- -- As one would expect, the lexer is essentially a small finite state -- machine. module Text.XML.HaXml.Lex -- | The first argument to xmlLex is the filename (used for source -- positions, especially in error messages), and the second is the string -- content of the XML file. xmlLex :: String -> String -> [Token] -- | xmlReLex is used when the parser expands a macro (PE -- reference). The expansion of the macro must be re-lexed as if for the -- first time. xmlReLex :: Posn -> String -> [Token] -- | posInNewCxt name pos creates a new source position from an -- old one. It is used when opening a new file (e.g. a DTD inclusion), to -- denote the start of the file name, but retain the stacked -- information that it was included from the old pos. posInNewCxt :: String -> Maybe Posn -> Posn -- | All tokens are paired up with a source position. Lexical errors are -- passed back through the Either type. type Token = Either String (Posn, TokenT) -- | Source positions contain a filename, line, column, and an inclusion -- point, which is itself another source position, recursively. data Posn Pn :: String -> !Int -> !Int -> (Maybe Posn) -> Posn -- | The basic token type. data TokenT -- | <!-- TokCommentOpen :: TokenT -- | TokCommentClose :: TokenT -- | <? TokPIOpen :: TokenT -- | ?> TokPIClose :: TokenT -- | <![ TokSectionOpen :: TokenT -- | ]]> TokSectionClose :: TokenT -- | CDATA INCLUDE IGNORE etc TokSection :: Section -> TokenT -- | <! TokSpecialOpen :: TokenT -- | DOCTYPE ELEMENT ATTLIST etc TokSpecial :: Special -> TokenT -- | </ TokEndOpen :: TokenT -- | /> TokEndClose :: TokenT -- | < TokAnyOpen :: TokenT -- |
--   
TokAnyClose :: TokenT -- | [ TokSqOpen :: TokenT -- | ] TokSqClose :: TokenT -- | = TokEqual :: TokenT -- | ? TokQuery :: TokenT -- | * TokStar :: TokenT -- | + TokPlus :: TokenT -- | & TokAmp :: TokenT -- | ; TokSemi :: TokenT -- | # TokHash :: TokenT -- | ( TokBraOpen :: TokenT -- | ) TokBraClose :: TokenT -- | | TokPipe :: TokenT -- | % TokPercent :: TokenT -- | , TokComma :: TokenT -- | '' or "" TokQuote :: TokenT -- | begins with letter, no spaces TokName :: String -> TokenT -- | any character data TokFreeText :: String -> TokenT -- | fake token TokNull :: TokenT data Special DOCTYPEx :: Special ELEMENTx :: Special ATTLISTx :: Special ENTITYx :: Special NOTATIONx :: Special data Section CDATAx :: Section INCLUDEx :: Section IGNOREx :: Section instance Eq Where instance Eq Posn instance Eq Special instance Show Special instance Eq Section instance Show Section instance Eq TokenT instance Show TokenT instance Show Posn -- | Defines an internal representation of Haskell data/newtype definitions -- that correspond to the XML DTD types, and provides pretty-printers to -- convert these types into the Doc type of -- Text.PrettyPrint.HughesPJ. module Text.XML.HaXml.DtdToHaskell.TypeDef data TypeDef -- | Bool for main/aux. DataDef :: Bool -> Name -> AttrFields -> Constructors -> TypeDef EnumDef :: Name -> [Name] -> TypeDef type Constructors = [(Name, [StructType])] type AttrFields = [(Name, StructType)] data StructType Maybe :: StructType -> StructType -- | String holds default value. Defaultable :: StructType -> String -> StructType List :: StructType -> StructType -- | Non-empty lists. List1 :: StructType -> StructType Tuple :: [StructType] -> StructType OneOf :: [StructType] -> StructType -- | XML's contentspec allows ANY Any :: StructType String :: StructType Defined :: Name -> StructType ppTypeDef :: TypeDef -> Doc -- | Pretty print Haskell name. ppHName :: Name -> Doc -- | Pretty print XML name. ppXName :: Name -> Doc -- | Pretty print Haskell attributes name. ppAName :: Name -> Doc -- | Need to keep both the XML and Haskell versions of a name. data Name Name :: String -> String -> Name -- | original XML name xName :: Name -> String -- | mangled Haskell name hName :: Name -> String -- | Make a name valid in both XML and Haskell. name :: String -> Name -- | Append an underscore to the Haskell version of the name. name_ :: String -> Name -- | Prefix an attribute enumeration type name with its containing element -- name. name_a :: String -> String -> Name -- | Prefix an attribute enumeration constructor with its element-tag name, -- and its enumeration type name. name_ac :: String -> String -> String -> Name -- | Prefix a field name with its enclosing element name. name_f :: String -> String -> Name -- | Convert an XML name to a Haskell conid. mangle :: String -> String -- | Convert an XML name to a Haskell varid. manglef :: String -> String instance Eq Name instance Eq StructType instance Eq TypeDef instance Show StructType module Text.XML.HaXml.DtdToHaskell.Instance -- | Convert typedef to appropriate instance declaration, either -- XmlContent, XmlAttributes, or XmlAttrType. mkInstance :: TypeDef -> Doc -- | This module defines an internal (generic) representation for XML -- documents including their DTDs. -- -- History: The original module was derived by hand from the XML -- specification, following the grammar precisely. Then we simplified the -- types, removing layers of indirection and redundancy, and generally -- making things easier to work with. Then we allowed PEReferences to be -- ubiquitous, by removing them from the types and resolving all PE -- references at parse-time. Finally, we added a per-document symbol -- table for GEReferences, and a whitespace-significance flag for -- plaintext. module Text.XML.HaXml.Types type SymTab a = [(String, a)] emptyST :: SymTab a addST :: String -> a -> SymTab a -> SymTab a lookupST :: String -> SymTab a -> Maybe a -- | The symbol table stored in a document holds all its general entity -- reference definitions. data Document Document :: Prolog -> (SymTab EntityDef) -> Element -> [Misc] -> Document data Element Elem :: Name -> [Attribute] -> [Content] -> Element data ElemTag -- | intermediate for parsing ElemTag :: Name -> [Attribute] -> ElemTag data Content CElem :: Element -> Content -- | bool is whether whitespace is significant CString :: Bool -> CharData -> Content CRef :: Reference -> Content CMisc :: Misc -> Content type Attribute = (Name, AttValue) data AttValue AttValue :: [Either String Reference] -> AttValue data Prolog Prolog :: (Maybe XMLDecl) -> [Misc] -> (Maybe DocTypeDecl) -> [Misc] -> Prolog data XMLDecl XMLDecl :: VersionInfo -> (Maybe EncodingDecl) -> (Maybe SDDecl) -> XMLDecl data Misc Comment :: Comment -> Misc PI :: ProcessingInstruction -> Misc type ProcessingInstruction = (PITarget, String) type SDDecl = Bool type VersionInfo = String type Comment = String type PITarget = String data DocTypeDecl DTD :: Name -> (Maybe ExternalID) -> [MarkupDecl] -> DocTypeDecl data MarkupDecl Element :: ElementDecl -> MarkupDecl AttList :: AttListDecl -> MarkupDecl Entity :: EntityDecl -> MarkupDecl Notation :: NotationDecl -> MarkupDecl MarkupMisc :: Misc -> MarkupDecl data ExtSubset ExtSubset :: (Maybe TextDecl) -> [ExtSubsetDecl] -> ExtSubset data ExtSubsetDecl ExtMarkupDecl :: MarkupDecl -> ExtSubsetDecl ExtConditionalSect :: ConditionalSect -> ExtSubsetDecl data ElementDecl ElementDecl :: Name -> ContentSpec -> ElementDecl data ContentSpec EMPTY :: ContentSpec ANY :: ContentSpec Mixed :: Mixed -> ContentSpec ContentSpec :: CP -> ContentSpec data CP TagName :: Name -> Modifier -> CP Choice :: [CP] -> Modifier -> CP Seq :: [CP] -> Modifier -> CP data Modifier -- | Just One None :: Modifier -- | Zero Or One Query :: Modifier -- | Zero Or More Star :: Modifier -- | One Or More Plus :: Modifier data Mixed PCDATA :: Mixed PCDATAplus :: [Name] -> Mixed data AttListDecl AttListDecl :: Name -> [AttDef] -> AttListDecl data AttDef AttDef :: Name -> AttType -> DefaultDecl -> AttDef data AttType StringType :: AttType TokenizedType :: TokenizedType -> AttType EnumeratedType :: EnumeratedType -> AttType data TokenizedType ID :: TokenizedType IDREF :: TokenizedType IDREFS :: TokenizedType ENTITY :: TokenizedType ENTITIES :: TokenizedType NMTOKEN :: TokenizedType NMTOKENS :: TokenizedType data EnumeratedType NotationType :: NotationType -> EnumeratedType Enumeration :: Enumeration -> EnumeratedType type NotationType = [Name] type Enumeration = [NmToken] data DefaultDecl REQUIRED :: DefaultDecl IMPLIED :: DefaultDecl DefaultTo :: AttValue -> (Maybe FIXED) -> DefaultDecl data FIXED FIXED :: FIXED data ConditionalSect IncludeSect :: IncludeSect -> ConditionalSect IgnoreSect :: IgnoreSect -> ConditionalSect type IncludeSect = [ExtSubsetDecl] type IgnoreSect = [IgnoreSectContents] data Ignore Ignore :: Ignore data IgnoreSectContents IgnoreSectContents :: Ignore -> [(IgnoreSectContents, Ignore)] -> IgnoreSectContents data Reference RefEntity :: EntityRef -> Reference RefChar :: CharRef -> Reference type EntityRef = Name type CharRef = Int type PEReference = Name data EntityDecl EntityGEDecl :: GEDecl -> EntityDecl EntityPEDecl :: PEDecl -> EntityDecl data GEDecl GEDecl :: Name -> EntityDef -> GEDecl data PEDecl PEDecl :: Name -> PEDef -> PEDecl data EntityDef DefEntityValue :: EntityValue -> EntityDef DefExternalID :: ExternalID -> (Maybe NDataDecl) -> EntityDef data PEDef PEDefEntityValue :: EntityValue -> PEDef PEDefExternalID :: ExternalID -> PEDef data ExternalID SYSTEM :: SystemLiteral -> ExternalID PUBLIC :: PubidLiteral -> SystemLiteral -> ExternalID newtype NDataDecl NDATA :: Name -> NDataDecl data TextDecl TextDecl :: (Maybe VersionInfo) -> EncodingDecl -> TextDecl data ExtParsedEnt ExtParsedEnt :: (Maybe TextDecl) -> Content -> ExtParsedEnt data ExtPE ExtPE :: (Maybe TextDecl) -> [ExtSubsetDecl] -> ExtPE data NotationDecl NOTATION :: Name -> (Either ExternalID PublicID) -> NotationDecl newtype PublicID PUBLICID :: PubidLiteral -> PublicID newtype EncodingDecl EncodingDecl :: String -> EncodingDecl data EntityValue EntityValue :: [EV] -> EntityValue data EV EVString :: String -> EV EVRef :: Reference -> EV newtype PubidLiteral PubidLiteral :: String -> PubidLiteral newtype SystemLiteral SystemLiteral :: String -> SystemLiteral type Name = String type Names = [Name] type NmToken = String type NmTokens = [NmToken] type CharData = String type CDSect = CharData instance Eq Reference instance Eq AttValue instance Eq ElemTag -- | This module defines the notion of filters and filter combinators for -- processing XML documents. -- -- These XML transformation combinators are described in the paper -- ``Haskell and XML: Generic Combinators or Type-Based Translation?'' -- Malcolm Wallace and Colin Runciman, Proceedings ICFP'99. module Text.XML.HaXml.Combinators -- | All document transformations are content filters. A filter -- takes a single XML Content value and returns a sequence of -- Content values, possibly empty. type CFilter = Content -> [Content] keep :: a -> [a] none :: a -> [a] -- | Throw away current node, keep just the (unprocessed) children. children :: CFilter -- | Select the n'th positional result of a filter. position :: Int -> CFilter -> CFilter elm :: CFilter txt :: CFilter tag :: String -> CFilter attr :: Name -> CFilter attrval :: Attribute -> CFilter tagWith :: (String -> Bool) -> CFilter -- | For a mandatory attribute field, find key cont looks up the -- value of the attribute name key, and applies the continuation -- cont to the value. find :: String -> (String -> CFilter) -> CFilter -- | When an attribute field may be absent, use iffind key yes no -- to lookup its value. If the attribute is absent, it acts as the -- no filter, otherwise it applies the yes filter. iffind :: String -> (String -> CFilter) -> CFilter -> CFilter -- | ifTxt yes no processes any textual content with the -- yes filter, but otherwise is the same as the no -- filter. ifTxt :: (String -> CFilter) -> CFilter -> CFilter -- | Sequential (Irish,backwards) composition o :: CFilter -> CFilter -> CFilter -- | Binary parallel composition. Each filter uses a copy of the input, -- rather than one filter using the result of the other. (Has a more -- general type than just CFilter.) union :: (a -> [b]) -> (a -> [b]) -> (a -> [b]) -- | Glue a list of filters together. (A list version of union; also has a -- more general type than just CFilter.) cat :: [a -> [b]] -> (a -> [b]) -- | A special form of filter composition where the second filter works -- over the same data as the first, but also uses the first's result. andThen :: (a -> c) -> (c -> a -> b) -> (a -> b) -- | Directional choice: in f |>| g give g-productions only if -- no f-productions (|>|) :: (a -> [b]) -> (a -> [b]) -> (a -> [b]) -- | Pruning: in f with g, keep only those f-productions -- which have at least one g-production with :: CFilter -> CFilter -> CFilter -- | Pruning: in f without g, keep only those f-productions -- which have no g-productions without :: CFilter -> CFilter -> CFilter -- | Pronounced slash, f /> g means g inside f (/>) :: CFilter -> CFilter -> CFilter -- | Pronounced outside, f </ g means f containing g ( CFilter -> CFilter -- | Join an element-matching filter with a text-only filter et :: (String -> CFilter) -> CFilter -> CFilter -- | Express a list of filters like an XPath query, e.g. path -- [children, tag "name1", attr "attr1", children, tag "name2"] is -- like the XPath query /name1[@attr1]/name2. path :: [CFilter] -> CFilter deep :: CFilter -> CFilter deepest :: CFilter -> CFilter multi :: CFilter -> CFilter -- | Interior editing: f when g applies f only -- when the predicate g succeeds, otherwise the content is -- unchanged. when :: CFilter -> CFilter -> CFilter -- | Interior editing: g guards f applies f only -- when the predicate g succeeds, otherwise the content is -- discarded. guards :: CFilter -> CFilter -> CFilter -- | Process CHildren In Place. The filter is applied to any children of an -- element content, and the element rebuilt around the results. chip :: CFilter -> CFilter -- | Recursive application of filters: a fold-like operator. Defined as -- f o chip (foldXml f). foldXml :: CFilter -> CFilter -- | Build an element with the given tag name - its content is the results -- of the given list of filters. mkElem :: String -> [CFilter] -> CFilter -- | Build an element with the given name, attributes, and content. mkElemAttr :: String -> [(String, CFilter)] -> [CFilter] -> CFilter -- | Build some textual content. literal :: String -> CFilter -- | Build some CDATA content. cdata :: String -> CFilter -- | Rename an element tag. replaceTag :: String -> CFilter -- | Replace the attributes of an element. replaceAttrs :: [(String, String)] -> CFilter -- | Conjoin the two branches of a conditional. data ThenElse a (:>) :: a -> a -> ThenElse a -- | Select between the two branches of a joined conditional. (?>) :: (a -> [b]) -> ThenElse (a -> [b]) -> (a -> [b]) -- | A LabelFilter is like a CFilter except that it pairs up a polymorphic -- value (label) with each of its results. type LabelFilter a = Content -> [(a, Content)] -- | Compose a label-processing filter with a label-generating filter. oo :: (a -> CFilter) -> LabelFilter a -> CFilter -- | Combine labels. Think of this as a pair-wise zip on labels. x :: (CFilter -> LabelFilter a) -> (CFilter -> LabelFilter b) -> (CFilter -> LabelFilter (a, b)) -- | Number the results from 1 upwards. numbered :: CFilter -> LabelFilter String -- | In interspersed a f b, label each result of f with -- the string a, except for the last one which is labelled with -- the string b. interspersed :: String -> CFilter -> String -> LabelFilter String -- | Label each element in the result with its tag name. Non-element -- results get an empty string label. tagged :: CFilter -> LabelFilter String -- | Label each element in the result with the value of the named -- attribute. Elements without the attribute, and non-element results, -- get an empty string label. attributed :: String -> CFilter -> LabelFilter String -- | Label each textual part of the result with its text. Element results -- get an empty string label. textlabelled :: CFilter -> LabelFilter (Maybe String) -- | Label each content with some information extracted from itself. extracted :: (Content -> a) -> CFilter -> LabelFilter a -- | This is a pretty-printer for turning the internal representation of -- generic structured XML documents into the Doc type (which can later be -- rendered using Text.ParserCombinators.HughesPJ.render). Essentially -- there is one pp function for each type in Text.Xml.HaXml.Types, so you -- can pretty-print as much or as little of the document as you wish. module Text.XML.HaXml.Pretty document :: Document -> Doc content :: Content -> Doc element :: Element -> Doc doctypedecl :: DocTypeDecl -> Doc prolog :: Prolog -> Doc cp :: CP -> Doc -- | These are just some common abbreviations for generating HTML content -- within the XML transformation framework defined by -- Text.Xml.HaXml.Combinators. module Text.XML.HaXml.Html.Generate html :: [CFilter] -> CFilter hhead :: [CFilter] -> CFilter htitle :: [CFilter] -> CFilter hbody :: [CFilter] -> CFilter h1 :: [CFilter] -> CFilter h2 :: [CFilter] -> CFilter h3 :: [CFilter] -> CFilter h4 :: [CFilter] -> CFilter hpara :: [CFilter] -> CFilter hdiv :: [CFilter] -> CFilter hspan :: [CFilter] -> CFilter margin :: [CFilter] -> CFilter anchor :: [(String, CFilter)] -> [CFilter] -> CFilter makehref :: CFilter -> [CFilter] -> CFilter anchorname :: CFilter -> [CFilter] -> CFilter hpre :: [CFilter] -> CFilter hcentre :: [CFilter] -> CFilter hem :: [CFilter] -> CFilter htt :: [CFilter] -> CFilter hbold :: [CFilter] -> CFilter parens :: CFilter -> CFilter bullet :: [CFilter] -> CFilter htable :: [CFilter] -> CFilter hrow :: [CFilter] -> CFilter hcol :: [CFilter] -> CFilter hbr :: CFilter hhr :: CFilter showattr :: String -> CFilter (!) :: String -> CFilter (?) :: String -> CFilter htmlprint :: [Content] -> Doc -- | The preferred method for rendering a Document or single -- Content is by using the pretty printing facility defined in -- Pretty. Pretty-printing does not work well for cases, however, -- where the formatting in the XML document is significant. Examples of -- this case are XHTML's <pre> tag, Docbook's -- <literallayout> tag, and many more. -- -- Theoretically, the document author could avoid this problem by -- wrapping the contents of these tags in a <![CDATA[...]]> -- section, but often this is not practical, for instance when the -- literal-layout section contains other elements. Finally, program -- writers could manually format these elements by transforming them into -- a literal string in their CFliter, etc., but this is -- annoying to do and prone to omissions and formatting errors. -- -- As an alternative, this module provides the function verbatim, -- which will format XML Content as a String while -- retaining the formatting of the input document unchanged. -- -- Know problems: -- -- module Text.XML.HaXml.Verbatim -- | This class promises that the function verbatim knows how to -- format this data type into a string without changing the formatting. class Verbatim a verbatim :: Verbatim a => a -> String -- | This is a helper function is required because Haskell does not allow -- to make an ordinary tuple (like Attribute) an instance of a -- class. The resulting output will preface the actual attribute with a -- single blank so that lists of Attributes can be handled -- implicitly by the definition for lists of Verbatim data types. verbAttr :: Attribute -> String instance Verbatim Reference instance Verbatim Element instance Verbatim Content instance (Verbatim a, Verbatim b) => Verbatim (Either a b) instance Verbatim Char instance Verbatim a => Verbatim [a] module Text.XML.HaXml.Escape xmlEscape :: XmlEscaper -> Element -> Element xmlUnEscape :: XmlEscaper -> Element -> Element data XmlEscaper stdXmlEscaper :: XmlEscaper mkXmlEscaper :: [(Char, String)] -> (Char -> Bool) -> XmlEscaper -- | This module performs the translation of a parsed XML DTD into the -- internal representation of corresponding Haskell data/newtypes. module Text.XML.HaXml.DtdToHaskell.Convert dtd2TypeDef :: [MarkupDecl] -> [TypeDef] -- | This is a separate pretty-printer for HTML documents, recognising some -- of the differences between HTML and true XML. module Text.XML.HaXml.Html.Pretty document :: Document -> Doc element :: Element -> Doc attribute :: Attribute -> Doc content :: Content -> Doc -- | This is a new set of XML combinators for Xtract, not standard, but -- based on the standard set in Text.Xml.Haxml.Combinators. The -- main difference is that the Content Filter type becomes a Double -- Filter. A Double Filter always takes the whole document as an extra -- argument, so you can start to traverse it again from any inner -- location within the document tree. -- -- The new combinators definitions are derived from the old ones. New -- names are derived from the old by surrounding with the letter -- o, or by doubling the operator symbols. module Text.XML.HaXml.Xtract.Combinators -- | double content filter - takes document root + local subtree. type DFilter = Content -> Content -> [Content] -- | lift an ordinary content filter to a double filter. global :: CFilter -> DFilter local :: CFilter -> DFilter -- | drop a double filter to an ordinary content filter dfilter :: DFilter -> CFilter -- | lift a CFilter combinator to a DFilter combinator oglobo :: (CFilter -> CFilter) -> (DFilter -> DFilter) oloco :: (CFilter -> CFilter) -> (DFilter -> DFilter) -- | lifted composition over double filters. ooo :: DFilter -> DFilter -> DFilter -- | lifted choice. (||>||) :: (a -> b -> [c]) -> (a -> b -> [c]) -> (a -> b -> [c]) -- | lifted predicates. owithouto :: DFilter -> DFilter -> DFilter owitho :: DFilter -> DFilter -> DFilter -- | lifted unit and zero. ononeo :: DFilter okeepo :: DFilter oelmo :: DFilter otxto :: DFilter ochildreno :: DFilter applypred :: CFilter -> DFilter -> CFilter oiffindo :: String -> (String -> DFilter) -> DFilter -> DFilter oifTxto :: (String -> DFilter) -> DFilter -> DFilter ocato :: [a -> b -> [c]] -> (a -> b -> [c]) (//>>) :: DFilter -> DFilter -> DFilter (< DFilter -> DFilter odeepo :: DFilter -> DFilter -- | This library of monadic parser combinators is based on the ones -- defined by Graham Hutton and Erik Meijer. It has been extended by -- Malcolm Wallace to use an abstract token type (no longer just a -- string) as input, and to incorporate a State Transformer monad, useful -- for symbol tables, macros, and so on. Basic facilities for error -- reporting have also been added, and later extended by Graham Klyne to -- return the errors through an Either type, rather than just -- calling error. module Text.ParserCombinators.HuttonMeijerWallace newtype Parser s t e a -- | The parser type is parametrised on the types of the state s, -- the input tokens t, error-type e, and the result -- value a. The state and remaining input are threaded through -- the monad. P :: (s -> [Either e t] -> ParseResult s t e a) -> Parser s t e a -- | Deliver the first remaining token. item :: Parser s t e t -- | Fail if end of input is not reached eof :: Show p => Parser s (p, t) String () -- | Apply the parser to some real input, given an initial state value. If -- the parser fails, raise error to halt the program. (This is the -- original exported behaviour - to allow the caller to deal with the -- error differently, see papply'.) papply :: Parser s t String a -> s -> [Either String t] -> [(a, s, [Either String t])] -- | Apply the parser to some real input, given an initial state value. If -- the parser fails, return a diagnostic message to the caller. papply' :: Parser s t e a -> s -> [Either e t] -> Either e [(a, s, [Either e t])] -- | A choice between parsers. Keep only the first success. (+++) :: Parser s t e a -> Parser s t e a -> Parser s t e a -- | Deliver the first token if it equals the argument. tok :: Eq t => t -> Parser s (p, t) e t -- | Deliver the first token if it does not equal the argument. nottok :: Eq t => [t] -> Parser s (p, t) e t -- | Deliver zero or more values of a. many :: Parser s t e a -> Parser s t e [a] -- | Deliver one or more values of a. many1 :: Parser s t e a -> Parser s t e [a] -- | Deliver zero or more values of a separated by b's. sepby :: Parser s t e a -> Parser s t e b -> Parser s t e [a] -- | Deliver one or more values of a separated by b's. sepby1 :: Parser s t e a -> Parser s t e b -> Parser s t e [a] chainl :: Parser s t e a -> Parser s t e (a -> a -> a) -> a -> Parser s t e a chainl1 :: Parser s t e a -> Parser s t e (a -> a -> a) -> Parser s t e a chainr :: Parser s t e a -> Parser s t e (a -> a -> a) -> a -> Parser s t e a chainr1 :: Parser s t e a -> Parser s t e (a -> a -> a) -> Parser s t e a ops :: [(Parser s t e a, b)] -> Parser s t e b bracket :: (Show p, Show t) => Parser s (p, t) e a -> Parser s (p, t) e b -> Parser s (p, t) e c -> Parser s (p, t) e b -- | Accept a complete parse of the input only, no partial parses. toEOF :: Show p => Parser s (p, t) String a -> Parser s (p, t) String a -- | If the parser fails, generate an error message. elserror :: (Show p, Show t) => Parser s (p, t) String a -> String -> Parser s (p, t) String a -- | Update the internal state. stupd :: (s -> s) -> Parser s t e () -- | Query the internal state. stquery :: (s -> a) -> Parser s t e a -- | Deliver the entire internal state. stget :: Parser s t e s -- | This is useful for recursively expanding macros. When the user-parser -- recognises a macro use, it can lookup the macro expansion from the -- parse state, lex it, and then stuff the lexed expansion back down into -- the parser. reparse :: [Either e t] -> Parser s t e () instance MonadPlus (Parser s t e) instance Monad (Parser s t e) instance Functor (Parser s t e) -- | A non-validating XML parser. For the input grammar, see -- http://www.w3.org/TR/REC-xml. module Text.XML.HaXml.Parse -- | To parse a whole document, xmlParse file content takes a -- filename (for generating error reports) and the string content of that -- file. A parse error causes program failure, with message to stderr. xmlParse :: String -> String -> Document -- | To parse a whole document, xmlParse' file content takes a -- filename (for generating error reports) and the string content of that -- file. Any parse error message is passed back to the caller through the -- Either type. xmlParse' :: String -> String -> Either String Document -- | To parse just a DTD, dtdParse file content takes a filename -- (for generating error reports) and the string content of that file. If -- no DTD was found, you get Nothing rather than an error. -- However, if a DTD is found but contains errors, the program crashes. dtdParse :: String -> String -> Maybe DocTypeDecl -- | To parse just a DTD, dtdParse' file content takes a filename -- (for generating error reports) and the string content of that file. If -- no DTD was found, you get Right Nothing. If a DTD was found -- but contains errors, you get a Left message. dtdParse' :: String -> String -> Either String (Maybe DocTypeDecl) instance Show Modifier instance Show CP -- | The class Haskell2Xml is a replacement for Read and Show: it -- provides textual conversions (to and from an XML representation) for -- your Haskell data values. Use the tool DrIFT to derive this class for -- your own datatypes, then include this module where you want to use the -- facilities. -- -- The methods toContents and fromContents convert a value -- to and from a generic internal representation of an XML document -- without a DTD. The functions toXml and fromXml -- convert a value to and from a generic internal representation of an -- XML document including a DTD. The functions readXml and -- showXml convert to and from Strings. The functions -- fReadXml and fWriteXml do the conversion to and from the -- given filenames. The functions hGetXml and hPutXml do -- the conversion to and from the given file handles. (See the type -- signatures.) module Text.XML.HaXml.Haskell2Xml -- | A class to convert any Haskell value to and from an XML -- representation. class Haskell2Xml a toHType :: Haskell2Xml a => a -> HType toContents :: Haskell2Xml a => a -> [Content] fromContents :: Haskell2Xml a => [Content] -> (a, [Content]) xToChar :: Haskell2Xml a => a -> Char xFromChar :: Haskell2Xml a => Char -> a -- | Convert any Haskell value to an XML document, including both DTD and -- content. toXml :: Haskell2Xml a => a -> Document -- | toDTD converts a concrete representation of the Haskell type of -- a value (obtained by the method toHType) into a real -- DocTypeDecl. It ensures that PERefs are defined before they are used, -- and that no element or attribute-list is declared more than once. toDTD :: HType -> DocTypeDecl -- | Read a Haskell value from an XML document, ignoring the DTD and using -- the Haskell result type to determine how to parse it. fromXml :: Haskell2Xml a => Document -> a -- | Convert an XML document encoded as a String, into a Haskell value. readXml :: Haskell2Xml a => String -> Maybe a -- | Convert a Haskell value to an XML document, encoded as a String. showXml :: Haskell2Xml a => a -> String -- | Read a Haskell value from an XML document stored in a file. fReadXml :: Haskell2Xml a => FilePath -> IO a -- | Write a Haskell value to the given file as an XML document. fWriteXml :: Haskell2Xml a => FilePath -> a -> IO () -- | Read a Haskell value from an XML document transmitted through the -- given Handle. hGetXml :: Haskell2Xml a => Handle -> IO a -- | Write a Haskell value to the given Handle as an XML document. hPutXml :: Haskell2Xml a => Handle -> a -> IO () -- | A concrete representation of any Haskell type. data HType Maybe :: HType -> HType List :: HType -> HType Tuple :: [HType] -> HType -- | separate Haskell name and Xml name Prim :: String -> String -> HType String :: HType -- | A user-defined type has a name, a sequence of type variables, and a -- set of constructors. Defined :: String -> [HType] -> [Constr] -> HType -- | A concrete representation of any user-defined Haskell constructor. The -- constructor has a name, and a sequence of component types. The first -- sequence of types represents the minimum set of free type variables -- occurring in the (second) list of real component types. data Constr Constr :: String -> [HType] -> [HType] -> Constr mkElem :: Haskell2Xml a => a -> [Content] -> Content mkElemC :: Name -> [Content] -> Content showConstr :: Int -> HType -> String -- | The isPrefixOf function takes two lists and returns True -- iff the first list is a prefix of the second. isPrefixOf :: Eq a => [a] -> [a] -> Bool instance Eq Constr instance Show Constr instance Show HType instance Haskell2Xml () instance (Haskell2Xml a, Haskell2Xml b) => Haskell2Xml (Either a b) instance Haskell2Xml a => Haskell2Xml (Maybe a) instance (Haskell2Xml a, Haskell2Xml b) => Haskell2Xml (a, b) instance Haskell2Xml a => Haskell2Xml [a] instance Haskell2Xml Char instance Haskell2Xml Double instance Haskell2Xml Float instance Haskell2Xml Integer instance Haskell2Xml Int instance Haskell2Xml Bool instance Eq HType -- | This module provides the XmlContent class and readXml -- and writeXml functions that you will need if you generate a -- module of Haskell datatype definitions from an XML DTD. Use the -- DtdToHaskell program to generate both datatypes and instances of this -- class, then import this module to read and write values to and from -- XML files. module Text.XML.HaXml.Xml2Haskell -- | Read a fully-typed XML document from a string. readXml :: XmlContent a => String -> Maybe a -- | Convert a fully-typed XML document to a string. showXml :: XmlContent a => a -> String -- | Read a fully-typed XML document from a file handle. hGetXml :: XmlContent a => Handle -> IO a -- | Write a fully-typed XML document to a file handle. hPutXml :: XmlContent a => Handle -> a -> IO () -- | Read an XML document from a file and convert it to a fully-typed -- Haskell value. fReadXml :: XmlContent a => FilePath -> IO a -- | Write a fully-typed Haskell value to the given file as an XML -- document. fWriteXml :: XmlContent a => FilePath -> a -> IO () -- | The XmlContent class promises that an XML content element can be -- converted to and from a Haskell value. class XmlContent a fromElem :: XmlContent a => [Content] -> (Maybe a, [Content]) toElem :: XmlContent a => a -> [Content] -- | The XmlAttributes class promises that a list of XML tag attributes can -- be converted to and from a Haskell value. class XmlAttributes a fromAttrs :: XmlAttributes a => [Attribute] -> a toAttrs :: XmlAttributes a => a -> [Attribute] -- | The XmlAttrType class promises that an attribute taking an XML -- enumerated type can be converted to and from a Haskell value. class XmlAttrType a fromAttrToTyp :: XmlAttrType a => String -> Attribute -> Maybe a toAttrFrTyp :: XmlAttrType a => String -> a -> Maybe Attribute choice :: XmlContent a => (a -> b) -> ([Content] -> (Maybe b, [Content])) -> [Content] -> (Maybe b, [Content]) definite :: ([Content] -> (Maybe a, [Content])) -> String -> String -> [Content] -> (a, [Content]) many :: ([Content] -> (Maybe a, [Content])) -> [Content] -> ([a], [Content]) fromText :: [Content] -> (Maybe String, [Content]) toText :: String -> [Content] -- | The List1 type represents lists with at least one element. It is -- required for DTD content models that use + as a modifier. data List1 a NonEmpty :: [a] -> List1 a -- | A type corresponding to XML's ANY contentspec data ANYContent = forall -- a . XmlContent a => ANYContent a data ANYContent ANYContent :: ANYContent maybeToAttr :: (String -> a -> Maybe Attribute) -> String -> Maybe a -> Maybe Attribute defaultToAttr :: (String -> a -> Maybe Attribute) -> String -> Defaultable a -> Maybe Attribute definiteA :: (String -> Attribute -> Maybe a) -> String -> String -> [Attribute] -> a defaultA :: (String -> Attribute -> Maybe a) -> a -> String -> [Attribute] -> Defaultable a possibleA :: (String -> Attribute -> Maybe a) -> String -> [Attribute] -> Maybe a fromAttrToStr :: String -> Attribute -> Maybe String toAttrFrStr :: String -> String -> Maybe Attribute -- | If an attribute is defaultable, then it either takes the default value -- (which is omitted from the output), or a non-default value (which -- obviously must be printed). data Defaultable a Default :: a -> Defaultable a NonDefault :: a -> Defaultable a str2attr :: String -> AttValue attr2str :: AttValue -> String data Element Elem :: Name -> [Attribute] -> [Content] -> Element data Content CElem :: Element -> Content -- | bool is whether whitespace is significant CString :: Bool -> CharData -> Content CRef :: Reference -> Content CMisc :: Misc -> Content -- | The catMaybes function takes a list of Maybes and -- returns a list of all the Just values. catMaybes :: [Maybe a] -> [a] instance Eq a => Eq (Defaultable a) instance Show a => Show (Defaultable a) instance Eq ANYContent instance Show ANYContent instance Eq a => Eq (List1 a) instance Show a => Show (List1 a) instance XmlContent ANYContent instance XmlContent a => XmlContent (List1 a) instance XmlContent a => XmlContent (Maybe a) instance XmlContent a => XmlContent [a] instance (XmlContent a, XmlContent b, XmlContent c) => XmlContent (a, b, c) instance (XmlContent a, XmlContent b) => XmlContent (a, b) -- | Validate a document against a dtd. module Text.XML.HaXml.Validate -- | validate takes a DTD and a tagged element, and returns a list -- of errors in the document with respect to its DTD. -- -- If you have several documents to validate against a single DTD, then -- you will gain efficiency by freezing-in the DTD through partial -- application, e.g. checkMyDTD = validate myDTD. validate :: DocTypeDecl -> Element -> [String] -- | partialValidate is like validate, except that it does not check -- that the element type matches that of the DTD's root element. partialValidate :: DocTypeDecl -> Element -> [String] module Text.XML.HaXml.OneOfN data OneOf2 a b OneOf2 :: a -> OneOf2 a b TwoOf2 :: b -> OneOf2 a b data OneOf3 a b c OneOf3 :: a -> OneOf3 a b c TwoOf3 :: b -> OneOf3 a b c ThreeOf3 :: c -> OneOf3 a b c data OneOf4 a b c d OneOf4 :: a -> OneOf4 a b c d TwoOf4 :: b -> OneOf4 a b c d ThreeOf4 :: c -> OneOf4 a b c d FourOf4 :: d -> OneOf4 a b c d data OneOf5 a b c d e OneOf5 :: a -> OneOf5 a b c d e TwoOf5 :: b -> OneOf5 a b c d e ThreeOf5 :: c -> OneOf5 a b c d e FourOf5 :: d -> OneOf5 a b c d e FiveOf5 :: e -> OneOf5 a b c d e data OneOf6 a b c d e f OneOf6 :: a -> OneOf6 a b c d e f TwoOf6 :: b -> OneOf6 a b c d e f ThreeOf6 :: c -> OneOf6 a b c d e f FourOf6 :: d -> OneOf6 a b c d e f FiveOf6 :: e -> OneOf6 a b c d e f SixOf6 :: f -> OneOf6 a b c d e f data OneOf7 a b c d e f g OneOf7 :: a -> OneOf7 a b c d e f g TwoOf7 :: b -> OneOf7 a b c d e f g ThreeOf7 :: c -> OneOf7 a b c d e f g FourOf7 :: d -> OneOf7 a b c d e f g FiveOf7 :: e -> OneOf7 a b c d e f g SixOf7 :: f -> OneOf7 a b c d e f g SevenOf7 :: g -> OneOf7 a b c d e f g data OneOf8 a b c d e f g h OneOf8 :: a -> OneOf8 a b c d e f g h TwoOf8 :: b -> OneOf8 a b c d e f g h ThreeOf8 :: c -> OneOf8 a b c d e f g h FourOf8 :: d -> OneOf8 a b c d e f g h FiveOf8 :: e -> OneOf8 a b c d e f g h SixOf8 :: f -> OneOf8 a b c d e f g h SevenOf8 :: g -> OneOf8 a b c d e f g h EightOf8 :: h -> OneOf8 a b c d e f g h data OneOf9 a b c d e f g h i OneOf9 :: a -> OneOf9 a b c d e f g h i TwoOf9 :: b -> OneOf9 a b c d e f g h i ThreeOf9 :: c -> OneOf9 a b c d e f g h i FourOf9 :: d -> OneOf9 a b c d e f g h i FiveOf9 :: e -> OneOf9 a b c d e f g h i SixOf9 :: f -> OneOf9 a b c d e f g h i SevenOf9 :: g -> OneOf9 a b c d e f g h i EightOf9 :: h -> OneOf9 a b c d e f g h i NineOf9 :: i -> OneOf9 a b c d e f g h i data OneOf10 a b c d e f g h i j OneOf10 :: a -> OneOf10 a b c d e f g h i j TwoOf10 :: b -> OneOf10 a b c d e f g h i j ThreeOf10 :: c -> OneOf10 a b c d e f g h i j FourOf10 :: d -> OneOf10 a b c d e f g h i j FiveOf10 :: e -> OneOf10 a b c d e f g h i j SixOf10 :: f -> OneOf10 a b c d e f g h i j SevenOf10 :: g -> OneOf10 a b c d e f g h i j EightOf10 :: h -> OneOf10 a b c d e f g h i j NineOf10 :: i -> OneOf10 a b c d e f g h i j TenOf10 :: j -> OneOf10 a b c d e f g h i j data OneOf11 a b c d e f g h i j k OneOf11 :: a -> OneOf11 a b c d e f g h i j k TwoOf11 :: b -> OneOf11 a b c d e f g h i j k ThreeOf11 :: c -> OneOf11 a b c d e f g h i j k FourOf11 :: d -> OneOf11 a b c d e f g h i j k FiveOf11 :: e -> OneOf11 a b c d e f g h i j k SixOf11 :: f -> OneOf11 a b c d e f g h i j k SevenOf11 :: g -> OneOf11 a b c d e f g h i j k EightOf11 :: h -> OneOf11 a b c d e f g h i j k NineOf11 :: i -> OneOf11 a b c d e f g h i j k TenOf11 :: j -> OneOf11 a b c d e f g h i j k ElevenOf11 :: k -> OneOf11 a b c d e f g h i j k data OneOf12 a b c d e f g h i j k l OneOf12 :: a -> OneOf12 a b c d e f g h i j k l TwoOf12 :: b -> OneOf12 a b c d e f g h i j k l ThreeOf12 :: c -> OneOf12 a b c d e f g h i j k l FourOf12 :: d -> OneOf12 a b c d e f g h i j k l FiveOf12 :: e -> OneOf12 a b c d e f g h i j k l SixOf12 :: f -> OneOf12 a b c d e f g h i j k l SevenOf12 :: g -> OneOf12 a b c d e f g h i j k l EightOf12 :: h -> OneOf12 a b c d e f g h i j k l NineOf12 :: i -> OneOf12 a b c d e f g h i j k l TenOf12 :: j -> OneOf12 a b c d e f g h i j k l ElevenOf12 :: k -> OneOf12 a b c d e f g h i j k l TwelveOf12 :: l -> OneOf12 a b c d e f g h i j k l data OneOf13 a b c d e f g h i j k l m OneOf13 :: a -> OneOf13 a b c d e f g h i j k l m TwoOf13 :: b -> OneOf13 a b c d e f g h i j k l m ThreeOf13 :: c -> OneOf13 a b c d e f g h i j k l m FourOf13 :: d -> OneOf13 a b c d e f g h i j k l m FiveOf13 :: e -> OneOf13 a b c d e f g h i j k l m SixOf13 :: f -> OneOf13 a b c d e f g h i j k l m SevenOf13 :: g -> OneOf13 a b c d e f g h i j k l m EightOf13 :: h -> OneOf13 a b c d e f g h i j k l m NineOf13 :: i -> OneOf13 a b c d e f g h i j k l m TenOf13 :: j -> OneOf13 a b c d e f g h i j k l m ElevenOf13 :: k -> OneOf13 a b c d e f g h i j k l m TwelveOf13 :: l -> OneOf13 a b c d e f g h i j k l m ThirteenOf13 :: m -> OneOf13 a b c d e f g h i j k l m data OneOf14 a b c d e f g h i j k l m n OneOf14 :: a -> OneOf14 a b c d e f g h i j k l m n TwoOf14 :: b -> OneOf14 a b c d e f g h i j k l m n ThreeOf14 :: c -> OneOf14 a b c d e f g h i j k l m n FourOf14 :: d -> OneOf14 a b c d e f g h i j k l m n FiveOf14 :: e -> OneOf14 a b c d e f g h i j k l m n SixOf14 :: f -> OneOf14 a b c d e f g h i j k l m n SevenOf14 :: g -> OneOf14 a b c d e f g h i j k l m n EightOf14 :: h -> OneOf14 a b c d e f g h i j k l m n NineOf14 :: i -> OneOf14 a b c d e f g h i j k l m n TenOf14 :: j -> OneOf14 a b c d e f g h i j k l m n ElevenOf14 :: k -> OneOf14 a b c d e f g h i j k l m n TwelveOf14 :: l -> OneOf14 a b c d e f g h i j k l m n ThirteenOf14 :: m -> OneOf14 a b c d e f g h i j k l m n FourteenOf14 :: n -> OneOf14 a b c d e f g h i j k l m n data OneOf15 a b c d e f g h i j k l m n o OneOf15 :: a -> OneOf15 a b c d e f g h i j k l m n o TwoOf15 :: b -> OneOf15 a b c d e f g h i j k l m n o ThreeOf15 :: c -> OneOf15 a b c d e f g h i j k l m n o FourOf15 :: d -> OneOf15 a b c d e f g h i j k l m n o FiveOf15 :: e -> OneOf15 a b c d e f g h i j k l m n o SixOf15 :: f -> OneOf15 a b c d e f g h i j k l m n o SevenOf15 :: g -> OneOf15 a b c d e f g h i j k l m n o EightOf15 :: h -> OneOf15 a b c d e f g h i j k l m n o NineOf15 :: i -> OneOf15 a b c d e f g h i j k l m n o TenOf15 :: j -> OneOf15 a b c d e f g h i j k l m n o ElevenOf15 :: k -> OneOf15 a b c d e f g h i j k l m n o TwelveOf15 :: l -> OneOf15 a b c d e f g h i j k l m n o ThirteenOf15 :: m -> OneOf15 a b c d e f g h i j k l m n o FourteenOf15 :: n -> OneOf15 a b c d e f g h i j k l m n o FifteenOf15 :: o -> OneOf15 a b c d e f g h i j k l m n o data OneOf16 a b c d e f g h i j k l m n o p OneOf16 :: a -> OneOf16 a b c d e f g h i j k l m n o p TwoOf16 :: b -> OneOf16 a b c d e f g h i j k l m n o p ThreeOf16 :: c -> OneOf16 a b c d e f g h i j k l m n o p FourOf16 :: d -> OneOf16 a b c d e f g h i j k l m n o p FiveOf16 :: e -> OneOf16 a b c d e f g h i j k l m n o p SixOf16 :: f -> OneOf16 a b c d e f g h i j k l m n o p SevenOf16 :: g -> OneOf16 a b c d e f g h i j k l m n o p EightOf16 :: h -> OneOf16 a b c d e f g h i j k l m n o p NineOf16 :: i -> OneOf16 a b c d e f g h i j k l m n o p TenOf16 :: j -> OneOf16 a b c d e f g h i j k l m n o p ElevenOf16 :: k -> OneOf16 a b c d e f g h i j k l m n o p TwelveOf16 :: l -> OneOf16 a b c d e f g h i j k l m n o p ThirteenOf16 :: m -> OneOf16 a b c d e f g h i j k l m n o p FourteenOf16 :: n -> OneOf16 a b c d e f g h i j k l m n o p FifteenOf16 :: o -> OneOf16 a b c d e f g h i j k l m n o p SixteenOf16 :: p -> OneOf16 a b c d e f g h i j k l m n o p data OneOf17 a b c d e f g h i j k l m n o p q OneOf17 :: a -> OneOf17 a b c d e f g h i j k l m n o p q TwoOf17 :: b -> OneOf17 a b c d e f g h i j k l m n o p q ThreeOf17 :: c -> OneOf17 a b c d e f g h i j k l m n o p q FourOf17 :: d -> OneOf17 a b c d e f g h i j k l m n o p q FiveOf17 :: e -> OneOf17 a b c d e f g h i j k l m n o p q SixOf17 :: f -> OneOf17 a b c d e f g h i j k l m n o p q SevenOf17 :: g -> OneOf17 a b c d e f g h i j k l m n o p q EightOf17 :: h -> OneOf17 a b c d e f g h i j k l m n o p q NineOf17 :: i -> OneOf17 a b c d e f g h i j k l m n o p q TenOf17 :: j -> OneOf17 a b c d e f g h i j k l m n o p q ElevenOf17 :: k -> OneOf17 a b c d e f g h i j k l m n o p q TwelveOf17 :: l -> OneOf17 a b c d e f g h i j k l m n o p q ThirteenOf17 :: m -> OneOf17 a b c d e f g h i j k l m n o p q FourteenOf17 :: n -> OneOf17 a b c d e f g h i j k l m n o p q FifteenOf17 :: o -> OneOf17 a b c d e f g h i j k l m n o p q SixteenOf17 :: p -> OneOf17 a b c d e f g h i j k l m n o p q SeventeenOf17 :: q -> OneOf17 a b c d e f g h i j k l m n o p q data OneOf18 a b c d e f g h i j k l m n o p q r OneOf18 :: a -> OneOf18 a b c d e f g h i j k l m n o p q r TwoOf18 :: b -> OneOf18 a b c d e f g h i j k l m n o p q r ThreeOf18 :: c -> OneOf18 a b c d e f g h i j k l m n o p q r FourOf18 :: d -> OneOf18 a b c d e f g h i j k l m n o p q r FiveOf18 :: e -> OneOf18 a b c d e f g h i j k l m n o p q r SixOf18 :: f -> OneOf18 a b c d e f g h i j k l m n o p q r SevenOf18 :: g -> OneOf18 a b c d e f g h i j k l m n o p q r EightOf18 :: h -> OneOf18 a b c d e f g h i j k l m n o p q r NineOf18 :: i -> OneOf18 a b c d e f g h i j k l m n o p q r TenOf18 :: j -> OneOf18 a b c d e f g h i j k l m n o p q r ElevenOf18 :: k -> OneOf18 a b c d e f g h i j k l m n o p q r TwelveOf18 :: l -> OneOf18 a b c d e f g h i j k l m n o p q r ThirteenOf18 :: m -> OneOf18 a b c d e f g h i j k l m n o p q r FourteenOf18 :: n -> OneOf18 a b c d e f g h i j k l m n o p q r FifteenOf18 :: o -> OneOf18 a b c d e f g h i j k l m n o p q r SixteenOf18 :: p -> OneOf18 a b c d e f g h i j k l m n o p q r SeventeenOf18 :: q -> OneOf18 a b c d e f g h i j k l m n o p q r EighteenOf18 :: r -> OneOf18 a b c d e f g h i j k l m n o p q r data OneOf19 a b c d e f g h i j k l m n o p q r s OneOf19 :: a -> OneOf19 a b c d e f g h i j k l m n o p q r s TwoOf19 :: b -> OneOf19 a b c d e f g h i j k l m n o p q r s ThreeOf19 :: c -> OneOf19 a b c d e f g h i j k l m n o p q r s FourOf19 :: d -> OneOf19 a b c d e f g h i j k l m n o p q r s FiveOf19 :: e -> OneOf19 a b c d e f g h i j k l m n o p q r s SixOf19 :: f -> OneOf19 a b c d e f g h i j k l m n o p q r s SevenOf19 :: g -> OneOf19 a b c d e f g h i j k l m n o p q r s EightOf19 :: h -> OneOf19 a b c d e f g h i j k l m n o p q r s NineOf19 :: i -> OneOf19 a b c d e f g h i j k l m n o p q r s TenOf19 :: j -> OneOf19 a b c d e f g h i j k l m n o p q r s ElevenOf19 :: k -> OneOf19 a b c d e f g h i j k l m n o p q r s TwelveOf19 :: l -> OneOf19 a b c d e f g h i j k l m n o p q r s ThirteenOf19 :: m -> OneOf19 a b c d e f g h i j k l m n o p q r s FourteenOf19 :: n -> OneOf19 a b c d e f g h i j k l m n o p q r s FifteenOf19 :: o -> OneOf19 a b c d e f g h i j k l m n o p q r s SixteenOf19 :: p -> OneOf19 a b c d e f g h i j k l m n o p q r s SeventeenOf19 :: q -> OneOf19 a b c d e f g h i j k l m n o p q r s EighteenOf19 :: r -> OneOf19 a b c d e f g h i j k l m n o p q r s NineteenOf19 :: s -> OneOf19 a b c d e f g h i j k l m n o p q r s data OneOf20 a b c d e f g h i j k l m n o p q r s t OneOf20 :: a -> OneOf20 a b c d e f g h i j k l m n o p q r s t TwoOf20 :: b -> OneOf20 a b c d e f g h i j k l m n o p q r s t ThreeOf20 :: c -> OneOf20 a b c d e f g h i j k l m n o p q r s t FourOf20 :: d -> OneOf20 a b c d e f g h i j k l m n o p q r s t FiveOf20 :: e -> OneOf20 a b c d e f g h i j k l m n o p q r s t SixOf20 :: f -> OneOf20 a b c d e f g h i j k l m n o p q r s t SevenOf20 :: g -> OneOf20 a b c d e f g h i j k l m n o p q r s t EightOf20 :: h -> OneOf20 a b c d e f g h i j k l m n o p q r s t NineOf20 :: i -> OneOf20 a b c d e f g h i j k l m n o p q r s t TenOf20 :: j -> OneOf20 a b c d e f g h i j k l m n o p q r s t ElevenOf20 :: k -> OneOf20 a b c d e f g h i j k l m n o p q r s t TwelveOf20 :: l -> OneOf20 a b c d e f g h i j k l m n o p q r s t ThirteenOf20 :: m -> OneOf20 a b c d e f g h i j k l m n o p q r s t FourteenOf20 :: n -> OneOf20 a b c d e f g h i j k l m n o p q r s t FifteenOf20 :: o -> OneOf20 a b c d e f g h i j k l m n o p q r s t SixteenOf20 :: p -> OneOf20 a b c d e f g h i j k l m n o p q r s t SeventeenOf20 :: q -> OneOf20 a b c d e f g h i j k l m n o p q r s t EighteenOf20 :: r -> OneOf20 a b c d e f g h i j k l m n o p q r s t NineteenOf20 :: s -> OneOf20 a b c d e f g h i j k l m n o p q r s t TwentyOf20 :: t -> OneOf20 a b c d e f g h i j k l m n o p q r s t instance (Eq a, Eq b) => Eq (OneOf2 a b) instance (Show a, Show b) => Show (OneOf2 a b) instance (Eq a, Eq b, Eq c) => Eq (OneOf3 a b c) instance (Show a, Show b, Show c) => Show (OneOf3 a b c) instance (Eq a, Eq b, Eq c, Eq d) => Eq (OneOf4 a b c d) instance (Show a, Show b, Show c, Show d) => Show (OneOf4 a b c d) instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (OneOf5 a b c d e) instance (Show a, Show b, Show c, Show d, Show e) => Show (OneOf5 a b c d e) instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) => Eq (OneOf6 a b c d e f) instance (Show a, Show b, Show c, Show d, Show e, Show f) => Show (OneOf6 a b c d e f) instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g) => Eq (OneOf7 a b c d e f g) instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g) => Show (OneOf7 a b c d e f g) instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h) => Eq (OneOf8 a b c d e f g h) instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h) => Show (OneOf8 a b c d e f g h) instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i) => Eq (OneOf9 a b c d e f g h i) instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i) => Show (OneOf9 a b c d e f g h i) instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j) => Eq (OneOf10 a b c d e f g h i j) instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j) => Show (OneOf10 a b c d e f g h i j) instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k) => Eq (OneOf11 a b c d e f g h i j k) instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k) => Show (OneOf11 a b c d e f g h i j k) instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l) => Eq (OneOf12 a b c d e f g h i j k l) instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l) => Show (OneOf12 a b c d e f g h i j k l) instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m) => Eq (OneOf13 a b c d e f g h i j k l m) instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m) => Show (OneOf13 a b c d e f g h i j k l m) instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n) => Eq (OneOf14 a b c d e f g h i j k l m n) instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n) => Show (OneOf14 a b c d e f g h i j k l m n) instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o) => Eq (OneOf15 a b c d e f g h i j k l m n o) instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o) => Show (OneOf15 a b c d e f g h i j k l m n o) instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o, Eq p) => Eq (OneOf16 a b c d e f g h i j k l m n o p) instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o, Show p) => Show (OneOf16 a b c d e f g h i j k l m n o p) instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o, Eq p, Eq q) => Eq (OneOf17 a b c d e f g h i j k l m n o p q) instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o, Show p, Show q) => Show (OneOf17 a b c d e f g h i j k l m n o p q) instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o, Eq p, Eq q, Eq r) => Eq (OneOf18 a b c d e f g h i j k l m n o p q r) instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o, Show p, Show q, Show r) => Show (OneOf18 a b c d e f g h i j k l m n o p q r) instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o, Eq p, Eq q, Eq r, Eq s) => Eq (OneOf19 a b c d e f g h i j k l m n o p q r s) instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o, Show p, Show q, Show r, Show s) => Show (OneOf19 a b c d e f g h i j k l m n o p q r s) instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o, Eq p, Eq q, Eq r, Eq s, Eq t) => Eq (OneOf20 a b c d e f g h i j k l m n o p q r s t) instance (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o, Show p, Show q, Show r, Show s, Show t) => Show (OneOf20 a b c d e f g h i j k l m n o p q r s t) instance (XmlContent a, XmlContent b, XmlContent c, XmlContent d, XmlContent e, XmlContent f, XmlContent g, XmlContent h, XmlContent i, XmlContent j, XmlContent k, XmlContent l, XmlContent m, XmlContent n, XmlContent o, XmlContent p, XmlContent q, XmlContent r, XmlContent s, XmlContent t) => XmlContent (OneOf20 a b c d e f g h i j k l m n o p q r s t) instance (XmlContent a, XmlContent b, XmlContent c, XmlContent d, XmlContent e, XmlContent f, XmlContent g, XmlContent h, XmlContent i, XmlContent j, XmlContent k, XmlContent l, XmlContent m, XmlContent n, XmlContent o, XmlContent p, XmlContent q, XmlContent r, XmlContent s) => XmlContent (OneOf19 a b c d e f g h i j k l m n o p q r s) instance (XmlContent a, XmlContent b, XmlContent c, XmlContent d, XmlContent e, XmlContent f, XmlContent g, XmlContent h, XmlContent i, XmlContent j, XmlContent k, XmlContent l, XmlContent m, XmlContent n, XmlContent o, XmlContent p, XmlContent q, XmlContent r) => XmlContent (OneOf18 a b c d e f g h i j k l m n o p q r) instance (XmlContent a, XmlContent b, XmlContent c, XmlContent d, XmlContent e, XmlContent f, XmlContent g, XmlContent h, XmlContent i, XmlContent j, XmlContent k, XmlContent l, XmlContent m, XmlContent n, XmlContent o, XmlContent p, XmlContent q) => XmlContent (OneOf17 a b c d e f g h i j k l m n o p q) instance (XmlContent a, XmlContent b, XmlContent c, XmlContent d, XmlContent e, XmlContent f, XmlContent g, XmlContent h, XmlContent i, XmlContent j, XmlContent k, XmlContent l, XmlContent m, XmlContent n, XmlContent o, XmlContent p) => XmlContent (OneOf16 a b c d e f g h i j k l m n o p) instance (XmlContent a, XmlContent b, XmlContent c, XmlContent d, XmlContent e, XmlContent f, XmlContent g, XmlContent h, XmlContent i, XmlContent j, XmlContent k, XmlContent l, XmlContent m, XmlContent n, XmlContent o) => XmlContent (OneOf15 a b c d e f g h i j k l m n o) instance (XmlContent a, XmlContent b, XmlContent c, XmlContent d, XmlContent e, XmlContent f, XmlContent g, XmlContent h, XmlContent i, XmlContent j, XmlContent k, XmlContent l, XmlContent m, XmlContent n) => XmlContent (OneOf14 a b c d e f g h i j k l m n) instance (XmlContent a, XmlContent b, XmlContent c, XmlContent d, XmlContent e, XmlContent f, XmlContent g, XmlContent h, XmlContent i, XmlContent j, XmlContent k, XmlContent l, XmlContent m) => XmlContent (OneOf13 a b c d e f g h i j k l m) instance (XmlContent a, XmlContent b, XmlContent c, XmlContent d, XmlContent e, XmlContent f, XmlContent g, XmlContent h, XmlContent i, XmlContent j, XmlContent k, XmlContent l) => XmlContent (OneOf12 a b c d e f g h i j k l) instance (XmlContent a, XmlContent b, XmlContent c, XmlContent d, XmlContent e, XmlContent f, XmlContent g, XmlContent h, XmlContent i, XmlContent j, XmlContent k) => XmlContent (OneOf11 a b c d e f g h i j k) instance (XmlContent a, XmlContent b, XmlContent c, XmlContent d, XmlContent e, XmlContent f, XmlContent g, XmlContent h, XmlContent i, XmlContent j) => XmlContent (OneOf10 a b c d e f g h i j) instance (XmlContent a, XmlContent b, XmlContent c, XmlContent d, XmlContent e, XmlContent f, XmlContent g, XmlContent h, XmlContent i) => XmlContent (OneOf9 a b c d e f g h i) instance (XmlContent a, XmlContent b, XmlContent c, XmlContent d, XmlContent e, XmlContent f, XmlContent g, XmlContent h) => XmlContent (OneOf8 a b c d e f g h) instance (XmlContent a, XmlContent b, XmlContent c, XmlContent d, XmlContent e, XmlContent f, XmlContent g) => XmlContent (OneOf7 a b c d e f g) instance (XmlContent a, XmlContent b, XmlContent c, XmlContent d, XmlContent e, XmlContent f) => XmlContent (OneOf6 a b c d e f) instance (XmlContent a, XmlContent b, XmlContent c, XmlContent d, XmlContent e) => XmlContent (OneOf5 a b c d e) instance (XmlContent a, XmlContent b, XmlContent c, XmlContent d) => XmlContent (OneOf4 a b c d) instance (XmlContent a, XmlContent b, XmlContent c) => XmlContent (OneOf3 a b c) instance (XmlContent a, XmlContent b) => XmlContent (OneOf2 a b) -- | This is a parser for HTML documents. Unlike for XML documents, it must -- include a certain amount of error-correction to account for HTML -- features like self-terminating tags, unterminated tags, and incorrect -- nesting. The input is tokenised by the XML lexer (a separate lexer is -- not required for HTML). module Text.XML.HaXml.Html.Parse -- | The first argument is the name of the file, the second is the string -- contents of the file. The result is the generic representation of an -- XML document. htmlParse :: String -> String -> Document module Text.XML.HaXml.Wrappers -- | This useful auxiliary checks the commandline arguments for two -- filenames, the input and output file respectively. If either is -- missing, it is replaced by -, which can be interpreted by the -- caller as stdin and/or stdout. fix2Args :: IO (String, String) -- | The wrapper processXmlWith returns an IO () computation that -- collects the filenames (or stdin/stdout) to use when reading/writing -- XML documents. Its CFilter argument is applied to transform the XML -- document from the input and write it to the output. No DTD is attached -- to the output. -- -- If the input filename ends with .html or .htm, it is parsed using the -- error-correcting HTML parser rather than the strict XML parser. processXmlWith :: CFilter -> IO () -- | This is just a convenient way of bunching the XML combinators together -- with some other things you are likely to want at the same time. module Text.XML.HaXml -- | Renders the document as a string using the default style. render :: Doc -> String -- | The version of the library (currently 1.13.2). version :: String -- | A parser for the Xtract command-language. (The string input is -- tokenised internally by the lexer lexXtract.) See -- http://www.haskell.org/HaXml/Xtract.html for the grammar that -- is accepted. module Text.XML.HaXml.Xtract.Parse -- | The cool thing is that the Xtract command parser directly builds a -- higher-order DFilter (see -- Text.Xml.HaXml.Xtract.Combinators) which can be applied to an -- XML document without further ado. parseXtract :: String -> DFilter -- | To mix an Xtract query into an ordinary HaXml combinator expression. xtract :: String -> CFilter