sorted-list 0.2.1.0 → 0.2.1.1
raw patch · 4 files changed
+20/−9 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.SortedList: instance GHC.Classes.Ord a => Data.Semigroup.Semigroup (Data.SortedList.SortedList a)
+ Data.SortedList: instance GHC.Classes.Ord a => GHC.Base.Semigroup (Data.SortedList.SortedList a)
- Data.SortedList: delete :: Eq a => a -> SortedList a -> SortedList a
+ Data.SortedList: delete :: Ord a => a -> SortedList a -> SortedList a
Files
- Data/SortedList.hs +9/−3
- changelog.md +2/−0
- readme.md +3/−0
- sorted-list.cabal +6/−6
Data/SortedList.hs view
@@ -91,7 +91,7 @@ #endif -- | Type of sorted lists. Any (non-bottom) value of this type--- is a sorted list. Use the 'Monoid' instance to append sorted+-- is a sorted list. Use the 'Monoid' instance to merge sorted -- lists. newtype SortedList a = SortedList [a] deriving (Eq, Ord) @@ -213,9 +213,15 @@ #endif -- | Delete the first occurrence of the given element.-delete :: Eq a => a -> SortedList a -> SortedList a+delete :: Ord a => a -> SortedList a -> SortedList a {-# INLINE delete #-}-delete x (SortedList xs) = SortedList $ List.delete x xs+delete a (SortedList l) = SortedList $ go l+ where+ go (x:xs)+ | x < a = x : go xs+ | x > a = x : xs+ | otherwise = xs+ go [] = [] -- | Extract the prefix with the given length from a sorted list. take :: Int -> SortedList a -> SortedList a
+ changelog.md view
@@ -0,0 +1,2 @@+## 0.2.1.1+* Improve `delete` implementation.
+ readme.md view
@@ -0,0 +1,3 @@+# sorted-list++Type-enforced sorted lists and related functions.
sorted-list.cabal view
@@ -1,5 +1,5 @@ name: sorted-list-version: 0.2.1.0+version: 0.2.1.1 synopsis: Type-enforced sorted lists and related functions. description: Type-enforced sorted lists and related functions. .@@ -24,15 +24,15 @@ . If you are missing a feature, do not hesitate to ask by opening an issue at the bug-tracker.-homepage: https://github.com/Daniel-Diaz/sorted-list/blob/master/README.md license: BSD3 license-file: LICENSE-author: Daniel Díaz-maintainer: dhelta.diaz@gmail.com-bug-reports: https://github.com/Daniel-Diaz/sorted-list/issues+author: Daniel Casanueva (daniel.casanueva `at` proton.me)+maintainer: Daniel Casanueva (daniel.casanueva `at` proton.me)+bug-reports: https://gitlab.com/daniel-casanueva/haskell/sorted-list/-/issues category: Data build-type: Simple-cabal-version: >=1.10+cabal-version: 1.18+extra-doc-files: readme.md, changelog.md library exposed-modules: Data.SortedList