[commit: packages/containers] master: Fix efficiency claim for zipWith. (107ec12)

git at git.haskell.org git at git.haskell.org
Sun Dec 20 16:23:30 UTC 2015


Repository : ssh://git@git.haskell.org/containers

On branch  : master
Link       : http://git.haskell.org/packages/containers.git/commitdiff/107ec12d17aa98d8fd552276b81a94fe6f44224b

>---------------------------------------------------------------

commit 107ec12d17aa98d8fd552276b81a94fe6f44224b
Author: David Feuer <David.Feuer at gmail.com>
Date:   Thu Dec 18 11:19:53 2014 -0500

    Fix efficiency claim for zipWith.


>---------------------------------------------------------------

107ec12d17aa98d8fd552276b81a94fe6f44224b
 Data/Sequence.hs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Data/Sequence.hs b/Data/Sequence.hs
index 7d31f79..7675698 100644
--- a/Data/Sequence.hs
+++ b/Data/Sequence.hs
@@ -1872,9 +1872,9 @@ reverseNode f (Node3 s a b c) = Node3 s (f c) (f b) (f a)
 -- them up further and zip them with their matching pieces can be delayed until
 -- they're actually needed. We do the same thing for Digits (splitting into
 -- between one and four pieces) and Nodes (splitting into two or three). The
--- ultimate result is that we can index, or split at, any location in zs in
--- O(log(min{i,n-i})) time *immediately*, with only a constant-factor slowdown
--- as thunks are forced along the path.
+-- ultimate result is that we can index into, or split at, any location in zs
+-- in O((log(min{i,n-i}))^2) time *immediately*, while still being able to
+-- force all the thunks in O(n) time.
 --
 -- Benchmark info, and alternatives:
 --



More information about the ghc-commits mailing list