{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE CPP #-}
#if MIN_VERSION_base(4,12,0)
{-# LANGUAGE NoStarIsType #-}
#endif
module Data.Vector.Unboxed.Sized
( Vector
, pattern SomeSized
, VUM.MVector
, length
, length'
, knownLength
, knownLength'
, index
, index'
, unsafeIndex
, head
, last
, indexM
, indexM'
, unsafeIndexM
, headM
, lastM
, slice
, slice'
, init
, tail
, take
, take'
, drop
, drop'
, splitAt
, splitAt'
, empty
, singleton
, fromTuple
, replicate
, replicate'
, generate
, generate'
, iterateN
, iterateN'
, replicateM
, replicateM'
, generateM
, generateM'
, unfoldrN
, unfoldrN'
, enumFromN
, enumFromN'
, enumFromStepN
, enumFromStepN'
, cons
, snoc
, (++)
, force
, (//)
, update
, update_
, unsafeUpd
, unsafeUpdate
, unsafeUpdate_
, accum
, accumulate
, accumulate_
, unsafeAccum
, unsafeAccumulate
, unsafeAccumulate_
, reverse
, backpermute
, unsafeBackpermute
, ix
, _head
, _last
, indexed
, map
, imap
, concatMap
, mapM
, imapM
, mapM_
, imapM_
, forM
, forM_
, zipWith
, zipWith3
, zipWith4
, zipWith5
, zipWith6
, izipWith
, izipWith3
, izipWith4
, izipWith5
, izipWith6
, zip
, zip3
, zip4
, zip5
, zip6
, zipWithM
, izipWithM
, zipWithM_
, izipWithM_
, unzip
, unzip3
, unzip4
, unzip5
, unzip6
, elem
, notElem
, find
, findIndex
, elemIndex
, foldl
, foldl1
, foldl'
, foldl1'
, foldr
, foldr1
, foldr'
, foldr1'
, ifoldl
, ifoldl'
, ifoldr
, ifoldr'
, all
, any
, and
, or
, sum
, product
, maximum
, maximumBy
, minimum
, minimumBy
, maxIndex
, maxIndexBy
, minIndex
, minIndexBy
, foldM
, ifoldM
, fold1M
, foldM'
, ifoldM'
, fold1M'
, foldM_
, ifoldM_
, fold1M_
, foldM'_
, ifoldM'_
, fold1M'_
, sequence
, sequence_
, prescanl
, prescanl'
, postscanl
, postscanl'
, scanl
, scanl'
, scanl1
, scanl1'
, prescanr
, prescanr'
, postscanr
, postscanr'
, scanr
, scanr'
, scanr1
, scanr1'
, toList
, fromList
, fromListN
, fromListN'
, withSizedList
, freeze
, thaw
, copy
, unsafeFreeze
, unsafeThaw
, toSized
, withSized
, fromSized
, withVectorUnsafe
, Unbox
) where
import qualified Data.Vector.Generic.Sized as V
import qualified Data.Vector.Unboxed as VU
import Data.IndexedListLiterals (IndexedListLiterals)
import qualified Data.Vector.Unboxed.Mutable.Sized as VUM
import GHC.TypeLits
import Data.Finite
import Data.Proxy
import Control.Monad.Primitive
import Data.Vector.Unboxed (Unbox)
import Prelude hiding ( length, null,
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,
all, any, and, or, sum, product, maximum, minimum,
scanl, scanl1, scanr, scanr1,
enumFromTo, enumFromThenTo,
mapM, mapM_, sequence, sequence_,
showsPrec )
type Vector = V.Vector VU.Vector
length :: forall n a. KnownNat n
=> Vector n a -> Int
length = V.length
{-# inline length #-}
length' :: forall n a.
Vector n a -> Proxy n
length' = V.length'
{-# inline length' #-}
knownLength :: forall n a r. Unbox a
=> Vector n a
-> (KnownNat n => r)
-> r
knownLength = V.knownLength
knownLength' :: forall n a r. Unbox a
=> Vector n a
-> (KnownNat n => Proxy n -> r)
-> r
knownLength' = V.knownLength'
index :: forall n a. Unbox a
=> Vector n a -> Finite n -> a
index = V.index
{-# inline index #-}
index' :: forall n m a p. (KnownNat n, Unbox a)
=> Vector (n+m+1) a -> p n -> a
index' = V.index'
{-# inline index' #-}
unsafeIndex :: forall n a. Unbox a
=> Vector n a -> Int -> a
unsafeIndex = V.unsafeIndex
{-# inline unsafeIndex #-}
head :: forall n a. (Unbox a)
=> Vector (1+n) a -> a
head = V.head
{-# inline head #-}
last :: forall n a. (Unbox a)
=> Vector (n+1) a -> a
last = V.last
{-# inline last #-}
ix :: forall n a f. (Unbox a, Functor f)
=> Finite n -> (a -> f a) -> Vector n a -> f (Vector n a)
ix = V.ix
{-# inline ix #-}
_head :: forall n a f. (Unbox a, Functor f)
=> (a -> f a) -> Vector (1+n) a -> f (Vector (1+n) a)
_head = V._head
{-# inline _head #-}
_last :: forall n a f. (Unbox a, Functor f)
=> (a -> f a) -> Vector (n+1) a -> f (Vector (n+1) a)
_last = V._last
{-# inline _last #-}
indexM :: forall n a m. (Unbox a, Monad m)
=> Vector n a -> Finite n -> m a
indexM = V.indexM
{-# inline indexM #-}
indexM' :: forall n k a m p. (KnownNat n, Unbox a, Monad m)
=> Vector (n+k) a -> p n -> m a
indexM' = V.indexM'
{-# inline indexM' #-}
unsafeIndexM :: forall n a m. (Unbox a, Monad m)
=> Vector n a -> Int -> m a
unsafeIndexM = V.unsafeIndexM
{-# inline unsafeIndexM #-}
headM :: forall n a m. (Unbox a, Monad m)
=> Vector (1+n) a -> m a
headM = V.headM
{-# inline headM #-}
lastM :: forall n a m. (Unbox a, Monad m)
=> Vector (n+1) a -> m a
lastM = V.lastM
{-# inline lastM #-}
slice :: forall i n m a p. (KnownNat i, KnownNat n, Unbox a)
=> p i
-> Vector (i+n+m) a
-> Vector n a
slice = V.slice
{-# inline slice #-}
slice' :: forall i n m a p. (KnownNat i, KnownNat n, Unbox a)
=> p i
-> p n
-> Vector (i+n+m) a
-> Vector n a
slice' = V.slice'
{-# inline slice' #-}
init :: forall n a. (Unbox a)
=> Vector (n+1) a -> Vector n a
init = V.init
{-# inline init #-}
tail :: forall n a. (Unbox a)
=> Vector (1+n) a -> Vector n a
tail = V.tail
{-# inline tail #-}
take :: forall n m a. (KnownNat n, Unbox a)
=> Vector (n+m) a -> Vector n a
take = V.take
{-# inline take #-}
take' :: forall n m a p. (KnownNat n, Unbox a)
=> p n -> Vector (n+m) a -> Vector n a
take' = V.take'
{-# inline take' #-}
drop :: forall n m a. (KnownNat n, Unbox a)
=> Vector (n+m) a -> Vector m a
drop = V.drop
{-# inline drop #-}
drop' :: forall n m a p. (KnownNat n, Unbox a)
=> p n -> Vector (n+m) a -> Vector m a
drop' = V.drop'
{-# inline drop' #-}
splitAt :: forall n m a. (KnownNat n, Unbox a)
=> Vector (n+m) a -> (Vector n a, Vector m a)
splitAt = V.splitAt
{-# inline splitAt #-}
splitAt' :: forall n m a p. (KnownNat n, Unbox a)
=> p n -> Vector (n+m) a -> (Vector n a, Vector m a)
splitAt' = V.splitAt'
{-# inline splitAt' #-}
empty :: forall a. (Unbox a)
=> Vector 0 a
empty = V.empty
{-# inline empty #-}
singleton :: forall a. (Unbox a)
=> a -> Vector 1 a
singleton = V.singleton
{-# inline singleton #-}
fromTuple :: forall a input length.
(Unbox a, IndexedListLiterals input length a, KnownNat length)
=> input -> Vector length a
fromTuple = V.fromTuple
{-# inline fromTuple #-}
replicate :: forall n a. (KnownNat n, Unbox a)
=> a -> Vector n a
replicate = V.replicate
{-# inline replicate #-}
replicate' :: forall n a p. (KnownNat n, Unbox a)
=> p n -> a -> Vector n a
replicate' = V.replicate'
{-# inline replicate' #-}
generate :: forall n a. (KnownNat n, Unbox a)
=> (Finite n -> a) -> Vector n a
generate = V.generate
{-# inline generate #-}
generate' :: forall n a p. (KnownNat n, Unbox a)
=> p n -> (Finite n -> a) -> Vector n a
generate' = V.generate'
{-# inline generate' #-}
iterateN :: forall n a. (KnownNat n, Unbox a)
=> (a -> a) -> a -> Vector n a
iterateN = V.iterateN
{-# inline iterateN #-}
iterateN' :: forall n a p. (KnownNat n, Unbox a)
=> p n -> (a -> a) -> a -> Vector n a
iterateN' = V.iterateN'
{-# inline iterateN' #-}
replicateM :: forall n m a. (KnownNat n, Unbox a, Monad m)
=> m a -> m (Vector n a)
replicateM = V.replicateM
{-# inline replicateM #-}
replicateM' :: forall n m a p. (KnownNat n, Unbox a, Monad m)
=> p n -> m a -> m (Vector n a)
replicateM' = V.replicateM'
{-# inline replicateM' #-}
generateM :: forall n m a. (KnownNat n, Unbox a, Monad m)
=> (Finite n -> m a) -> m (Vector n a)
generateM = V.generateM
{-# inline generateM #-}
generateM' :: forall n m a p. (KnownNat n, Unbox a, Monad m)
=> p n -> (Finite n -> m a) -> m (Vector n a)
generateM' = V.generateM'
{-# inline generateM' #-}
unfoldrN :: forall n a b. (KnownNat n, Unbox a)
=> (b -> (a, b)) -> b -> Vector n a
unfoldrN = V.unfoldrN
{-# inline unfoldrN #-}
unfoldrN' :: forall n a b p. (KnownNat n, Unbox a)
=> p n -> (b -> (a, b)) -> b -> Vector n a
unfoldrN' = V.unfoldrN'
{-# inline unfoldrN' #-}
enumFromN :: forall n a. (KnownNat n, Unbox a, Num a)
=> a -> Vector n a
enumFromN = V.enumFromN
{-# inline enumFromN #-}
enumFromN' :: forall n a p. (KnownNat n, Unbox a, Num a)
=> a -> p n -> Vector n a
enumFromN' = V.enumFromN'
{-# inline enumFromN' #-}
enumFromStepN :: forall n a. (KnownNat n, Unbox a, Num a)
=> a -> a -> Vector n a
enumFromStepN = V.enumFromStepN
{-# inline enumFromStepN #-}
enumFromStepN' :: forall n a p. (KnownNat n, Unbox a, Num a)
=> a -> a -> p n -> Vector n a
enumFromStepN' = V.enumFromStepN'
{-# inline enumFromStepN' #-}
cons :: forall n a. Unbox a
=> a -> Vector n a -> Vector (1+n) a
cons = V.cons
{-# inline cons #-}
snoc :: forall n a. Unbox a
=> Vector n a -> a -> Vector (n+1) a
snoc = V.snoc
{-# inline snoc #-}
(++) :: forall n m a. Unbox a
=> Vector n a -> Vector m a -> Vector (n+m) a
(++) = (V.++)
{-# inline (++) #-}
force :: Unbox a => Vector n a -> Vector n a
force = V.force
{-# inline force #-}
(//) :: (Unbox a)
=> Vector m a
-> [(Finite m, a)]
-> Vector m a
(//) = (V.//)
{-# inline (//) #-}
update :: (Unbox a)
=> Vector m a
-> Vector n (Int, a)
-> Vector m a
update = V.update
{-# inline update #-}
update_ :: Unbox a
=> Vector m a
-> Vector n Int
-> Vector n a
-> Vector m a
update_ = V.update_
{-# inline update_ #-}
unsafeUpd :: (Unbox a)
=> Vector m a
-> [(Int, a)]
-> Vector m a
unsafeUpd = V.unsafeUpd
{-# inline unsafeUpd #-}
unsafeUpdate :: (Unbox a)
=> Vector m a
-> Vector n (Int, a)
-> Vector m a
unsafeUpdate = V.unsafeUpdate
{-# inline unsafeUpdate #-}
unsafeUpdate_ :: Unbox a
=> Vector m a
-> Vector n Int
-> Vector n a
-> Vector m a
unsafeUpdate_ = V.unsafeUpdate_
{-# inline unsafeUpdate_ #-}
accum :: Unbox a
=> (a -> b -> a)
-> Vector m a
-> [(Int,b)]
-> Vector m a
accum = V.accum
{-# inline accum #-}
accumulate :: (Unbox a, Unbox b)
=> (a -> b -> a)
-> Vector m a
-> Vector n (Int,b)
-> Vector m a
accumulate = V.accumulate
{-# inline accumulate #-}
accumulate_ :: (Unbox a, Unbox b)
=> (a -> b -> a)
-> Vector m a
-> Vector n Int
-> Vector n b
-> Vector m a
accumulate_ = V.accumulate_
{-# inline accumulate_ #-}
unsafeAccum :: Unbox a
=> (a -> b -> a)
-> Vector m a
-> [(Int,b)]
-> Vector m a
unsafeAccum = V.unsafeAccum
{-# inline unsafeAccum #-}
unsafeAccumulate :: (Unbox a, Unbox b)
=> (a -> b -> a)
-> Vector m a
-> Vector n (Int,b)
-> Vector m a
unsafeAccumulate = V.unsafeAccumulate
{-# inline unsafeAccumulate #-}
unsafeAccumulate_ :: (Unbox a, Unbox b)
=> (a -> b -> a)
-> Vector m a
-> Vector n Int
-> Vector n b
-> Vector m a
unsafeAccumulate_ = V.unsafeAccumulate_
{-# inline unsafeAccumulate_ #-}
reverse :: (Unbox a) => Vector n a -> Vector n a
reverse = V.reverse
{-# inline reverse #-}
backpermute :: Unbox a
=> Vector m a
-> Vector n Int
-> Vector n a
backpermute = V.backpermute
{-# inline backpermute #-}
unsafeBackpermute :: Unbox a
=> Vector m a
-> Vector n Int
-> Vector n a
unsafeBackpermute = V.unsafeBackpermute
{-# inline unsafeBackpermute #-}
indexed :: (Unbox a, Unbox (Finite n))
=> Vector n a -> Vector n (Finite n,a)
indexed = V.indexed
{-# inline indexed #-}
map :: (Unbox a, Unbox b)
=> (a -> b) -> Vector n a -> Vector n b
map = V.map
{-# inline map #-}
imap :: (Unbox a, Unbox b)
=> (Finite n -> a -> b) -> Vector n a -> Vector n b
imap = V.imap
{-# inline imap #-}
concatMap :: (Unbox a, Unbox b)
=> (a -> Vector m b) -> Vector n a -> Vector (n * m) b
concatMap = V.concatMap
{-# inline concatMap #-}
mapM :: (Monad m, Unbox a, Unbox b)
=> (a -> m b) -> Vector n a -> m (Vector n b)
mapM = V.mapM
{-# inline mapM #-}
imapM :: (Monad m, Unbox a, Unbox b)
=> (Finite n -> a -> m b) -> Vector n a -> m (Vector n b)
imapM = V.imapM
{-# inline imapM #-}
mapM_ :: (Monad m, Unbox a) => (a -> m b) -> Vector n a -> m ()
mapM_ = V.mapM_
{-# inline mapM_ #-}
imapM_ :: (Monad m, Unbox a) => (Finite n -> a -> m b) -> Vector n a -> m ()
imapM_ = V.imapM_
{-# inline imapM_ #-}
forM :: (Monad m, Unbox a, Unbox b)
=> Vector n a -> (a -> m b) -> m (Vector n b)
forM = V.forM
{-# inline forM #-}
forM_ :: (Monad m, Unbox a) => Vector n a -> (a -> m b) -> m ()
forM_ = V.forM_
{-# inline forM_ #-}
zipWith :: (Unbox a, Unbox b, Unbox c)
=> (a -> b -> c) -> Vector n a -> Vector n b -> Vector n c
zipWith = V.zipWith
{-# inline zipWith #-}
zipWith3 :: (Unbox a, Unbox b, Unbox c, Unbox d)
=> (a -> b -> c -> d) -> Vector n a -> Vector n b -> Vector n c -> Vector n d
zipWith3 = V.zipWith3
{-# inline zipWith3 #-}
zipWith4 :: (Unbox a,Unbox b,Unbox c,Unbox d,Unbox e)
=> (a -> b -> c -> d -> e)
-> Vector n a
-> Vector n b
-> Vector n c
-> Vector n d
-> Vector n e
zipWith4 = V.zipWith4
{-# inline zipWith4 #-}
zipWith5 :: (Unbox a,Unbox b,Unbox c,Unbox d,Unbox e,Unbox f)
=> (a -> b -> c -> d -> e -> f)
-> Vector n a
-> Vector n b
-> Vector n c
-> Vector n d
-> Vector n e
-> Vector n f
zipWith5 = V.zipWith5
{-# inline zipWith5 #-}
zipWith6 :: (Unbox a,Unbox b,Unbox c,Unbox d,Unbox e,Unbox f,Unbox g)
=> (a -> b -> c -> d -> e -> f -> g)
-> Vector n a
-> Vector n b
-> Vector n c
-> Vector n d
-> Vector n e
-> Vector n f
-> Vector n g
zipWith6 = V.zipWith6
{-# inline zipWith6 #-}
izipWith :: (Unbox a,Unbox b,Unbox c)
=> (Finite n -> a -> b -> c)
-> Vector n a
-> Vector n b
-> Vector n c
izipWith = V.izipWith
{-# inline izipWith #-}
izipWith3 :: (Unbox a,Unbox b,Unbox c,Unbox d)
=> (Finite n -> a -> b -> c -> d)
-> Vector n a
-> Vector n b
-> Vector n c
-> Vector n d
izipWith3 = V.izipWith3
{-# inline izipWith3 #-}
izipWith4 :: (Unbox a,Unbox b,Unbox c,Unbox d,Unbox e)
=> (Finite n -> a -> b -> c -> d -> e)
-> Vector n a
-> Vector n b
-> Vector n c
-> Vector n d
-> Vector n e
izipWith4 = V.izipWith4
{-# inline izipWith4 #-}
izipWith5 :: (Unbox a,Unbox b,Unbox c,Unbox d,Unbox e,Unbox f)
=> (Finite n -> a -> b -> c -> d -> e -> f)
-> Vector n a
-> Vector n b
-> Vector n c
-> Vector n d
-> Vector n e
-> Vector n f
izipWith5 = V.izipWith5
{-# inline izipWith5 #-}
izipWith6 :: (Unbox a,Unbox b,Unbox c,Unbox d,Unbox e,Unbox f,Unbox g)
=> (Finite n -> a -> b -> c -> d -> e -> f -> g)
-> Vector n a
-> Vector n b
-> Vector n c
-> Vector n d
-> Vector n e
-> Vector n f
-> Vector n g
izipWith6 = V.izipWith6
{-# inline izipWith6 #-}
zip :: (Unbox a, Unbox b)
=> Vector n a -> Vector n b -> Vector n (a, b)
zip = V.zip
{-# inline zip #-}
zip3 :: (Unbox a, Unbox b, Unbox c)
=> Vector n a -> Vector n b -> Vector n c -> Vector n (a, b, c)
zip3 = V.zip3
{-# inline zip3 #-}
zip4 :: (Unbox a,Unbox b,Unbox c,Unbox d)
=> Vector n a
-> Vector n b
-> Vector n c
-> Vector n d
-> Vector n (a,b,c,d)
zip4 = V.zip4
{-# inline zip4 #-}
zip5 :: (Unbox a,Unbox b,Unbox c,Unbox d,Unbox e)
=> Vector n a
-> Vector n b
-> Vector n c
-> Vector n d
-> Vector n e
-> Vector n (a,b,c,d,e)
zip5 = V.zip5
{-# inline zip5 #-}
zip6 :: (Unbox a,Unbox b,Unbox c,Unbox d,Unbox e,Unbox f)
=> Vector n a
-> Vector n b
-> Vector n c
-> Vector n d
-> Vector n e
-> Vector n f
-> Vector n (a,b,c,d,e,f)
zip6 = V.zip6
{-# inline zip6 #-}
zipWithM :: (Monad m, Unbox a, Unbox b, Unbox c)
=> (a -> b -> m c) -> Vector n a -> Vector n b -> m (Vector n c)
zipWithM = V.zipWithM
{-# inline zipWithM #-}
izipWithM :: (Monad m, Unbox a, Unbox b, Unbox c)
=> (Finite n -> a -> b -> m c) -> Vector n a -> Vector n b -> m (Vector n c)
izipWithM = V.izipWithM
{-# inline izipWithM #-}
zipWithM_ :: (Monad m, Unbox a, Unbox b)
=> (a -> b -> m c) -> Vector n a -> Vector n b -> m ()
zipWithM_ = V.zipWithM_
{-# inline zipWithM_ #-}
izipWithM_ :: (Monad m, Unbox a, Unbox b)
=> (Finite n -> a -> b -> m c) -> Vector n a -> Vector n b -> m ()
izipWithM_ = V.izipWithM_
{-# inline izipWithM_ #-}
unzip :: (Unbox a, Unbox b)
=> Vector n (a, b) -> (Vector n a, Vector n b)
unzip = V.unzip
{-# inline unzip #-}
unzip3 :: (Unbox a, Unbox b, Unbox c)
=> Vector n (a, b, c) -> (Vector n a, Vector n b, Vector n c)
unzip3 = V.unzip3
{-# inline unzip3 #-}
unzip4 :: (Unbox a, Unbox b, Unbox c, Unbox d)
=> Vector n (a, b, c, d) -> (Vector n a, Vector n b, Vector n c, Vector n d)
unzip4 = V.unzip4
{-# inline unzip4 #-}
unzip5 :: (Unbox a, Unbox b, Unbox c, Unbox d, Unbox e)
=> Vector n (a, b, c, d, e) -> (Vector n a, Vector n b, Vector n c, Vector n d, Vector n e)
unzip5 = V.unzip5
{-# inline unzip5 #-}
unzip6 :: (Unbox a, Unbox b, Unbox c, Unbox d, Unbox e, Unbox f)
=> Vector n (a, b, c, d, e, f) -> (Vector n a, Vector n b, Vector n c, Vector n d, Vector n e, Vector n f)
unzip6 = V.unzip6
{-# inline unzip6 #-}
infix 4 `elem`
elem :: (Unbox a, Eq a) => a -> Vector n a -> Bool
elem = V.elem
{-# inline elem #-}
infix 4 `notElem`
notElem :: (Unbox a, Eq a) => a -> Vector n a -> Bool
notElem = V.notElem
{-# inline notElem #-}
find :: Unbox a => (a -> Bool) -> Vector n a -> Maybe a
find = V.find
{-# inline find #-}
findIndex :: Unbox a => (a -> Bool) -> Vector n a -> Maybe (Finite n)
findIndex = V.findIndex
{-# inline findIndex #-}
elemIndex :: (Unbox a, Eq a) => a -> Vector n a -> Maybe (Finite n)
elemIndex = V.elemIndex
{-# inline elemIndex #-}
foldl :: Unbox b => (a -> b -> a) -> a -> Vector n b -> a
foldl = V.foldl
{-# inline foldl #-}
foldl1 :: Unbox a => (a -> a -> a) -> Vector (1+n) a -> a
foldl1 = V.foldl1
{-# inline foldl1 #-}
foldl' :: Unbox b => (a -> b -> a) -> a -> Vector n b -> a
foldl' = V.foldl'
{-# inline foldl' #-}
foldl1' :: Unbox a => (a -> a -> a) -> Vector (1+n) a -> a
foldl1' = V.foldl1'
{-# inline foldl1' #-}
foldr :: Unbox a => (a -> b -> b) -> b -> Vector n a -> b
foldr = V.foldr
{-# inline foldr #-}
foldr1 :: Unbox a => (a -> a -> a) -> Vector (n+1) a -> a
foldr1 = V.foldr1
{-# inline foldr1 #-}
foldr' :: Unbox a => (a -> b -> b) -> b -> Vector n a -> b
foldr' = V.foldr'
{-# inline foldr' #-}
foldr1' :: Unbox a => (a -> a -> a) -> Vector (n+1) a -> a
foldr1' = V.foldr1'
{-# inline foldr1' #-}
ifoldl :: Unbox b => (a -> Finite n -> b -> a) -> a -> Vector n b -> a
ifoldl = V.ifoldl
{-# inline ifoldl #-}
ifoldl' :: Unbox b => (a -> Finite n -> b -> a) -> a -> Vector n b -> a
ifoldl' = V.ifoldl'
{-# inline ifoldl' #-}
ifoldr :: Unbox a => (Finite n -> a -> b -> b) -> b -> Vector n a -> b
ifoldr = V.ifoldr
{-# inline ifoldr #-}
ifoldr' :: Unbox a => (Finite n -> a -> b -> b) -> b -> Vector n a -> b
ifoldr' = V.ifoldr'
{-# inline ifoldr' #-}
all :: Unbox a => (a -> Bool) -> Vector n a -> Bool
all = V.all
{-# inline all #-}
any :: Unbox a => (a -> Bool) -> Vector n a -> Bool
any = V.any
{-# inline any #-}
and :: Vector n Bool -> Bool
and = V.and
{-# inline and #-}
or :: Vector n Bool -> Bool
or = V.or
{-# inline or #-}
sum :: (Unbox a, Num a) => Vector n a -> a
sum = V.sum
{-# inline sum #-}
product :: (Unbox a, Num a) => Vector n a -> a
product = V.product
{-# inline product #-}
maximum :: (Unbox a, Ord a) => Vector (n+1) a -> a
maximum = V.maximum
{-# inline maximum #-}
maximumBy :: Unbox a
=> (a -> a -> Ordering) -> Vector (n+1) a -> a
maximumBy = V.maximumBy
{-# inline maximumBy #-}
minimum :: (Unbox a, Ord a) => Vector (n+1) a -> a
minimum = V.minimum
{-# inline minimum #-}
minimumBy :: Unbox a
=> (a -> a -> Ordering) -> Vector (n+1) a -> a
minimumBy = V.minimumBy
{-# inline minimumBy #-}
maxIndex :: (Unbox a, Ord a) => Vector (n+1) a -> Finite (n + 1)
maxIndex = V.maxIndex
{-# inline maxIndex #-}
maxIndexBy :: Unbox a
=> (a -> a -> Ordering) -> Vector (n+1) a -> Finite (n + 1)
maxIndexBy = V.maxIndexBy
{-# inline maxIndexBy #-}
minIndex :: (Unbox a, Ord a) => Vector (n+1) a -> Finite (n + 1)
minIndex = V.minIndex
{-# inline minIndex #-}
minIndexBy :: Unbox a
=> (a -> a -> Ordering) -> Vector (n+1) a -> Finite (n + 1)
minIndexBy = V.minIndexBy
{-# inline minIndexBy #-}
foldM :: (Monad m, Unbox b) => (a -> b -> m a) -> a -> Vector n b -> m a
foldM = V.foldM
{-# inline foldM #-}
ifoldM :: (Monad m, Unbox b) => (a -> Finite n -> b -> m a) -> a -> Vector n b -> m a
ifoldM = V.ifoldM
{-# inline ifoldM #-}
fold1M :: (Monad m, Unbox a)
=> (a -> a -> m a) -> Vector (1+n) a -> m a
fold1M = V.fold1M
{-# inline fold1M #-}
foldM' :: (Monad m, Unbox b) => (a -> b -> m a) -> a -> Vector n b -> m a
foldM' = V.foldM'
{-# inline foldM' #-}
ifoldM' :: (Monad m, Unbox b)
=> (a -> Finite n -> b -> m a) -> a -> Vector n b -> m a
ifoldM' = V.ifoldM'
{-# inline ifoldM' #-}
fold1M' :: (Monad m, Unbox a)
=> (a -> a -> m a) -> Vector (n+1) a -> m a
fold1M' = V.fold1M'
{-# inline fold1M' #-}
foldM_ :: (Monad m, Unbox b)
=> (a -> b -> m a) -> a -> Vector n b -> m ()
foldM_ = V.foldM_
{-# inline foldM_ #-}
ifoldM_ :: (Monad m, Unbox b)
=> (a -> Finite n -> b -> m a) -> a -> Vector n b -> m ()
ifoldM_ = V.ifoldM_
{-# inline ifoldM_ #-}
fold1M_ :: (Monad m, Unbox a)
=> (a -> a -> m a) -> Vector (n+1) a -> m ()
fold1M_ = V.fold1M_
{-# inline fold1M_ #-}
foldM'_ :: (Monad m, Unbox b)
=> (a -> b -> m a) -> a -> Vector n b -> m ()
foldM'_ = V.foldM'_
{-# inline foldM'_ #-}
ifoldM'_ :: (Monad m, Unbox b)
=> (a -> Finite n -> b -> m a) -> a -> Vector n b -> m ()
ifoldM'_ = V.ifoldM'_
{-# inline ifoldM'_ #-}
fold1M'_ :: (Monad m, Unbox a)
=> (a -> a -> m a) -> Vector (n+1) a -> m ()
fold1M'_ = V.fold1M'_
{-# inline fold1M'_ #-}
sequence :: (Monad m, Unbox a, Unbox (m a))
=> Vector n (m a) -> m (Vector n a)
sequence = V.sequence
{-# inline sequence #-}
sequence_ :: (Monad m, Unbox (m a)) => Vector n (m a) -> m ()
sequence_ = V.sequence_
{-# inline sequence_ #-}
prescanl :: (Unbox a, Unbox b) => (a -> b -> a) -> a -> Vector n b -> Vector n a
prescanl = V.prescanl
{-# inline prescanl #-}
prescanl' :: (Unbox a, Unbox b) => (a -> b -> a) -> a -> Vector n b -> Vector n a
prescanl' = V.prescanl'
{-# inline prescanl' #-}
postscanl :: (Unbox a, Unbox b) => (a -> b -> a) -> a -> Vector n b -> Vector n a
postscanl = V.postscanl
{-# inline postscanl #-}
postscanl' :: (Unbox a, Unbox b) => (a -> b -> a) -> a -> Vector n b -> Vector n a
postscanl' = V.postscanl'
{-# inline postscanl' #-}
scanl :: (Unbox a, Unbox b) => (a -> b -> a) -> a -> Vector n b -> Vector n a
scanl = V.scanl
{-# inline scanl #-}
scanl' :: (Unbox a, Unbox b) => (a -> b -> a) -> a -> Vector n b -> Vector n a
scanl' = V.scanl'
{-# inline scanl' #-}
scanl1 :: Unbox a => (a -> a -> a) -> Vector (n+1) a -> Vector (n+1) a
scanl1 = V.scanl1
{-# inline scanl1 #-}
scanl1' :: Unbox a => (a -> a -> a) -> Vector (n+1) a -> Vector (n+1) a
scanl1' = V.scanl1'
{-# inline scanl1' #-}
prescanr :: (Unbox a, Unbox b) => (a -> b -> b) -> b -> Vector n a -> Vector n b
prescanr = V.prescanr
{-# inline prescanr #-}
prescanr' :: (Unbox a, Unbox b) => (a -> b -> b) -> b -> Vector n a -> Vector n b
prescanr' = V.prescanr'
{-# inline prescanr' #-}
postscanr :: (Unbox a, Unbox b) => (a -> b -> b) -> b -> Vector n a -> Vector n b
postscanr = V.postscanr
{-# inline postscanr #-}
postscanr' :: (Unbox a, Unbox b) => (a -> b -> b) -> b -> Vector n a -> Vector n b
postscanr' = V.postscanr'
{-# inline postscanr' #-}
scanr :: (Unbox a, Unbox b) => (a -> b -> b) -> b -> Vector n a -> Vector n b
scanr = V.scanr
{-# inline scanr #-}
scanr' :: (Unbox a, Unbox b) => (a -> b -> b) -> b -> Vector n a -> Vector n b
scanr' = V.scanr'
{-# inline scanr' #-}
scanr1 :: Unbox a => (a -> a -> a) -> Vector (n+1) a -> Vector (n+1) a
scanr1 = V.scanr1
{-# inline scanr1 #-}
scanr1' :: Unbox a => (a -> a -> a) -> Vector (n+1) a -> Vector (n+1) a
scanr1' = V.scanr1'
{-# inline scanr1' #-}
toList :: Unbox a => Vector n a -> [a]
toList = V.toList
{-# inline toList #-}
fromList :: (Unbox a, KnownNat n) => [a] -> Maybe (Vector n a)
fromList = V.fromList
{-# inline fromList #-}
fromListN :: forall n a. (Unbox a, KnownNat n)
=> [a] -> Maybe (Vector n a)
fromListN = V.fromListN
{-# inline fromListN #-}
fromListN' :: forall n a p. (Unbox a, KnownNat n)
=> p n -> [a] -> Maybe (Vector n a)
fromListN' = V.fromListN'
{-# inline fromListN' #-}
withSizedList :: forall a r. Unbox a
=> [a] -> (forall n. KnownNat n => Vector n a -> r) -> r
withSizedList xs = withSized (VU.fromList xs)
{-# inline withSizedList #-}
freeze :: (PrimMonad m, Unbox a)
=> VUM.MVector n (PrimState m) a
-> m (Vector n a)
freeze = V.freeze
unsafeFreeze :: (PrimMonad m, Unbox a)
=> VUM.MVector n (PrimState m) a
-> m (Vector n a)
unsafeFreeze = V.unsafeFreeze
thaw :: (PrimMonad m, Unbox a)
=> Vector n a
-> m (VUM.MVector n (PrimState m) a)
thaw = V.thaw
unsafeThaw :: (PrimMonad m, Unbox a)
=> Vector n a
-> m (VUM.MVector n (PrimState m) a)
unsafeThaw = V.unsafeThaw
copy :: (PrimMonad m, Unbox a)
=> VUM.MVector n (PrimState m) a
-> Vector n a
-> m ()
copy = V.copy
toSized :: forall n a. (Unbox a, KnownNat n)
=> VU.Vector a -> Maybe (Vector n a)
toSized = V.toSized
{-# inline toSized #-}
withSized :: forall a r. Unbox a
=> VU.Vector a -> (forall n. KnownNat n => Vector n a -> r) -> r
withSized = V.withSized
{-# inline withSized #-}
fromSized :: Vector n a -> VU.Vector a
fromSized = V.fromSized
{-# inline fromSized #-}
withVectorUnsafe :: forall a b (n :: Nat). ()
=> (VU.Vector a -> VU.Vector b) -> Vector n a -> Vector n b
withVectorUnsafe = V.withVectorUnsafe
{-# inline withVectorUnsafe #-}
pattern SomeSized :: Unbox a => KnownNat n => Vector n a -> VU.Vector a
pattern SomeSized v = V.SomeSized v
{-# complete SomeSized #-}