packages feed

multiset-comb 0.2 → 0.2.1

raw patch · 2 files changed

+6/−2 lines, 2 files

Files

Math/Combinatorics/Multiset.hs view
@@ -20,6 +20,7 @@        , fromDistinctList        , fromCounts        , getCounts+       , size           -- ** Operations        , disjUnion@@ -73,6 +74,10 @@ --   elements. getCounts :: Multiset a -> [Count] getCounts (MS xs) = map snd xs++-- | Compute the total size of a multiset.+size :: Multiset a -> Int+size = sum . getCounts  liftMS :: ([(a, Count)] -> [(b, Count)]) -> Multiset a -> Multiset b liftMS f (MS m) = MS (f m)
multiset-comb.cabal view
@@ -1,12 +1,11 @@ Name:                multiset-comb-Version:             0.2+Version:             0.2.1 Synopsis:            Combinatorial algorithms over multisets Description:         Various combinatorial algorithms over multisets,                      including generating all permutations,                      partitions, size-2 partitions, size-k subsets,                      and Sawada's algorithm for generating all                      necklaces with elements from a multiset.-Homepage:            http://code.haskell.org/~byorgey/code/multiset-comb License:             BSD3 License-file:        LICENSE Author:              Brent Yorgey