Closed mattbierner closed 10 years ago
Because this requires tracking an additional edit
property separate from the tree itself, I decided to fork this work to hamt_plus instead. The API of hamt_plus is nearly identical to hamt, but hamt_plus supports a few more features in exchange for some additional overhead.
All inner
set
operations would be mutations instead of persistent update. This would greatly improve performance by reducing memory allocations and path copying.mutate
would make the input hamt as a mutable, and mark the return value as immutable. It is assumed these would referenced be the same, although this would not be enforced. The internalupdate
operation would simply check to see if we are in mutable mode when deciding if we should transform or mutate.Capturing
h
in the mutate function for use outside of the function would result in undefined behavior.