data-partition 0.2.0.0 → 0.2.0.1
raw patch · 2 files changed
+6/−3 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Data/Partition.hs +5/−2
- data-partition.cabal +1/−1
Data/Partition.hs view
@@ -48,9 +48,12 @@ -- with every remaining element being given its own set. fromSets :: (Ord a) => [Set.Set a] -> Partition a fromSets sets = Partition { - forwardMap = Map.fromList [ (x, Set.findMin s) | s <- sets, x <- Set.toList s ],- backwardMap = Map.fromList [ (Set.findMin s, s) | s <- sets ]+ forwardMap = Map.fromList [ (x, Set.findMin s) | s <- sets', x <- Set.toList s ],+ backwardMap = Map.fromList [ (Set.findMin s, s) | s <- sets' ] }+ where+ sets' = filter (not.isSingleton) sets+ isSingleton s = 1 == Set.size s -- | Returns a list of all nontrivial sets (sets with more than one element) in the -- partition.
data-partition.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: data-partition-version: 0.2.0.0+version: 0.2.0.1 synopsis: A pure disjoint set (union find) data structure -- description: homepage: https://github.com/luqui/data-partition