[Haskell-cafe] HaXml 1.13 -> 1.22 upgrade

Michael Orlitzky michael at orlitzky.com
Mon Dec 12 21:49:06 CET 2011


On 12/12/11 02:42, Malcolm Wallace wrote:
> The extra parameter "i" is for "information" attached to each node of
> the tree.  As you have correctly guessed, the parser fills in this
> field with positional information relating to the original source
> document, which is useful for instance if you are validating or
> checking the original document.  When building new parts of a
> document, it is perfectly fine to attach "noPos".
>
> You can alternatively replace all of the informational items in the
> tree, with for instance "fmap (const ())" if you don't care about
> them.
>
> The information fields are useful for other purposes though, e.g. to
> hold the relevant xmlns namespace for subtrees; or to distinguish
> added/removed/modified subtrees in a diff-like viewer.
>
> Regards, Malcolm

Thanks, I understand what's going on now.

I like the noPos solution because the other ones make the reader think 
there's something important going on; with noPos, I can just comment 
"gotta give it a Posn, and this is the only one I know how to make."



More information about the Haskell-Cafe mailing list