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

Henning Thielemann schlepptop at henning-thielemann.de
Wed Jan 7 16:27:09 EST 2009


kahl at cas.mcmaster.ca schrieb:

> I plead to accelerate the already perceptible shift towards more qualified
> imports, and to treat the unqualified import as the exception.
> 
> Ord is a particularly good candidate for that,
> since it is hogging the whole partial-order namespace
> for the special case of linear orders.
> 
> In your example, if there is only one occurrence of Dual
> in a large module, then
> 
>  >     sortBy (comparing `on` Ord.Dual . fst) stuff
> 
> would be natural. In other places, that module might use ``POrd.Dual''...

+1

> However, if a module uses only Ord duality,
> and uses that a lot, then it may become more readable to
> use an unqualified import (still preferably with an explicit import list)

See: http://www.haskell.org/haskellwiki/Import_modules_properly

> and write
> 
>  >     sortBy (comparing `on` Dual . fst) stuff
> 
> For this special case, I don't want to force qualified import,
> but suggest it as standard usage,
> leaving open the more concise second option.

+1


However I don't care about Dual vs. Opposite vs. Reverse.


More information about the Libraries mailing list