Skip to content

Commit

Permalink
Backport foldl' to Prelude.Compat
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
RyanGlScott committed Apr 30, 2024
1 parent 1659f24 commit b0d68d3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions base-compat-batteries/base-compat-batteries.cabal
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion base-compat/CHANGES.markdown
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions base-compat/README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion base-compat/base-compat.cabal
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
9 changes: 7 additions & 2 deletions base-compat/src/Prelude/Compat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -119,6 +119,7 @@ module Prelude.Compat (
, elem
, foldMap
, foldl
, foldl'
, foldl1
, foldr
, foldr1
Expand Down Expand Up @@ -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 (
Expand Down

0 comments on commit b0d68d3

Please sign in to comment.