[erlang-questions] Tuples referencing each other problem
Grzegorz Junka
list1@REDACTED
Thu Sep 21 16:23:46 CEST 2017
Many thanks to all for your responses and suggestions.
To answer your question Richard, I don't actually need a cyclical
structure. As I mentioned, this is a simplification of a more specific
problem. I didn't want to describe all the specifics to ask a question.
I need to design a tree, a variant of a HAMT tree, but which can be
traversed in both directions, from the root to leafs and from leafs to
the root (independently, i.e. starting from a reference to a leaf rather
than recursively). Tuples that reference each other is one solution but
not the only one fortunately, i.e. I can add ids to each node and use
another data structure to store the mapping id-node, then store the id
of the parent in the child.
Thank you for the pointer to the book.
GrzegorzJ
On 18/09/2017 00:53, Richard A. O'Keefe wrote:
> On further reflection, I suppose I should ask:
> Why is it that you think you need cyclic structures?
> What do you actually want to *do* with them?
>
> As a matter of curiosity, have you read Okasaki's
> book on functional data structures?
>
> (Didn't someone convert Okasaki's Edison library
> to Erlang at some point? What happened to that?)
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170921/0491930d/attachment.htm>
More information about the erlang-questions
mailing list