HORIZON HASKELLDocslts/ghc-10.0.x2b276322026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

Modulexhtml-3000.4.1.0Haskell2010

Text.XHtml.Strict

Produces XHTML 1.0 Strict.

Contents
  1. Data types
  2. Classes
  3. Primitives and basic combinators
  4. Rendering
Synopsis
  • Packagexhtml-3000.4.1.0
  • Exports178
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceStrict.hs

Data types

newtypenewtype Html
#
Instances7Show, Semigroup, Monoid, ADDATTRS, CHANGEATTRS, HTML, …
  • Show HtmlDefined in xhtml-3000.4.1.0 · Text.XHtml.Internals
  • Semigroup HtmlDefined in xhtml-3000.4.1.0 · Text.XHtml.Internals
  • Monoid HtmlDefined in xhtml-3000.4.1.0 · Text.XHtml.Internals
  • ADDATTRS HtmlDefined in xhtml-3000.4.1.0 · Text.XHtml.Internals
  • CHANGEATTRS HtmlDefined in xhtml-3000.4.1.0 · Text.XHtml.Internals
  • HTML HtmlDefined in xhtml-3000.4.1.0 · Text.XHtml.Internals
  • HTMLTABLE HtmlDefined in xhtml-3000.4.1.0 · Text.XHtml.Table
datadata HtmlAttr

Attributes with name and value.

Instances1Show
  • Show HtmlAttrDefined in xhtml-3000.4.1.0 · Text.XHtml.Internals

Classes

classclass HTML a where

HTML is the class of things that can be validly put inside an HTML tag. So this can be one or more Html elements, or a String, for example.

Methods

Instances11HTML, …
  • HTML ByteStringDefined in xhtml-3000.4.1.0 · Text.XHtml.Internals
  • HTML ByteStringDefined in xhtml-3000.4.1.0 · Text.XHtml.Internals
  • HTML CharDefined in xhtml-3000.4.1.0 · Text.XHtml.Internals
  • HTML TextDefined in xhtml-3000.4.1.0 · Text.XHtml.Internals
  • HTML TextDefined in xhtml-3000.4.1.0 · Text.XHtml.Internals
  • HTML HtmlTreeDefined in xhtml-3000.4.1.0 · Text.XHtml.Debug
  • HTML HotLinkDefined in xhtml-3000.4.1.0 · Text.XHtml.Extras
  • HTML HtmlDefined in xhtml-3000.4.1.0 · Text.XHtml.Internals
  • HTML HtmlTableDefined in xhtml-3000.4.1.0 · Text.XHtml.Table
  • HTML a => HTML (Maybe a)Defined in xhtml-3000.4.1.0 · Text.XHtml.Internals
  • HTML a => HTML [a]Defined in xhtml-3000.4.1.0 · Text.XHtml.Internals

Primitives and basic combinators

value(<<)
  1. :: HTML a
  2. => (Html -> b)

    Parent

  3. -> a

    Child

  4. -> b

Put something inside an HTML element.

value(+++) :: (HTML a, HTML b) => a -> b -> Html

Create a piece of HTML which is the concatenation of two things which can be made into HTML.

valueisNoHtml :: Html -> Bool

Checks whether the given piece of HTML is empty. This materializes the list, so it's not great to do this a bunch.

valueprimHtml :: String -> Html

This is not processed for special chars. use stringToHtml or lineToHtml instead, for user strings, because they understand special chars, like <.

Rendering

valueshowHtml :: HTML html => html -> Builder

Output the HTML without adding newlines or spaces within the markup. This should be the most time and space efficient way to render HTML, though the output is quite unreadable.

valuerenderHtmlWithLanguage
  1. :: HTML html
  2. => Text

    The code of the "dominant" language of the webpage.

  3. -> html

    All the Html, including a header.

  4. -> Builder

Outputs indented XHTML. Because space matters in HTML, the output is quite messy.

valueprettyHtml :: HTML html => html -> String

Outputs indented HTML, with indentation inside elements. This can change the meaning of the HTML document, and is mostly useful for debugging the HTML output. The implementation is inefficient, and you are normally better off using showHtml or renderHtml.

valueshowHtmlFragment :: HTML html => html -> Builder

Render a piece of HTML without adding a DOCTYPE declaration or root element. Does not add any extra whitespace.

valuerenderHtmlFragment :: HTML html => html -> Builder

Render a piece of indented HTML without adding a DOCTYPE declaration or root element. Only adds whitespace where it does not change the meaning of the document.

valueprettyHtmlFragment :: HTML html => html -> String

Render a piece of indented HTML without adding a DOCTYPE declaration or a root element. The indentation is done inside elements. This can change the meaning of the HTML document, and is mostly useful for debugging the HTML output. The implementation is inefficient, and you are normally better off using showHtmlFragment or renderHtmlFragment.

valuelinesToHtml :: [String] -> Html

This converts a string, but keeps spaces as non-line-breakable, and adds line breaks between each of the strings in the input list.

valuemenu :: Text -> [Html] -> Html
#

Deprecated. menu generates strange XHTML, and is not flexible enough. Roll your own that suits your needs.