Copyright | (c) Jonathan Merritt 2017 |
---|---|
License | BSD3 |
Maintainer | j.s.merritt@gmail.com |
Stability | Experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
- class GToElem e n a t z
- genericToElem :: (Generic z, GToElem e n a t (Rep z)) => OptionsElement n a -> Compose e n a t c -> z -> e
Documentation
class GToElem e n a t z Source #
Class for generically converting a type to an element.
gToElem
GToElem e n a t U1 Source # | U1 - no-argument constructor. |
ToElem e z => GToElem e n a t (S1 q (Rec0 [z])) Source # | S1 (named or unnamed) + [z] - record selector for a list of ToElem child nodes. |
ToElem e z => GToElem e n a t (S1 q (Rec0 (Maybe z))) Source # | S1 (named or unnamed) + Maybe z - record selector for a ToElem child. |
ToElem e z => GToElem e n a t (S1 q (Rec0 z)) Source # | S1 (named or unnamed) - record selector for a ToElem child. |
ToXText t z => GToElem e n a t (S1 q (Rec0 (CData [z]))) Source # | S1 (named or unnamed) + [CData] - record selector for a list of CDATA child nodes. |
ToXText t z => GToElem e n a t (S1 q (Rec0 (CData (Maybe z)))) Source # | S1 (named or unnamed) + CData Maybe - record selector for an optional CDATA child node. |
ToXText t z => GToElem e n a t (S1 q (Rec0 (CData z))) Source # | S1 (named or unnamed) + CData - record selector for a CDATA child node. |
ToXText t z => GToElem e n a t (S1 q (Rec0 (Content (Maybe z)))) Source # | S1 (named or unnamed) + Content Maybe - record selector for an optional content node. |
ToXText t z => GToElem e n a t (S1 q (Rec0 (Content z))) Source # | S1 (named or unnamed) + Content - record selector for a content node. |
(KnownSymbol name, ToXText t z) => GToElem e n a t (S1 (MetaSel (Just Symbol name) g h i) (Rec0 (Child [z]))) Source # | S1 (named) + [Child] - record selector for a list of simple child elements with text. |
(KnownSymbol name, ToXText t z) => GToElem e n a t (S1 (MetaSel (Just Symbol name) g h i) (Rec0 (Child (Maybe z)))) Source # | S1 (named) + Child Maybe - record selector for an optional simple child element with text. |
(KnownSymbol name, ToXText t z) => GToElem e n a t (S1 (MetaSel (Just Symbol name) g h i) (Rec0 (Child z))) Source # | S1 (named) + Child - record selector for a simple child element with text. |
(KnownSymbol name, ToXText t z) => GToElem e n a t (S1 (MetaSel (Just Symbol name) g h i) (Rec0 (Attr (Maybe z)))) Source # | S1 (named) + Attr Maybe - record selector for optional XML attribute. |
(KnownSymbol name, ToXText t z) => GToElem e n a t (S1 (MetaSel (Just Symbol name) g h i) (Rec0 (Attr z))) Source # | S1 (named) + Attr - record selector for an XML attribute. |
(GToElem e n a t z1, GToElem e n a t z2) => GToElem e n a t ((:+:) z1 z2) Source # | Sum type (ie. multiple constructors). |
(GToElem e n a t z1, GToElem e n a t z2) => GToElem e n a t ((:*:) z1 z2) Source # | Product type (ie. multiple fields). |
(KnownSymbol name, GToElem e n a t z) => GToElem e n a t (C1 (MetaCons name q w) z) Source # | C1 - constructor. The name of the element is obtained from the constructor name. |
(KnownSymbol name, ToElem e z) => GToElem e n a t (D1 (MetaData g h i True) (C1 (MetaCons name q w) (S1 s (Rec0 z)))) Source # | Newtype. A newtype should be processed in the same way as the type it wraps, but the name of the element must be changed at the end. |
GToElem e n a t z => GToElem e n a t (D1 (MetaData g h i False) z) Source # | D1 - Datatype (non-newtype). When we encounter a Datatype, just proceed directly to processing its contents, without any additional handling. |
genericToElem :: (Generic z, GToElem e n a t (Rep z)) => OptionsElement n a -> Compose e n a t c -> z -> e Source #
Generic producer for a ToElem
instance.