packages feed

extra 1.7.13 → 1.7.14

raw patch · 3 files changed

+10/−4 lines, 3 filesdep ~basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base

API changes (from Hackage documentation)

Files

CHANGES.txt view
@@ -1,5 +1,8 @@ Changelog for Extra +1.7.14, released 2023-07-01+    #106, add compatibility with GHC 9.7+    #103, future-proof against addition of Data.List.unsnoc 1.7.13, released 2023-04-22     #102, add mwhen :: Monoid a => Bool -> a -> a     #99, make replace with an empty from intersperse the replacement
extra.cabal view
@@ -1,7 +1,7 @@ cabal-version:      1.18 build-type:         Simple name:               extra-version:            1.7.13+version:            1.7.14 license:            BSD3 license-file:       LICENSE category:           Development@@ -15,7 +15,7 @@     The module "Extra" documents all functions provided by this library. Modules such as "Data.List.Extra" provide extra functions over "Data.List" and also reexport "Data.List". Users are recommended to replace "Data.List" imports with "Data.List.Extra" if they need the extra functionality. homepage:           https://github.com/ndmitchell/extra#readme bug-reports:        https://github.com/ndmitchell/extra/issues-tested-with:        GHC==9.2, GHC==9.0, GHC==8.10, GHC==8.8, GHC==8.6+tested-with:        GHC==9.6, GHC==9.4, GHC==9.2, GHC==9.0, GHC==8.10, GHC==8.8  extra-doc-files:     CHANGES.txt
src/Data/List/Extra.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE CPP, TupleSections, ConstraintKinds #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}  -- | This module extends "Data.List" with extra functions of a similar nature. --   The package also exports the existing "Data.List" functions.@@ -156,7 +157,7 @@ lastDef d xs = foldl (\_ x -> x) d xs -- I know this looks weird, but apparently this is the fastest way to do this: https://hackage.haskell.org/package/base-4.12.0.0/docs/src/GHC.List.html#last {-# INLINE lastDef #-} -#if !MIN_VERSION_base(4,19,0)+#if __GLASGOW_HASKELL__ <= 906 -- | A total variant of the list index function `(!!)`. -- -- > [2,3,4] !? 1    == Just 3@@ -189,6 +190,7 @@ list nil cons [] = nil list nil cons (x:xs) = cons x xs +#if __GLASGOW_HASKELL__ <= 906 -- | If the list is empty returns 'Nothing', otherwise returns the 'init' and the 'last'. -- -- > unsnoc "test" == Just ("tes",'t')@@ -199,6 +201,7 @@ unsnoc [x] = Just ([], x) unsnoc (x:xs) = Just (x:a, b)     where Just (a,b) = unsnoc xs+#endif  -- | Append an element to the start of a list, an alias for '(:)'. --@@ -288,7 +291,7 @@ -- -- > concatUnzip [("a","AB"),("bc","C")] == ("abc","ABC") concatUnzip :: [([a], [b])] -> ([a], [b])-concatUnzip = (concat *** concat) . unzip+concatUnzip = (concat *** concat) . Prelude.unzip  -- | A merging of 'unzip3' and 'concat'. --