Talk:Decorate-sort-undecorate idiom

From Rosetta Code

Functionally Speaking

Some languages may support the task as specified with their version of the higher order function sortBy or similar. In general I think the general purpose HOF would be groupBy in functional languages.--Nigel Galloway (talk) 17:26, 31 July 2023 (UTC)

Whether the key function is cached is what makes the decorate-sort-undecorate idiom efficient in situations where the key function is an expensive calculation. Not all groupBy sorts are cached. See for example --Wherrera (talk) 18:25, 31 July 2023 (UTC)