Safe Haskell | Safe |
---|---|
Language | Haskell98 |
- data T name string
- newtype Name ident :: * -> * = Name ident
- mapName :: (Name name0 -> Name name1) -> (Name name0 -> Name name1) -> T name0 string -> T name1 string
- open :: Name name -> [T name string] -> T name string
- isOpen :: T name string -> Bool
- maybeOpen :: T name string -> Maybe (Name name, [T name string])
- close :: Name name -> T name string
- isClose :: T name string -> Bool
- maybeClose :: T name string -> Maybe (Name name)
- text :: string -> T name string
- isText :: T name string -> Bool
- maybeText :: T name string -> Maybe string
- innerText :: Monoid string => [T name string] -> string
- comment :: String -> T name string
- isComment :: T name string -> Bool
- maybeComment :: T name string -> Maybe String
- special :: Name name -> String -> T name string
- isSpecial :: T name string -> Bool
- maybeSpecial :: T name string -> Maybe (Name name, String)
- cdata :: Tag name => String -> T name string
- isCData :: Tag name => T name string -> Bool
- maybeCData :: Tag name => T name string -> Maybe String
- processing :: Name name -> T name string -> T name string
- isProcessing :: T name string -> Bool
- maybeProcessing :: T name string -> Maybe (Name name, T name string)
- warning :: String -> T name string
- isWarning :: T name string -> Bool
- maybeWarning :: T name string -> Maybe String
- formatOpen :: (Tag name, Attribute name, C string) => Bool -> Name name -> [T name string] -> ShowS
- formatClose :: Tag name => Name name -> ShowS
- textFromCData :: (Tag name, C char) => T name [char] -> T name [char]
- concatTexts :: Monoid string => [T name string] -> [T name string]
- mapText :: Tag name => (String -> String) -> T name String -> T name String
- mapTextA :: (Tag name, Applicative f) => (String -> f String) -> T name String -> f (T name String)
Documentation
An HTML element, a document is [T]
.
There is no requirement for Open
and Close
to match.
The type parameter string
lets you choose between
[Char]
for interpreted HTML entity references and
[HTMLChar.T]
for uninterpreted HTML entities.
You will most oftenly want plain Char
,
since HTMLChar.T
is only necessary if you want to know,
whether a non-ASCII character was encoded as HTML entity
or as non-ASCII Unicode character.
Open (Name name) [T name string] | An open tag with |
Close (Name name) | A closing tag |
Text string | A text node, guaranteed not to be the empty string |
Comment String | A comment |
Special (Name name) String | A tag like |
Processing (Name name) (T name string) | A tag like |
Warning String | Mark a syntax error in the input file |
Functor (T name) Source # | |
Foldable (T name) Source # | |
Traversable (T name) Source # | |
(Eq string, Eq name) => Eq (T name string) Source # | |
(Ord string, Ord name) => Ord (T name string) Source # | |
(Show string, Show name, Attribute name) => Show (T name string) Source # | |
(Tag name, Attribute name, C string) => C (T name string) Source # | |
mapName :: (Name name0 -> Name name1) -> (Name name0 -> Name name1) -> T name0 string -> T name1 string Source #
innerText :: Monoid string => [T name string] -> string Source #
Extract all text content from tags (similar to Verbatim found in HaXml)
isProcessing :: T name string -> Bool Source #
formatOpen :: (Tag name, Attribute name, C string) => Bool -> Name name -> [T name string] -> ShowS Source #
textFromCData :: (Tag name, C char) => T name [char] -> T name [char] Source #
Replace CDATA sections by plain text.
concatTexts :: Monoid string => [T name string] -> [T name string] Source #
Merge adjacent Text sections.