Proposal #2560 again: add newtype Down/ReverseOrd to Data.Ord
Sterling Clover
s.clover at gmail.com
Tue Jan 6 11:26:09 EST 2009
FlipOrd { unFlipOrd :: a } ?
--S
On Jan 6, 2009, at 10:58 AM, Twan van Laarhoven wrote:
> kahl at cas.mcmaster.ca wrote:
>> Me neither...
>> How about:
>> -- intended for |qualified| import |as Ord|:
>> newtype Dual a = Dual { unDual :: a } deriving Eq
>
> In my opinion "dual" is even worse:
>
> - "dual" is not a name that people think about when they want
> something sorted in descending order or they want a different
> priority queue, etc. I think of names like "reverse", "descending"
> and "something to do with order".
>
> - "dual" can mean many more things. First of all there are
> different dualities in mathematics, I guess this refers to the
> categorical dual. Then there are many ways to use that duality in
> Haskell. The first thing that comes to mind, and which is a closer
> fit, is newtype Op t a b = Op (t b a), the dual of a
> Control.Category style category.
>
> Twan
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
More information about the Libraries
mailing list