Unique 0.1.0.2 → 0.1.0.3
raw patch · 2 files changed
+7/−4 lines, 2 files
Files
- Data/List/Unique.hs +6/−3
- Unique.cabal +1/−1
Data/List/Unique.hs view
@@ -64,7 +64,10 @@ -- | 'countElem' gets the number of occurrences of the specified element. Example: ----- countElem 'o' "foo bar" == Just 2+-- countElem 'o' "foo bar" == 2 -countElem :: Ord a => a -> [a] -> Maybe Int-countElem x = lookup x . count+countElem :: Eq a => a -> [a] -> Int +countElem x [] = 0+countElem x (y:ys) = case x == y of + False -> countElem x ys+ True -> 1 + countElem x ys
Unique.cabal view
@@ -10,7 +10,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.1.0.2+version: 0.1.0.3 -- A short (one-line) description of the package. synopsis: It provides the functionality like unix "uniq" utility