packages feed

multiset 0.3.0 → 0.3.1

raw patch · 4 files changed

+42/−5 lines, 4 filesdep +Globdep +doctestdep ~basePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies added: Glob, doctest

Dependency ranges changed: base

API changes (from Hackage documentation)

- Data.IntMultiSet: instance Data IntMultiSet
- Data.IntMultiSet: instance Eq IntMultiSet
- Data.IntMultiSet: instance Monoid IntMultiSet
- Data.IntMultiSet: instance Ord IntMultiSet
- Data.IntMultiSet: instance Read IntMultiSet
- Data.IntMultiSet: instance Show IntMultiSet
- Data.IntMultiSet: instance Typeable IntMultiSet
- Data.MultiSet: instance (Data a, Ord a) => Data (MultiSet a)
- Data.MultiSet: instance (Read a, Ord a) => Read (MultiSet a)
- Data.MultiSet: instance Eq a => Eq (MultiSet a)
- Data.MultiSet: instance Foldable MultiSet
- Data.MultiSet: instance Ord a => Monoid (MultiSet a)
- Data.MultiSet: instance Ord a => Ord (MultiSet a)
- Data.MultiSet: instance Show a => Show (MultiSet a)
- Data.MultiSet: instance Typeable MultiSet
+ Data.IntMultiSet: instance Data.Data.Data Data.IntMultiSet.IntMultiSet
+ Data.IntMultiSet: instance GHC.Base.Monoid Data.IntMultiSet.IntMultiSet
+ Data.IntMultiSet: instance GHC.Classes.Eq Data.IntMultiSet.IntMultiSet
+ Data.IntMultiSet: instance GHC.Classes.Ord Data.IntMultiSet.IntMultiSet
+ Data.IntMultiSet: instance GHC.Read.Read Data.IntMultiSet.IntMultiSet
+ Data.IntMultiSet: instance GHC.Show.Show Data.IntMultiSet.IntMultiSet
+ Data.MultiSet: instance (Data.Data.Data a, GHC.Classes.Ord a) => Data.Data.Data (Data.MultiSet.MultiSet a)
+ Data.MultiSet: instance (GHC.Read.Read a, GHC.Classes.Ord a) => GHC.Read.Read (Data.MultiSet.MultiSet a)
+ Data.MultiSet: instance Data.Foldable.Foldable Data.MultiSet.MultiSet
+ Data.MultiSet: instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.MultiSet.MultiSet a)
+ Data.MultiSet: instance GHC.Classes.Ord a => GHC.Base.Monoid (Data.MultiSet.MultiSet a)
+ Data.MultiSet: instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.MultiSet.MultiSet a)
+ Data.MultiSet: instance GHC.Show.Show a => GHC.Show.Show (Data.MultiSet.MultiSet a)
- Data.MultiSet: bind :: Ord b => MultiSet a -> (a -> MultiSet b) -> MultiSet b
+ Data.MultiSet: bind :: (Ord b) => MultiSet a -> (a -> MultiSet b) -> MultiSet b
- Data.MultiSet: concatMap :: Ord b => (a -> [b]) -> MultiSet a -> MultiSet b
+ Data.MultiSet: concatMap :: (Ord b) => (a -> [b]) -> MultiSet a -> MultiSet b
- Data.MultiSet: map :: Ord b => (a -> b) -> MultiSet a -> MultiSet b
+ Data.MultiSet: map :: (Ord b) => (a -> b) -> MultiSet a -> MultiSet b
- Data.MultiSet: mapMaybe :: Ord b => (a -> Maybe b) -> MultiSet a -> MultiSet b
+ Data.MultiSet: mapMaybe :: (Ord b) => (a -> Maybe b) -> MultiSet a -> MultiSet b
- Data.MultiSet: unionsMap :: Ord b => (a -> MultiSet b) -> MultiSet a -> MultiSet b
+ Data.MultiSet: unionsMap :: (Ord b) => (a -> MultiSet b) -> MultiSet a -> MultiSet b

Files

Data/IntMultiSet.hs view
@@ -361,6 +361,10 @@  -- | /O(log n)/. Retrieves the minimal element of the multiset, and the set stripped from that element -- Returns @Nothing@ when passed an empty multiset.+--+-- Examples:+-- >>> minView $ fromList [100, 100, 200, 300]+-- Just (100,fromOccurList [(100,1),(200,1),(300,1)]) minView :: IntMultiSet -> Maybe (Key, IntMultiSet) minView x   | null x    = Nothing@@ -368,10 +372,14 @@  -- | /O(log n)/. Retrieves the maximal element of the multiset, and the set stripped from that element -- @fail@s (in the monad) when passed an empty multiset.+--+-- Examples:+-- >>> maxView $ fromList [100, 100, 200, 300]+-- Just (300,fromOccurList [(100,2),(200,1)]) maxView :: IntMultiSet -> Maybe (Key, IntMultiSet) maxView x   | null x    = Nothing-  | otherwise = Just (deleteFindMin x)+  | otherwise = Just (deleteFindMax x)  {--------------------------------------------------------------------   Union, Difference, Intersection
Data/MultiSet.hs view
@@ -347,6 +347,10 @@ -- | /O(log n)/. Retrieves the minimal element of the multiset, --   and the set with that element removed. --   Returns @Nothing@ when passed an empty multiset.+--+-- Examples:+-- >>> minView $ fromList ['a', 'a', 'b', 'c']+-- Just ('a',fromOccurList [('a',1),('b',1),('c',1)]) minView :: MultiSet a -> Maybe (a, MultiSet a) minView x   | null x    = Nothing@@ -355,10 +359,14 @@ -- | /O(log n)/. Retrieves the maximal element of the multiset, --   and the set with that element removed. --   Returns @Nothing@ when passed an empty multiset.+--+-- Examples:+-- >>> maxView $ fromList ['a', 'a', 'b', 'c']+-- Just ('c',fromOccurList [('a',2),('b',1)]) maxView :: MultiSet a -> Maybe (a, MultiSet a) maxView x   | null x    = Nothing-  | otherwise = Just (deleteFindMin x)+  | otherwise = Just (deleteFindMax x)  {--------------------------------------------------------------------   Union, Difference, Intersection
multiset.cabal view
@@ -1,5 +1,5 @@ name:             multiset-version:          0.3.0+version:          0.3.1 author:           Twan van Laarhoven maintainer:       twanvl@gmail.com bug-reports:      https://github.com/twanvl/multiset/issues@@ -11,7 +11,7 @@ license:          BSD3 license-file:     LICENSE build-type:       Simple-Cabal-version:    >= 1.6+Cabal-version:    >= 1.10 extra-source-files: include/Typeable.h  source-repository head@@ -19,9 +19,20 @@     location: http://github.com/twanvl/multiset.git  Library+  default-language:   Haskell2010   exposed-modules:    Data.MultiSet, Data.IntMultiSet    include-dirs:       include-  extensions:         CPP+  default-extensions: CPP   ghc-options:        -Wall   build-depends:      containers >= 0.5, base >= 4 && < 5++test-suite doctests+  default-language:   Haskell2010+  type:               exitcode-stdio-1.0+  ghc-options:        -threaded+  hs-source-dirs:     test+  main-is:            Main.hs+  build-depends:      Glob+                    , base >= 4 && < 5+                    , doctest
+ test/Main.hs view
@@ -0,0 +1,10 @@+module Main (main) where++import System.FilePath.Glob (glob)+import Test.DocTest (doctest)++main :: IO ()+main = do+  glob "Data/**/*.hs" >>= doctest+  glob "test/**/*.hs" >>= doctest+