Copyright | (c) Jonathan Merritt 2017 |
---|---|
License | BSD3 |
Maintainer | j.s.merritt@gmail.com |
Stability | Experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
- class GFromElem e n a t z
- genericFromElem :: (Generic z, GFromElem e n a t (Rep z), Eq n) => OptionsElement n a -> Decompose e n a t d -> e -> Result e n a t z
Documentation
class GFromElem e n a t z Source #
Class for generically converting an element to a type.
gFromElem
GFromElem e n a t U1 Source # | U1 - no-argument constructor. |
FromElem e n a t z => GFromElem e n a t (S1 q (Rec0 [z])) Source # | S1 (named or unnamed) + List - record selector for a list of |
FromElem e n a t z => GFromElem e n a t (S1 q (Rec0 (Maybe z))) Source # | S1 (named or unnamed) + Maybe - record selector for an optional |
FromElem e n a t z => GFromElem e n a t (S1 q (Rec0 z)) Source # | S1 (named or unnamed) - record selector for a |
FromXText t z => GFromElem e n a t (S1 q (Rec0 (CData [z]))) Source # | S1 (named or unnamed) + [CData] - record selector for a list of CDATA child nodes. |
FromXText t z => GFromElem 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. |
FromXText t z => GFromElem e n a t (S1 q (Rec0 (CData z))) Source # | S1 (named or unnamed) + CData - record selector for a CDATA child node. |
FromXText t z => GFromElem e n a t (S1 q (Rec0 (Content (Maybe z)))) Source # | S1 (named or unnamed) + Content Maybe - record selector for an optional content child. |
FromXText t z => GFromElem e n a t (S1 q (Rec0 (Content z))) Source # | S1 (named or unnamed) + Content - record selector for a content child. |
(KnownSymbol name, FromXText t z) => GFromElem 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 child elements with text content. |
(KnownSymbol name, FromXText t z) => GFromElem e n a t (S1 (MetaSel (Just Symbol name) g h i) (Rec0 (Child (Maybe z)))) Source # | S1 (named) + Child Maybe - record selector for a simple optional child element with text content. |
(KnownSymbol name, FromXText t z) => GFromElem 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 content. |
(KnownSymbol name, FromXText t z) => GFromElem e n a t (S1 (MetaSel (Just Symbol name) g h i) (Rec0 (Attr (Maybe z)))) Source # | S1 (named) + Attr Maybe - record selector for an optional XML attribute. |
(KnownSymbol name, FromXText t z) => GFromElem 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. |
(GFromElem e n a t z1, GFromElem e n a t z2) => GFromElem e n a t ((:+:) z1 z2) Source # | Sum type (ie. multiple constructors). |
(GFromElem e n a t z1, GFromElem e n a t z2) => GFromElem e n a t ((:*:) z1 z2) Source # | Product type (ie. multiple fields). |
(KnownSymbol name, Eq n, GFromElem e n a t z) => GFromElem e n a t (C1 (MetaCons name q w) z) Source # | C1 - constructor. |
(Generic z, GSingleConstructorName (Rep z), KnownSymbol name, FromElem e n a t z) => GFromElem e n a t (D1 (MetaData g h i True) (C1 (MetaCons name q w) (S1 s (Rec0 z)))) Source # | Newtype. A newtype should appear the same as the type it wraps, but the name of the element is expected to be different. To read a newtype, there are some shenanigans involved: 1. Check that the actual element name matches the newtype's constructor. 2. Rename the element to the original, wrapped type. The original type must have ONLY ONE constructor, otherwise we wouldn't know what the element should be renamed to. 3. Read in the original element and wrap it in the newtype constructor. |
GFromElem e n a t z => GFromElem e n a t (D1 (MetaData g h i False) z) Source # | D1 - Datatype (non-newtype). |