archives

Comprehensions with ‘Order by’ and ‘Group by’

Comprehensive Comprehensions, Phil Wadler and Simon Peyton Jones

"The new constructs proposed here are more general than the constructs in the other languages, because they work with any function of a given type, rather than being limited to specific functions. Parametricity of these functions plays an important role in ensuring the semantics of such constructs is independent of particular details of how tuples of bindings are represented."