Re: Maximum and Minimum monoids

On 12/29/12 8:29 AM, Strake wrote:> and (Max a) and (Min a) are not properly monoids. They're monoids just fine. It's just that their identity element need not be in the set being folded over.
We could define these:
Supr, Infi :: * -> *
Please please, if we're going to abbreviate mathematical terms then we ought to stick to the standard mathematical abbreviations: sup, inf. Personally, I'm fine with Min and Max as they are, because in particular they capture the fact that we're dealing with total orders here. That is, other than for empty sets, they do in fact return the maximum/minimum. Whereas Sup and Inf bring to mind the fact that what we're dealing with is a complete lattice, which need not be a total order. While Sup and Inf make perfectly good monoids/semigroups, I'd prefer if they properly allow all complete lattices rather than being unnecessarily restricted to Ord. -- Live well, ~wren

On Sat, Dec 29, 2012 at 11:18 PM, wren ng thornton
Please please, if we're going to abbreviate mathematical terms then we ought to stick to the standard mathematical abbreviations: sup, inf.
Agreed.
Personally, I'm fine with Min and Max as they are, because in particular they capture the fact that we're dealing with total orders here. That is, other than for empty sets, they do in fact return the maximum/minimum. Whereas Sup and Inf bring to mind the fact that what we're dealing with is a complete lattice, which need not be a total order. While Sup and Inf make perfectly good monoids/semigroups, I'd prefer if they properly allow all complete lattices rather than being unnecessarily restricted to Ord.
I think your concerns here are legitimate, but I have to agree with Herbert that reference "maximal element" is problematic. Is there anything wrong with just using the Max semigroup and, e.g. `sconcat . (minBound :|)`, or something similar?

On 12/29/12 7:25 PM, Ben Millwood wrote:
On Sat, Dec 29, 2012 at 11:18 PM, wren ng thornton
wrote: Please please, if we're going to abbreviate mathematical terms then we ought to stick to the standard mathematical abbreviations: sup, inf.
Agreed.
Personally, I'm fine with Min and Max as they are, because in particular they capture the fact that we're dealing with total orders here. That is, other than for empty sets, they do in fact return the maximum/minimum. Whereas Sup and Inf bring to mind the fact that what we're dealing with is a complete lattice, which need not be a total order. While Sup and Inf make perfectly good monoids/semigroups, I'd prefer if they properly allow all complete lattices rather than being unnecessarily restricted to Ord.
I think your concerns here are legitimate, but I have to agree with Herbert that reference "maximal element" is problematic.
I agree that it is problematic, just not quite as problematic as the OP made it out to be.
Is there anything wrong with just using the Max semigroup and, e.g. `sconcat . (minBound :|)`, or something similar?
Nothing wrong at all :) I'd love to see semigroups become a more welcomed part of the core litany of Haskell. -- Live well, ~wren
participants (2)
-
Ben Millwood
-
wren ng thornton