Proposal: improve the Data.Tree API

Johan Tibell johan.tibell at
Thu Feb 27 13:08:27 UTC 2014


General comment: none of the other containers APIs use a function<DataType>
suffix. I noticed that Data.Tree does for a bunch of functions. Perhaps we
should avoid continuing down that path and instead have functions like
'lookup' and 'lookupInForest'.

On Thu, Feb 27, 2014 at 12:34 PM, João Cristóvão <jmacristovao at>wrote:

> -- | get the sub-tree rooted at the first (left-most, depth-first) value
> that
> -- matches the provided condition
> findTree :: (a -> Bool) -> Tree a -> Maybe (Tree a)

I believe we usually use a "By" suffix for functions that take the
predicate as an argument instead of as an instance. So I'd vote for
lookupBy instead of findTree.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list