4 ms·
Haskell has sortBy and comparing, like this: sortBy (comparing salary) employees The grammar is not as close to English, but close enough to understand.
by eru 12y ago
Haskell has sortBy and comparing, like this:
sortBy (comparing salary) employees
The grammar is not as close to English, but close enough to understand.
- pdpi 12y agoThe canonical example there is actually to use on and infix `` notation: sortBy (compare `on` salary) employeers