Distinguish between empty trees and non-existent sub-trees#431
Distinguish between empty trees and non-existent sub-trees#431samoht merged 2 commits intomirage:masterfrom
Conversation
Change `S.find_tree` to return an optional value. This allows to not conflate the meaning of `Empty: it is now only "an empty subtree". And we use None to denote non-existent sub-trees.
|
/cc @talex5 |
|
Why is |
|
Because this you can create a tree (starting from an empty tree) without having to tie it to a store. |
|
(e.g. |
|
Where is this? Seems like any other implementation of |
|
I've pushed a commit to remove I think ideally we would cache the empty value in the |
There were two ways to create an empty subtree: - `Empty and; - `Node <empty-node> This was a bit confusing, so remove the `Empty case. This forces `empty` to become a function, as the hash of the empty node depends on the backend used. Ideally we would cache the empty node in the Repo.t value, but it is a bit hard to do currently.
|
Ah, because when you save a But couldn't |
|
The |
Change
S.find_treeto return an optional value. This allows to not conflatethe meaning of `Empty: it is now only "an empty subtree". And we use None to
denote non-existent sub-trees.