Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

filterValues and filterKeys #97

Merged
merged 4 commits into from
Jun 4, 2017

Conversation

matthewleon
Copy link
Contributor

supersedes #80

Rebases and implements the suggestions in that PR.


-- | Filter out those key/value pairs of a map for which a predicate
-- | fails to hold.
filter :: forall a. (String -> a -> Boolean) -> StrMap a -> StrMap a
Copy link
Contributor

Choose a reason for hiding this comment

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

filterWithKey perhaps?


-- | Filter out those key/value pairs of a map for which a predicate
-- | on the value fails to hold.
filterValues :: forall a. (a -> Boolean) -> StrMap a -> StrMap a
Copy link
Contributor

Choose a reason for hiding this comment

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

I would just call this one filter actually.

@paf31
Copy link
Contributor

paf31 commented Jun 3, 2017

Sorry for the bikeshedding 😁

cc @hdgarrood

@matthewleon
Copy link
Contributor Author

Sorry for the bikeshedding 😁

Nothing to be sorry about, someone's gotta do it!

michal-jewel and others added 3 commits June 4, 2017 15:08
whitespace

pluralize

test fixes

simplify tests

use ST to reduce algorithmic complexity
@hdgarrood
Copy link
Contributor

👍 for filter and filterWithKey.

matthewleon added a commit to matthewleon/purescript-maps that referenced this pull request Jun 4, 2017
@paf31 paf31 merged commit bbf299b into purescript-deprecated:master Jun 4, 2017
@paf31
Copy link
Contributor

paf31 commented Jun 4, 2017

Thanks!

paf31 pushed a commit that referenced this pull request Jun 4, 2017
* persistent map filters and isSubMap

* rename filter fns following review

#97 (review)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants