
I noticed that the Down newtype (whose Ord instance inverts its payload's ordering) currently only exists in GHC.Exts, and it seems like something fairly generally useful. What do people think of moving it to (or re-exporting it from) Data.Ord? Moving it would be nicer, but the fancy list comprehension desugaring might want it in GHC.Exts, so I'm not sure what the consequences would be. Anyone have comments/ideas? Thanks, Dan

On Fri, Nov 18, 2011 at 11:48 AM, Daniel Peebles
I noticed that the Down newtype (whose Ord instance inverts its payload's ordering) currently only exists in GHC.Exts, and it seems like something fairly generally useful. What do people think of moving it to (or re-exporting it from) Data.Ord? Moving it would be nicer, but the fancy list comprehension desugaring might want it in GHC.Exts, so I'm not sure what the consequences would be. Anyone have comments/ideas? Thanks, Dan
I have no opinion on whether it's moved or re-exported, but +1 on providing this type. Michael

I like the concept, but not the name. Inverse (or Inv) would be a better name imho. Sjoerd On Nov 18, 2011, at 8:48 PM, Daniel Peebles wrote:
I noticed that the Down newtype (whose Ord instance inverts its payload's ordering) currently only exists in GHC.Exts, and it seems like something fairly generally useful. What do people think of moving it to (or re-exporting it from) Data.Ord? Moving it would be nicer, but the fancy list comprehension desugaring might want it in GHC.Exts, so I'm not sure what the consequences would be.
Anyone have comments/ideas?
Thanks, Dan _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

On Sat, 2011-11-19 at 12:07 +0100, Sjoerd Visscher wrote:
I like the concept, but not the name. Inverse (or Inv) would be a better name imho.
btw, doesn't that "Down" transform the Ord relation into its "dual" (in the category sense)? If so, wouldn't a categorical term like "Dual" or "Opposite" (as in "Opposite Category") be more appropriate (given that Haskell libraries already recycles many categorical terms?) Just saying... :-) -- hvr.

The problem Dual is taken by Data.Monoid. With Opposite it isn't clear what is being inverted as well. Perhaps Desc (or Descending)?
That would permit nice descriptions when used with the extended list comprehension sugar.
Sent from my iPad
On Nov 19, 2011, at 7:28 AM, Herbert Valerio Riedel
On Sat, 2011-11-19 at 12:07 +0100, Sjoerd Visscher wrote:
I like the concept, but not the name. Inverse (or Inv) would be a better name imho.
btw, doesn't that "Down" transform the Ord relation into its "dual" (in the category sense)? If so, wouldn't a categorical term like "Dual" or "Opposite" (as in "Opposite Category") be more appropriate (given that Haskell libraries already recycles many categorical terms?)
Just saying... :-)
-- hvr.
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

On Sat, Nov 19, 2011 at 4:48 PM, Edward Kmett
The problem Dual is taken by Data.Monoid. With Opposite it isn't clear what is being inverted as well. Perhaps Desc (or Descending)?
That would permit nice descriptions when used with the extended list comprehension sugar.
I like Desc, and it's better than Descending. +1 (whatever the name is chosen) Cheers, -- Felipe.

Desc has the same problem as Down: it doesn't make clear that it makes an already descending ordering ascending. Sjoerd On Nov 19, 2011, at 7:48 PM, Edward Kmett wrote:
The problem Dual is taken by Data.Monoid. With Opposite it isn't clear what is being inverted as well. Perhaps Desc (or Descending)?
That would permit nice descriptions when used with the extended list comprehension sugar.
Sent from my iPad
On Nov 19, 2011, at 7:28 AM, Herbert Valerio Riedel
wrote: On Sat, 2011-11-19 at 12:07 +0100, Sjoerd Visscher wrote:
I like the concept, but not the name. Inverse (or Inv) would be a better name imho.
btw, doesn't that "Down" transform the Ord relation into its "dual" (in the category sense)? If so, wouldn't a categorical term like "Dual" or "Opposite" (as in "Opposite Category") be more appropriate (given that Haskell libraries already recycles many categorical terms?)
Just saying... :-)
-- hvr.
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

