David Menendez wrote:
This is a great example of why it's a bad idea to introduce new
functionality with a Monoid instance. Even if you know the instance
exists, mappend is so general that it's difficult or impossible to
predict what it will do at a given type.

There should be an explicit function for combining Ordering values
lexicographically, with a note in the documentation saying that it's
the basis of the Monoid instance.

Agreed.

Supposing such an explicit function exists (with proper documentation), would the original example be worth mentioning in or around comparing's documentation? If it saved the next user a couple of minutes of coming up with something similar, I'd be happy.

Martijn.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to