Skip to content

Add extra defaults for partition and filter #10

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 1 commit into from
Aug 9, 2017
Merged

Add extra defaults for partition and filter #10

merged 1 commit into from
Aug 9, 2017

Conversation

i-am-tom
Copy link

@i-am-tom i-am-tom commented Aug 8, 2017

This commit adds four new functions: partitionDefaultFilter, partitionDefaultFilterMap, filterDefaultPartition, and filterDefaultPartitionMap. Granted, the partition-by-filter functions aren't too efficient, but they should at least be correct!

Copy link
Member

@LiamGoodacre LiamGoodacre left a comment

Choose a reason for hiding this comment

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

Thanks!

-- | A default implementation of `partition` using `filterMap`. Note that this
-- | is almost certainly going to be suboptimal compared to direct
-- | implementations.
partitionDefaultFilterMap :: forall f a. Filterable f =>
Copy link
Member

Choose a reason for hiding this comment

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

Could you move this somewhere under maybeBool? I try not to use declarations until after they have been introduced.

This commit adds four new functions: `partitionDefaultFilter`,
`partitionDefaultFilterMap`, `filterDefaultPartition`, and
`filterDefaultPartitionMap`.
@LiamGoodacre LiamGoodacre merged commit 35c3945 into purescript:master Aug 9, 2017
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