We provide a type class for tag and attribute names. Instances can be names that preserve case, names with lowercase letters as canonical representation. To do: Qualified names.
- class C name where
- fromString :: String -> name
- toString :: name -> String
- class Tag ident where
- tagFromString :: String -> ident
- tagToString :: ident -> String
- class Attribute ident where
- attributeFromString :: String -> ident
- attributeToString :: ident -> String
- match :: (C name, Eq name) => String -> name -> Bool
- matchAny :: (C name, Eq name) => [String] -> name -> Bool
types and classes
We need to distinguish between tag names and attribute names, because DOCTYPE as tag name must be written upper case, whereas as attribute name it may be written either way.
tagFromString :: String -> identSource
tagToString :: ident -> StringSource
class Attribute ident whereSource
attributeFromString :: String -> identSource
attributeToString :: ident -> StringSource