Unique 0.4.6.1 → 0.4.7
raw patch · 3 files changed
+20/−3 lines, 3 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
+ Data.List.Unique: allUnique :: Ord a => [a] -> Bool
Files
- Data/List/Unique.hs +11/−0
- Unique.cabal +2/−2
- tests/Main.hs +7/−1
Data/List/Unique.hs view
@@ -19,6 +19,7 @@ , repeated , repeatedBy , unique+ , allUnique , count , count_ , occurrences@@ -71,6 +72,16 @@ lh :: [a] -> (a, Int) lh = liftA2 (,) head length++-- | 'allUnique' checks whether all elements of the list are unique+--+-- > allUnique "foo bar" == False+-- > allUnique ['a'..'z'] == True+-- > allUnique [] == True (!)+-- Since 0.4.7++allUnique :: Ord a => [a] -> Bool+allUnique = all ( (==) 1 . length) . sg -- | 'count' of each element in the list, it sorts by keys (elements). Example: --
Unique.cabal view
@@ -1,6 +1,6 @@ name: Unique -version: 0.4.6.1+version: 0.4.7 synopsis: It provides the functionality like unix "uniq" utility description: Library provides the functions to find unique and duplicate elements in the list@@ -21,7 +21,7 @@ Data.List.UniqueStrict, Data.List.UniqueUnsorted - build-depends: base >=4.0 && < 4.10+ build-depends: base >=4.0 && < 5 , extra , containers , hashable
tests/Main.hs view
@@ -2,7 +2,13 @@ import SortUniq import RepeatedBy import Complex+import AllUnique import Test.Hspec main :: IO ()-main = mapM_ hspec [isUniqueTests, sortUniqTests, repeatedByTests, complexTests]+main = mapM_ hspec [isUniqueTests+ , sortUniqTests+ , repeatedByTests+ , complexTests+ , allUniqueTests+ ]