I wrote CRUD. I really want to write a method that will change the value in Trie. There are examples with Trie.put?
My code: Here are the difficulties with changing the balance field in the Trie
I wrote CRUD. I really want to write a method that will change the value in Trie. There are examples with Trie.put?
My code: Here are the difficulties with changing the balance field in the Trie
Looking at similar code in the superheroes example, I think you might be wanting to call Trie.replace
instead. Compare with:
Or perhaps the problem here is that you are passing Float.equal
, not Nat32.equal
, to compare the key (which I think is of type Nat32
, not Float
).
First I made Trie.find and then I wanted to make this change and only then Trie.put or Trie.replace.
But How?
If you share your code in a gist (or a git repo), I could try to make it work for you.
I found an answer from you here. Thank you