Proposal #2560 again: add newtype Down/ReverseOrd to Data.Ord
Reid Barton
rwbarton at math.harvard.edu
Tue Jan 6 13:12:36 EST 2009
On Tue, Jan 06, 2009 at 05:15:46PM -0000, kahl at cas.mcmaster.ca wrote:
[...]
> 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.
In my part of the category-theory world, standard terminology is
"opposite category" and thus "opposite ordering" (since a partial
order is a special case of a category). But I would not be too
surprised to hear "dual ordering" as well.
(By the way, a much worse abuse of the name Dual already exists in
Data.Monoid, to describe the operation of flipping the arguments of
the multiplication in a monoid. This should certainly be called the
opposite monoid. Google for "dual monoid" and you will find that all
uses of that term are for other 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
> >
> > http://saxophone.jpberlin.de/MonadTransformer?source=http%3A%2F%2Fwww%2Ehaskell%2Eorg%2Fhaskellwiki%2FCategory%3AMonad&language=English
>
> ;-)
While "opposite" is a term used in category theory, it's also a
perfectly ordinary word that has the right connotations to
non-mathematicians. "Dual" is a little scary, I think.
Regards,
Reid
More information about the Libraries
mailing list