Skip to content
This repository was archived by the owner on Jun 17, 2026. It is now read-only.

Merge pull request #411 from dfinity/ggreif/update-moc-0.7.0#412

Open
fury02 wants to merge 2 commits into
caffeinelabs:masterfrom
fury02:master
Open

Merge pull request #411 from dfinity/ggreif/update-moc-0.7.0#412
fury02 wants to merge 2 commits into
caffeinelabs:masterfrom
fury02:master

Conversation

@fury02

@fury02 fury02 commented Aug 27, 2022

Copy link
Copy Markdown

Update moc to 0.7.0

The 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

@ghost

ghost commented Aug 27, 2022

Copy link
Copy Markdown

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

  1. Contributor License Agreement

@ghost ghost added the cla:pending label Aug 27, 2022
Comment thread src/TrieSet.mo Outdated
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, ());

Copy link
Copy Markdown
Contributor

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

Comment thread 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;

@ggreif ggreif Aug 27, 2022

Copy link
Copy Markdown
Contributor

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.

@fury02 fury02 Aug 28, 2022

Copy link
Copy Markdown
Author

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.

@fury02

fury02 commented Aug 28, 2022

Copy link
Copy Markdown
Author

I'm sorry, checking fixed it
The generic type 'T' must be defined by the type at the time of use
Fixed for the version that is being compiled.

Using (T -> type Nat)

my_trie_set := TrieSet.put(my_trie_set, 1, Nat.hash, Nat.equal)

@ggreif ggreif force-pushed the master branch 3 times, most recently from d52aecd to 08507fc Compare October 21, 2022 12:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants