Proposal: Add filterM or filterA to Data.Sequence

David Feuer david.feuer at gmail.com
Tue Dec 30 18:15:42 UTC 2014


On Tue, Dec 30, 2014 at 12:05 PM, Johan Tibell <johan.tibell at gmail.com> wrote:
> We should check that `filterM . toList` isn't as fast. That was the case for
> bytestring and we rejected adding filterM there for that reason.

Let me expand that definition to what it really looks like:

  filterMSeq f = fmap fromList . filterM f . toList

Yes, you can do this. Yes, it's probably even pretty efficient. But
it's a bit painful to have to expand things out like this just to
switch a bit of code from lists to sequences.


More information about the Libraries mailing list