Closed rogpeppe closed 6 years ago
Yes. I agree :) I think we can simply change the current deriveFilter function. Just like the plan is to do with fmap, when the input and output types are the same. https://github.com/awalterschulze/goderive/issues/14
I just first want to provide a clone function, so that people that want to have a copy can easily get one.
deriveClone(T) T
deriveFilter is now in place by default.
https://github.com/awalterschulze/goderive/commit/88cd557d060cb12c1abd91c89978d5a9d0c0e332
To get the old behavior call deriveFilter(deriveClone(list), predicate)
It would be nice to have a filter plugin that modified the slice items in place rather than returning a newly allocated slice.