But remove doesn't truly remove from the source range because the length of the source range stays the same. It's return value is a modified copy of the source range.
Filter doesn't really work right away because that would also remove duplicate elements while I only want to remove at a given index. It also makes for clunkier looking code and is counterintinuitive to come up with (I want to remove an element therefore I have to filter every element that isn't equal to that element from the source range...)
And while I haven't worked in c++, even that appears to have remove_copy which is really what I want.
I could use temporary variables and blow that neat line up in 3 lines which, while still readable, look redundant.
I'm happy the d result is 3 times shorter then their haskell solution but not that the time spent was 5 minutes working and the rest of the time debugging. This as opposed to using racket where the time spent is 15 minutes but after that everything works great (while my racket experience is limited to playing around with it for 2 weeks now and then).