Proposal #2560 again: add newtype Down/ReverseOrd to Data.Ord

kahl at kahl at
Tue Jan 6 12:15:46 EST 2009

Twan van Laarhoven <twanvl at> replied:

 > kahl at wrote:
 > > Me neither...
 > > 
 > > How about:
 > > 
 > > -- intended for |qualified| import |as Ord|:
 > > newtype Dual a = Dual { unDual :: a } deriving Eq
 >   - "dual" can mean many more things.

Exactly --- that's why I propose qualified import,
so one would use, e.g.:

   sort . map Ord.Dual

clarifying that one is using the dual Ord instance.
(Ordering duality is about the fact that
 the converse of an ordering relation is an ordering relation again;
 the Haskell type class |Ord| is the special case of linear orderings.

This is standard terminology,
and I think we should encourage
such use of standard terminology and concepts.

Of course, alternatives remain available,
in the spirit of Henning Thielemann's ``Warm, fuzzy thing Transformer'': 

> It was argued that people avoid Haskell because of terms from Category
> theory like 'Monad'. This problem can now be solved by a wrapper which
> presents all the WWW without monads! Start e.g. at



More information about the Libraries mailing list