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 committed Jun 8, 2023
1 parent 167b0d3 commit efcb475
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 39 deletions.
5 changes: 2 additions & 3 deletions vector-stream/src/Data/Stream/Monadic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,14 @@ import Data.Char ( ord )
import GHC.Base ( unsafeChr )
import Control.Monad ( liftM )
import qualified Prelude
import Prelude hiding ( length, null,
import Prelude hiding ( Foldable(..),
replicate, (++),
head, last, (!!),
init, tail, take, drop,
map, mapM, mapM_, concatMap,
zipWith, zipWith3, zip, zip3,
filter, takeWhile, dropWhile,
elem, notElem,
foldl, foldl1, foldr, foldr1,
notElem,
and, or,
scanl, scanl1,
enumFromTo, enumFromThenTo )
Expand Down
7 changes: 3 additions & 4 deletions vector/src/Data/Vector.hs
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,15 @@ import Control.Monad.Fix ( MonadFix (mfix) )
import Control.Monad.Zip
import Data.Function ( fix )

import Prelude hiding ( length, null,
import Prelude hiding ( Foldable(..),
replicate, (++), concat,
head, last,
init, tail, take, drop, splitAt, reverse,
map, concatMap,
zipWith, zipWith3, zip, zip3, unzip, unzip3,
filter, takeWhile, dropWhile, span, break,
elem, notElem,
foldl, foldl1, foldr, foldr1, foldMap,
all, any, and, or, sum, product, minimum, maximum,
notElem,
all, any, and, or,
scanl, scanl1, scanr, scanr1,
enumFromTo, enumFromThenTo,
mapM, mapM_, sequence, sequence_ )
Expand Down
5 changes: 2 additions & 3 deletions vector/src/Data/Vector/Fusion/Bundle.hs
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,14 @@ import Data.Vector.Fusion.Bundle.Monadic ( Chunk(..), lift )
import qualified Data.Vector.Fusion.Bundle.Monadic as M
import qualified Data.Vector.Fusion.Stream.Monadic as S

import Prelude hiding ( length, null,
import Prelude hiding ( Foldable(..),
replicate, (++),
head, last, (!!),
init, tail, take, drop,
map, concatMap,
zipWith, zipWith3, zip, zip3,
filter, takeWhile, dropWhile,
elem, notElem,
foldl, foldl1, foldr, foldr1,
notElem,
and, or,
scanl, scanl1,
enumFromTo, enumFromThenTo,
Expand Down
5 changes: 2 additions & 3 deletions vector/src/Data/Vector/Fusion/Bundle/Monadic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,14 @@ import qualified Data.List as List
import Data.Char ( ord )
import GHC.Base ( unsafeChr )
import Control.Monad ( liftM )
import Prelude hiding ( length, null,
import Prelude hiding ( Foldable(..),
replicate, (++),
head, last, (!!),
init, tail, take, drop,
map, mapM, mapM_, concatMap,
zipWith, zipWith3, zip, zip3,
filter, takeWhile, dropWhile,
elem, notElem,
foldl, foldl1, foldr, foldr1,
notElem,
and, or,
scanl, scanl1,
enumFromTo, enumFromThenTo )
Expand Down
7 changes: 3 additions & 4 deletions vector/src/Data/Vector/Generic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,15 @@ import Data.Vector.Internal.Check

import Control.Monad.ST ( ST, runST )
import Control.Monad.Primitive
import Prelude hiding ( length, null,
import Prelude hiding ( Foldable(..),
replicate, (++), concat,
head, last,
init, tail, take, drop, splitAt, reverse,
map, concat, concatMap,
zipWith, zipWith3, zip, zip3, unzip, unzip3,
filter, takeWhile, dropWhile, span, break,
elem, notElem,
foldl, foldl1, foldr, foldr1, foldMap,
all, any, and, or, sum, product, maximum, minimum,
notElem,
all, any, and, or,
scanl, scanl1, scanr, scanr1,
enumFromTo, enumFromThenTo,
mapM, mapM_, sequence, sequence_,
Expand Down
4 changes: 2 additions & 2 deletions vector/src/Data/Vector/Generic/Mutable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ import Data.Vector.Internal.Check

import Control.Monad.Primitive ( PrimMonad(..), RealWorld, stToPrim )

import Prelude hiding ( length, null, replicate, reverse, map, read,
take, drop, splitAt, init, tail, mapM_, foldr, foldl )
import Prelude hiding ( Foldable(..), replicate, reverse, map, read,
take, drop, splitAt, init, tail, mapM_ )

#include "vector.h"

Expand Down
4 changes: 2 additions & 2 deletions vector/src/Data/Vector/Mutable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ import Data.Vector.Internal.Check
import Data.Primitive.Array
import Control.Monad.Primitive

import Prelude hiding ( length, null, replicate, reverse, read,
take, drop, splitAt, init, tail, foldr, foldl, mapM_ )
import Prelude hiding ( Foldable(..), replicate, reverse, read,
take, drop, splitAt, init, tail, mapM_ )

import Data.Typeable ( Typeable )

Expand Down
7 changes: 3 additions & 4 deletions vector/src/Data/Vector/Primitive.hs
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,15 @@ import Control.Monad ( liftM )
import Control.Monad.ST ( ST )
import Control.Monad.Primitive

import Prelude hiding ( length, null,
import Prelude hiding ( Foldable(..),
replicate, (++), concat,
head, last,
init, tail, take, drop, splitAt, reverse,
map, concatMap,
zipWith, zipWith3, zip, zip3, unzip, unzip3,
filter, takeWhile, dropWhile, span, break,
elem, notElem,
foldl, foldl1, foldr, foldr1, foldMap,
all, any, sum, product, minimum, maximum,
notElem,
all, any,
scanl, scanl1, scanr, scanr1,
enumFromTo, enumFromThenTo,
mapM, mapM_ )
Expand Down
4 changes: 2 additions & 2 deletions vector/src/Data/Vector/Primitive/Mutable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ import Control.DeepSeq ( NFData(rnf)
#endif
)

import Prelude hiding ( length, null, replicate, reverse, map, read,
take, drop, splitAt, init, tail, foldr, foldl, mapM_ )
import Prelude hiding ( Foldable(..), replicate, reverse, map, read,
take, drop, splitAt, init, tail, mapM_ )

import Data.Typeable ( Typeable )
import Data.Coerce
Expand Down
7 changes: 3 additions & 4 deletions vector/src/Data/Vector/Storable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,15 @@ import Control.DeepSeq ( NFData(rnf)
import Control.Monad.ST ( ST )
import Control.Monad.Primitive

import Prelude hiding ( length, null,
import Prelude hiding ( Foldable(..),
replicate, (++), concat,
head, last,
init, tail, take, drop, splitAt, reverse,
map, concatMap,
zipWith, zipWith3, zip, zip3, unzip, unzip3,
filter, takeWhile, dropWhile, span, break,
elem, notElem,
foldl, foldl1, foldr, foldr1, foldMap,
all, any, and, or, sum, product, minimum, maximum,
notElem,
all, any, and, or,
scanl, scanl1, scanr, scanr1,
enumFromTo, enumFromThenTo,
mapM, mapM_ )
Expand Down
4 changes: 2 additions & 2 deletions vector/src/Data/Vector/Storable/Mutable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ import qualified Data.Primitive.Types as DPT
import GHC.Word (Word8, Word16, Word32, Word64)
import GHC.Ptr (Ptr(..))

import Prelude hiding ( length, null, replicate, reverse, map, read,
take, drop, splitAt, init, tail, foldr, foldl, mapM_ )
import Prelude hiding ( Foldable(..), replicate, reverse, map, read,
take, drop, splitAt, init, tail, mapM_ )

import Data.Typeable ( Typeable )

Expand Down
7 changes: 3 additions & 4 deletions vector/src/Data/Vector/Unboxed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,15 @@ import Data.Vector.Fusion.Util ( delayed_min )
import Control.Monad.ST ( ST )
import Control.Monad.Primitive

import Prelude hiding ( length, null,
import Prelude hiding ( Foldable(..),
replicate, (++), concat,
head, last,
init, tail, take, drop, splitAt, reverse,
map, concatMap,
zipWith, zipWith3, zip, zip3, unzip, unzip3,
filter, takeWhile, dropWhile, span, break,
elem, notElem,
foldl, foldl1, foldr, foldr1, foldMap,
all, any, and, or, sum, product, minimum, maximum,
notElem,
all, any, and, or,
scanl, scanl1, scanr, scanr1,
enumFromTo, enumFromThenTo,
mapM, mapM_ )
Expand Down
4 changes: 2 additions & 2 deletions vector/src/Data/Vector/Unboxed/Mutable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ import qualified Data.Vector.Generic.Mutable as G
import Data.Vector.Fusion.Util ( delayed_min )
import Control.Monad.Primitive

import Prelude hiding ( length, null, replicate, reverse, map, read,
import Prelude hiding ( Foldable(..), replicate, reverse, map, read,
take, drop, splitAt, init, tail,
zip, zip3, unzip, unzip3, foldr, foldl, mapM_ )
zip, zip3, unzip, unzip3, mapM_ )

-- don't import an unused Data.Vector.Internal.Check
#define NOT_VECTOR_MODULE
Expand Down

0 comments on commit efcb475

Please sign in to comment.