On Sat, Nov 19, 2011 at 6:19 PM, Sjoerd Visscher
Desc has the same problem as Down: it doesn't make clear that it makes an already descending ordering ascending.
Desc reminds me of tables where you click the header and change between ascending and descending. Invert, Dual, Down and Opposite don't remind me of anything regarding orders at all. What are you inverting? Dual of what? Of couse, that's only my humble opinion. =) Cheers, -- Felipe.

On Sat, Nov 19, 2011 at 8:32 PM, Felipe Almeida Lessa
On Sat, Nov 19, 2011 at 6:19 PM, Sjoerd Visscher
wrote: Desc has the same problem as Down: it doesn't make clear that it makes an already descending ordering ascending.
Desc reminds me of tables where you click the header and change between ascending and descending. Invert, Dual, Down and Opposite don't remind me of anything regarding orders at all. What are you inverting? Dual of what? Of couse, that's only my humble opinion. =)
Just to confuse and frustrate things further, I'm going to suggest Reverse. I think that's the normal word I'd use to describe a flipped ordering. I don't see any harm in reusing the existing Dual newtype from Monoid, though.

Dual already has an Ord instance.
Sent from my iPhone
On Nov 19, 2011, at 4:46 PM, Ben Millwood
On Sat, Nov 19, 2011 at 8:32 PM, Felipe Almeida Lessa
wrote: On Sat, Nov 19, 2011 at 6:19 PM, Sjoerd Visscher
wrote: Desc has the same problem as Down: it doesn't make clear that it makes an already descending ordering ascending.
Desc reminds me of tables where you click the header and change between ascending and descending. Invert, Dual, Down and Opposite don't remind me of anything regarding orders at all. What are you inverting? Dual of what? Of couse, that's only my humble opinion. =)
Just to confuse and frustrate things further, I'm going to suggest Reverse. I think that's the normal word I'd use to describe a flipped ordering.
I don't see any harm in reusing the existing Dual newtype from Monoid, though.
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

Because sometimes you put them in containers directly. I've done this, it isn't a theoretical situation.
Sent from my iPhone
On Nov 19, 2011, at 5:24 PM, Herbert Valerio Riedel
On Sat, 2011-11-19 at 17:03 -0500, Edward Kmett wrote:
Dual already has an Ord instance.
...btw, why does a monoid need an Ord instance anyway? :-)

On 11/19/11 3:19 PM, Sjoerd Visscher wrote:
Desc has the same problem as Down: it doesn't make clear that it makes an already descending ordering ascending.
FWIW I call the newtype Reverse in my local libraries. Another option would be Converse. (Both of which are a bit less ambiguous than Inverse.) -- Live well, ~wren

Reverse is better indeed, but +1 on any name that ends with -verse. Sjoerd On Nov 20, 2011, at 11:56 PM, wren ng thornton wrote:
On 11/19/11 3:19 PM, Sjoerd Visscher wrote:
Desc has the same problem as Down: it doesn't make clear that it makes an already descending ordering ascending.
FWIW I call the newtype Reverse in my local libraries. Another option would be Converse. (Both of which are a bit less ambiguous than Inverse.)
-- Live well, ~wren
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

On Sun, Nov 20, 2011 at 3:21 PM, wren ng thornton
On 11/20/11 6:11 PM, Sjoerd Visscher wrote:
Reverse is better indeed, but +1 on any name that ends with -verse.
So that's three votes for Reverse. Are there any complaints against this color for the bikeshed?
Reverse sounds good to me too, especially since it matches up with the reverse function so well. Michael

