<div dir="ltr">+1, have implemented it in a few occasions already.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 17, 2016 at 11:03 PM, David Feuer <span dir="ltr"><<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Daniel Wagner would like to add the following straightforward function<br>
to Data.Tree. I think this is a grand idea.<br>
<br>
foldTree :: (a -> [b] -> b) -> Tree a -> b<br>
foldTree f = go<br>
where<br>
go (Node x ts) = f x (map go ts)<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Alp Mestanogullari</div>
</div>