zero-functional / zero-functional

A library providing zero-cost chaining for functional abstractions in Nim.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

max_by_key

iacore opened this issue · comments

commented

A commonly used operation is "keyed max".

Example: (cubes --> reduce(if it.accu.x < it.elem.x: it.accu else: it.elem))

I propose (cubes --> maxBy(it.x)) or (cubes --> max(it.x))

not sure if that can be done here.

I know it can be done - for instance in scala - but are there any examples of other nim libraries having this "commonly used operation" implemented?