goderive
goderive copied to clipboard
reuse fmap's input list, if output type is the same as the input type
This is a performance improvement.
I'm not sure that this is necessarily a good thing - there are arguments both ways. It's not always OK to modify the slice that's being passed in. I suspect that it might be better for there to be a different plugin that modifies in place.
This is why I would love to have immutability in Go, so that we don't have to make this decision, but now here we are.
So you would prefer to rather have an inplace variant of fmap and filter than it being the default?