Skip to content
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

feat(stdlib): Implement immutable map and immutable set #1414

Merged
merged 5 commits into from
Nov 4, 2022

Conversation

alex-snezhko
Copy link
Member

I figured I'd include both maps and sets in one PR since their implementation is almost identical. They are both implemented as size-balanced BSTs, following "Implementing Sets Efficiently in a Functional Language" by Stephen Adams. API for these is as was discussed in #1403

Copy link
Member

@ospencer ospencer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking really good! A couple of small things but otherwise this is excellent 😄

stdlib/immutablemap.gr Outdated Show resolved Hide resolved
stdlib/immutablemap.gr Outdated Show resolved Hide resolved
stdlib/immutablemap.gr Outdated Show resolved Hide resolved
stdlib/immutablemap.gr Outdated Show resolved Hide resolved
Copy link
Member

@ospencer ospencer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the review delay here! This looks absolutely fantastic 🤩

Copy link
Member

@phated phated left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is excellent! I ran into a few things while reviewing and commented inline. Thanks for all your work and I'm excited to get this updated and merged 🎉

stdlib/immutablemap.gr Outdated Show resolved Hide resolved
stdlib/immutablemap.gr Show resolved Hide resolved
stdlib/immutablemap.gr Outdated Show resolved Hide resolved
stdlib/immutablemap.gr Outdated Show resolved Hide resolved
stdlib/immutablemap.gr Outdated Show resolved Hide resolved
stdlib/immutableset.gr Outdated Show resolved Hide resolved
stdlib/immutableset.gr Outdated Show resolved Hide resolved
stdlib/immutableset.gr Outdated Show resolved Hide resolved
stdlib/immutableset.gr Outdated Show resolved Hide resolved
stdlib/immutableset.gr Outdated Show resolved Hide resolved
Copy link
Member

@phated phated left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one change and I think we are good to go.

compiler/test/stdlib/immutableset.test.gr Outdated Show resolved Hide resolved
Copy link
Member

@phated phated left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all the awesome work on this! 🎉

@phated phated merged commit b31120d into grain-lang:main Nov 4, 2022
@github-actions github-actions bot mentioned this pull request Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants