sorted-list 0.1.4.2 → 0.1.5.0
raw patch · 2 files changed
+10/−3 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.SortedList: instance Eq a => Eq (SortedList a)
- Data.SortedList: instance Foldable SortedList
- Data.SortedList: instance NFData a => NFData (SortedList a)
- Data.SortedList: instance Ord a => Monoid (SortedList a)
- Data.SortedList: instance Ord a => Ord (SortedList a)
- Data.SortedList: instance Show a => Show (SortedList a)
- Data.SortedList: null :: SortedList a -> Bool
+ Data.SortedList: delete :: Eq a => a -> SortedList a -> SortedList a
+ Data.SortedList: instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.SortedList.SortedList a)
+ Data.SortedList: instance Data.Foldable.Foldable Data.SortedList.SortedList
+ Data.SortedList: instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.SortedList.SortedList a)
+ Data.SortedList: instance GHC.Classes.Ord a => GHC.Base.Monoid (Data.SortedList.SortedList a)
+ Data.SortedList: instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.SortedList.SortedList a)
+ Data.SortedList: instance GHC.Show.Show a => GHC.Show.Show (Data.SortedList.SortedList a)
Files
- Data/SortedList.hs +9/−2
- sorted-list.cabal +1/−1
Data/SortedList.hs view
@@ -20,6 +20,8 @@ , uncons -- * Inserting , insert+ -- * Deleting+ , delete -- * Sublists , take , drop@@ -175,6 +177,11 @@ insert x xs = mappend (singleton x) xs #endif +-- | Delete the first occurrence of the given element.+delete :: Eq a => a -> SortedList a -> SortedList a+{-# INLINE delete #-}+delete x (SortedList xs) = SortedList $ List.delete x xs+ -- | Extract the prefix with the given length from a sorted list. take :: Int -> SortedList a -> SortedList a take n = fst . splitAt n@@ -245,8 +252,8 @@ -- Note that 'map' will hang if the argument is an infinite list. -- -- Even though 'SortedList' can't be made an instance of 'Functor',--- 'map' /does/ hold the 'Functor' laws. The problem to write--- this instance is the 'Ord' instance requirement on the type of+-- 'map' /does/ hold the 'Functor' laws (for finite lists).+-- We can't however write an instance because of the 'Ord' instance requirement on the type of -- the elements of the result list. Therefore, while 'SortedList' -- is not a functor type in general, it is when restricted to elements of -- orderable types.
sorted-list.cabal view
@@ -1,5 +1,5 @@ name: sorted-list-version: 0.1.4.2+version: 0.1.5.0 synopsis: Type-enforced sorted lists and related functions. description: Type-enforced sorted lists and related functions. .