[Haskell-cafe] Improving *> and >> for Data.Sequence

David Feuer david.feuer at gmail.com
Wed Nov 19 19:58:46 UTC 2014


On Wed, Nov 19, 2014 at 2:02 PM, Ross Paterson <R.Paterson at city.ac.uk>
wrote:

> On Wed, Nov 19, 2014 at 01:53:02PM -0500, David Feuer wrote:
> > I meant O(m log (mn)) = O(m (log m + log n)), because there are m
> appends,
> > building up from O(n) to O(mn), but it really doesn't matter because we
> can
> > easily do better.
>
> Indeed it's moot, but appending a tree of size n to one of size mn
> costs O(log n).
>

Right, I forgot that. I got to looking at <*> just now, and it suggests the
following question: is there a particularly efficient way to build a Seq
when its ultimate size is known in advance, avoiding the usual incremental
rebuilding?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20141119/16a605f3/attachment.html>


More information about the Haskell-Cafe mailing list