Proposal: Add a catamorphism on Trees

Joachim Breitner mail at joachim-breitner.de
Tue May 17 21:18:51 UTC 2016


Hi,

Am Dienstag, den 17.05.2016, 17:03 -0400 schrieb David Feuer:
> Daniel Wagner would like to add the following straightforward
> function
> to Data.Tree. I think this is a grand idea.
> 
> foldTree :: (a -> [b] -> b) -> Tree a -> b
> foldTree f = go
>   where
>     go (Node x ts) = f x (map go ts)

LGTM

Joachim
-- 
Joachim “nomeata” Breitner
  mail at joachim-breitner.dehttps://www.joachim-breitner.de/
  XMPP: nomeata at joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F
  Debian Developer: nomeata at debian.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20160517/767d41a0/attachment.sig>


More information about the Libraries mailing list