[commit: packages/containers] ghc-head: Change the split method to return a list, as per the discussion on the list. Bump version number to 0.5.3.2 to reflect change. (a7e1145)

git at git.haskell.org git at git.haskell.org
Thu Jan 16 07:51:00 UTC 2014


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

On branch  : ghc-head
Link       : http://git.haskell.org/packages/containers.git/commitdiff/a7e114548d21ed08434c871f6ec5e5fabc68eb79

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

commit a7e114548d21ed08434c871f6ec5e5fabc68eb79
Author: Ryan Newton <rrnewton at gmail.com>
Date:   Mon Dec 2 23:15:05 2013 -0500

    Change the split method to return a list, as per the discussion on the list.
    Bump version number to 0.5.3.2 to reflect change.


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

a7e114548d21ed08434c871f6ec5e5fabc68eb79
 Data/Map/Base.hs |   12 +++++++-----
 containers.cabal |    2 +-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/Data/Map/Base.hs b/Data/Map/Base.hs
index 083b803..4767a1d 100644
--- a/Data/Map/Base.hs
+++ b/Data/Map/Base.hs
@@ -2816,13 +2816,15 @@ foldlStrict f = go
 {-# INLINE foldlStrict #-}
 
 
--- | /O(1)/.  Decompose a Map into pieces.  No guarantee is made as to the sizes of
--- the pieces, but some of them will be balanced, and some may be empty.
-splitTree :: Map k b -> Maybe (Map k b, Map k b, Map k b)
+-- | /O(1)/.  Decompose a Map into pieces, based on the structure of the underlying
+-- tree.  No guarantee is made as to the sizes of the pieces: an internal, but
+-- deterministic process determines this.  This is most useful for consuming a Map in
+-- parallel.
+splitTree :: Map k b -> [Map k b]
 splitTree orig =
   case orig of 
-    Tip           -> Nothing
-    Bin 1 k v l r -> Just (singleton k v, l, r)
+    Tip           -> []
+    Bin 1 k v l r -> [singleton k v, l, r]
 {-# INLINE splitTree #-}
 
 
diff --git a/containers.cabal b/containers.cabal
index 4a54c4a..845cb2d 100644
--- a/containers.cabal
+++ b/containers.cabal
@@ -1,5 +1,5 @@
 name: containers
-version: 0.5.3.1
+version: 0.5.3.2
 license: BSD3
 license-file: LICENSE
 maintainer: fox at ucw.cz



More information about the ghc-commits mailing list