
I generally feel having these only-one-way-to-do-it instances just defined
is better than forcing orphans upon those who _do_ want them.
Inevitably those users seem to wind up with separate orphans that tend to
collide, or just give up and define their own type. Both of those outcomes
are rather suboptimal.
-Edward
On Sat, Feb 21, 2015 at 4:48 PM, Joachim Breitner
HI,
Am Samstag, den 21.02.2015, 21:26 +0000 schrieb Oliver Charles:
Having Applicative might be nice for `pure`. That way we can getSum . foldMap pure, and so on. Of course, in that case using `Sum` is no different, but this opens up the ability to construct `Sum`s from other parts of code that simply require `Applicative`.
is that any better than "getSum . foldMap Sum"?
Adding an Applicative instance, when the only main use case is to cover-over the lack of a Pointed type class, does not seem to be a good guiding principle.
BTW, coerce would work as well here, if you for some reason want to use a polymorphic argument to foldMap.
Still not convinced :-), Joachim
-- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries