Range golf challenge: apply predicate to a subrange, returning the original range modified.

FeepingCreature feepingcreature at gmail.com
Fri Oct 7 19:19:16 UTC 2022


On Friday, 7 October 2022 at 16:49:33 UTC, rassoc wrote:
> On 10/7/22 16:00, FeepingCreature via Digitalmars-d wrote:
>> Thoughts?
>
> How about your selector func wraps the elements, similar to 
> Nullable or via SumType, and your modifier func operates on the 
> marked ones during iteration while returning the others as is? 
> Poor man's monads?

Y'all are missing the point a bit. :)

The type spec of the selector is "takes a range, returns a 
subrange." A subrange here being "a range like the original but 
with some amount of elements missing." Not, specifically, a 
predicate! That's what makes it interesting! :)


More information about the Digitalmars-d mailing list