<div dir="ltr">On Mon, Aug 31, 2015 at 1:54 PM, Fermin Reig <span dir="ltr"><<a href="mailto:ferminreig@fastmail.fm" target="_blank">ferminreig@fastmail.fm</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We could generalise:<br>
<br>
mconcat:: [a] -> a<br>
mconcat = foldr mappend memtpy<br>
<br>
to:<br>
<br>
mconcat:: Foldable t => t a -> a<br>
mconcat = foldr mappend memtpy<br>
-- even<br>
-- mconcat = fold<br></blockquote><div><br></div><div>I don't understand the appeal of generalizing the type of a function when the generalization already exists; but in this case it's not a viable option anyways because mconcat is a class method of Monoid, and the definition of the Foldable class already refers to Monoid. Creating a circular dependency of Monoid on Foldable would be a headache best avoided.<br><br></div><div>Regards,<br></div><div>Reid Barton<br></div></div></div></div>