Proposal: add an order-reversing newtype to Data.Ord

Conrad Parker conrad at metadecks.org
Wed Jul 11 04:31:07 CEST 2012


On 10 July 2012 23:28, Twan van Laarhoven <twanvl at gmail.com> wrote:
> On 10/07/12 14:31, Strake wrote:
>>
>> On 09/07/2012, Edward Kmett <ekmett at gmail.com> wrote:
>>>
>>> I would be happy enough with just re-exporting Down and calling it a day.
>>> Last time this topic came up it was bikeshedded to death without
>>> resolution.
>>
>>
>> Why is it called "Down"? Is this a mathematical term?
>
>
> I believe the Down newtype was introduced for use with extended list
> comprehension, things like
>     [ name u | u <- users, then sort (Down (salary x)) ].

That is illustrative; it reads much better than Reverse or DualOrd
would, and I expect that sort is the most common use of an Ord
instance.

+1 for re-exporting Down.

Conrad.



More information about the Libraries mailing list