Skip to content

Commit

Permalink
Backport List to Data.List.Compat
Browse files Browse the repository at this point in the history
Addresses one check box in #24.
  • Loading branch information
RyanGlScott committed Apr 23, 2024
1 parent 9dfc424 commit a77a453
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions base-compat/CHANGES.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Changes in 0.14.0 [????.??.??]
- Sync with `base-4.20`/GHC 9.10
- Backport `foldl'` to `Prelude.Compat`
- Backport `List` to `Data.List.Compat` (when building with GHC 9.6 or later)

## 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 @@ -166,6 +166,7 @@ So far the following is covered.
* `heqT` to `Data.Typeable.Compat`
* `unzip` to `Data.Functor.Compat`
* `(!?)` and `unsnoc` to `Data.List.Compat`
* `List` to `Data.List.Compat` (when building with GHC 9.6 or later)
* `getSolo` to `Data.Tuple.Compat`
* `decT` and `hdecT` to `Data.Typeable.Compat`
* `decTypeRep` to `Type.Reflection.Compat`
Expand Down
9 changes: 9 additions & 0 deletions base-compat/src/Data/List/Compat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
#endif
module Data.List.Compat (
module Base

#if MIN_VERSION_base(4,18,0) && !(MIN_VERSION_base(4,20,0))
, List
#endif

#if !(MIN_VERSION_base(4,19,0))
, (!?)
, unsnoc
Expand Down Expand Up @@ -105,6 +110,10 @@ import GHC.Exts (build)
import Prelude.Compat hiding (foldr, null)
#endif

#if MIN_VERSION_base(4,18,0) && !(MIN_VERSION_base(4,20,0))
import GHC.List (List)
#endif

#if !(MIN_VERSION_base(4,5,0))
-- | The 'dropWhileEnd' function drops the largest suffix of a list
-- in which the given predicate holds for all elements. For example:
Expand Down

0 comments on commit a77a453

Please sign in to comment.