map, sort, map
Feb. 5th, 2011 01:23 pmThe Schwartzian transform came up briefly in conversation in #dreamwidth. It is a way to sort by a calculated value, useful when calculating for said value is expensive.
I think I have seen it before, but I didn't realize it was a common enough idiom to have a name. I like how deceptively confusing it is, but once it is explained line-by-line it suddenly makes sense!
I think I have seen it before, but I didn't realize it was a common enough idiom to have a name. I like how deceptively confusing it is, but once it is explained line-by-line it suddenly makes sense!