generic-xmlpickler- Generic generation of HXT XmlPickler instances using GHC Generics.

Safe HaskellNone




gxpickle :: forall a. (Generic a, GXmlPickler (Rep a), ConNames (Rep a)) => PU a Source

The generic pickler. Uses a tag for each constructor with the lower case constructor name, and a tag for each record field with the lower case field name. Most values are pickled using their own XmlPickler instance, and Strings are pickled as possibly empty text nodes.

class GXmlPickler f where Source

The generic XmlPickler class. This gives generic xml picklers for the functors from Regular. These are usually not used directly.


gxpicklef :: PU a -> PU (f a) Source

xpEither :: PU a -> PU b -> PU (Either a b) Source

Combine two picklers into a pickler for Either. While pickling, check if the either is a Left or Right and use the appropriate pickler. During unpickling, first try the first, and if it fails, try the second.