Skip to content

Commit

Permalink
Future-proof against potential Prelude.foldl'
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodigrim authored and ulysses4ever committed May 25, 2023
1 parent 5e10d7f commit 3e1b4b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
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)

-- 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

0 comments on commit 3e1b4b3

Please sign in to comment.