[Haskell-beginners] How to "insert" a cross reference into a tree structure
Stephen Tetley
stephen.tetley at gmail.com
Sun Dec 19 12:28:59 CET 2010
On 19 December 2010 09:54, Edward Z. Yang <ezyang at mit.edu> wrote:
>
> Related to editing values embedded deep in structures, but not related
> to cross-references, you might find this post interesting:
>
> http://conal.net/blog/posts/semantic-editor-combinators/
Zippers are another view on editing nested structures, try to find
Gerard Huet's original Zipper functional pearl if you can (I think it
is probably accessible via Citeseer), although the code is in OCaml
its a better eplanation than the haskellwiki page.
For the original problem, it may be more appealing to have
cross-references outside the syntax tree and put them in a "relational
structure" like a finite map (e.g. Data.Map or a variant that is
better for one-to-many relations). As information then gets separated
into two places, there is perhaps more book-keeping to be done than
with tying-the-knot, however the book-keeping itself will be simpler.
More information about the Beginners
mailing list