-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge pull request #411 from dfinity/ggreif/update-moc-0.7.0 #412
base: master
Are you sure you want to change the base?
Conversation
Dear @fury02, In order to potentially merge your code in this open-source repository and therefore proceed with your contribution, we need to have your approval on DFINITY's CLA1. If you decide to agree with it, please visit this issue and read the instructions there. — The DFINITY Foundation Footnotes
|
src/TrieSet.mo
Outdated
@@ -26,14 +26,18 @@ module { | |||
|
|||
/// Put an element into the set. | |||
public func put<T>(s : Set<T>, x : T, xh : Hash, eq : (T, T) -> Bool) : Set<T> { | |||
let (s2, _) = Trie.put<T,()>(s, { key = x; hash = xh }, eq, ()); | |||
s2 | |||
// let (s2, _) = Trie.put<T,()>(s, { key = x; hash = xh }, eq, ()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feel free to remove old code, this obscures the real changes in the PR's diff
src/TrieSet.mo
Outdated
s2 | ||
// let (s2, _) = Trie.remove<T, ()>(s, { key = x; hash = xh }, eq); | ||
// s2 | ||
s := Trie.remove<T, ()>(s, { key = x; hash = xh}, eq).0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this even compile? Function parameters are supposed to be immutable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Recommendations have also been adopted.
Update `moc` to 0.7.0
I'm sorry, checking fixed it Using (T -> type Nat) my_trie_set := TrieSet.put(my_trie_set, 1, Nat.hash, Nat.equal) |
d52aecd
to
08507fc
Compare
Update
moc
to 0.7.0The put; delete functions do not work; (TrieSet)
I made a correction by referring directly to the Trie.
Look maybe these are all the fixes that are needed