patch applied (packages/HaXml): new module ShowXmlLazy provided by Eric Webster

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Thu Aug 17 09:48:56 EDT 2006


Thu Aug 17 06:43:03 PDT 2006  Malcolm.Wallace at cs.york.ac.uk
  * new module ShowXmlLazy provided by Eric Webster
  Notes from Eric:
      I discovered that the implementation of showXml in the stable and
      development branch of HaXml doesn't work in a lazy manner and so was
      getting out-of-memory errors when processing large datasets.  Upon
      examining the HaXml code I discovered that the reason this is so, is
      somewhere in the Text.PrettyPrint.HughesPJ module rather then in
      HaXml.  I hacked together a showXmlLazy function which is identical
      to your own showXml but I reimplemented the PrettyPrint functions
      using only basic string operations.  The result is that I can now
      consume and convert to XML arbitrarily large datasets.  It is also a
      little faster than showXml but the output is horribly ugly (but
      still valid).
  
      I wonder if it would not be better to separate the serialization of
      Xml from the formatting of Xml in the library?  Maybe showXml could
      also take a formating function as input which defines rules for
      formating documents, elements, etc.  Or I suppose showXml could just
      output a String in the quickest way possible and have a bunch of
      other functions that cat prettily format strings containing Xml
      documents.

    A ./src/Text/XML/HaXml/ShowXmlLazy.hs


More information about the Cvs-libraries mailing list