Skip to content

Conversation

@qlonik
Copy link
Contributor

@qlonik qlonik commented Oct 20, 2021

There is filterMap as filtering extensions for map. This adds similar filtering variants for collect.

*/
export const filterCollect: <K>(
O: Ord<K>
) => <A, B>(f: (k: K, a: A) => Option<B>) => (m: Map<K, A>) => Array<B> = RM.filterCollect as any
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if doing as any is a good idea. But it avoids duplication implementing the same function with a different signature.

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.

1 participant