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

[RFC] Add STMContainers.Multiset #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sjakobi
Copy link

@sjakobi sjakobi commented May 30, 2016

I have implemented a simple multiset on top of Map that is useful for counting things. The API is partly inspired by the multiset package.

I'm still unsure about the following design issue:

Should the counts be represented as Word, Word64 or Natural instead?

This would simplify focus, insertMany and deleteMany, and allow for larger counts.

On the downside Word and Word64 are slightly more hairy to use safely and Natural would result in higher memory consumption.

@nikita-volkov
Copy link
Owner

Thanks for your contribution, however I believe it would be better for you to release this as your own separate package. Since in your implementation you only depend on the public parts of the API this should pose no problems for you.

I've actually been thinking about revising the library to extract all the others containers as separate packages. If you're interested in the reasons, I've described a few in a documentation for another package. I plan to make an expanded post about the benefits of such an approach some time soon.

@sjakobi
Copy link
Author

sjakobi commented May 30, 2016

Thanks for the quick response!

I think you're making some pretty good points in that README. On the other hand it's only a few days ago that I heard other people favoring fewer, more fully-featured packages. I think the main argument was less maintenance hassle for both authors and users.

Would you mind if I leave this PR open until the discussion on your post is over? I'd be very interested in hearing other opinions on this policy.

@nikita-volkov
Copy link
Owner

Sure. I'll try to remember to post a link here when I publish it.

@sjakobi
Copy link
Author

sjakobi commented May 30, 2016

Sure.

Thanks!

I'll try to remember to post a link here when I publish it.

No worries! I'm sure I'll see it on r/haskell! :)

@3noch
Copy link

3noch commented Feb 10, 2017

@nikita-volkov Did you ever write that post? ;)

@3noch
Copy link

3noch commented Feb 10, 2017

@sjakobi What ever became of this? Did you release your work as a separate package?

@sjakobi
Copy link
Author

sjakobi commented Feb 10, 2017

Did you release your work as a separate package?

I haven't so far. If you'd like to use it, I will though! Do you have a comment on the design issue from above?

Should the counts be represented as Word, Word64 or Natural instead?

@nikita-volkov
Copy link
Owner

@3noch Not yet

@mitchellwrosen
Copy link
Contributor

I'd just like to chime in on the separate package debate. The major problem I see with releasing a package like stm-containers-multiset is discoverability.

Ideallly, there could be a prominent section in stm-containers' description that says, like, "Check out these similar packages, none of which are officially endorsed by this author". Then, even crappy packages/variations can at least get enough eyes on them for collaboration, bug fixes, rewrites, or what have you. It'd just be a shame if multiple people implement stm-containers-multiset just because they don't know about each others' work, and the Hackage UI really does not help us out here.

@nikita-volkov What do you think about that? Would you be willing to, say, point at other peoples' packages in the stm-containers description, for situations like this? (If not, totally fine of course, just wondering).

@mitchellwrosen
Copy link
Contributor

mitchellwrosen commented Nov 6, 2018

@sjakobi Natural :)

(Similar situation solved in stm with Natural: https://hackage.haskell.org/package/stm-2.5.0.0/docs/Control-Concurrent-STM-TBQueue.html)

@nikita-volkov
Copy link
Owner

Would you be willing to, say, point at other peoples' packages in the stm-containers description, for situations like this?

Sure! No problem

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.

4 participants