{-# LANGUAGE CPP, DeriveDataTypeable, MultiParamTypeClasses, FlexibleInstances, TypeFamilies, Rank2Types, ScopedTypeVariables #-}
module Data.Vector.Storable (
Vector, MVector(..), Storable,
length, null,
(!), (!?), head, last,
unsafeIndex, unsafeHead, unsafeLast,
indexM, headM, lastM,
unsafeIndexM, unsafeHeadM, unsafeLastM,
slice, init, tail, take, drop, splitAt,
unsafeSlice, unsafeInit, unsafeTail, unsafeTake, unsafeDrop,
empty, singleton, replicate, generate, iterateN,
replicateM, generateM, iterateNM, create, createT,
unfoldr, unfoldrN,
unfoldrM, unfoldrNM,
constructN, constructrN,
enumFromN, enumFromStepN, enumFromTo, enumFromThenTo,
cons, snoc, (++), concat,
force,
(//), update_,
unsafeUpd, unsafeUpdate_,
accum, accumulate_,
unsafeAccum, unsafeAccumulate_,
reverse, backpermute, unsafeBackpermute,
modify,
map, imap, concatMap,
mapM, mapM_, forM, forM_,
zipWith, zipWith3, zipWith4, zipWith5, zipWith6,
izipWith, izipWith3, izipWith4, izipWith5, izipWith6,
zipWithM, zipWithM_,
filter, ifilter, uniq,
mapMaybe, imapMaybe,
filterM,
takeWhile, dropWhile,
partition, unstablePartition, partitionWith, span, break,
elem, notElem, find, findIndex, findIndices, elemIndex, elemIndices,
foldl, foldl1, foldl', foldl1', foldr, foldr1, foldr', foldr1',
ifoldl, ifoldl', ifoldr, ifoldr',
all, any, and, or,
sum, product,
maximum, maximumBy, minimum, minimumBy,
minIndex, minIndexBy, maxIndex, maxIndexBy,
foldM, foldM', fold1M, fold1M',
foldM_, foldM'_, fold1M_, fold1M'_,
prescanl, prescanl',
postscanl, postscanl',
scanl, scanl', scanl1, scanl1',
prescanr, prescanr',
postscanr, postscanr',
scanr, scanr', scanr1, scanr1',
toList, fromList, fromListN,
G.convert, unsafeCast,
freeze, thaw, copy, unsafeFreeze, unsafeThaw, unsafeCopy,
unsafeFromForeignPtr, unsafeFromForeignPtr0,
unsafeToForeignPtr, unsafeToForeignPtr0,
unsafeWith
) where
import qualified Data.Vector.Generic as G
import Data.Vector.Storable.Mutable ( MVector(..) )
import Data.Vector.Storable.Internal
import qualified Data.Vector.Fusion.Bundle as Bundle
import Foreign.Storable
import Foreign.ForeignPtr
import Foreign.Ptr
import Foreign.Marshal.Array ( advancePtr, copyArray )
import Control.DeepSeq ( NFData(rnf)
#if MIN_VERSION_deepseq(1,4,3)
, NFData1(liftRnf)
#endif
)
import Control.Monad.ST ( ST )
import Control.Monad.Primitive
import Prelude hiding ( length, null,
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,
all, any, and, or, sum, product, minimum, maximum,
scanl, scanl1, scanr, scanr1,
enumFromTo, enumFromThenTo,
mapM, mapM_ )
import Data.Typeable ( Typeable )
import Data.Data ( Data(..) )
import Text.Read ( Read(..), readListPrecDefault )
import Data.Semigroup ( Semigroup(..) )
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid ( Monoid(..) )
import Data.Traversable ( Traversable )
#endif
#if __GLASGOW_HASKELL__ >= 708
import qualified GHC.Exts as Exts
#endif
#define NOT_VECTOR_MODULE
#include "vector.h"
data Vector a = Vector {-# UNPACK #-} !Int
{-# UNPACK #-} !(ForeignPtr a)
deriving ( Typeable )
instance NFData (Vector a) where
rnf :: Vector a -> ()
rnf (Vector _ _) = ()
#if MIN_VERSION_deepseq(1,4,3)
instance NFData1 Vector where
liftRnf :: (a -> ()) -> Vector a -> ()
liftRnf _ (Vector _ _) = ()
#endif
instance (Show a, Storable a) => Show (Vector a) where
showsPrec :: Int -> Vector a -> ShowS
showsPrec = Int -> Vector a -> ShowS
forall (v :: * -> *) a. (Vector v a, Show a) => Int -> v a -> ShowS
G.showsPrec
instance (Read a, Storable a) => Read (Vector a) where
readPrec :: ReadPrec (Vector a)
readPrec = ReadPrec (Vector a)
forall (v :: * -> *) a. (Vector v a, Read a) => ReadPrec (v a)
G.readPrec
readListPrec :: ReadPrec [Vector a]
readListPrec = ReadPrec [Vector a]
forall a. Read a => ReadPrec [a]
readListPrecDefault
instance (Data a, Storable a) => Data (Vector a) where
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Vector a -> c (Vector a)
gfoldl = (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Vector a -> c (Vector a)
forall (v :: * -> *) a (c :: * -> *).
(Vector v a, Data a) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> v a -> c (v a)
G.gfoldl
toConstr :: Vector a -> Constr
toConstr _ = String -> Constr
G.mkVecConstr "Data.Vector.Storable.Vector"
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Vector a)
gunfold = (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Vector a)
forall (v :: * -> *) a (c :: * -> *).
(Vector v a, Data a) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (v a)
G.gunfold
dataTypeOf :: Vector a -> DataType
dataTypeOf _ = String -> DataType
G.mkVecType "Data.Vector.Storable.Vector"
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (Vector a))
dataCast1 = (forall d. Data d => c (t d)) -> Maybe (c (Vector a))
forall (v :: * -> *) a (t :: * -> *) (c :: * -> *).
(Vector v a, Data a, Typeable v, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (v a))
G.dataCast
type instance G.Mutable Vector = MVector
instance Storable a => G.Vector Vector a where
{-# INLINE basicUnsafeFreeze #-}
basicUnsafeFreeze :: Mutable Vector (PrimState m) a -> m (Vector a)
basicUnsafeFreeze (MVector n fp) = Vector a -> m (Vector a)
forall (m :: * -> *) a. Monad m => a -> m a
return (Vector a -> m (Vector a)) -> Vector a -> m (Vector a)
forall a b. (a -> b) -> a -> b
$ Int -> ForeignPtr a -> Vector a
forall a. Int -> ForeignPtr a -> Vector a
Vector Int
n ForeignPtr a
fp
{-# INLINE basicUnsafeThaw #-}
basicUnsafeThaw :: Vector a -> m (Mutable Vector (PrimState m) a)
basicUnsafeThaw (Vector n :: Int
n fp :: ForeignPtr a
fp) = MVector (PrimState m) a -> m (Mutable Vector (PrimState m) a)
forall (m :: * -> *) a. Monad m => a -> m a
return (MVector (PrimState m) a -> m (Mutable Vector (PrimState m) a))
-> MVector (PrimState m) a -> m (Mutable Vector (PrimState m) a)
forall a b. (a -> b) -> a -> b
$ Int -> ForeignPtr a -> MVector (PrimState m) a
forall s a. Int -> ForeignPtr a -> MVector s a
MVector Int
n ForeignPtr a
fp
{-# INLINE basicLength #-}
basicLength :: Vector a -> Int
basicLength (Vector n :: Int
n _) = Int
n
{-# INLINE basicUnsafeSlice #-}
basicUnsafeSlice :: Int -> Int -> Vector a -> Vector a
basicUnsafeSlice i :: Int
i n :: Int
n (Vector _ fp :: ForeignPtr a
fp) = Int -> ForeignPtr a -> Vector a
forall a. Int -> ForeignPtr a -> Vector a
Vector Int
n ((Ptr a -> Ptr a) -> ForeignPtr a -> ForeignPtr a
forall a. (Ptr a -> Ptr a) -> ForeignPtr a -> ForeignPtr a
updPtr (Ptr a -> Int -> Ptr a
forall a. Storable a => Ptr a -> Int -> Ptr a
`advancePtr` Int
i) ForeignPtr a
fp)
{-# INLINE basicUnsafeIndexM #-}
basicUnsafeIndexM :: Vector a -> Int -> m a
basicUnsafeIndexM (Vector _ fp :: ForeignPtr a
fp) i :: Int
i = a -> m a
forall (m :: * -> *) a. Monad m => a -> m a
return
(a -> m a) -> (IO a -> a) -> IO a -> m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IO a -> a
forall a. IO a -> a
unsafeInlineIO
(IO a -> m a) -> IO a -> m a
forall a b. (a -> b) -> a -> b
$ ForeignPtr a -> (Ptr a -> IO a) -> IO a
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr a
fp ((Ptr a -> IO a) -> IO a) -> (Ptr a -> IO a) -> IO a
forall a b. (a -> b) -> a -> b
$ \p :: Ptr a
p ->
Ptr a -> Int -> IO a
forall a. Storable a => Ptr a -> Int -> IO a
peekElemOff Ptr a
p Int
i
{-# INLINE basicUnsafeCopy #-}
basicUnsafeCopy :: Mutable Vector (PrimState m) a -> Vector a -> m ()
basicUnsafeCopy (MVector n fp) (Vector _ fq :: ForeignPtr a
fq)
= IO () -> m ()
forall (m1 :: * -> *) (m2 :: * -> *) a.
(PrimBase m1, PrimMonad m2) =>
m1 a -> m2 a
unsafePrimToPrim
(IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ ForeignPtr a -> (Ptr a -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr a
fp ((Ptr a -> IO ()) -> IO ()) -> (Ptr a -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \p :: Ptr a
p ->
ForeignPtr a -> (Ptr a -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr a
fq ((Ptr a -> IO ()) -> IO ()) -> (Ptr a -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \q :: Ptr a
q ->
Ptr a -> Ptr a -> Int -> IO ()
forall a. Storable a => Ptr a -> Ptr a -> Int -> IO ()
copyArray Ptr a
p Ptr a
q Int
n
{-# INLINE elemseq #-}
elemseq :: Vector a -> a -> b -> b
elemseq _ = a -> b -> b
forall a b. a -> b -> b
seq
instance (Storable a, Eq a) => Eq (Vector a) where
{-# INLINE (==) #-}
xs :: Vector a
xs == :: Vector a -> Vector a -> Bool
== ys :: Vector a
ys = Bundle Vector a -> Bundle Vector a -> Bool
forall a (v :: * -> *). Eq a => Bundle v a -> Bundle v a -> Bool
Bundle.eq (Vector a -> Bundle Vector a
forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream Vector a
xs) (Vector a -> Bundle Vector a
forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream Vector a
ys)
{-# INLINE (/=) #-}
xs :: Vector a
xs /= :: Vector a -> Vector a -> Bool
/= ys :: Vector a
ys = Bool -> Bool
not (Bundle Vector a -> Bundle Vector a -> Bool
forall a (v :: * -> *). Eq a => Bundle v a -> Bundle v a -> Bool
Bundle.eq (Vector a -> Bundle Vector a
forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream Vector a
xs) (Vector a -> Bundle Vector a
forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream Vector a
ys))
instance (Storable a, Ord a) => Ord (Vector a) where
{-# INLINE compare #-}
compare :: Vector a -> Vector a -> Ordering
compare xs :: Vector a
xs ys :: Vector a
ys = Bundle Vector a -> Bundle Vector a -> Ordering
forall a (v :: * -> *).
Ord a =>
Bundle v a -> Bundle v a -> Ordering
Bundle.cmp (Vector a -> Bundle Vector a
forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream Vector a
xs) (Vector a -> Bundle Vector a
forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream Vector a
ys)
{-# INLINE (<) #-}
xs :: Vector a
xs < :: Vector a -> Vector a -> Bool
< ys :: Vector a
ys = Bundle Vector a -> Bundle Vector a -> Ordering
forall a (v :: * -> *).
Ord a =>
Bundle v a -> Bundle v a -> Ordering
Bundle.cmp (Vector a -> Bundle Vector a
forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream Vector a
xs) (Vector a -> Bundle Vector a
forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream Vector a
ys) Ordering -> Ordering -> Bool
forall a. Eq a => a -> a -> Bool
== Ordering
LT
{-# INLINE (<=) #-}
xs :: Vector a
xs <= :: Vector a -> Vector a -> Bool
<= ys :: Vector a
ys = Bundle Vector a -> Bundle Vector a -> Ordering
forall a (v :: * -> *).
Ord a =>
Bundle v a -> Bundle v a -> Ordering
Bundle.cmp (Vector a -> Bundle Vector a
forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream Vector a
xs) (Vector a -> Bundle Vector a
forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream Vector a
ys) Ordering -> Ordering -> Bool
forall a. Eq a => a -> a -> Bool
/= Ordering
GT
{-# INLINE (>) #-}
xs :: Vector a
xs > :: Vector a -> Vector a -> Bool
> ys :: Vector a
ys = Bundle Vector a -> Bundle Vector a -> Ordering
forall a (v :: * -> *).
Ord a =>
Bundle v a -> Bundle v a -> Ordering
Bundle.cmp (Vector a -> Bundle Vector a
forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream Vector a
xs) (Vector a -> Bundle Vector a
forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream Vector a
ys) Ordering -> Ordering -> Bool
forall a. Eq a => a -> a -> Bool
== Ordering
GT
{-# INLINE (>=) #-}
xs :: Vector a
xs >= :: Vector a -> Vector a -> Bool
>= ys :: Vector a
ys = Bundle Vector a -> Bundle Vector a -> Ordering
forall a (v :: * -> *).
Ord a =>
Bundle v a -> Bundle v a -> Ordering
Bundle.cmp (Vector a -> Bundle Vector a
forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream Vector a
xs) (Vector a -> Bundle Vector a
forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream Vector a
ys) Ordering -> Ordering -> Bool
forall a. Eq a => a -> a -> Bool
/= Ordering
LT
instance Storable a => Semigroup (Vector a) where
{-# INLINE (<>) #-}
<> :: Vector a -> Vector a -> Vector a
(<>) = Vector a -> Vector a -> Vector a
forall a. Storable a => Vector a -> Vector a -> Vector a
(++)
{-# INLINE sconcat #-}
sconcat :: NonEmpty (Vector a) -> Vector a
sconcat = NonEmpty (Vector a) -> Vector a
forall (v :: * -> *) a. Vector v a => NonEmpty (v a) -> v a
G.concatNE
instance Storable a => Monoid (Vector a) where
{-# INLINE mempty #-}
mempty :: Vector a
mempty = Vector a
forall a. Storable a => Vector a
empty
{-# INLINE mappend #-}
mappend :: Vector a -> Vector a -> Vector a
mappend = Vector a -> Vector a -> Vector a
forall a. Storable a => Vector a -> Vector a -> Vector a
(++)
{-# INLINE mconcat #-}
mconcat :: [Vector a] -> Vector a
mconcat = [Vector a] -> Vector a
forall a. Storable a => [Vector a] -> Vector a
concat
#if __GLASGOW_HASKELL__ >= 708
instance Storable a => Exts.IsList (Vector a) where
type Item (Vector a) = a
fromList :: [Item (Vector a)] -> Vector a
fromList = [Item (Vector a)] -> Vector a
forall a. Storable a => [a] -> Vector a
fromList
fromListN :: Int -> [Item (Vector a)] -> Vector a
fromListN = Int -> [Item (Vector a)] -> Vector a
forall a. Storable a => Int -> [a] -> Vector a
fromListN
toList :: Vector a -> [Item (Vector a)]
toList = Vector a -> [Item (Vector a)]
forall a. Storable a => Vector a -> [a]
toList
#endif
length :: Storable a => Vector a -> Int
{-# INLINE length #-}
length :: Vector a -> Int
length = Vector a -> Int
forall (v :: * -> *) a. Vector v a => v a -> Int
G.length
null :: Storable a => Vector a -> Bool
{-# INLINE null #-}
null :: Vector a -> Bool
null = Vector a -> Bool
forall (v :: * -> *) a. Vector v a => v a -> Bool
G.null
(!) :: Storable a => Vector a -> Int -> a
{-# INLINE (!) #-}
(!) = Vector a -> Int -> a
forall (v :: * -> *) a. Vector v a => v a -> Int -> a
(G.!)
(!?) :: Storable a => Vector a -> Int -> Maybe a
{-# INLINE (!?) #-}
!? :: Vector a -> Int -> Maybe a
(!?) = Vector a -> Int -> Maybe a
forall (v :: * -> *) a. Vector v a => v a -> Int -> Maybe a
(G.!?)
head :: Storable a => Vector a -> a
{-# INLINE head #-}
head :: Vector a -> a
head = Vector a -> a
forall (v :: * -> *) a. Vector v a => v a -> a
G.head
last :: Storable a => Vector a -> a
{-# INLINE last #-}
last :: Vector a -> a
last = Vector a -> a
forall (v :: * -> *) a. Vector v a => v a -> a
G.last
unsafeIndex :: Storable a => Vector a -> Int -> a
{-# INLINE unsafeIndex #-}
unsafeIndex :: Vector a -> Int -> a
unsafeIndex = Vector a -> Int -> a
forall (v :: * -> *) a. Vector v a => v a -> Int -> a
G.unsafeIndex
unsafeHead :: Storable a => Vector a -> a
{-# INLINE unsafeHead #-}
unsafeHead :: Vector a -> a
unsafeHead = Vector a -> a
forall (v :: * -> *) a. Vector v a => v a -> a
G.unsafeHead
unsafeLast :: Storable a => Vector a -> a
{-# INLINE unsafeLast #-}
unsafeLast :: Vector a -> a
unsafeLast = Vector a -> a
forall (v :: * -> *) a. Vector v a => v a -> a
G.unsafeLast
indexM :: (Storable a, Monad m) => Vector a -> Int -> m a
{-# INLINE indexM #-}
indexM :: Vector a -> Int -> m a
indexM = Vector a -> Int -> m a
forall (v :: * -> *) a (m :: * -> *).
(Vector v a, Monad m) =>
v a -> Int -> m a
G.indexM
headM :: (Storable a, Monad m) => Vector a -> m a
{-# INLINE headM #-}
headM :: Vector a -> m a
headM = Vector a -> m a
forall (v :: * -> *) a (m :: * -> *).
(Vector v a, Monad m) =>
v a -> m a
G.headM
lastM :: (Storable a, Monad m) => Vector a -> m a
{-# INLINE lastM #-}
lastM :: Vector a -> m a
lastM = Vector a -> m a
forall (v :: * -> *) a (m :: * -> *).
(Vector v a, Monad m) =>
v a -> m a
G.lastM
unsafeIndexM :: (Storable a, Monad m) => Vector a -> Int -> m a
{-# INLINE unsafeIndexM #-}
unsafeIndexM :: Vector a -> Int -> m a
unsafeIndexM = Vector a -> Int -> m a
forall (v :: * -> *) a (m :: * -> *).
(Vector v a, Monad m) =>
v a -> Int -> m a
G.unsafeIndexM
unsafeHeadM :: (Storable a, Monad m) => Vector a -> m a
{-# INLINE unsafeHeadM #-}
unsafeHeadM :: Vector a -> m a
unsafeHeadM = Vector a -> m a
forall (v :: * -> *) a (m :: * -> *).
(Vector v a, Monad m) =>
v a -> m a
G.unsafeHeadM
unsafeLastM :: (Storable a, Monad m) => Vector a -> m a
{-# INLINE unsafeLastM #-}
unsafeLastM :: Vector a -> m a
unsafeLastM = Vector a -> m a
forall (v :: * -> *) a (m :: * -> *).
(Vector v a, Monad m) =>
v a -> m a
G.unsafeLastM
slice :: Storable a
=> Int
-> Int
-> Vector a
-> Vector a
{-# INLINE slice #-}
slice :: Int -> Int -> Vector a -> Vector a
slice = Int -> Int -> Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => Int -> Int -> v a -> v a
G.slice
init :: Storable a => Vector a -> Vector a
{-# INLINE init #-}
init :: Vector a -> Vector a
init = Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => v a -> v a
G.init
tail :: Storable a => Vector a -> Vector a
{-# INLINE tail #-}
tail :: Vector a -> Vector a
tail = Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => v a -> v a
G.tail
take :: Storable a => Int -> Vector a -> Vector a
{-# INLINE take #-}
take :: Int -> Vector a -> Vector a
take = Int -> Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => Int -> v a -> v a
G.take
drop :: Storable a => Int -> Vector a -> Vector a
{-# INLINE drop #-}
drop :: Int -> Vector a -> Vector a
drop = Int -> Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => Int -> v a -> v a
G.drop
{-# INLINE splitAt #-}
splitAt :: Storable a => Int -> Vector a -> (Vector a, Vector a)
splitAt :: Int -> Vector a -> (Vector a, Vector a)
splitAt = Int -> Vector a -> (Vector a, Vector a)
forall (v :: * -> *) a. Vector v a => Int -> v a -> (v a, v a)
G.splitAt
unsafeSlice :: Storable a => Int
-> Int
-> Vector a
-> Vector a
{-# INLINE unsafeSlice #-}
unsafeSlice :: Int -> Int -> Vector a -> Vector a
unsafeSlice = Int -> Int -> Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => Int -> Int -> v a -> v a
G.unsafeSlice
unsafeInit :: Storable a => Vector a -> Vector a
{-# INLINE unsafeInit #-}
unsafeInit :: Vector a -> Vector a
unsafeInit = Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => v a -> v a
G.unsafeInit
unsafeTail :: Storable a => Vector a -> Vector a
{-# INLINE unsafeTail #-}
unsafeTail :: Vector a -> Vector a
unsafeTail = Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => v a -> v a
G.unsafeTail
unsafeTake :: Storable a => Int -> Vector a -> Vector a
{-# INLINE unsafeTake #-}
unsafeTake :: Int -> Vector a -> Vector a
unsafeTake = Int -> Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => Int -> v a -> v a
G.unsafeTake
unsafeDrop :: Storable a => Int -> Vector a -> Vector a
{-# INLINE unsafeDrop #-}
unsafeDrop :: Int -> Vector a -> Vector a
unsafeDrop = Int -> Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => Int -> v a -> v a
G.unsafeDrop
empty :: Storable a => Vector a
{-# INLINE empty #-}
empty :: Vector a
empty = Vector a
forall (v :: * -> *) a. Vector v a => v a
G.empty
singleton :: Storable a => a -> Vector a
{-# INLINE singleton #-}
singleton :: a -> Vector a
singleton = a -> Vector a
forall (v :: * -> *) a. Vector v a => a -> v a
G.singleton
replicate :: Storable a => Int -> a -> Vector a
{-# INLINE replicate #-}
replicate :: Int -> a -> Vector a
replicate = Int -> a -> Vector a
forall (v :: * -> *) a. Vector v a => Int -> a -> v a
G.replicate
generate :: Storable a => Int -> (Int -> a) -> Vector a
{-# INLINE generate #-}
generate :: Int -> (Int -> a) -> Vector a
generate = Int -> (Int -> a) -> Vector a
forall (v :: * -> *) a. Vector v a => Int -> (Int -> a) -> v a
G.generate
iterateN :: Storable a => Int -> (a -> a) -> a -> Vector a
{-# INLINE iterateN #-}
iterateN :: Int -> (a -> a) -> a -> Vector a
iterateN = Int -> (a -> a) -> a -> Vector a
forall (v :: * -> *) a. Vector v a => Int -> (a -> a) -> a -> v a
G.iterateN
unfoldr :: Storable a => (b -> Maybe (a, b)) -> b -> Vector a
{-# INLINE unfoldr #-}
unfoldr :: (b -> Maybe (a, b)) -> b -> Vector a
unfoldr = (b -> Maybe (a, b)) -> b -> Vector a
forall (v :: * -> *) a b.
Vector v a =>
(b -> Maybe (a, b)) -> b -> v a
G.unfoldr
unfoldrN :: Storable a => Int -> (b -> Maybe (a, b)) -> b -> Vector a
{-# INLINE unfoldrN #-}
unfoldrN :: Int -> (b -> Maybe (a, b)) -> b -> Vector a
unfoldrN = Int -> (b -> Maybe (a, b)) -> b -> Vector a
forall (v :: * -> *) a b.
Vector v a =>
Int -> (b -> Maybe (a, b)) -> b -> v a
G.unfoldrN
unfoldrM :: (Monad m, Storable a) => (b -> m (Maybe (a, b))) -> b -> m (Vector a)
{-# INLINE unfoldrM #-}
unfoldrM :: (b -> m (Maybe (a, b))) -> b -> m (Vector a)
unfoldrM = (b -> m (Maybe (a, b))) -> b -> m (Vector a)
forall (m :: * -> *) (v :: * -> *) a b.
(Monad m, Vector v a) =>
(b -> m (Maybe (a, b))) -> b -> m (v a)
G.unfoldrM
unfoldrNM :: (Monad m, Storable a) => Int -> (b -> m (Maybe (a, b))) -> b -> m (Vector a)
{-# INLINE unfoldrNM #-}
unfoldrNM :: Int -> (b -> m (Maybe (a, b))) -> b -> m (Vector a)
unfoldrNM = Int -> (b -> m (Maybe (a, b))) -> b -> m (Vector a)
forall (m :: * -> *) (v :: * -> *) a b.
(Monad m, Vector v a) =>
Int -> (b -> m (Maybe (a, b))) -> b -> m (v a)
G.unfoldrNM
constructN :: Storable a => Int -> (Vector a -> a) -> Vector a
{-# INLINE constructN #-}
constructN :: Int -> (Vector a -> a) -> Vector a
constructN = Int -> (Vector a -> a) -> Vector a
forall (v :: * -> *) a. Vector v a => Int -> (v a -> a) -> v a
G.constructN
constructrN :: Storable a => Int -> (Vector a -> a) -> Vector a
{-# INLINE constructrN #-}
constructrN :: Int -> (Vector a -> a) -> Vector a
constructrN = Int -> (Vector a -> a) -> Vector a
forall (v :: * -> *) a. Vector v a => Int -> (v a -> a) -> v a
G.constructrN
enumFromN :: (Storable a, Num a) => a -> Int -> Vector a
{-# INLINE enumFromN #-}
enumFromN :: a -> Int -> Vector a
enumFromN = a -> Int -> Vector a
forall (v :: * -> *) a. (Vector v a, Num a) => a -> Int -> v a
G.enumFromN
enumFromStepN :: (Storable a, Num a) => a -> a -> Int -> Vector a
{-# INLINE enumFromStepN #-}
enumFromStepN :: a -> a -> Int -> Vector a
enumFromStepN = a -> a -> Int -> Vector a
forall (v :: * -> *) a. (Vector v a, Num a) => a -> a -> Int -> v a
G.enumFromStepN
enumFromTo :: (Storable a, Enum a) => a -> a -> Vector a
{-# INLINE enumFromTo #-}
enumFromTo :: a -> a -> Vector a
enumFromTo = a -> a -> Vector a
forall (v :: * -> *) a. (Vector v a, Enum a) => a -> a -> v a
G.enumFromTo
enumFromThenTo :: (Storable a, Enum a) => a -> a -> a -> Vector a
{-# INLINE enumFromThenTo #-}
enumFromThenTo :: a -> a -> a -> Vector a
enumFromThenTo = a -> a -> a -> Vector a
forall (v :: * -> *) a. (Vector v a, Enum a) => a -> a -> a -> v a
G.enumFromThenTo
cons :: Storable a => a -> Vector a -> Vector a
{-# INLINE cons #-}
cons :: a -> Vector a -> Vector a
cons = a -> Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => a -> v a -> v a
G.cons
snoc :: Storable a => Vector a -> a -> Vector a
{-# INLINE snoc #-}
snoc :: Vector a -> a -> Vector a
snoc = Vector a -> a -> Vector a
forall (v :: * -> *) a. Vector v a => v a -> a -> v a
G.snoc
infixr 5 ++
(++) :: Storable a => Vector a -> Vector a -> Vector a
{-# INLINE (++) #-}
++ :: Vector a -> Vector a -> Vector a
(++) = Vector a -> Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => v a -> v a -> v a
(G.++)
concat :: Storable a => [Vector a] -> Vector a
{-# INLINE concat #-}
concat :: [Vector a] -> Vector a
concat = [Vector a] -> Vector a
forall (v :: * -> *) a. Vector v a => [v a] -> v a
G.concat
replicateM :: (Monad m, Storable a) => Int -> m a -> m (Vector a)
{-# INLINE replicateM #-}
replicateM :: Int -> m a -> m (Vector a)
replicateM = Int -> m a -> m (Vector a)
forall (m :: * -> *) (v :: * -> *) a.
(Monad m, Vector v a) =>
Int -> m a -> m (v a)
G.replicateM
generateM :: (Monad m, Storable a) => Int -> (Int -> m a) -> m (Vector a)
{-# INLINE generateM #-}
generateM :: Int -> (Int -> m a) -> m (Vector a)
generateM = Int -> (Int -> m a) -> m (Vector a)
forall (m :: * -> *) (v :: * -> *) a.
(Monad m, Vector v a) =>
Int -> (Int -> m a) -> m (v a)
G.generateM
iterateNM :: (Monad m, Storable a) => Int -> (a -> m a) -> a -> m (Vector a)
{-# INLINE iterateNM #-}
iterateNM :: Int -> (a -> m a) -> a -> m (Vector a)
iterateNM = Int -> (a -> m a) -> a -> m (Vector a)
forall (m :: * -> *) (v :: * -> *) a.
(Monad m, Vector v a) =>
Int -> (a -> m a) -> a -> m (v a)
G.iterateNM
create :: Storable a => (forall s. ST s (MVector s a)) -> Vector a
{-# INLINE create #-}
create :: (forall s. ST s (MVector s a)) -> Vector a
create p :: forall s. ST s (MVector s a)
p = (forall s. ST s (Mutable Vector s a)) -> Vector a
forall (v :: * -> *) a.
Vector v a =>
(forall s. ST s (Mutable v s a)) -> v a
G.create forall s. ST s (Mutable Vector s a)
forall s. ST s (MVector s a)
p
createT :: (Traversable f, Storable a) => (forall s. ST s (f (MVector s a))) -> f (Vector a)
{-# INLINE createT #-}
createT :: (forall s. ST s (f (MVector s a))) -> f (Vector a)
createT p :: forall s. ST s (f (MVector s a))
p = (forall s. ST s (f (Mutable Vector s a))) -> f (Vector a)
forall (f :: * -> *) (v :: * -> *) a.
(Traversable f, Vector v a) =>
(forall s. ST s (f (Mutable v s a))) -> f (v a)
G.createT forall s. ST s (f (Mutable Vector s a))
forall s. ST s (f (MVector s a))
p
force :: Storable a => Vector a -> Vector a
{-# INLINE force #-}
force :: Vector a -> Vector a
force = Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => v a -> v a
G.force
(//) :: Storable a => Vector a
-> [(Int, a)]
-> Vector a
{-# INLINE (//) #-}
// :: Vector a -> [(Int, a)] -> Vector a
(//) = Vector a -> [(Int, a)] -> Vector a
forall (v :: * -> *) a. Vector v a => v a -> [(Int, a)] -> v a
(G.//)
update_ :: Storable a
=> Vector a
-> Vector Int
-> Vector a
-> Vector a
{-# INLINE update_ #-}
update_ :: Vector a -> Vector Int -> Vector a -> Vector a
update_ = Vector a -> Vector Int -> Vector a -> Vector a
forall (v :: * -> *) a.
(Vector v a, Vector v Int) =>
v a -> v Int -> v a -> v a
G.update_
unsafeUpd :: Storable a => Vector a -> [(Int, a)] -> Vector a
{-# INLINE unsafeUpd #-}
unsafeUpd :: Vector a -> [(Int, a)] -> Vector a
unsafeUpd = Vector a -> [(Int, a)] -> Vector a
forall (v :: * -> *) a. Vector v a => v a -> [(Int, a)] -> v a
G.unsafeUpd
unsafeUpdate_ :: Storable a => Vector a -> Vector Int -> Vector a -> Vector a
{-# INLINE unsafeUpdate_ #-}
unsafeUpdate_ :: Vector a -> Vector Int -> Vector a -> Vector a
unsafeUpdate_ = Vector a -> Vector Int -> Vector a -> Vector a
forall (v :: * -> *) a.
(Vector v a, Vector v Int) =>
v a -> v Int -> v a -> v a
G.unsafeUpdate_
accum :: Storable a
=> (a -> b -> a)
-> Vector a
-> [(Int,b)]
-> Vector a
{-# INLINE accum #-}
accum :: (a -> b -> a) -> Vector a -> [(Int, b)] -> Vector a
accum = (a -> b -> a) -> Vector a -> [(Int, b)] -> Vector a
forall (v :: * -> *) a b.
Vector v a =>
(a -> b -> a) -> v a -> [(Int, b)] -> v a
G.accum
accumulate_ :: (Storable a, Storable b)
=> (a -> b -> a)
-> Vector a
-> Vector Int
-> Vector b
-> Vector a
{-# INLINE accumulate_ #-}
accumulate_ :: (a -> b -> a) -> Vector a -> Vector Int -> Vector b -> Vector a
accumulate_ = (a -> b -> a) -> Vector a -> Vector Int -> Vector b -> Vector a
forall (v :: * -> *) a b.
(Vector v a, Vector v Int, Vector v b) =>
(a -> b -> a) -> v a -> v Int -> v b -> v a
G.accumulate_
unsafeAccum :: Storable a => (a -> b -> a) -> Vector a -> [(Int,b)] -> Vector a
{-# INLINE unsafeAccum #-}
unsafeAccum :: (a -> b -> a) -> Vector a -> [(Int, b)] -> Vector a
unsafeAccum = (a -> b -> a) -> Vector a -> [(Int, b)] -> Vector a
forall (v :: * -> *) a b.
Vector v a =>
(a -> b -> a) -> v a -> [(Int, b)] -> v a
G.unsafeAccum
unsafeAccumulate_ :: (Storable a, Storable b) =>
(a -> b -> a) -> Vector a -> Vector Int -> Vector b -> Vector a
{-# INLINE unsafeAccumulate_ #-}
unsafeAccumulate_ :: (a -> b -> a) -> Vector a -> Vector Int -> Vector b -> Vector a
unsafeAccumulate_ = (a -> b -> a) -> Vector a -> Vector Int -> Vector b -> Vector a
forall (v :: * -> *) a b.
(Vector v a, Vector v Int, Vector v b) =>
(a -> b -> a) -> v a -> v Int -> v b -> v a
G.unsafeAccumulate_
reverse :: Storable a => Vector a -> Vector a
{-# INLINE reverse #-}
reverse :: Vector a -> Vector a
reverse = Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => v a -> v a
G.reverse
backpermute :: Storable a => Vector a -> Vector Int -> Vector a
{-# INLINE backpermute #-}
backpermute :: Vector a -> Vector Int -> Vector a
backpermute = Vector a -> Vector Int -> Vector a
forall (v :: * -> *) a.
(Vector v a, Vector v Int) =>
v a -> v Int -> v a
G.backpermute
unsafeBackpermute :: Storable a => Vector a -> Vector Int -> Vector a
{-# INLINE unsafeBackpermute #-}
unsafeBackpermute :: Vector a -> Vector Int -> Vector a
unsafeBackpermute = Vector a -> Vector Int -> Vector a
forall (v :: * -> *) a.
(Vector v a, Vector v Int) =>
v a -> v Int -> v a
G.unsafeBackpermute
modify :: Storable a => (forall s. MVector s a -> ST s ()) -> Vector a -> Vector a
{-# INLINE modify #-}
modify :: (forall s. MVector s a -> ST s ()) -> Vector a -> Vector a
modify p :: forall s. MVector s a -> ST s ()
p = (forall s. Mutable Vector s a -> ST s ()) -> Vector a -> Vector a
forall (v :: * -> *) a.
Vector v a =>
(forall s. Mutable v s a -> ST s ()) -> v a -> v a
G.modify forall s. Mutable Vector s a -> ST s ()
forall s. MVector s a -> ST s ()
p
map :: (Storable a, Storable b) => (a -> b) -> Vector a -> Vector b
{-# INLINE map #-}
map :: (a -> b) -> Vector a -> Vector b
map = (a -> b) -> Vector a -> Vector b
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b) -> v a -> v b
G.map
imap :: (Storable a, Storable b) => (Int -> a -> b) -> Vector a -> Vector b
{-# INLINE imap #-}
imap :: (Int -> a -> b) -> Vector a -> Vector b
imap = (Int -> a -> b) -> Vector a -> Vector b
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(Int -> a -> b) -> v a -> v b
G.imap
concatMap :: (Storable a, Storable b) => (a -> Vector b) -> Vector a -> Vector b
{-# INLINE concatMap #-}
concatMap :: (a -> Vector b) -> Vector a -> Vector b
concatMap = (a -> Vector b) -> Vector a -> Vector b
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> v b) -> v a -> v b
G.concatMap
mapM :: (Monad m, Storable a, Storable b) => (a -> m b) -> Vector a -> m (Vector b)
{-# INLINE mapM #-}
mapM :: (a -> m b) -> Vector a -> m (Vector b)
mapM = (a -> m b) -> Vector a -> m (Vector b)
forall (m :: * -> *) (v :: * -> *) a b.
(Monad m, Vector v a, Vector v b) =>
(a -> m b) -> v a -> m (v b)
G.mapM
mapM_ :: (Monad m, Storable a) => (a -> m b) -> Vector a -> m ()
{-# INLINE mapM_ #-}
mapM_ :: (a -> m b) -> Vector a -> m ()
mapM_ = (a -> m b) -> Vector a -> m ()
forall (m :: * -> *) (v :: * -> *) a b.
(Monad m, Vector v a) =>
(a -> m b) -> v a -> m ()
G.mapM_
forM :: (Monad m, Storable a, Storable b) => Vector a -> (a -> m b) -> m (Vector b)
{-# INLINE forM #-}
forM :: Vector a -> (a -> m b) -> m (Vector b)
forM = Vector a -> (a -> m b) -> m (Vector b)
forall (m :: * -> *) (v :: * -> *) a b.
(Monad m, Vector v a, Vector v b) =>
v a -> (a -> m b) -> m (v b)
G.forM
forM_ :: (Monad m, Storable a) => Vector a -> (a -> m b) -> m ()
{-# INLINE forM_ #-}
forM_ :: Vector a -> (a -> m b) -> m ()
forM_ = Vector a -> (a -> m b) -> m ()
forall (m :: * -> *) (v :: * -> *) a b.
(Monad m, Vector v a) =>
v a -> (a -> m b) -> m ()
G.forM_
zipWith :: (Storable a, Storable b, Storable c)
=> (a -> b -> c) -> Vector a -> Vector b -> Vector c
{-# INLINE zipWith #-}
zipWith :: (a -> b -> c) -> Vector a -> Vector b -> Vector c
zipWith = (a -> b -> c) -> Vector a -> Vector b -> Vector c
forall (v :: * -> *) a b c.
(Vector v a, Vector v b, Vector v c) =>
(a -> b -> c) -> v a -> v b -> v c
G.zipWith
zipWith3 :: (Storable a, Storable b, Storable c, Storable d)
=> (a -> b -> c -> d) -> Vector a -> Vector b -> Vector c -> Vector d
{-# INLINE zipWith3 #-}
zipWith3 :: (a -> b -> c -> d) -> Vector a -> Vector b -> Vector c -> Vector d
zipWith3 = (a -> b -> c -> d) -> Vector a -> Vector b -> Vector c -> Vector d
forall (v :: * -> *) a b c d.
(Vector v a, Vector v b, Vector v c, Vector v d) =>
(a -> b -> c -> d) -> v a -> v b -> v c -> v d
G.zipWith3
zipWith4 :: (Storable a, Storable b, Storable c, Storable d, Storable e)
=> (a -> b -> c -> d -> e)
-> Vector a -> Vector b -> Vector c -> Vector d -> Vector e
{-# INLINE zipWith4 #-}
zipWith4 :: (a -> b -> c -> d -> e)
-> Vector a -> Vector b -> Vector c -> Vector d -> Vector e
zipWith4 = (a -> b -> c -> d -> e)
-> Vector a -> Vector b -> Vector c -> Vector d -> Vector e
forall (v :: * -> *) a b c d e.
(Vector v a, Vector v b, Vector v c, Vector v d, Vector v e) =>
(a -> b -> c -> d -> e) -> v a -> v b -> v c -> v d -> v e
G.zipWith4
zipWith5 :: (Storable a, Storable b, Storable c, Storable d, Storable e,
Storable f)
=> (a -> b -> c -> d -> e -> f)
-> Vector a -> Vector b -> Vector c -> Vector d -> Vector e
-> Vector f
{-# INLINE zipWith5 #-}
zipWith5 :: (a -> b -> c -> d -> e -> f)
-> Vector a
-> Vector b
-> Vector c
-> Vector d
-> Vector e
-> Vector f
zipWith5 = (a -> b -> c -> d -> e -> f)
-> Vector a
-> Vector b
-> Vector c
-> Vector d
-> Vector e
-> Vector f
forall (v :: * -> *) a b c d e f.
(Vector v a, Vector v b, Vector v c, Vector v d, Vector v e,
Vector v f) =>
(a -> b -> c -> d -> e -> f)
-> v a -> v b -> v c -> v d -> v e -> v f
G.zipWith5
zipWith6 :: (Storable a, Storable b, Storable c, Storable d, Storable e,
Storable f, Storable g)
=> (a -> b -> c -> d -> e -> f -> g)
-> Vector a -> Vector b -> Vector c -> Vector d -> Vector e
-> Vector f -> Vector g
{-# INLINE zipWith6 #-}
zipWith6 :: (a -> b -> c -> d -> e -> f -> g)
-> Vector a
-> Vector b
-> Vector c
-> Vector d
-> Vector e
-> Vector f
-> Vector g
zipWith6 = (a -> b -> c -> d -> e -> f -> g)
-> Vector a
-> Vector b
-> Vector c
-> Vector d
-> Vector e
-> Vector f
-> Vector g
forall (v :: * -> *) a b c d e f g.
(Vector v a, Vector v b, Vector v c, Vector v d, Vector v e,
Vector v f, Vector v g) =>
(a -> b -> c -> d -> e -> f -> g)
-> v a -> v b -> v c -> v d -> v e -> v f -> v g
G.zipWith6
izipWith :: (Storable a, Storable b, Storable c)
=> (Int -> a -> b -> c) -> Vector a -> Vector b -> Vector c
{-# INLINE izipWith #-}
izipWith :: (Int -> a -> b -> c) -> Vector a -> Vector b -> Vector c
izipWith = (Int -> a -> b -> c) -> Vector a -> Vector b -> Vector c
forall (v :: * -> *) a b c.
(Vector v a, Vector v b, Vector v c) =>
(Int -> a -> b -> c) -> v a -> v b -> v c
G.izipWith
izipWith3 :: (Storable a, Storable b, Storable c, Storable d)
=> (Int -> a -> b -> c -> d)
-> Vector a -> Vector b -> Vector c -> Vector d
{-# INLINE izipWith3 #-}
izipWith3 :: (Int -> a -> b -> c -> d)
-> Vector a -> Vector b -> Vector c -> Vector d
izipWith3 = (Int -> a -> b -> c -> d)
-> Vector a -> Vector b -> Vector c -> Vector d
forall (v :: * -> *) a b c d.
(Vector v a, Vector v b, Vector v c, Vector v d) =>
(Int -> a -> b -> c -> d) -> v a -> v b -> v c -> v d
G.izipWith3
izipWith4 :: (Storable a, Storable b, Storable c, Storable d, Storable e)
=> (Int -> a -> b -> c -> d -> e)
-> Vector a -> Vector b -> Vector c -> Vector d -> Vector e
{-# INLINE izipWith4 #-}
izipWith4 :: (Int -> a -> b -> c -> d -> e)
-> Vector a -> Vector b -> Vector c -> Vector d -> Vector e
izipWith4 = (Int -> a -> b -> c -> d -> e)
-> Vector a -> Vector b -> Vector c -> Vector d -> Vector e
forall (v :: * -> *) a b c d e.
(Vector v a, Vector v b, Vector v c, Vector v d, Vector v e) =>
(Int -> a -> b -> c -> d -> e) -> v a -> v b -> v c -> v d -> v e
G.izipWith4
izipWith5 :: (Storable a, Storable b, Storable c, Storable d, Storable e,
Storable f)
=> (Int -> a -> b -> c -> d -> e -> f)
-> Vector a -> Vector b -> Vector c -> Vector d -> Vector e
-> Vector f
{-# INLINE izipWith5 #-}
izipWith5 :: (Int -> a -> b -> c -> d -> e -> f)
-> Vector a
-> Vector b
-> Vector c
-> Vector d
-> Vector e
-> Vector f
izipWith5 = (Int -> a -> b -> c -> d -> e -> f)
-> Vector a
-> Vector b
-> Vector c
-> Vector d
-> Vector e
-> Vector f
forall (v :: * -> *) a b c d e f.
(Vector v a, Vector v b, Vector v c, Vector v d, Vector v e,
Vector v f) =>
(Int -> a -> b -> c -> d -> e -> f)
-> v a -> v b -> v c -> v d -> v e -> v f
G.izipWith5
izipWith6 :: (Storable a, Storable b, Storable c, Storable d, Storable e,
Storable f, Storable g)
=> (Int -> a -> b -> c -> d -> e -> f -> g)
-> Vector a -> Vector b -> Vector c -> Vector d -> Vector e
-> Vector f -> Vector g
{-# INLINE izipWith6 #-}
izipWith6 :: (Int -> a -> b -> c -> d -> e -> f -> g)
-> Vector a
-> Vector b
-> Vector c
-> Vector d
-> Vector e
-> Vector f
-> Vector g
izipWith6 = (Int -> a -> b -> c -> d -> e -> f -> g)
-> Vector a
-> Vector b
-> Vector c
-> Vector d
-> Vector e
-> Vector f
-> Vector g
forall (v :: * -> *) a b c d e f g.
(Vector v a, Vector v b, Vector v c, Vector v d, Vector v e,
Vector v f, Vector v g) =>
(Int -> a -> b -> c -> d -> e -> f -> g)
-> v a -> v b -> v c -> v d -> v e -> v f -> v g
G.izipWith6
zipWithM :: (Monad m, Storable a, Storable b, Storable c)
=> (a -> b -> m c) -> Vector a -> Vector b -> m (Vector c)
{-# INLINE zipWithM #-}
zipWithM :: (a -> b -> m c) -> Vector a -> Vector b -> m (Vector c)
zipWithM = (a -> b -> m c) -> Vector a -> Vector b -> m (Vector c)
forall (m :: * -> *) (v :: * -> *) a b c.
(Monad m, Vector v a, Vector v b, Vector v c) =>
(a -> b -> m c) -> v a -> v b -> m (v c)
G.zipWithM
zipWithM_ :: (Monad m, Storable a, Storable b)
=> (a -> b -> m c) -> Vector a -> Vector b -> m ()
{-# INLINE zipWithM_ #-}
zipWithM_ :: (a -> b -> m c) -> Vector a -> Vector b -> m ()
zipWithM_ = (a -> b -> m c) -> Vector a -> Vector b -> m ()
forall (m :: * -> *) (v :: * -> *) a b c.
(Monad m, Vector v a, Vector v b) =>
(a -> b -> m c) -> v a -> v b -> m ()
G.zipWithM_
filter :: Storable a => (a -> Bool) -> Vector a -> Vector a
{-# INLINE filter #-}
filter :: (a -> Bool) -> Vector a -> Vector a
filter = (a -> Bool) -> Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => (a -> Bool) -> v a -> v a
G.filter
ifilter :: Storable a => (Int -> a -> Bool) -> Vector a -> Vector a
{-# INLINE ifilter #-}
ifilter :: (Int -> a -> Bool) -> Vector a -> Vector a
ifilter = (Int -> a -> Bool) -> Vector a -> Vector a
forall (v :: * -> *) a.
Vector v a =>
(Int -> a -> Bool) -> v a -> v a
G.ifilter
uniq :: (Storable a, Eq a) => Vector a -> Vector a
{-# INLINE uniq #-}
uniq :: Vector a -> Vector a
uniq = Vector a -> Vector a
forall (v :: * -> *) a. (Vector v a, Eq a) => v a -> v a
G.uniq
mapMaybe :: (Storable a, Storable b) => (a -> Maybe b) -> Vector a -> Vector b
{-# INLINE mapMaybe #-}
mapMaybe :: (a -> Maybe b) -> Vector a -> Vector b
mapMaybe = (a -> Maybe b) -> Vector a -> Vector b
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> Maybe b) -> v a -> v b
G.mapMaybe
imapMaybe :: (Storable a, Storable b) => (Int -> a -> Maybe b) -> Vector a -> Vector b
{-# INLINE imapMaybe #-}
imapMaybe :: (Int -> a -> Maybe b) -> Vector a -> Vector b
imapMaybe = (Int -> a -> Maybe b) -> Vector a -> Vector b
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(Int -> a -> Maybe b) -> v a -> v b
G.imapMaybe
filterM :: (Monad m, Storable a) => (a -> m Bool) -> Vector a -> m (Vector a)
{-# INLINE filterM #-}
filterM :: (a -> m Bool) -> Vector a -> m (Vector a)
filterM = (a -> m Bool) -> Vector a -> m (Vector a)
forall (m :: * -> *) (v :: * -> *) a.
(Monad m, Vector v a) =>
(a -> m Bool) -> v a -> m (v a)
G.filterM
takeWhile :: Storable a => (a -> Bool) -> Vector a -> Vector a
{-# INLINE takeWhile #-}
takeWhile :: (a -> Bool) -> Vector a -> Vector a
takeWhile = (a -> Bool) -> Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => (a -> Bool) -> v a -> v a
G.takeWhile
dropWhile :: Storable a => (a -> Bool) -> Vector a -> Vector a
{-# INLINE dropWhile #-}
dropWhile :: (a -> Bool) -> Vector a -> Vector a
dropWhile = (a -> Bool) -> Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => (a -> Bool) -> v a -> v a
G.dropWhile
partition :: Storable a => (a -> Bool) -> Vector a -> (Vector a, Vector a)
{-# INLINE partition #-}
partition :: (a -> Bool) -> Vector a -> (Vector a, Vector a)
partition = (a -> Bool) -> Vector a -> (Vector a, Vector a)
forall (v :: * -> *) a.
Vector v a =>
(a -> Bool) -> v a -> (v a, v a)
G.partition
unstablePartition :: Storable a => (a -> Bool) -> Vector a -> (Vector a, Vector a)
{-# INLINE unstablePartition #-}
unstablePartition :: (a -> Bool) -> Vector a -> (Vector a, Vector a)
unstablePartition = (a -> Bool) -> Vector a -> (Vector a, Vector a)
forall (v :: * -> *) a.
Vector v a =>
(a -> Bool) -> v a -> (v a, v a)
G.unstablePartition
partitionWith :: (Storable a, Storable b, Storable c) => (a -> Either b c) -> Vector a -> (Vector b, Vector c)
{-# INLINE partitionWith #-}
partitionWith :: (a -> Either b c) -> Vector a -> (Vector b, Vector c)
partitionWith = (a -> Either b c) -> Vector a -> (Vector b, Vector c)
forall (v :: * -> *) a b c.
(Vector v a, Vector v b, Vector v c) =>
(a -> Either b c) -> v a -> (v b, v c)
G.partitionWith
span :: Storable a => (a -> Bool) -> Vector a -> (Vector a, Vector a)
{-# INLINE span #-}
span :: (a -> Bool) -> Vector a -> (Vector a, Vector a)
span = (a -> Bool) -> Vector a -> (Vector a, Vector a)
forall (v :: * -> *) a.
Vector v a =>
(a -> Bool) -> v a -> (v a, v a)
G.span
break :: Storable a => (a -> Bool) -> Vector a -> (Vector a, Vector a)
{-# INLINE break #-}
break :: (a -> Bool) -> Vector a -> (Vector a, Vector a)
break = (a -> Bool) -> Vector a -> (Vector a, Vector a)
forall (v :: * -> *) a.
Vector v a =>
(a -> Bool) -> v a -> (v a, v a)
G.break
infix 4 `elem`
elem :: (Storable a, Eq a) => a -> Vector a -> Bool
{-# INLINE elem #-}
elem :: a -> Vector a -> Bool
elem = a -> Vector a -> Bool
forall (v :: * -> *) a. (Vector v a, Eq a) => a -> v a -> Bool
G.elem
infix 4 `notElem`
notElem :: (Storable a, Eq a) => a -> Vector a -> Bool
{-# INLINE notElem #-}
notElem :: a -> Vector a -> Bool
notElem = a -> Vector a -> Bool
forall (v :: * -> *) a. (Vector v a, Eq a) => a -> v a -> Bool
G.notElem
find :: Storable a => (a -> Bool) -> Vector a -> Maybe a
{-# INLINE find #-}
find :: (a -> Bool) -> Vector a -> Maybe a
find = (a -> Bool) -> Vector a -> Maybe a
forall (v :: * -> *) a. Vector v a => (a -> Bool) -> v a -> Maybe a
G.find
findIndex :: Storable a => (a -> Bool) -> Vector a -> Maybe Int
{-# INLINE findIndex #-}
findIndex :: (a -> Bool) -> Vector a -> Maybe Int
findIndex = (a -> Bool) -> Vector a -> Maybe Int
forall (v :: * -> *) a.
Vector v a =>
(a -> Bool) -> v a -> Maybe Int
G.findIndex
findIndices :: Storable a => (a -> Bool) -> Vector a -> Vector Int
{-# INLINE findIndices #-}
findIndices :: (a -> Bool) -> Vector a -> Vector Int
findIndices = (a -> Bool) -> Vector a -> Vector Int
forall (v :: * -> *) a.
(Vector v a, Vector v Int) =>
(a -> Bool) -> v a -> v Int
G.findIndices
elemIndex :: (Storable a, Eq a) => a -> Vector a -> Maybe Int
{-# INLINE elemIndex #-}
elemIndex :: a -> Vector a -> Maybe Int
elemIndex = a -> Vector a -> Maybe Int
forall (v :: * -> *) a. (Vector v a, Eq a) => a -> v a -> Maybe Int
G.elemIndex
elemIndices :: (Storable a, Eq a) => a -> Vector a -> Vector Int
{-# INLINE elemIndices #-}
elemIndices :: a -> Vector a -> Vector Int
elemIndices = a -> Vector a -> Vector Int
forall (v :: * -> *) a.
(Vector v a, Vector v Int, Eq a) =>
a -> v a -> v Int
G.elemIndices
foldl :: Storable b => (a -> b -> a) -> a -> Vector b -> a
{-# INLINE foldl #-}
foldl :: (a -> b -> a) -> a -> Vector b -> a
foldl = (a -> b -> a) -> a -> Vector b -> a
forall (v :: * -> *) b a.
Vector v b =>
(a -> b -> a) -> a -> v b -> a
G.foldl
foldl1 :: Storable a => (a -> a -> a) -> Vector a -> a
{-# INLINE foldl1 #-}
foldl1 :: (a -> a -> a) -> Vector a -> a
foldl1 = (a -> a -> a) -> Vector a -> a
forall (v :: * -> *) a. Vector v a => (a -> a -> a) -> v a -> a
G.foldl1
foldl' :: Storable b => (a -> b -> a) -> a -> Vector b -> a
{-# INLINE foldl' #-}
foldl' :: (a -> b -> a) -> a -> Vector b -> a
foldl' = (a -> b -> a) -> a -> Vector b -> a
forall (v :: * -> *) b a.
Vector v b =>
(a -> b -> a) -> a -> v b -> a
G.foldl'
foldl1' :: Storable a => (a -> a -> a) -> Vector a -> a
{-# INLINE foldl1' #-}
foldl1' :: (a -> a -> a) -> Vector a -> a
foldl1' = (a -> a -> a) -> Vector a -> a
forall (v :: * -> *) a. Vector v a => (a -> a -> a) -> v a -> a
G.foldl1'
foldr :: Storable a => (a -> b -> b) -> b -> Vector a -> b
{-# INLINE foldr #-}
foldr :: (a -> b -> b) -> b -> Vector a -> b
foldr = (a -> b -> b) -> b -> Vector a -> b
forall (v :: * -> *) a b.
Vector v a =>
(a -> b -> b) -> b -> v a -> b
G.foldr
foldr1 :: Storable a => (a -> a -> a) -> Vector a -> a
{-# INLINE foldr1 #-}
foldr1 :: (a -> a -> a) -> Vector a -> a
foldr1 = (a -> a -> a) -> Vector a -> a
forall (v :: * -> *) a. Vector v a => (a -> a -> a) -> v a -> a
G.foldr1
foldr' :: Storable a => (a -> b -> b) -> b -> Vector a -> b
{-# INLINE foldr' #-}
foldr' :: (a -> b -> b) -> b -> Vector a -> b
foldr' = (a -> b -> b) -> b -> Vector a -> b
forall (v :: * -> *) a b.
Vector v a =>
(a -> b -> b) -> b -> v a -> b
G.foldr'
foldr1' :: Storable a => (a -> a -> a) -> Vector a -> a
{-# INLINE foldr1' #-}
foldr1' :: (a -> a -> a) -> Vector a -> a
foldr1' = (a -> a -> a) -> Vector a -> a
forall (v :: * -> *) a. Vector v a => (a -> a -> a) -> v a -> a
G.foldr1'
ifoldl :: Storable b => (a -> Int -> b -> a) -> a -> Vector b -> a
{-# INLINE ifoldl #-}
ifoldl :: (a -> Int -> b -> a) -> a -> Vector b -> a
ifoldl = (a -> Int -> b -> a) -> a -> Vector b -> a
forall (v :: * -> *) b a.
Vector v b =>
(a -> Int -> b -> a) -> a -> v b -> a
G.ifoldl
ifoldl' :: Storable b => (a -> Int -> b -> a) -> a -> Vector b -> a
{-# INLINE ifoldl' #-}
ifoldl' :: (a -> Int -> b -> a) -> a -> Vector b -> a
ifoldl' = (a -> Int -> b -> a) -> a -> Vector b -> a
forall (v :: * -> *) b a.
Vector v b =>
(a -> Int -> b -> a) -> a -> v b -> a
G.ifoldl'
ifoldr :: Storable a => (Int -> a -> b -> b) -> b -> Vector a -> b
{-# INLINE ifoldr #-}
ifoldr :: (Int -> a -> b -> b) -> b -> Vector a -> b
ifoldr = (Int -> a -> b -> b) -> b -> Vector a -> b
forall (v :: * -> *) a b.
Vector v a =>
(Int -> a -> b -> b) -> b -> v a -> b
G.ifoldr
ifoldr' :: Storable a => (Int -> a -> b -> b) -> b -> Vector a -> b
{-# INLINE ifoldr' #-}
ifoldr' :: (Int -> a -> b -> b) -> b -> Vector a -> b
ifoldr' = (Int -> a -> b -> b) -> b -> Vector a -> b
forall (v :: * -> *) a b.
Vector v a =>
(Int -> a -> b -> b) -> b -> v a -> b
G.ifoldr'
all :: Storable a => (a -> Bool) -> Vector a -> Bool
{-# INLINE all #-}
all :: (a -> Bool) -> Vector a -> Bool
all = (a -> Bool) -> Vector a -> Bool
forall (v :: * -> *) a. Vector v a => (a -> Bool) -> v a -> Bool
G.all
any :: Storable a => (a -> Bool) -> Vector a -> Bool
{-# INLINE any #-}
any :: (a -> Bool) -> Vector a -> Bool
any = (a -> Bool) -> Vector a -> Bool
forall (v :: * -> *) a. Vector v a => (a -> Bool) -> v a -> Bool
G.any
and :: Vector Bool -> Bool
{-# INLINE and #-}
and :: Vector Bool -> Bool
and = Vector Bool -> Bool
forall (v :: * -> *). Vector v Bool => v Bool -> Bool
G.and
or :: Vector Bool -> Bool
{-# INLINE or #-}
or :: Vector Bool -> Bool
or = Vector Bool -> Bool
forall (v :: * -> *). Vector v Bool => v Bool -> Bool
G.or
sum :: (Storable a, Num a) => Vector a -> a
{-# INLINE sum #-}
sum :: Vector a -> a
sum = Vector a -> a
forall (v :: * -> *) a. (Vector v a, Num a) => v a -> a
G.sum
product :: (Storable a, Num a) => Vector a -> a
{-# INLINE product #-}
product :: Vector a -> a
product = Vector a -> a
forall (v :: * -> *) a. (Vector v a, Num a) => v a -> a
G.product
maximum :: (Storable a, Ord a) => Vector a -> a
{-# INLINE maximum #-}
maximum :: Vector a -> a
maximum = Vector a -> a
forall (v :: * -> *) a. (Vector v a, Ord a) => v a -> a
G.maximum
maximumBy :: Storable a => (a -> a -> Ordering) -> Vector a -> a
{-# INLINE maximumBy #-}
maximumBy :: (a -> a -> Ordering) -> Vector a -> a
maximumBy = (a -> a -> Ordering) -> Vector a -> a
forall (v :: * -> *) a.
Vector v a =>
(a -> a -> Ordering) -> v a -> a
G.maximumBy
minimum :: (Storable a, Ord a) => Vector a -> a
{-# INLINE minimum #-}
minimum :: Vector a -> a
minimum = Vector a -> a
forall (v :: * -> *) a. (Vector v a, Ord a) => v a -> a
G.minimum
minimumBy :: Storable a => (a -> a -> Ordering) -> Vector a -> a
{-# INLINE minimumBy #-}
minimumBy :: (a -> a -> Ordering) -> Vector a -> a
minimumBy = (a -> a -> Ordering) -> Vector a -> a
forall (v :: * -> *) a.
Vector v a =>
(a -> a -> Ordering) -> v a -> a
G.minimumBy
maxIndex :: (Storable a, Ord a) => Vector a -> Int
{-# INLINE maxIndex #-}
maxIndex :: Vector a -> Int
maxIndex = Vector a -> Int
forall (v :: * -> *) a. (Vector v a, Ord a) => v a -> Int
G.maxIndex
maxIndexBy :: Storable a => (a -> a -> Ordering) -> Vector a -> Int
{-# INLINE maxIndexBy #-}
maxIndexBy :: (a -> a -> Ordering) -> Vector a -> Int
maxIndexBy = (a -> a -> Ordering) -> Vector a -> Int
forall (v :: * -> *) a.
Vector v a =>
(a -> a -> Ordering) -> v a -> Int
G.maxIndexBy
minIndex :: (Storable a, Ord a) => Vector a -> Int
{-# INLINE minIndex #-}
minIndex :: Vector a -> Int
minIndex = Vector a -> Int
forall (v :: * -> *) a. (Vector v a, Ord a) => v a -> Int
G.minIndex
minIndexBy :: Storable a => (a -> a -> Ordering) -> Vector a -> Int
{-# INLINE minIndexBy #-}
minIndexBy :: (a -> a -> Ordering) -> Vector a -> Int
minIndexBy = (a -> a -> Ordering) -> Vector a -> Int
forall (v :: * -> *) a.
Vector v a =>
(a -> a -> Ordering) -> v a -> Int
G.minIndexBy
foldM :: (Monad m, Storable b) => (a -> b -> m a) -> a -> Vector b -> m a
{-# INLINE foldM #-}
foldM :: (a -> b -> m a) -> a -> Vector b -> m a
foldM = (a -> b -> m a) -> a -> Vector b -> m a
forall (m :: * -> *) (v :: * -> *) b a.
(Monad m, Vector v b) =>
(a -> b -> m a) -> a -> v b -> m a
G.foldM
fold1M :: (Monad m, Storable a) => (a -> a -> m a) -> Vector a -> m a
{-# INLINE fold1M #-}
fold1M :: (a -> a -> m a) -> Vector a -> m a
fold1M = (a -> a -> m a) -> Vector a -> m a
forall (m :: * -> *) (v :: * -> *) a.
(Monad m, Vector v a) =>
(a -> a -> m a) -> v a -> m a
G.fold1M
foldM' :: (Monad m, Storable b) => (a -> b -> m a) -> a -> Vector b -> m a
{-# INLINE foldM' #-}
foldM' :: (a -> b -> m a) -> a -> Vector b -> m a
foldM' = (a -> b -> m a) -> a -> Vector b -> m a
forall (m :: * -> *) (v :: * -> *) b a.
(Monad m, Vector v b) =>
(a -> b -> m a) -> a -> v b -> m a
G.foldM'
fold1M' :: (Monad m, Storable a) => (a -> a -> m a) -> Vector a -> m a
{-# INLINE fold1M' #-}
fold1M' :: (a -> a -> m a) -> Vector a -> m a
fold1M' = (a -> a -> m a) -> Vector a -> m a
forall (m :: * -> *) (v :: * -> *) a.
(Monad m, Vector v a) =>
(a -> a -> m a) -> v a -> m a
G.fold1M'
foldM_ :: (Monad m, Storable b) => (a -> b -> m a) -> a -> Vector b -> m ()
{-# INLINE foldM_ #-}
foldM_ :: (a -> b -> m a) -> a -> Vector b -> m ()
foldM_ = (a -> b -> m a) -> a -> Vector b -> m ()
forall (m :: * -> *) (v :: * -> *) b a.
(Monad m, Vector v b) =>
(a -> b -> m a) -> a -> v b -> m ()
G.foldM_
fold1M_ :: (Monad m, Storable a) => (a -> a -> m a) -> Vector a -> m ()
{-# INLINE fold1M_ #-}
fold1M_ :: (a -> a -> m a) -> Vector a -> m ()
fold1M_ = (a -> a -> m a) -> Vector a -> m ()
forall (m :: * -> *) (v :: * -> *) a.
(Monad m, Vector v a) =>
(a -> a -> m a) -> v a -> m ()
G.fold1M_
foldM'_ :: (Monad m, Storable b) => (a -> b -> m a) -> a -> Vector b -> m ()
{-# INLINE foldM'_ #-}
foldM'_ :: (a -> b -> m a) -> a -> Vector b -> m ()
foldM'_ = (a -> b -> m a) -> a -> Vector b -> m ()
forall (m :: * -> *) (v :: * -> *) b a.
(Monad m, Vector v b) =>
(a -> b -> m a) -> a -> v b -> m ()
G.foldM'_
fold1M'_ :: (Monad m, Storable a) => (a -> a -> m a) -> Vector a -> m ()
{-# INLINE fold1M'_ #-}
fold1M'_ :: (a -> a -> m a) -> Vector a -> m ()
fold1M'_ = (a -> a -> m a) -> Vector a -> m ()
forall (m :: * -> *) (v :: * -> *) a.
(Monad m, Vector v a) =>
(a -> a -> m a) -> v a -> m ()
G.fold1M'_
prescanl :: (Storable a, Storable b) => (a -> b -> a) -> a -> Vector b -> Vector a
{-# INLINE prescanl #-}
prescanl :: (a -> b -> a) -> a -> Vector b -> Vector a
prescanl = (a -> b -> a) -> a -> Vector b -> Vector a
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> a) -> a -> v b -> v a
G.prescanl
prescanl' :: (Storable a, Storable b) => (a -> b -> a) -> a -> Vector b -> Vector a
{-# INLINE prescanl' #-}
prescanl' :: (a -> b -> a) -> a -> Vector b -> Vector a
prescanl' = (a -> b -> a) -> a -> Vector b -> Vector a
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> a) -> a -> v b -> v a
G.prescanl'
postscanl :: (Storable a, Storable b) => (a -> b -> a) -> a -> Vector b -> Vector a
{-# INLINE postscanl #-}
postscanl :: (a -> b -> a) -> a -> Vector b -> Vector a
postscanl = (a -> b -> a) -> a -> Vector b -> Vector a
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> a) -> a -> v b -> v a
G.postscanl
postscanl' :: (Storable a, Storable b) => (a -> b -> a) -> a -> Vector b -> Vector a
{-# INLINE postscanl' #-}
postscanl' :: (a -> b -> a) -> a -> Vector b -> Vector a
postscanl' = (a -> b -> a) -> a -> Vector b -> Vector a
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> a) -> a -> v b -> v a
G.postscanl'
scanl :: (Storable a, Storable b) => (a -> b -> a) -> a -> Vector b -> Vector a
{-# INLINE scanl #-}
scanl :: (a -> b -> a) -> a -> Vector b -> Vector a
scanl = (a -> b -> a) -> a -> Vector b -> Vector a
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> a) -> a -> v b -> v a
G.scanl
scanl' :: (Storable a, Storable b) => (a -> b -> a) -> a -> Vector b -> Vector a
{-# INLINE scanl' #-}
scanl' :: (a -> b -> a) -> a -> Vector b -> Vector a
scanl' = (a -> b -> a) -> a -> Vector b -> Vector a
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> a) -> a -> v b -> v a
G.scanl'
scanl1 :: Storable a => (a -> a -> a) -> Vector a -> Vector a
{-# INLINE scanl1 #-}
scanl1 :: (a -> a -> a) -> Vector a -> Vector a
scanl1 = (a -> a -> a) -> Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => (a -> a -> a) -> v a -> v a
G.scanl1
scanl1' :: Storable a => (a -> a -> a) -> Vector a -> Vector a
{-# INLINE scanl1' #-}
scanl1' :: (a -> a -> a) -> Vector a -> Vector a
scanl1' = (a -> a -> a) -> Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => (a -> a -> a) -> v a -> v a
G.scanl1'
prescanr :: (Storable a, Storable b) => (a -> b -> b) -> b -> Vector a -> Vector b
{-# INLINE prescanr #-}
prescanr :: (a -> b -> b) -> b -> Vector a -> Vector b
prescanr = (a -> b -> b) -> b -> Vector a -> Vector b
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> b) -> b -> v a -> v b
G.prescanr
prescanr' :: (Storable a, Storable b) => (a -> b -> b) -> b -> Vector a -> Vector b
{-# INLINE prescanr' #-}
prescanr' :: (a -> b -> b) -> b -> Vector a -> Vector b
prescanr' = (a -> b -> b) -> b -> Vector a -> Vector b
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> b) -> b -> v a -> v b
G.prescanr'
postscanr :: (Storable a, Storable b) => (a -> b -> b) -> b -> Vector a -> Vector b
{-# INLINE postscanr #-}
postscanr :: (a -> b -> b) -> b -> Vector a -> Vector b
postscanr = (a -> b -> b) -> b -> Vector a -> Vector b
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> b) -> b -> v a -> v b
G.postscanr
postscanr' :: (Storable a, Storable b) => (a -> b -> b) -> b -> Vector a -> Vector b
{-# INLINE postscanr' #-}
postscanr' :: (a -> b -> b) -> b -> Vector a -> Vector b
postscanr' = (a -> b -> b) -> b -> Vector a -> Vector b
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> b) -> b -> v a -> v b
G.postscanr'
scanr :: (Storable a, Storable b) => (a -> b -> b) -> b -> Vector a -> Vector b
{-# INLINE scanr #-}
scanr :: (a -> b -> b) -> b -> Vector a -> Vector b
scanr = (a -> b -> b) -> b -> Vector a -> Vector b
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> b) -> b -> v a -> v b
G.scanr
scanr' :: (Storable a, Storable b) => (a -> b -> b) -> b -> Vector a -> Vector b
{-# INLINE scanr' #-}
scanr' :: (a -> b -> b) -> b -> Vector a -> Vector b
scanr' = (a -> b -> b) -> b -> Vector a -> Vector b
forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> b) -> b -> v a -> v b
G.scanr'
scanr1 :: Storable a => (a -> a -> a) -> Vector a -> Vector a
{-# INLINE scanr1 #-}
scanr1 :: (a -> a -> a) -> Vector a -> Vector a
scanr1 = (a -> a -> a) -> Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => (a -> a -> a) -> v a -> v a
G.scanr1
scanr1' :: Storable a => (a -> a -> a) -> Vector a -> Vector a
{-# INLINE scanr1' #-}
scanr1' :: (a -> a -> a) -> Vector a -> Vector a
scanr1' = (a -> a -> a) -> Vector a -> Vector a
forall (v :: * -> *) a. Vector v a => (a -> a -> a) -> v a -> v a
G.scanr1'
toList :: Storable a => Vector a -> [a]
{-# INLINE toList #-}
toList :: Vector a -> [a]
toList = Vector a -> [a]
forall (v :: * -> *) a. Vector v a => v a -> [a]
G.toList
fromList :: Storable a => [a] -> Vector a
{-# INLINE fromList #-}
fromList :: [a] -> Vector a
fromList = [a] -> Vector a
forall (v :: * -> *) a. Vector v a => [a] -> v a
G.fromList
fromListN :: Storable a => Int -> [a] -> Vector a
{-# INLINE fromListN #-}
fromListN :: Int -> [a] -> Vector a
fromListN = Int -> [a] -> Vector a
forall (v :: * -> *) a. Vector v a => Int -> [a] -> v a
G.fromListN
unsafeCast :: forall a b. (Storable a, Storable b) => Vector a -> Vector b
{-# INLINE unsafeCast #-}
unsafeCast :: Vector a -> Vector b
unsafeCast (Vector n :: Int
n fp :: ForeignPtr a
fp)
= Int -> ForeignPtr b -> Vector b
forall a. Int -> ForeignPtr a -> Vector a
Vector ((Int
n Int -> Int -> Int
forall a. Num a => a -> a -> a
* a -> Int
forall a. Storable a => a -> Int
sizeOf (a
forall a. HasCallStack => a
undefined :: a)) Int -> Int -> Int
forall a. Integral a => a -> a -> a
`div` b -> Int
forall a. Storable a => a -> Int
sizeOf (b
forall a. HasCallStack => a
undefined :: b))
(ForeignPtr a -> ForeignPtr b
forall a b. ForeignPtr a -> ForeignPtr b
castForeignPtr ForeignPtr a
fp)
unsafeFreeze
:: (Storable a, PrimMonad m) => MVector (PrimState m) a -> m (Vector a)
{-# INLINE unsafeFreeze #-}
unsafeFreeze :: MVector (PrimState m) a -> m (Vector a)
unsafeFreeze = MVector (PrimState m) a -> m (Vector a)
forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
Mutable v (PrimState m) a -> m (v a)
G.unsafeFreeze
unsafeThaw
:: (Storable a, PrimMonad m) => Vector a -> m (MVector (PrimState m) a)
{-# INLINE unsafeThaw #-}
unsafeThaw :: Vector a -> m (MVector (PrimState m) a)
unsafeThaw = Vector a -> m (MVector (PrimState m) a)
forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
v a -> m (Mutable v (PrimState m) a)
G.unsafeThaw
thaw :: (Storable a, PrimMonad m) => Vector a -> m (MVector (PrimState m) a)
{-# INLINE thaw #-}
thaw :: Vector a -> m (MVector (PrimState m) a)
thaw = Vector a -> m (MVector (PrimState m) a)
forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
v a -> m (Mutable v (PrimState m) a)
G.thaw
freeze :: (Storable a, PrimMonad m) => MVector (PrimState m) a -> m (Vector a)
{-# INLINE freeze #-}
freeze :: MVector (PrimState m) a -> m (Vector a)
freeze = MVector (PrimState m) a -> m (Vector a)
forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
Mutable v (PrimState m) a -> m (v a)
G.freeze
unsafeCopy
:: (Storable a, PrimMonad m) => MVector (PrimState m) a -> Vector a -> m ()
{-# INLINE unsafeCopy #-}
unsafeCopy :: MVector (PrimState m) a -> Vector a -> m ()
unsafeCopy = MVector (PrimState m) a -> Vector a -> m ()
forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
Mutable v (PrimState m) a -> v a -> m ()
G.unsafeCopy
copy :: (Storable a, PrimMonad m) => MVector (PrimState m) a -> Vector a -> m ()
{-# INLINE copy #-}
copy :: MVector (PrimState m) a -> Vector a -> m ()
copy = MVector (PrimState m) a -> Vector a -> m ()
forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
Mutable v (PrimState m) a -> v a -> m ()
G.copy
unsafeFromForeignPtr :: Storable a
=> ForeignPtr a
-> Int
-> Int
-> Vector a
{-# INLINE_FUSED unsafeFromForeignPtr #-}
unsafeFromForeignPtr :: ForeignPtr a -> Int -> Int -> Vector a
unsafeFromForeignPtr fp :: ForeignPtr a
fp i :: Int
i n :: Int
n = ForeignPtr a -> Int -> Vector a
forall a. Storable a => ForeignPtr a -> Int -> Vector a
unsafeFromForeignPtr0 ForeignPtr a
fp' Int
n
where
fp' :: ForeignPtr a
fp' = (Ptr a -> Ptr a) -> ForeignPtr a -> ForeignPtr a
forall a. (Ptr a -> Ptr a) -> ForeignPtr a -> ForeignPtr a
updPtr (Ptr a -> Int -> Ptr a
forall a. Storable a => Ptr a -> Int -> Ptr a
`advancePtr` Int
i) ForeignPtr a
fp
{-# RULES
"unsafeFromForeignPtr fp 0 n -> unsafeFromForeignPtr0 fp n " forall fp n.
unsafeFromForeignPtr fp 0 n = unsafeFromForeignPtr0 fp n #-}
unsafeFromForeignPtr0 :: Storable a
=> ForeignPtr a
-> Int
-> Vector a
{-# INLINE unsafeFromForeignPtr0 #-}
unsafeFromForeignPtr0 :: ForeignPtr a -> Int -> Vector a
unsafeFromForeignPtr0 fp :: ForeignPtr a
fp n :: Int
n = Int -> ForeignPtr a -> Vector a
forall a. Int -> ForeignPtr a -> Vector a
Vector Int
n ForeignPtr a
fp
unsafeToForeignPtr :: Storable a => Vector a -> (ForeignPtr a, Int, Int)
{-# INLINE unsafeToForeignPtr #-}
unsafeToForeignPtr :: Vector a -> (ForeignPtr a, Int, Int)
unsafeToForeignPtr (Vector n :: Int
n fp :: ForeignPtr a
fp) = (ForeignPtr a
fp, 0, Int
n)
unsafeToForeignPtr0 :: Storable a => Vector a -> (ForeignPtr a, Int)
{-# INLINE unsafeToForeignPtr0 #-}
unsafeToForeignPtr0 :: Vector a -> (ForeignPtr a, Int)
unsafeToForeignPtr0 (Vector n :: Int
n fp :: ForeignPtr a
fp) = (ForeignPtr a
fp, Int
n)
unsafeWith :: Storable a => Vector a -> (Ptr a -> IO b) -> IO b
{-# INLINE unsafeWith #-}
unsafeWith :: Vector a -> (Ptr a -> IO b) -> IO b
unsafeWith (Vector _ fp :: ForeignPtr a
fp) = ForeignPtr a -> (Ptr a -> IO b) -> IO b
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr a
fp