Commit 06471064 authored by Eric Myhre's avatar Eric Myhre

Add description of Node.NodeBuilder <-> ADL relationship.

Mind, I don't know if all the details of this have been worked out.
In particular, where to get the LinkStorer and other fun stuff passed
through this interface might be a fun dance (if, indeed, such a thing
ends up needed -- this hasn't been written yet!).  We'll see.
One thing is clear: we want this contract here for all the same
already-known reasons: a traversal.Transform over a structure using
an ADL should "just work".
Signed-off-by: default avatarEric Myhre <hash@exultant.us>
parent 77d79154
...@@ -103,6 +103,12 @@ type Node interface { ...@@ -103,6 +103,12 @@ type Node interface {
// other ipldfree.Node (e.g. even the builder obtained from a string node // other ipldfree.Node (e.g. even the builder obtained from a string node
// will be able to build maps). This is not required by the contract; // will be able to build maps). This is not required by the contract;
// such packages only do so out of internal implementation convenience.) // such packages only do so out of internal implementation convenience.)
//
// This "able to replace" behavior also has a specific application regarding
// nodes implementing Advanced Data Layouts: it means that the NodeBuilder
// returned by this method must produce a new Node using that same ADL.
// For example, if a Node is a map implemented by some sort of HAMT, its
// NodeBuilder must also produce a new HAMT.
NodeBuilder() NodeBuilder NodeBuilder() NodeBuilder
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment