From b0d68d32698e62664d4b43cbc938cb571c8fc364 Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Tue, 23 Apr 2024 07:42:24 -0400 Subject: [PATCH] Backport foldl' to Prelude.Compat Also bump the major version number to 0.14.0, per the version policy in the `base-compat` `README`. Addresses one check box in #24. --- base-compat-batteries/base-compat-batteries.cabal | 4 ++-- base-compat/CHANGES.markdown | 3 ++- base-compat/README.markdown | 1 + base-compat/base-compat.cabal | 2 +- base-compat/src/Prelude/Compat.hs | 9 +++++++-- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/base-compat-batteries/base-compat-batteries.cabal b/base-compat-batteries/base-compat-batteries.cabal index fb28319..acdf031 100644 --- a/base-compat-batteries/base-compat-batteries.cabal +++ b/base-compat-batteries/base-compat-batteries.cabal @@ -1,5 +1,5 @@ name: base-compat-batteries -version: 0.13.1 +version: 0.14.0 license: MIT license-file: LICENSE copyright: (c) 2012-2018 Simon Hengel, @@ -66,7 +66,7 @@ library Haskell2010 build-depends: base >= 4.3 && < 5, - base-compat == 0.13.1, + base-compat == 0.14.0, ghc-prim if !impl(ghc >= 7.8) build-depends: diff --git a/base-compat/CHANGES.markdown b/base-compat/CHANGES.markdown index 75b7313..cc770bb 100644 --- a/base-compat/CHANGES.markdown +++ b/base-compat/CHANGES.markdown @@ -1,5 +1,6 @@ -## Changes in ???? [????.??.??] +## Changes in 0.14.0 [????.??.??] - Sync with `base-4.20`/GHC 9.10 + - Backport `foldl'` to `Prelude.Compat` ## Changes in 0.13.1 [2023.10.11] - Sync with `base-4.19`/GHC 9.8 diff --git a/base-compat/README.markdown b/base-compat/README.markdown index a3a24d6..58231b2 100644 --- a/base-compat/README.markdown +++ b/base-compat/README.markdown @@ -152,6 +152,7 @@ So far the following is covered. * `unsafeFixIO` and `unsafeDupablePerformIO` to `System.IO.Unsafe.IO` * `RuntimeRep`-polymorphic `($!)` to `Prelude.Compat` * `liftA2` is re-exported from `Prelude.Compat` + * `foldl'` is re-exported from `Prelude.Compat` * `RuntimeRep`-polymorphic `throw` to `Control.Exception.Compat` * `isResourceVanishedError`, `resourceVanishedErrorType`, and `isResourceVanishedErrorType` to `System.IO.Error.Compat` diff --git a/base-compat/base-compat.cabal b/base-compat/base-compat.cabal index 5fc59b5..3a22c64 100644 --- a/base-compat/base-compat.cabal +++ b/base-compat/base-compat.cabal @@ -1,5 +1,5 @@ name: base-compat -version: 0.13.1 +version: 0.14.0 license: MIT license-file: LICENSE copyright: (c) 2012-2018 Simon Hengel, diff --git a/base-compat/src/Prelude/Compat.hs b/base-compat/src/Prelude/Compat.hs index bb6cc4d..9ec33b3 100644 --- a/base-compat/src/Prelude/Compat.hs +++ b/base-compat/src/Prelude/Compat.hs @@ -7,11 +7,11 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeInType #-} #endif -#if MIN_VERSION_base(4,17,0) && !(MIN_VERSION_base(4,18,0)) +#if MIN_VERSION_base(4,17,0) && !(MIN_VERSION_base(4,20,0)) {-# LANGUAGE ExplicitNamespaces #-} #endif module Prelude.Compat ( -#if MIN_VERSION_base(4,18,0) +#if MIN_VERSION_base(4,20,0) module Base #else either @@ -119,6 +119,7 @@ module Prelude.Compat ( , elem , foldMap , foldl +, foldl' , foldl1 , foldr , foldr1 @@ -299,6 +300,10 @@ import Prelude as Base hiding ( import Control.Applicative (liftA2) # endif +# if !(MIN_VERSION_base(4,20,0)) +import Data.Foldable (foldl') +# endif + #else import Prelude hiding (