[Haskell-cafe] Thoughts on program annotations.

Jason Dusek jason.dusek at gmail.com
Fri Mar 4 20:32:33 CET 2011


On Fri, Mar 4, 2011 at 07:01, wren ng thornton <wren at freegeek.org> wrote:
> where the annotation of MergeAnn is merged with the previous
> annotation up the tree (via mappend), thus allowing for
> annotations to be inherited and modified incrementally based
> on the Monoid instance; whereas the NewAnn constructor uses
> the annotation directly, overriding any contextual
> annotations. This can be helpful to reduce the amount of
> duplication in the AST, though how helpful will depend on how
> you plan to use/generate the ASTs.

  To handle this situation, I thought I'd leave it in the hands
  of the user (who will be me later) to use Data.Foldable.fold
  (or not) to arrive at the annotation when building up their
  tree of statements. I don't anticipate a problem with this but
  I may not use monoidal annotations on this AST for some time.
  (I anticipate using comments and raw text inclusions in the
  near future.)

--
Jason Dusek
Linux User #510144 | http://counter.li.org/



More information about the Haskell-Cafe mailing list