I have to admit I don't like this color for the same reason as my dislike of the Opposite and Dual suggestions. It isn't entirely clear which operator is being reversed, so you can call me a -1.
Sent from my iPad
On Nov 20, 2011, at 6:21 PM, wren ng thornton
On 11/20/11 6:11 PM, Sjoerd Visscher wrote:
Reverse is better indeed, but +1 on any name that ends with -verse.
So that's three votes for Reverse. Are there any complaints against this color for the bikeshed?
-- Live well, ~wren
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

On 11/21/11 10:23 AM, Edward Kmett wrote:
I have to admit I don't like this color for the same reason as my dislike of the Opposite and Dual suggestions. It isn't entirely clear which operator is being reversed, so you can call me a -1.
Would Converse be any clearer? The ambiguity of what's being inverted is the reason why I'm not a fan of Inverse (e.g., we invert multiplication all the time, to the point where we abuse notation and say we're inverting the numbers themselves). But other than Reverse and Converse, I can't think of any name that would immediately invoke the idea that the ordering relation is what's being dualized. Unless we go the Java route and choose something verbose like ReverseOrdering (or decide to be really perverse and choose CoOrd). But really, what else can be reversed? Sorting and ordering functions can have their outputs reversed. Whereas relations in general are conversed, binary operators are commuted, arguments to functions are flipped, components of pairs are swapped,... -- Live well, ~wren

+1 to add this newtype. I prefer the Reverse bikeshed, but I'll be happy with any name. Please, let's not let the name get in the way of getting it done. Thanks, Yitz P.S. If we're looking for a more flexible alternative, we can use Costotransverse.

If yinz keep bikeshedding over what to call it, I'm gonna propose TheOtherWayRound. :) -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

I'd like to add 'Flip', 'Invert', and 'AntiOrd' to the mix. Actually.
AntiOrd is sounding nice.
On Nov 22, 2011 12:53 AM, "Brandon Allbery"
If yinz keep bikeshedding over what to call it, I'm gonna propose
TheOtherWayRound. :)
-- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

+1 for Reverse
2011/11/22 John Meacham
I'd like to add 'Flip', 'Invert', and 'AntiOrd' to the mix. Actually. AntiOrd is sounding nice.
On Nov 22, 2011 12:53 AM, "Brandon Allbery"
wrote: If yinz keep bikeshedding over what to call it, I'm gonna propose TheOtherWayRound. :)
-- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

On 21 November 2011 12:57, Brent Yorgey
On Mon, Nov 21, 2011 at 12:11:27AM +0100, Sjoerd Visscher wrote:
Reverse is better indeed, but +1 on any name that ends with -verse.
In that case I propose Universe, Adverse, or Perverse. ;)
Wouldn't Perverse have some kind of random (via unsafePerformIO of course!) comparison functionality? ;-) -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

On Sun, Nov 20, 2011 at 21:06, Ivan Lazar Miljenovic < ivan.miljenovic@gmail.com> wrote:
Wouldn't Perverse have some kind of random (via unsafePerformIO of course!) comparison functionality? ;-)
sortBy (\_ _ = EQ) ? -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms

On Sun, Nov 20, 2011 at 09:08:34PM -0500, Brandon Allbery wrote:
On Sun, Nov 20, 2011 at 21:06, Ivan Lazar Miljenovic < ivan.miljenovic@gmail.com> wrote:
Wouldn't Perverse have some kind of random (via unsafePerformIO of course!) comparison functionality? ;-)
sortBy (\_ _ = EQ) ?
Haha, yes, having everything compare as equal sounds much more perverse: it is technically valid but completely defeats the entire purpose. (Random comparison, in comparison, would just be evil.) -Brent
participants (16)
-
Ben Millwood
-
Brandon Allbery
-
Brent Yorgey
-
Daniel Fischer
-
Daniel Peebles
-
Edward Kmett
-
Felipe Almeida Lessa
-
Herbert Valerio Riedel
-
Ivan Lazar Miljenovic
-
John Meacham
-
Michael Snoyman
-
Simon Meier
-
Sjoerd Visscher
-
Stephen Tetley
-
wren ng thornton
-
Yitzchak Gale