Modulehxt-9.3.1.22Haskell2010
Text.XML.HXT.Arrow.Pickle.Xml
Pickler functions for converting between user defined data types
and XmlTree data. Usefull for persistent storage and retreival
of arbitray data as XML documents.
This module is an adaptation of the pickler combinators
developed by Andrew Kennedy
( https://www.microsoft.com/en-us/research/wp-content/uploads/2004/01/picklercombinators.pdf )
The difference to Kennedys approach is that the target is not
a list of Chars but a list of XmlTrees. The basic picklers will
convert data into XML text nodes. New are the picklers for
creating elements and attributes.
One extension was neccessary: The unpickling may fail.
Old: Therefore the unpickler has a Maybe result type.
Failure is used to unpickle optional elements
(Maybe data) and lists of arbitray length.
Since hxt-9.2.0: The unpicklers are implemented as
a parser monad with an Either err val result type.
This enables appropriate error messages , when unpickling
XML stuff, that is not generated with the picklers and which contains
some elements and/or attributes that are not handled when unpickling.
There is an example program demonstrating the use
of the picklers for a none trivial data structure.
(see "examples/arrows/pickle" directory in the hxt distribution)