Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Synopsis
- 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 |
Instances
Functor (T name) Source # | |
Foldable (T name) Source # | |
Defined in Text.HTML.Tagchup.Tag fold :: Monoid m => T name m -> m # foldMap :: Monoid m => (a -> m) -> T name a -> m # foldr :: (a -> b -> b) -> b -> T name a -> b # foldr' :: (a -> b -> b) -> b -> T name a -> b # foldl :: (b -> a -> b) -> b -> T name a -> b # foldl' :: (b -> a -> b) -> b -> T name a -> b # foldr1 :: (a -> a -> a) -> T name a -> a # foldl1 :: (a -> a -> a) -> T name a -> a # elem :: Eq a => a -> T name a -> Bool # maximum :: Ord a => T name a -> a # minimum :: Ord a => T name a -> a # | |
Traversable (T name) Source # | |
(Eq name, Eq string) => Eq (T name string) Source # | |
(Ord name, Ord string) => Ord (T name string) Source # | |
Defined in Text.HTML.Tagchup.Tag compare :: T name string -> T name string -> Ordering # (<) :: T name string -> T name string -> Bool # (<=) :: T name string -> T name string -> Bool # (>) :: T name string -> T name string -> Bool # (>=) :: T name string -> T name string -> Bool # | |
(Attribute name, Show name, Show string) => Show (T name string) Source # | |
(Tag name, Attribute name, C string) => C (T name string) Source # | |
Defined in Text.HTML.Tagchup.Tag |
Name ident |
Instances
Eq ident => Eq (Name ident) | |
Ord ident => Ord (Name ident) | |
Show ident => Show (Name ident) | |
Tag ident => C (Name ident) | |
Defined in Text.XML.Basic.Tag |
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.