snoyberg / mono-traversable

Type classes for mapping, folding, and traversing monomorphic containers
152 stars 61 forks source link

Consider adding `filterSet` to `IsSet` #177

Closed lehmacdj closed 2 years ago

lehmacdj commented 4 years ago

Just like filterMap which was added in #167, we are missing

filterSet :: IsSet set => (Element set -> Bool) -> set -> set

Can we add such a function?

In principle it is possible to give an implementation of this for every instance of SetContainer but we wouldn't be able to give a default implementation for it, because we don't have setFromList.

snoyberg commented 4 years ago

I'm open to such a PR.

lehmacdj commented 4 years ago

Implemented in #178