Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Defines an internal representation of Haskell data/newtype definitions
that correspond to the XML DTD types, and provides pretty-printers to
convert these types into the Doc
type of Text.PrettyPrint.HughesPJ.
Synopsis
- data TypeDef
- type Constructors = [(Name, [StructType])]
- type AttrFields = [(Name, StructType)]
- data StructType
- ppTypeDef :: TypeDef -> Doc
- ppHName :: Name -> Doc
- ppXName :: Name -> Doc
- ppAName :: Name -> Doc
- data Name = Name {}
- name :: String -> Name
- name_ :: String -> Name
- name_a :: String -> String -> Name
- name_ac :: String -> String -> String -> Name
- name_f :: String -> String -> Name
- mangle :: String -> String
- manglef :: String -> String
Internal representation of types
DataDef Bool Name AttrFields Constructors | Bool for main/aux. |
EnumDef Name [Name] |
type Constructors = [(Name, [StructType])] Source #
type AttrFields = [(Name, StructType)] Source #
data StructType Source #
Maybe StructType | |
Defaultable StructType String | String holds default value. |
List StructType | |
List1 StructType | Non-empty lists. |
Tuple [StructType] | |
OneOf [StructType] | |
Any | XML's contentspec allows ANY |
StringMixed | mixed (#PCDATA | ... )* |
String | string only (#PCDATA) |
Defined Name |
Instances
Eq StructType Source # | |
Defined in Text.XML.HaXml.DtdToHaskell.TypeDef (==) :: StructType -> StructType -> Bool # (/=) :: StructType -> StructType -> Bool # | |
Show StructType Source # | |
Defined in Text.XML.HaXml.DtdToHaskell.TypeDef showsPrec :: Int -> StructType -> ShowS # show :: StructType -> String # showList :: [StructType] -> ShowS # |
Pretty-print a TypeDef
Name mangling
Need to keep both the XML and Haskell versions of a name.
name_a :: String -> String -> Name Source #
Prefix an attribute enumeration type name with its containing element name.