-
-
Notifications
You must be signed in to change notification settings - Fork 115
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)!: Make queue and stack mutable & provide Immutable submodules #1479
Conversation
@alex-snezhko I think we're going to hold this PR back from 0.5.5 because we think it is confusing to have Queue and Stack be the immutable versions but Map & Set are mutable (and then have the inverse have the special naming). We're going to deprecated the immutable Queue & Stack in 0.5.5 and then have you make this the breaking change that moves stuff around. How does that sound? |
Sounds good! |
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.
Easy to read and clear code, great documentation and tests.
Looks very good to me!
33cb48c
to
9fdc216
Compare
9fdc216
to
fa1b64c
Compare
c7426bb
to
4dfc7c5
Compare
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.
@alex-snezhko I've rebased this so I could generate the docs with my submodule support in #1684 - however, I think you need to update the @since
and @history
for the various things that moved around. e.g. Since functions moved from the root into the Immutable
submodule, I think those should be @since v0.6.0
with a history item saying they were originally a root API (similar to how we did those other PRs).
7332ebc
to
487aedd
Compare
487aedd
to
34c824e
Compare
Rebased again and regenerated the docs with graindoc fixes. |
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.
Overall looks great! Would just love if these record fields were renamed.
Also looks like the set tests need to be formatted. |
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.
I made the change Oscar wanted, so this should be good to queue.
Thanks @phated :) |
…dules (grain-lang#1479) * feat(stdlib): Mutable queue and stack * moved mutable impls to root of modules * generate submodule docs with graindoc submodule support * updated history * update docs with graindoc fixes * formatting * update names as per review --------- Co-authored-by: Blaine Bublitz <blaine.bublitz@gmail.com>
Mutable array-based implementations for queues and stacks. From a few benchmarks these implementations offer much faster performance than the current immutable
Queue
andStack
implementations (likely due to gains in cache locality because of underlying array representation), which may make them more viable for performance-sensitive applications.