| XtractLazy | Source code | Contents | Index
Text.XML.HaXml.TypeMapping
Contents
A class to get an explicit type representation for any value Explicit representation of Haskell datatype information Helper functions to extract type info as strings Conversion from Haskell datatype to DTD
Synopsis
class HTypeable a where
toHType :: a -> HType
data HType
= Maybe HType
| List HType
| Tuple [HType]
| Prim String String
| String
| Defined String [HType] [Constr]
data Constr = Constr String [HType] [HType]
showHType :: HType -> ShowS
showConstr :: Int -> HType -> String
toDTD :: HType -> DocTypeDecl
A class to get an explicit type representation for any value
class HTypeable a where | Source
`HTypeable` promises that we can create an explicit representation of of the type of any value.
Methods
toHType :: a -> HType | Source
Instances
HTypeable Bool
HTypeable Char
HTypeable Double
HTypeable Float
HTypeable Int
HTypeable Integer
HTypeable ()
HTypeable ANYContent
HTypeable a => HTypeable ([] a)
HTypeable a => HTypeable (Maybe a)
HTypeable a => HTypeable (List1 a)
(HTypeable a, HTypeable b) => HTypeable (Either a b)
(HTypeable a, HTypeable b) => HTypeable ((,) a b)
(HTypeable a, HTypeable b, HTypeable c) => HTypeable ((,,) a b c)
(HTypeable a, HTypeable b, HTypeable c, HTypeable d) => HTypeable ((,,,) a b c d)
(HTypeable a, HTypeable b, HTypeable c, HTypeable d, HTypeable e) => HTypeable ((,,,,) a b c d e)
(HTypeable a, HTypeable b, HTypeable c, HTypeable d, HTypeable e, HTypeable f) => HTypeable ((,,,,,) a b c d e f)
(HTypeable a, HTypeable b, HTypeable c, HTypeable d, HTypeable e, HTypeable f, HTypeable g) => HTypeable ((,,,,,,) a b c d e f g)
(HTypeable a, HTypeable b, HTypeable c, HTypeable d, HTypeable e, HTypeable f, HTypeable g, HTypeable h) => HTypeable ((,,,,,,,) a b c d e f g h)
(HTypeable a, HTypeable b, HTypeable c, HTypeable d, HTypeable e, HTypeable f, HTypeable g, HTypeable h, HTypeable i) => HTypeable ((,,,,,,,,) a b c d e f g h i)
(HTypeable a, HTypeable b, HTypeable c, HTypeable d, HTypeable e, HTypeable f, HTypeable g, HTypeable h, HTypeable i, HTypeable j) => HTypeable ((,,,,,,,,,) a b c d e f g h i j)
(HTypeable a, HTypeable b, HTypeable c, HTypeable d, HTypeable e, HTypeable f, HTypeable g, HTypeable h, HTypeable i, HTypeable j, HTypeable k) => HTypeable ((,,,,,,,,,,) a b c d e f g h i j k)
(HTypeable a, HTypeable b, HTypeable c, HTypeable d, HTypeable e, HTypeable f, HTypeable g, HTypeable h, HTypeable i, HTypeable j, HTypeable k, HTypeable l) => HTypeable ((,,,,,,,,,,,) a b c d e f g h i j k l)
(HTypeable a, HTypeable b, HTypeable c, HTypeable d, HTypeable e, HTypeable f, HTypeable g, HTypeable h, HTypeable i, HTypeable j, HTypeable k, HTypeable l, HTypeable m) => HTypeable ((,,,,,,,,,,,,) a b c d e f g h i j k l m)
(HTypeable a, HTypeable b, HTypeable c, HTypeable d, HTypeable e, HTypeable f, HTypeable g, HTypeable h, HTypeable i, HTypeable j, HTypeable k, HTypeable l, HTypeable m, HTypeable n) => HTypeable ((,,,,,,,,,,,,,) a b c d e f g h i j k l m n)
(HTypeable a, HTypeable b, HTypeable c, HTypeable d, HTypeable e, HTypeable f, HTypeable g, HTypeable h, HTypeable i, HTypeable j, HTypeable k, HTypeable l, HTypeable m, HTypeable n, HTypeable o) => HTypeable ((,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o)
Explicit representation of Haskell datatype information
data HType | Source
A concrete representation of any Haskell type.
Constructors
Maybe HType |
List HType |
Tuple [HType] |
Prim String String | separate Haskell name and XML name
String |
Defined String [HType] [Constr] | A user-defined type has a name, a sequence of type variables, and a set of constructors. (The variables might already be instantiated to actual types.)
Instances
Eq HType
Show HType
data Constr | Source
A concrete representation of any user-defined Haskell constructor. The constructor has a name, and a sequence of component types. The first sequence of types represents the minimum set of free type variables occurring in the (second) list of real component types. If there are fieldnames, they are contained in the final list, and correspond one-to-one with the component types.
Constructors
Constr String [HType] [HType] |
Instances
Eq Constr
Show Constr
Helper functions to extract type info as strings
showHType :: HType -> ShowS | Source
showConstr :: Int -> HType -> String | Source
Project the n'th constructor from an HType and convert it to a string suitable for an XML tagname.
Conversion from Haskell datatype to DTD
toDTD :: HType -> DocTypeDecl | Source
`toDTD` converts a concrete representation of the Haskell type of a value (obtained by the method `toHType`) into a real DocTypeDecl. It ensures that PERefs are defined before they are used, and that no element or attribute-list is declared more than once.
Produced by Haddock version 2.4.2