Open Benjamin-McRae-Tracsis opened 1 week ago
Originally, the reason I didn't include filter
/mapMaybe
was that I thought the best implementation would depend on the predicate. However, upon benchmarking, it seems that using Data.List.filter
, i.e.
filter f = fromList . Data.List.filter f . toList
is the fastest implementation overall (at least the fastest I can think of). I'm not sure about adding functions that just use list functions, since users can easily do that themselves and even combine multiple transformations without converting to vectors in between (though tbf, zip
and zipWith
are also implemented this way).
I'd also like to avoid a dependency on witherable
, to keep the dependency footprint low.
I think it would be good to add an efficient Filterable and Witherable instance for vectors.