@@ -163,14 +163,13 @@ module Data.Vector.Generic (
163
163
164
164
import Data.Vector.Generic.Base
165
165
166
- import Data.Vector.Generic.Mutable ( MVector )
167
166
import qualified Data.Vector.Generic.Mutable as M
168
167
169
168
import qualified Data.Vector.Generic.New as New
170
169
import Data.Vector.Generic.New ( New )
171
170
172
171
import qualified Data.Vector.Fusion.Bundle as Bundle
173
- import Data.Vector.Fusion.Bundle ( Bundle , MBundle , Step ( .. ), lift , inplace )
172
+ import Data.Vector.Fusion.Bundle ( Bundle , MBundle , lift , inplace )
174
173
import qualified Data.Vector.Fusion.Bundle.Monadic as MBundle
175
174
import Data.Vector.Fusion.Stream.Monadic ( Stream )
176
175
import qualified Data.Vector.Fusion.Stream.Monadic as S
@@ -179,8 +178,6 @@ import Data.Vector.Fusion.Util
179
178
180
179
import Control.Monad.ST ( ST , runST )
181
180
import Control.Monad.Primitive
182
- import qualified Control.Monad as Monad
183
- import qualified Data.List as List
184
181
import Prelude hiding ( length , null ,
185
182
replicate , (++) , concat ,
186
183
head , last ,
@@ -573,7 +570,7 @@ constructN !n f = runST (
573
570
v'' <- unsafeFreeze v'
574
571
fill v'' (i+ 1 )
575
572
576
- fill v i = return v
573
+ fill v _ = return v
577
574
578
575
-- | /O(n)/ Construct a vector with @n@ elements from right to left by
579
576
-- repeatedly applying the generator function to the already constructed part
@@ -602,7 +599,7 @@ constructrN !n f = runST (
602
599
v'' <- unsafeFreeze v'
603
600
fill v'' (i+ 1 )
604
601
605
- fill v i = return v
602
+ fill v _ = return v
606
603
607
604
608
605
-- Enumeration
@@ -1228,39 +1225,39 @@ unzip xs = (map fst xs, map snd xs)
1228
1225
unzip3 :: (Vector v a , Vector v b , Vector v c , Vector v (a , b , c ))
1229
1226
=> v (a , b , c ) -> (v a , v b , v c )
1230
1227
{-# INLINE unzip3 #-}
1231
- unzip3 xs = (map (\ (a, b, c ) -> a) xs,
1232
- map (\ (a , b, c ) -> b) xs,
1233
- map (\ (a, b , c) -> c) xs)
1228
+ unzip3 xs = (map (\ (a, _, _ ) -> a) xs,
1229
+ map (\ (_ , b, _ ) -> b) xs,
1230
+ map (\ (_, _ , c) -> c) xs)
1234
1231
1235
1232
unzip4 :: (Vector v a , Vector v b , Vector v c , Vector v d ,
1236
1233
Vector v (a , b , c , d ))
1237
1234
=> v (a , b , c , d ) -> (v a , v b , v c , v d )
1238
1235
{-# INLINE unzip4 #-}
1239
- unzip4 xs = (map (\ (a, b, c, d ) -> a) xs,
1240
- map (\ (a , b, c, d ) -> b) xs,
1241
- map (\ (a, b , c, d ) -> c) xs,
1242
- map (\ (a, b, c , d) -> d) xs)
1236
+ unzip4 xs = (map (\ (a, _, _, _ ) -> a) xs,
1237
+ map (\ (_ , b, _, _ ) -> b) xs,
1238
+ map (\ (_, _ , c, _ ) -> c) xs,
1239
+ map (\ (_, _, _ , d) -> d) xs)
1243
1240
1244
1241
unzip5 :: (Vector v a , Vector v b , Vector v c , Vector v d , Vector v e ,
1245
1242
Vector v (a , b , c , d , e ))
1246
1243
=> v (a , b , c , d , e ) -> (v a , v b , v c , v d , v e )
1247
1244
{-# INLINE unzip5 #-}
1248
- unzip5 xs = (map (\ (a, b, c, d, e ) -> a) xs,
1249
- map (\ (a , b, c, d, e ) -> b) xs,
1250
- map (\ (a, b , c, d, e ) -> c) xs,
1251
- map (\ (a, b, c , d, e ) -> d) xs,
1252
- map (\ (a, b, c, d , e) -> e) xs)
1245
+ unzip5 xs = (map (\ (a, _, _, _, _ ) -> a) xs,
1246
+ map (\ (_ , b, _, _, _ ) -> b) xs,
1247
+ map (\ (_, _ , c, _, _ ) -> c) xs,
1248
+ map (\ (_, _, _ , d, _ ) -> d) xs,
1249
+ map (\ (_, _, _, _ , e) -> e) xs)
1253
1250
1254
1251
unzip6 :: (Vector v a , Vector v b , Vector v c , Vector v d , Vector v e ,
1255
1252
Vector v f , Vector v (a , b , c , d , e , f ))
1256
1253
=> v (a , b , c , d , e , f ) -> (v a , v b , v c , v d , v e , v f )
1257
1254
{-# INLINE unzip6 #-}
1258
- unzip6 xs = (map (\ (a, b, c, d, e, f ) -> a) xs,
1259
- map (\ (a , b, c, d, e, f ) -> b) xs,
1260
- map (\ (a, b , c, d, e, f ) -> c) xs,
1261
- map (\ (a, b, c , d, e, f ) -> d) xs,
1262
- map (\ (a, b, c, d , e, f ) -> e) xs,
1263
- map (\ (a, b, c, d, e , f) -> f) xs)
1255
+ unzip6 xs = (map (\ (a, _, _, _, _, _ ) -> a) xs,
1256
+ map (\ (_ , b, _, _, _, _ ) -> b) xs,
1257
+ map (\ (_, _ , c, _, _, _ ) -> c) xs,
1258
+ map (\ (_, _, _ , d, _, _ ) -> d) xs,
1259
+ map (\ (_, _, _, _ , e, _ ) -> e) xs,
1260
+ map (\ (_, _, _, _, _ , f) -> f) xs)
1264
1261
1265
1262
-- Filtering
1266
1263
-- ---------
@@ -1528,10 +1525,10 @@ maximum = Bundle.foldl1' max . stream
1528
1525
-- comparison function. The vector may not be empty.
1529
1526
maximumBy :: Vector v a => (a -> a -> Ordering ) -> v a -> a
1530
1527
{-# INLINE maximumBy #-}
1531
- maximumBy cmp = Bundle. foldl1' maxBy . stream
1528
+ maximumBy cmpr = Bundle. foldl1' maxBy . stream
1532
1529
where
1533
1530
{-# INLINE maxBy #-}
1534
- maxBy x y = case cmp x y of
1531
+ maxBy x y = case cmpr x y of
1535
1532
LT -> y
1536
1533
_ -> x
1537
1534
@@ -1545,10 +1542,10 @@ minimum = Bundle.foldl1' min . stream
1545
1542
-- comparison function. The vector may not be empty.
1546
1543
minimumBy :: Vector v a => (a -> a -> Ordering ) -> v a -> a
1547
1544
{-# INLINE minimumBy #-}
1548
- minimumBy cmp = Bundle. foldl1' minBy . stream
1545
+ minimumBy cmpr = Bundle. foldl1' minBy . stream
1549
1546
where
1550
1547
{-# INLINE minBy #-}
1551
- minBy x y = case cmp x y of
1548
+ minBy x y = case cmpr x y of
1552
1549
GT -> y
1553
1550
_ -> x
1554
1551
@@ -1562,10 +1559,10 @@ maxIndex = maxIndexBy compare
1562
1559
-- the given comparison function. The vector may not be empty.
1563
1560
maxIndexBy :: Vector v a => (a -> a -> Ordering ) -> v a -> Int
1564
1561
{-# INLINE maxIndexBy #-}
1565
- maxIndexBy cmp = fst . Bundle. foldl1' imax . Bundle. indexed . stream
1562
+ maxIndexBy cmpr = fst . Bundle. foldl1' imax . Bundle. indexed . stream
1566
1563
where
1567
1564
imax (i,x) (j,y) = i `seq` j `seq`
1568
- case cmp x y of
1565
+ case cmpr x y of
1569
1566
LT -> (j,y)
1570
1567
_ -> (i,x)
1571
1568
@@ -1579,10 +1576,10 @@ minIndex = minIndexBy compare
1579
1576
-- the given comparison function. The vector may not be empty.
1580
1577
minIndexBy :: Vector v a => (a -> a -> Ordering ) -> v a -> Int
1581
1578
{-# INLINE minIndexBy #-}
1582
- minIndexBy cmp = fst . Bundle. foldl1' imin . Bundle. indexed . stream
1579
+ minIndexBy cmpr = fst . Bundle. foldl1' imin . Bundle. indexed . stream
1583
1580
where
1584
1581
imin (i,x) (j,y) = i `seq` j `seq`
1585
- case cmp x y of
1582
+ case cmpr x y of
1586
1583
GT -> (j,y)
1587
1584
_ -> (i,x)
1588
1585
0 commit comments