Maximum and Minimum monoids

Gabriel Gonzalez gabriel439 at gmail.com
Thu Dec 27 22:13:28 CET 2012


On 12/27/2012 02:45 PM, Roman Cheplyaka wrote:
> I don't think the analogy holds. First and Last are wrappers for Maybe
> by intention — they are needed because we can't have two different
> instances for Maybe (although both of them make sense).
>
> In this case, however, Maybe is used artificially to "lift" numbers.
> Monoidal instance for Maybe corresponding to 'max' would look rather
> weird.
>
> Finally, we have nice names for mempty of Maximum/Minimum but not of
> First/Last.
>
> Roman
Good point.  Now I'm slightly in favor of Roman's approach.  Count me as 
+0.2 for Roman's version.



More information about the Libraries mailing list