`mapMaybe` and `mapMaybeWithKey`? #59

Closed
favonia opened this Issue Feb 19, 2013 · 0 comments

Comments

Projects
None yet
1 participant

favonia commented Feb 19, 2013

I'm wondering if we can have mapMaybe and mapMaybeWithKey. (c.f. IntMap) This is equivalent to

fromList . mapMaybe (uncurry f) . toList

but I guess it's slower. It seems that filter does something quite efficient and it'd be nice to have other functions enjoying the same efficiency.

@jcpetruzza jcpetruzza added a commit to jcpetruzza/unordered-containers that referenced this issue Dec 14, 2014

@jcpetruzza jcpetruzza Add mapMaybe and mapMaybeWithKey (issue #59)
They share the implementation with filterWithKey,
without affecting the former's structure reuse.
d5fbab7

favonia closed this May 1, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment