Skip to content

Extend Foldable (foldl', null, length) #223

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

Merged
merged 2 commits into from
Feb 12, 2019

Conversation

shekeru
Copy link
Contributor

@shekeru shekeru commented Feb 11, 2019

The Foldable instance was slightly extended for issue for Issue #222 out of boredom. Namely adding foldl', null, length, on both HashMap and HashSet. Due to its usage in HashSet, I assumed the INLINE pragma was appropriate.

@treeowl
Copy link
Collaborator

treeowl commented Feb 11, 2019

Why not also foldl, foldr', and foldMap? While we're at it, we might consider mapM and sequence.

@treeowl
Copy link
Collaborator

treeowl commented Feb 11, 2019

Er.... No, we can't do anything special for mapM or sequence. But the other Foldable methods would be good.

@shekeru
Copy link
Contributor Author

shekeru commented Feb 11, 2019

I assume that would require implementing those functions somewhere in the Base.hs files, and since I'm a newbie to Haskell, and with the library overall, I didn't feel comfortable doing that. Sorry for the trouble.

@treeowl
Copy link
Collaborator

treeowl commented Feb 12, 2019

That is true. We'd better do that later.

@treeowl treeowl merged commit 53eb7eb into haskell-unordered-containers:master Feb 12, 2019
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.

2 participants