type Html = [HtmlItem] data HtmlItem = HtmlChars String | HtmlContext HtmlTag Html | HtmlCommand HtmlTag | HtmlGarbage HtmlBadTag instance Eq HtmlItem instance Show HtmlItem type HtmlTag = (TagName, TagAttrs) type TagAttrs = [(String, String)] type HtmlBadTag = (String, TagAttrs)
Html
is a data type for HTML documents.
An HTML document is a sequence of HTML items, represented by the type
HtmlItem
. An item is either
some plain text (the constructor HtmlChars
),
an elements with some contents (the constructor HtmlContext
), or
an empty element (the constructor HtmlCommand
).
Parsing and printing HTML: parseHtml, printHtml.
Constructing HTML: ctx, h1, img, etc.
Manipulation HTML: mapHtmlChars, et al.
Analysing HTML: extractTitle, htmlchars, et al.
The type Html
does not capture what a correct HTML document is.
HTML elements can be mixed in arbitrary ways.