| Copyright | (c) 2014 Alp Mestanogullari |
|---|---|
| License | BSD3 |
| Maintainer | alpmestan@gmail.com |
| Stability | experimental |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Text.Taggy.Types
Description
Core types of taggy.
- data Tag
- tname :: Tag -> Text
- isTagOpen :: Tag -> Bool
- isTagClose :: Tag -> Bool
- isTagText :: Tag -> Bool
- isTagComment :: Tag -> Bool
- isTagScript :: Tag -> Bool
- isTagStyle :: Tag -> Bool
- tagsNamed :: Text -> [Tag] -> [Tag]
- data Attribute = Attribute !Text !Text
- attrs :: Tag -> [Attribute]
- attrKey :: Attribute -> Text
- attrValue :: Attribute -> Text
- data L a
- emptyL :: L a
- appL :: L a -> L a -> L a
- insertL :: a -> L a -> L a
- singletonL :: a -> L a
- toListL :: L a -> [a]
Tag type
A Tag can be one of the following types of tags:
- an opening tag that has a name, a list of attributes, and whether it is a self-closing tag or not
- a closing tag with the name of the tag
- some raw
Text - an HTML comment tag
- a
script.../scripttag - a
style.../styletag
The latter two are useful to be considered separately in the parser and also lets you collect these bits quite easily.
isTagClose :: Tag -> Bool #
Is this Tag a closing tag?
isTagComment :: Tag -> Bool #
Is this Tag an HTML comment tag?
Attributes
An attribute is just an attribute name and an attribute value.
A small difference list implementation
singletonL :: a -> L a #