<div dir="ltr"><div><div><div><div>Hi Ivan,<br><br>>> then what about the arguably better name `size`?<br>
> Huh, I thought we already had that.<br><br></div>We do?<br></div>If there is consensus I would then add `size` with the arguably more efficient implementation:<br>size :: Tree a -> Int<br>size = getSum . F.foldMap (const $ Sum 1)<br>

<br>> * An Ord instance (achievable via standalone deriving, though this isn't ideal)<br></div><br>Agreed.<br></div><br><div>> * Functions to take/drop so many levels of the tree (take is<br>> relatively easy; drop would result in a Forest).<br>

<br></div><div>Similar to treeprune in <a href="http://hackage.haskell.org/package/hledger-lib-0.22.1/docs/Hledger-Utils.html#v:subtreeat">http://hackage.haskell.org/package/hledger-lib-0.22.1/docs/Hledger-Utils.html#v:subtreeat</a> ?<br>

<br>> mirror :: Tree a -> Tree a<br>> mirror (Node a ts) = Node a . reverse $ map mirror ts<br>
</div><div><br></div><div>I don't have strong feeling about this one, but if more people see as useful, why not...<br><br></div><div>Joćo<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-24 11:38 GMT+00:00 Ivan Lazar Miljenovic <span dir="ltr"><<a href="mailto:ivan.miljenovic@gmail.com" target="_blank">ivan.miljenovic@gmail.com</a>></span>:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 24 February 2014 22:17, Tobias Florek <<a href="mailto:haskell@ibotty.net">haskell@ibotty.net</a>> wrote:<br>


> hi,<br>
><br>
>> But to be honest, I don't have strong feelings about this, I'm willing<br>
>> to drop this particular function (length) from the proposal, if there is<br>
>> no consensus.<br>
><br>
> then what about the arguably better name `size`?<br>
<br>
</div>Huh, I thought we already had that.<br>
<br>
Some things I missed when I last used Data.Tree:<br>
<br>
* An Ord instance (achievable via standalone deriving, though this isn't ideal)<br>
<br>
* A function to take the mirror-image of a tree (name not that important):<br>
<br>
mirror :: Tree a -> Tree a<br>
mirror (Node a ts) = Node a . reverse $ map mirror ts<br>
<br>
* Functions to take/drop so many levels of the tree (take is<br>
relatively easy; drop would result in a Forest).<br>
<div class="im HOEnZb"><br>
<br>
><br>
> cheers,<br>
>  tobias florek<br>
><br>
><br>
> _______________________________________________<br>
> Libraries mailing list<br>
> <a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
> <a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
<br>
<br>
<br>
</div><div class="im HOEnZb">--<br>
Ivan Lazar Miljenovic<br>
<a href="mailto:Ivan.Miljenovic@gmail.com">Ivan.Miljenovic@gmail.com</a><br>
<a href="http://IvanMiljenovic.wordpress.com" target="_blank">http://IvanMiljenovic.wordpress.com</a><br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
</div></div></blockquote></div><br></div>