Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future-proof against potential Prelude.foldl' #8960

Merged
merged 1 commit into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cabal-syntax/src/Distribution/Compat/Prelude.hs
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,9 @@ module Distribution.Compat.Prelude (

-- We also could hide few partial function
import Prelude as BasePrelude hiding
( mapM, mapM_, sequence, null, length, foldr, any, all, head, tail, last, init
( mapM, mapM_, sequence, any, all, head, tail, last, init
-- partial functions
, read
, foldr1, foldl1
#if MINVER_base_411
-- As of base 4.11.0.0 Prelude exports part of Semigroup(..).
-- Hide this so we instead rely on Distribution.Compat.Semigroup.
Expand All @@ -142,8 +141,9 @@ import Prelude as BasePrelude hiding
, Word
-- We hide them, as we import only some members
, Traversable, traverse, sequenceA
, Foldable, foldMap
, Foldable(..)
)
import Data.Foldable as BasePrelude (foldl, elem, sum, product, maximum, minimum)
ffaf1 marked this conversation as resolved.
Show resolved Hide resolved

-- AMP
import Data.Foldable
Expand Down
3 changes: 2 additions & 1 deletion Cabal-tests/tests/UnitTests/Distribution/Utils/CharSet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
#endif
module UnitTests.Distribution.Utils.CharSet where

import Prelude hiding (Foldable(..))
import Data.Char (isAlpha, isAlphaNum)
import Data.List (foldl')
import Data.Foldable (foldl')
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit (testCase, (@?=))

Expand Down