Logo

Programming-Idioms

History of Idiom 28 > diff from v44 to v45

Edit summary for version 45 by morteako:
New Haskell implementation by user [morteako]

Version 44

2019-03-26, 21:17:14

Version 45

2019-07-03, 16:05:29

Idiom #28 Sort by a property

Sort elements of array-like collection items in ascending order of x.p, where p is a field of the type Item of the objects in items.

Idiom #28 Sort by a property

Sort elements of array-like collection items in ascending order of x.p, where p is a field of the type Item of the objects in items.

Imports
import qualified Data.List as List
Code
List.sortOn p items