elm-community / list-extra

Convenience functions for working with List.

Home Page:http://package.elm-lang.org/packages/elm-community/list-extra/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding `filterMap` method

peterszerzo opened this issue · comments

I recently found it useful to have a method that filters and maps a list at the same time, with the following type signature:

filterMap : (a -> ( b, Bool )) -> List a -> List b

The mapped value b is included in the resulting list if the boolean value returned in the tuple is true.

Does it make sense to include this in the library? If so, I have an implementation ready and happy to issue a PR.

It is not preferable at all, I overlooked :/. Thanks for reviewing the issue report so I can get it out of the way :).