-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Generate XML-isomorphic types
--   
--   TemplateHaskell generators for XML-isomorphic data types, including
--   instances for parsing and rendering. A convenient DSL to define those
--   types. This is similar to XSD but is Haskell-specific.
@package xml-isogen
@version 0.2.1


-- | Generate enumeration data types with prefixed constructors but
--   unprefixed <a>Show</a> and <a>Read</a> instances.
--   
--   <pre>
--   enumGenerate $ EnumDesc "Animal" ["Cat", "Dog", "Gopher"]
--   </pre>
--   
--   produces
--   
--   <pre>
--   data Animal = AnimalCat | AnimalDog | AnimalGopher
--   </pre>
--   
--   yet <a>Read</a> and <a>Show</a> parse and print regular values:
--   
--   <pre>
--   show AnimalDog == "Dog"
--   (read "Cat" :: Animal) == AnimalCat
--   </pre>
module Data.THGen.Enum
data Exhaustiveness
Exhaustive :: Exhaustiveness
NonExhaustive :: Exhaustiveness
data EnumDesc
EnumDesc :: Exhaustiveness -> String -> [String] -> EnumDesc
enumGenerate :: EnumDesc -> DecsQ
instance GHC.Show.Show Data.THGen.Enum.Exhaustiveness
instance GHC.Classes.Ord Data.THGen.Enum.Exhaustiveness
instance GHC.Classes.Eq Data.THGen.Enum.Exhaustiveness

module Text.XML.ParentAttributes
class ToXmlParentAttributes a
toXmlParentAttributes :: ToXmlParentAttributes a => a -> [(Name, Text)]
class ToXmlAttribute a
toXmlAttribute :: ToXmlAttribute a => a -> Text
toXmlAttributeIntegral :: Integral a => a -> Text
instance Text.XML.ParentAttributes.ToXmlAttribute Data.Text.Internal.Text
instance Text.XML.ParentAttributes.ToXmlAttribute GHC.Types.Int
instance Text.XML.ParentAttributes.ToXmlAttribute GHC.Types.Word
instance Text.XML.ParentAttributes.ToXmlAttribute GHC.Integer.Type.Integer
instance Text.XML.ParentAttributes.ToXmlAttribute GHC.Natural.Natural
instance Text.XML.ParentAttributes.ToXmlParentAttributes a


-- | Generate XML-isomorphic types from declarative descriptions.
--   
--   There are two kinds of XML-isomorphic types: enumerations and records.
--   Enumerations are simple enum-types generated via
--   <a>Data.THGen.Enum</a> plus a <tt>FromContent</tt> instance and a
--   <tt>ToXML</tt> instance which are derived from <a>Read</a> and
--   <a>Show</a>. Records are a bit more complicated: to define a record
--   you need to supply its name, a prefix for fields, and a list of field
--   descriptions. A field description contains the XML tag name and
--   repetition kind (mandatory, optional, repeated or multiplied).
--   
--   The repetition kind determines both the parsing strategy and the
--   wrapper around the field type:
--   
--   <ul>
--   <li><tt>a</tt> for mandatory fields</li>
--   <li><tt>Maybe a</tt> for optional fields</li>
--   <li><tt>[a]</tt> for repeated fields</li>
--   <li><tt>NonEmpty a</tt> for multiplied fields</li>
--   </ul>
--   
--   Example 1.
--   
--   <pre>
--   "Color" =:= enum
--     &amp; "R"
--     &amp; "G"
--     &amp; "B"
--   </pre>
--   
--   produces
--   
--   <pre>
--   data XmlColor
--     = XmlColorR
--     | XmlColorG
--     | XmlColorB
--     | UnknownXmlColor String
--   </pre>
--   
--   with a <tt>FromContent</tt> instance that expects the current element
--   content to be either <tt>R</tt>, <tt>G</tt> or <tt>B</tt>.
--   
--   Example 2.
--   
--   <pre>
--   "Message" =:= record
--     ! "author"
--     + "recipient"
--     ? "message" [t|Text|]
--     * "attachement"
--   </pre>
--   
--   produces
--   
--   <pre>
--   data Message = Message
--     { _mAuthor      :: Author
--     , _mRecipient   :: NonEmpty Recipient
--     , _mMessage     :: Maybe Text
--     , _mAttachement :: [Attachement]
--     } deriving (...)
--   </pre>
--   
--   with a corresponding <a>FromDom</a> instance. Lenses are generated
--   automatically as well.
--   
--   The examples above also demonstrate that to define the declarative
--   descriptions of data types we provide a terse and convenient EDSL.
--   
--   To define an enumeration, use the <a>enum</a> function followed by the
--   name of the data type to be generated. You can optionally specify if
--   the enumeration is exhaustive (contains only the listed constructors)
--   or non-exhaustive (also contains a constructor for unknown values;
--   this is the default):
--   
--   <pre>
--   "Enum1" Exhaustive =:= enum
--     ...
--   </pre>
--   
--   <pre>
--   "Enum2" NonExhaustive =:= enum
--     ...
--   </pre>
--   
--   To define a record, use the <a>record</a> function followed by the
--   name of the data type to be generated. The prefix for the record
--   fields is inferred automatically by taking all of the uppercase
--   letters in the name. You can override it manually like so:
--   
--   <pre>
--   "Reference" "ref" =:= record
--      ...
--   </pre>
--   
--   To describe a record field you must supply its name as it appears in
--   the XML tag, prefixed by its repetition kind:
--   
--   <ul>
--   <li><tt>!</tt> for mandatory fields</li>
--   <li><tt>?</tt> for optional fields</li>
--   <li><tt>*</tt> for repeated fields</li>
--   <li><tt>+</tt> for multiplied fields</li>
--   </ul>
--   
--   The type of the field is inferred automatically from its name, so if
--   the field is called <tt>"author"</tt> its type will be
--   <tt>Author</tt>. You can override the type by specifying it in
--   quasiquotes like so:
--   
--   <pre>
--   "Message" =:= record
--     ! "author" [t|Person|]
--     ...
--   </pre>
module Data.THGen.XML
data Exhaustiveness
Exhaustive :: Exhaustiveness
NonExhaustive :: Exhaustiveness
data PrefixName
PrefixName :: String -> String -> PrefixName
data ExhaustivenessName
ExhaustivenessName :: String -> Exhaustiveness -> ExhaustivenessName
record :: IsoXmlDescRecord
enum :: IsoXmlDescEnum
(!) :: IsoXmlDescRecord -> IsoXmlDescPreField -> IsoXmlDescRecord
infixl 2 !
(?) :: IsoXmlDescRecord -> IsoXmlDescPreField -> IsoXmlDescRecord
infixl 2 ?
(*) :: IsoXmlDescRecord -> IsoXmlDescPreField -> IsoXmlDescRecord
infixl 2 *
(+) :: IsoXmlDescRecord -> IsoXmlDescPreField -> IsoXmlDescRecord
infixl 2 +
(!%) :: IsoXmlDescRecord -> IsoXmlDescPreAttribute -> IsoXmlDescRecord
infixl 2 !%
(?%) :: IsoXmlDescRecord -> IsoXmlDescPreAttribute -> IsoXmlDescRecord
infixl 2 ?%
(&) :: IsoXmlDescEnum -> IsoXmlDescEnumCon -> IsoXmlDescEnum
infixl 2 &
(=:=) :: Description name desc => name -> desc -> DecsQ
infix 0 =:=

-- | A space efficient, packed, unboxed Unicode text type.
data Text :: *

-- | A fixed-precision integer type with at least the range <tt>[-2^29 ..
--   2^29-1]</tt>. The exact range for a given implementation can be
--   determined by using <a>minBound</a> and <a>maxBound</a> from the
--   <a>Bounded</a> class.
data Int :: *

-- | Invariant: <a>Jn#</a> and <a>Jp#</a> are used iff value doesn't fit in
--   <a>S#</a>
--   
--   Useful properties resulting from the invariants:
--   
--   <ul>
--   <li><pre>abs (<a>S#</a> _) &lt;= abs (<a>Jp#</a> _)</pre></li>
--   <li><pre>abs (<a>S#</a> _) &lt; abs (<a>Jn#</a> _)</pre></li>
--   </ul>
data Integer :: *
instance Data.THGen.XML.Description Data.THGen.XML.PrefixName Data.THGen.XML.IsoXmlDescRecord
instance Data.THGen.XML.Description Data.THGen.XML.ExhaustivenessName Data.THGen.XML.IsoXmlDescEnum
instance Data.String.IsString (Language.Haskell.TH.Lib.TypeQ -> Data.THGen.XML.IsoXmlDescPreField)
instance Data.String.IsString Data.THGen.XML.IsoXmlDescPreField
instance Data.String.IsString (Language.Haskell.TH.Lib.TypeQ -> Data.THGen.XML.IsoXmlDescPreAttribute)
instance Data.String.IsString Data.THGen.XML.IsoXmlDescPreAttribute
instance s ~ GHC.Base.String => Data.String.IsString (s -> Data.THGen.XML.PrefixName)
instance Data.String.IsString Data.THGen.XML.PrefixName
instance e ~ Data.THGen.Enum.Exhaustiveness => Data.String.IsString (e -> Data.THGen.XML.ExhaustivenessName)
instance Data.String.IsString Data.THGen.XML.ExhaustivenessName
instance Data.String.IsString Data.THGen.XML.IsoXmlDescEnumCon
