Proposal: improve the Data.Tree API

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


Hi,

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 gmail.com>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.

Cheers,
Johan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20140227/a87da290/attachment.html>


More information about the Libraries mailing list