{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ViewPatterns #-}
module Data.Vector.SEXP
( Vector(..)
, Mutable.MVector(..)
, ElemRep
, VECTOR
, SVECTOR
, Data.Vector.SEXP.fromSEXP
, unsafeFromSEXP
, Data.Vector.SEXP.toSEXP
, unsafeToSEXP
, length
, null
, (!)
, (!?)
, head
, last
, unsafeIndex
, unsafeHead
, unsafeLast
, indexM
, headM
, lastM
, unsafeIndexM
, unsafeHeadM
, unsafeLastM
, slice
, init
, take
, drop
, tail
, splitAt
, unsafeTail
, unsafeSlice
, unsafeDrop
, unsafeTake
, unsafeInit
, empty
, singleton
, replicate
, generate
, iterateN
, replicateM
, generateM
, create
, unfoldr
, unfoldrN
, constructN
, constructrN
, enumFromN
, enumFromStepN
, enumFromTo
, enumFromThenTo
, cons
, snoc
, (++)
, concat
, force
, (//)
, unsafeUpd
, accum
, unsafeAccum
, reverse
, map
, imap
, concatMap
, mapM
, mapM_
, forM
, forM_
, zipWith
, zipWith3
, zipWith4
, zipWith5
, zipWith6
, izipWith
, izipWith3
, izipWith4
, izipWith5
, izipWith6
, zipWithM
, zipWithM_
, filter
, ifilter
, filterM
, takeWhile
, dropWhile
, partition
, unstablePartition
, span
, break
, elem
, notElem
, find
, findIndex
, elemIndex
, foldl
, foldl1
, foldl'
, foldl1'
, foldr
, foldr1
, foldr'
, foldr1'
, ifoldl
, ifoldl'
, ifoldr
, ifoldr'
, all
, any
, 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
, freeze
, thaw
, copy
, unsafeFreeze
, unsafeThaw
, unsafeCopy
, toString
, toByteString
, unsafeWithByteString
) where
import Control.Exception (evaluate)
import Control.Monad.R.Class
import Control.Monad.R.Internal
import Control.Memory.Region
import Data.Vector.SEXP.Base
import Data.Vector.SEXP.Mutable (MVector)
import qualified Data.Vector.SEXP.Mutable as Mutable
import qualified Data.Vector.SEXP.Mutable.Internal as Mutable
import Foreign.R ( SEXP(..), SEXP0(..) )
import qualified Foreign.R as R
import Foreign.R.Type ( SEXPTYPE(Char) )
import Control.Monad.ST (ST, runST)
import Data.Int
import Data.Proxy (Proxy(..))
import Data.Reflection (Reifies(..), reify)
import qualified Data.Vector.Generic as G
import Data.Vector.Generic.New (run)
import Data.ByteString ( ByteString )
import qualified Data.ByteString as B
import qualified Data.ByteString.Unsafe as B
import Control.Applicative hiding (empty)
import Control.Exception (mask_)
#if MIN_VERSION_vector(0,11,0)
import qualified Data.Vector.Fusion.Bundle.Monadic as Bundle
import Data.Vector.Fusion.Bundle.Monadic (sSize, sElems)
import Data.Vector.Fusion.Bundle.Size (Size(Unknown), smaller)
import Data.Vector.Fusion.Bundle (lift)
import qualified Data.Vector.Fusion.Stream.Monadic as Stream
import qualified Data.List as List
#else
import qualified Data.Vector.Fusion.Stream as Stream
import qualified Data.Vector.Fusion.Stream.Monadic as MStream
#endif
import Control.Monad.Primitive ( PrimMonad, unsafeInlineIO, unsafePrimToPrim )
import qualified Control.DeepSeq as DeepSeq
import Data.Word ( Word8 )
import Foreign ( Storable, Ptr, castPtr, peekElemOff )
import Foreign.ForeignPtr (ForeignPtr, withForeignPtr)
import Foreign.Marshal.Array ( copyArray )
import qualified GHC.Foreign as GHC
import qualified GHC.ForeignPtr as GHC
import GHC.IO.Encoding.UTF8
import qualified GHC.Exts as Exts
import System.IO.Unsafe
import Prelude
( Eq(..)
, Enum
, Monad(..)
, Num(..)
, Ord(..)
, Show(..)
, Bool
, IO
, Maybe
, Ordering
, String
, (.)
, ($)
, fromIntegral
, seq
, uncurry
)
import qualified Prelude
newtype ForeignSEXP (ty::SEXPTYPE) = ForeignSEXP (ForeignPtr R.SEXPREC)
foreignSEXP :: PrimMonad m => SEXP s ty -> m (ForeignSEXP ty)
foreignSEXP :: forall (m :: * -> *) s (ty :: SEXPTYPE).
PrimMonad m =>
SEXP s ty -> m (ForeignSEXP ty)
foreignSEXP sx :: SEXP s ty
sx@(SEXP (SEXP0 Ptr SEXPREC
ptr)) =
forall (m1 :: * -> *) (m2 :: * -> *) a.
(PrimBase m1, PrimMonad m2) =>
m1 a -> m2 a
unsafePrimToPrim forall a b. (a -> b) -> a -> b
$ forall a. IO a -> IO a
mask_ forall a b. (a -> b) -> a -> b
$ do
forall s (a :: SEXPTYPE). SEXP s a -> IO ()
R.preserveObject SEXP s ty
sx
forall (ty :: SEXPTYPE). ForeignPtr SEXPREC -> ForeignSEXP ty
ForeignSEXP forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. Ptr a -> IO () -> IO (ForeignPtr a)
GHC.newConcForeignPtr Ptr SEXPREC
ptr (forall s (a :: SEXPTYPE). SEXP s a -> IO ()
R.releaseObject SEXP s ty
sx)
withForeignSEXP
:: ForeignSEXP ty
-> (SEXP V ty -> IO r)
-> IO r
withForeignSEXP :: forall (ty :: SEXPTYPE) r.
ForeignSEXP ty -> (SEXP V ty -> IO r) -> IO r
withForeignSEXP (ForeignSEXP ForeignPtr SEXPREC
fptr) SEXP V ty -> IO r
f =
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr SEXPREC
fptr forall a b. (a -> b) -> a -> b
$ \Ptr SEXPREC
ptr -> SEXP V ty -> IO r
f (forall s (a :: SEXPTYPE). SEXP0 -> SEXP s a
SEXP (Ptr SEXPREC -> SEXP0
SEXP0 Ptr SEXPREC
ptr))
data Vector (ty :: SEXPTYPE) a = Vector
{ forall (ty :: SEXPTYPE) a. Vector ty a -> ForeignSEXP ty
vectorBase :: {-# UNPACK #-} !(ForeignSEXP ty)
, forall (ty :: SEXPTYPE) a. Vector ty a -> Int32
vectorOffset :: {-# UNPACK #-} !Int32
, forall (ty :: SEXPTYPE) a. Vector ty a -> Int32
vectorLength :: {-# UNPACK #-} !Int32
}
instance (Eq a, SVECTOR ty a) => Eq (Vector ty a) where
Vector ty a
a == :: Vector ty a -> Vector ty a -> Bool
== Vector ty a
b = forall (ty :: SEXPTYPE) a. SVECTOR ty a => Vector ty a -> [a]
toList Vector ty a
a forall a. Eq a => a -> a -> Bool
== forall (ty :: SEXPTYPE) a. SVECTOR ty a => Vector ty a -> [a]
toList Vector ty a
b
instance (Show a, SVECTOR ty a) => Show (Vector ty a) where
show :: Vector ty a -> String
show Vector ty a
v = String
"fromList " forall a. [a] -> [a] -> [a]
Prelude.++ forall a. Show a => [a] -> ShowS
showList (forall (ty :: SEXPTYPE) a. SVECTOR ty a => Vector ty a -> [a]
toList Vector ty a
v) String
""
newtype W t ty a = W { forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW :: Vector ty a }
withW :: proxy t -> Vector ty a -> W t ty a
withW :: forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW proxy t
_ Vector ty a
v = forall t (ty :: SEXPTYPE) a. Vector ty a -> W t ty a
W Vector ty a
v
proxyFW :: (W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW :: forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW W t ty a -> r
f Vector ty a
v p t
p = W t ty a -> r
f (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW p t
p Vector ty a
v)
proxyFW2 :: (W t tya a -> W t tyb b -> r) -> Vector tya a -> Vector tyb b -> p t -> r
proxyFW2 :: forall t (tya :: SEXPTYPE) a (tyb :: SEXPTYPE) b r (p :: * -> *).
(W t tya a -> W t tyb b -> r)
-> Vector tya a -> Vector tyb b -> p t -> r
proxyFW2 W t tya a -> W t tyb b -> r
f Vector tya a
v1 Vector tyb b
v2 p t
p = W t tya a -> W t tyb b -> r
f (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW p t
p Vector tya a
v1) (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW p t
p Vector tyb b
v2)
proxyW :: W t ty a -> p t -> Vector ty a
proxyW :: forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW W t ty a
v p t
_ = forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW W t ty a
v
type instance G.Mutable (W t ty) = Mutable.W t ty
instance (Reifies t (AcquireIO s), SVECTOR ty a) => G.Vector (W t ty) a where
{-# INLINE basicUnsafeFreeze #-}
basicUnsafeFreeze :: forall (m :: * -> *).
PrimMonad m =>
Mutable (W t ty) (PrimState m) a -> m (W t ty a)
basicUnsafeFreeze (forall t (ty :: SEXPTYPE) s a. W t ty s a -> MVector s ty a
Mutable.unW -> Mutable.MVector SEXP (PrimState m) ty
sx Int32
off Int32
len) = do
ForeignSEXP ty
fp <- forall (m :: * -> *) s (ty :: SEXPTYPE).
PrimMonad m =>
SEXP s ty -> m (ForeignSEXP ty)
foreignSEXP SEXP (PrimState m) ty
sx
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. Vector ty a -> W t ty a
W forall a b. (a -> b) -> a -> b
$ forall (ty :: SEXPTYPE) a.
ForeignSEXP ty -> Int32 -> Int32 -> Vector ty a
Vector ForeignSEXP ty
fp Int32
off Int32
len
{-# INLINE basicUnsafeThaw #-}
basicUnsafeThaw :: forall (m :: * -> *).
PrimMonad m =>
W t ty a -> m (Mutable (W t ty) (PrimState m) a)
basicUnsafeThaw (forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW -> Vector ForeignSEXP ty
fp Int32
off Int32
len) = forall (m1 :: * -> *) (m2 :: * -> *) a.
(PrimBase m1, PrimMonad m2) =>
m1 a -> m2 a
unsafePrimToPrim forall a b. (a -> b) -> a -> b
$
forall (ty :: SEXPTYPE) r.
ForeignSEXP ty -> (SEXP V ty -> IO r) -> IO r
withForeignSEXP ForeignSEXP ty
fp forall a b. (a -> b) -> a -> b
$ \SEXP V ty
ptr -> do
SEXP s ty
sx' <- forall (ty :: SEXPTYPE). SEXP V ty -> IO (SEXP s ty)
acquireIO (forall t s (a :: SEXPTYPE). (t <= s) => SEXP s a -> SEXP t a
R.release SEXP V ty
ptr)
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ forall (proxy :: * -> *) t s (ty :: SEXPTYPE) a.
proxy t -> MVector s ty a -> W t ty s a
Mutable.withW Proxy t
p forall a b. (a -> b) -> a -> b
$ forall s (ty :: SEXPTYPE) a.
SEXP s ty -> Int32 -> Int32 -> MVector s ty a
Mutable.MVector (forall s (a :: SEXPTYPE) r. SEXP s a -> SEXP r a
R.unsafeRelease SEXP s ty
sx') Int32
off Int32
len
where
AcquireIO forall (ty :: SEXPTYPE). SEXP V ty -> IO (SEXP s ty)
acquireIO = forall {k} (s :: k) a (proxy :: k -> *).
Reifies s a =>
proxy s -> a
reflect (forall {k} (t :: k). Proxy t
Proxy :: Proxy t)
p :: Proxy t
p = forall {k} (t :: k). Proxy t
Proxy :: Proxy t
basicLength :: W t ty a -> Int
basicLength (forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW -> Vector ForeignSEXP ty
_ Int32
_ Int32
len) = forall a b. (Integral a, Num b) => a -> b
fromIntegral Int32
len
{-# INLINE basicUnsafeSlice #-}
basicUnsafeSlice :: Int -> Int -> W t ty a -> W t ty a
basicUnsafeSlice (forall a b. (Integral a, Num b) => a -> b
fromIntegral ->Int32
i)
(forall a b. (Integral a, Num b) => a -> b
fromIntegral ->Int32
n) (forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW -> Vector ForeignSEXP ty
fp Int32
off Int32
_len) = forall t (ty :: SEXPTYPE) a. Vector ty a -> W t ty a
W forall a b. (a -> b) -> a -> b
$ forall (ty :: SEXPTYPE) a.
ForeignSEXP ty -> Int32 -> Int32 -> Vector ty a
Vector ForeignSEXP ty
fp (Int32
off forall a. Num a => a -> a -> a
+ Int32
i) Int32
n
{-# INLINE basicUnsafeIndexM #-}
basicUnsafeIndexM :: forall (m :: * -> *). Monad m => W t ty a -> Int -> m a
basicUnsafeIndexM W t ty a
v Int
i = forall (m :: * -> *) a. Monad m => a -> m a
return forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. IO a -> a
unsafeInlineIO forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> Int -> IO a
peekElemOff (forall a (ty :: SEXPTYPE). Storable a => Vector ty a -> Ptr a
unsafeToPtr (forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW W t ty a
v)) Int
i
{-# INLINE basicUnsafeCopy #-}
basicUnsafeCopy :: forall (m :: * -> *).
PrimMonad m =>
Mutable (W t ty) (PrimState m) a -> W t ty a -> m ()
basicUnsafeCopy Mutable (W t ty) (PrimState m) a
mv W t ty a
v =
forall (m1 :: * -> *) (m2 :: * -> *) a.
(PrimBase m1, PrimMonad m2) =>
m1 a -> m2 a
unsafePrimToPrim forall a b. (a -> b) -> a -> b
$
forall a. Storable a => Ptr a -> Ptr a -> Int -> IO ()
copyArray (forall a s (ty :: SEXPTYPE). Storable a => MVector s ty a -> Ptr a
Mutable.unsafeToPtr (forall t (ty :: SEXPTYPE) s a. W t ty s a -> MVector s ty a
Mutable.unW Mutable (W t ty) (PrimState m) a
mv))
(forall a (ty :: SEXPTYPE). Storable a => Vector ty a -> Ptr a
unsafeToPtr (forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW W t ty a
v))
(forall (v :: * -> *) a. Vector v a => v a -> Int
G.basicLength W t ty a
v)
{-# INLINE elemseq #-}
elemseq :: forall b. W t ty a -> a -> b -> b
elemseq W t ty a
_ = seq :: forall a b. a -> b -> b
seq
instance SVECTOR ty a => Exts.IsList (Vector ty a) where
type Item (Vector ty a) = a
fromList :: [Item (Vector ty a)] -> Vector ty a
fromList = forall (ty :: SEXPTYPE) a. SVECTOR ty a => [a] -> Vector ty a
fromList
fromListN :: Int -> [Item (Vector ty a)] -> Vector ty a
fromListN = forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Int -> [a] -> Vector ty a
fromListN
toList :: Vector ty a -> [Item (Vector ty a)]
toList = forall (ty :: SEXPTYPE) a. SVECTOR ty a => Vector ty a -> [a]
toList
unsafeToPtr :: Storable a => Vector ty a -> Ptr a
{-# INLINE unsafeToPtr #-}
unsafeToPtr :: forall a (ty :: SEXPTYPE). Storable a => Vector ty a -> Ptr a
unsafeToPtr (Vector ForeignSEXP ty
fp Int32
off Int32
len) = forall a. IO a -> a
unsafeInlineIO forall a b. (a -> b) -> a -> b
$ forall (ty :: SEXPTYPE) r.
ForeignSEXP ty -> (SEXP V ty -> IO r) -> IO r
withForeignSEXP ForeignSEXP ty
fp forall a b. (a -> b) -> a -> b
$ \SEXP V ty
sx ->
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ forall a s (ty :: SEXPTYPE). Storable a => MVector s ty a -> Ptr a
Mutable.unsafeToPtr forall a b. (a -> b) -> a -> b
$ forall s (ty :: SEXPTYPE) a.
SEXP s ty -> Int32 -> Int32 -> MVector s ty a
Mutable.MVector SEXP V ty
sx Int32
off Int32
len
fromSEXP :: (SVECTOR ty a) => SEXP s ty -> Vector ty a
fromSEXP :: forall (ty :: SEXPTYPE) a s.
SVECTOR ty a =>
SEXP s ty -> Vector ty a
fromSEXP SEXP s ty
s = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p -> forall a. (forall s. ST s a) -> a
runST forall a b. (a -> b) -> a -> b
$ do
W t ty s a
w <- forall (v :: * -> *) a s. New v a -> ST s (Mutable v s a)
run (forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. Vector v a => v a -> New v a
G.clone (forall (ty :: SEXPTYPE) a s.
SVECTOR ty a =>
SEXP s ty -> Vector ty a
unsafeFromSEXP SEXP s ty
s) Proxy t
p)
W t ty a
v <- forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
Mutable v (PrimState m) a -> m (v a)
G.unsafeFreeze W t ty s a
w
forall (m :: * -> *) a. Monad m => a -> m a
return (forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW W t ty a
v)
unsafeFromSEXP :: SVECTOR ty a
=> SEXP s ty
-> Vector ty a
unsafeFromSEXP :: forall (ty :: SEXPTYPE) a s.
SVECTOR ty a =>
SEXP s ty -> Vector ty a
unsafeFromSEXP SEXP s ty
s = forall a. IO a -> a
unsafeInlineIO forall a b. (a -> b) -> a -> b
$ do
ForeignSEXP ty
sxp <- forall (m :: * -> *) s (ty :: SEXPTYPE).
PrimMonad m =>
SEXP s ty -> m (ForeignSEXP ty)
foreignSEXP SEXP s ty
s
CInt
l <- forall (a :: SEXPTYPE) s. IsVector a => SEXP s a -> IO CInt
R.length SEXP s ty
s
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ forall (ty :: SEXPTYPE) a.
ForeignSEXP ty -> Int32 -> Int32 -> Vector ty a
Vector ForeignSEXP ty
sxp Int32
0 (forall a b. (Integral a, Num b) => a -> b
fromIntegral CInt
l)
toSEXP :: SVECTOR ty a => Vector ty a -> SEXP s ty
toSEXP :: forall (ty :: SEXPTYPE) a s.
SVECTOR ty a =>
Vector ty a -> SEXP s ty
toSEXP Vector ty a
s = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p -> forall a. (forall s. ST s a) -> a
runST forall a b. (a -> b) -> a -> b
$ do
W t ty s a
w <- forall (v :: * -> *) a s. New v a -> ST s (Mutable v s a)
run (forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. Vector v a => v a -> New v a
G.clone Vector ty a
s Proxy t
p)
W t ty a
v <- forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
Mutable v (PrimState m) a -> m (v a)
G.unsafeFreeze W t ty s a
w
forall (m :: * -> *) a. Monad m => a -> m a
return (forall (ty :: SEXPTYPE) a s.
SVECTOR ty a =>
Vector ty a -> SEXP s ty
unsafeToSEXP (forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW W t ty a
v))
unsafeToSEXP :: SVECTOR ty a => Vector ty a -> SEXP s ty
unsafeToSEXP :: forall (ty :: SEXPTYPE) a s.
SVECTOR ty a =>
Vector ty a -> SEXP s ty
unsafeToSEXP (Vector (ForeignSEXP ForeignPtr SEXPREC
fsx) Int32
_ Int32
_) = forall a. IO a -> a
unsafePerformIO forall a b. (a -> b) -> a -> b
$
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr SEXPREC
fsx forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. Monad m => a -> m a
return forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall s (a :: SEXPTYPE). SEXP0 -> SEXP s a
R.sexp forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr SEXPREC -> SEXP0
SEXP0
toString :: Vector 'Char Word8 -> String
toString :: Vector 'Char Word8 -> String
toString Vector 'Char Word8
v = forall a. IO a -> a
unsafeInlineIO forall a b. (a -> b) -> a -> b
$
TextEncoding -> CStringLen -> IO String
GHC.peekCStringLen TextEncoding
utf8 ( forall a b. Ptr a -> Ptr b
castPtr forall a b. (a -> b) -> a -> b
$ forall a (ty :: SEXPTYPE). Storable a => Vector ty a -> Ptr a
unsafeToPtr Vector 'Char Word8
v
, forall a b. (Integral a, Num b) => a -> b
fromIntegral forall a b. (a -> b) -> a -> b
$ forall (ty :: SEXPTYPE) a. Vector ty a -> Int32
vectorLength Vector 'Char Word8
v)
toByteString :: Vector 'Char Word8 -> ByteString
toByteString :: Vector 'Char Word8 -> ByteString
toByteString Vector 'Char Word8
v = forall a. IO a -> a
unsafeInlineIO forall a b. (a -> b) -> a -> b
$
CStringLen -> IO ByteString
B.packCStringLen ( forall a b. Ptr a -> Ptr b
castPtr forall a b. (a -> b) -> a -> b
$ forall a (ty :: SEXPTYPE). Storable a => Vector ty a -> Ptr a
unsafeToPtr Vector 'Char Word8
v
, forall a b. (Integral a, Num b) => a -> b
fromIntegral forall a b. (a -> b) -> a -> b
$ forall (ty :: SEXPTYPE) a. Vector ty a -> Int32
vectorLength Vector 'Char Word8
v)
unsafeWithByteString :: DeepSeq.NFData a => Vector 'Char Word8 -> (ByteString -> IO a) -> a
unsafeWithByteString :: forall a.
NFData a =>
Vector 'Char Word8 -> (ByteString -> IO a) -> a
unsafeWithByteString Vector 'Char Word8
v ByteString -> IO a
f = forall a. IO a -> a
unsafeInlineIO forall a b. (a -> b) -> a -> b
$ do
ByteString
x <- CStringLen -> IO ByteString
B.unsafePackCStringLen (forall a b. Ptr a -> Ptr b
castPtr forall a b. (a -> b) -> a -> b
$ forall a (ty :: SEXPTYPE). Storable a => Vector ty a -> Ptr a
unsafeToPtr Vector 'Char Word8
v
,forall a b. (Integral a, Num b) => a -> b
fromIntegral forall a b. (a -> b) -> a -> b
$ forall (ty :: SEXPTYPE) a. Vector ty a -> Int32
vectorLength Vector 'Char Word8
v)
a
w <- forall a. NFData a => a -> a
DeepSeq.force forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ByteString -> IO a
f ByteString
x
forall a. a -> IO a
evaluate a
w
length :: SVECTOR ty a => Vector ty a -> Int
{-# INLINE length #-}
length :: forall (ty :: SEXPTYPE) a. SVECTOR ty a => Vector ty a -> Int
length Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. Vector v a => v a -> Int
G.length Vector ty a
v
null :: SVECTOR ty a => Vector ty a -> Bool
{-# INLINE null #-}
null :: forall (ty :: SEXPTYPE) a. SVECTOR ty a => Vector ty a -> Bool
null Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. Vector v a => v a -> Bool
G.null Vector ty a
v
(!) :: SVECTOR ty a => Vector ty a -> Int -> a
{-# INLINE (!) #-}
! :: forall (ty :: SEXPTYPE) a. SVECTOR ty a => Vector ty a -> Int -> a
(!) Vector ty a
v Int
i = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => v a -> Int -> a
G.! Int
i) Vector ty a
v
(!?) :: SVECTOR ty a => Vector ty a -> Int -> Maybe a
{-# INLINE (!?) #-}
!? :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Vector ty a -> Int -> Maybe a
(!?) Vector ty a
v Int
i = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => v a -> Int -> Maybe a
G.!? Int
i) Vector ty a
v
head :: SVECTOR ty a => Vector ty a -> a
{-# INLINE head #-}
head :: forall (ty :: SEXPTYPE) a. SVECTOR ty a => Vector ty a -> a
head Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. Vector v a => v a -> a
G.head Vector ty a
v
last :: SVECTOR ty a => Vector ty a -> a
{-# INLINE last #-}
last :: forall (ty :: SEXPTYPE) a. SVECTOR ty a => Vector ty a -> a
last Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. Vector v a => v a -> a
G.last Vector ty a
v
unsafeIndex :: SVECTOR ty a => Vector ty a -> Int -> a
{-# INLINE unsafeIndex #-}
unsafeIndex :: forall (ty :: SEXPTYPE) a. SVECTOR ty a => Vector ty a -> Int -> a
unsafeIndex Vector ty a
v Int
i = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => v a -> Int -> a
`G.unsafeIndex` Int
i) Vector ty a
v
unsafeHead :: SVECTOR ty a => Vector ty a -> a
{-# INLINE unsafeHead #-}
unsafeHead :: forall (ty :: SEXPTYPE) a. SVECTOR ty a => Vector ty a -> a
unsafeHead Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. Vector v a => v a -> a
G.unsafeHead Vector ty a
v
unsafeLast :: SVECTOR ty a => Vector ty a -> a
{-# INLINE unsafeLast #-}
unsafeLast :: forall (ty :: SEXPTYPE) a. SVECTOR ty a => Vector ty a -> a
unsafeLast Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. Vector v a => v a -> a
G.unsafeLast Vector ty a
v
indexM :: (SVECTOR ty a, Monad m) => Vector ty a -> Int -> m a
{-# INLINE indexM #-}
indexM :: forall (ty :: SEXPTYPE) a (m :: * -> *).
(SVECTOR ty a, Monad m) =>
Vector ty a -> Int -> m a
indexM Vector ty a
v Int
i = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a (m :: * -> *).
(Vector v a, Monad m) =>
v a -> Int -> m a
`G.indexM` Int
i) Vector ty a
v
headM :: (SVECTOR ty a, Monad m) => Vector ty a -> m a
{-# INLINE headM #-}
headM :: forall (ty :: SEXPTYPE) a (m :: * -> *).
(SVECTOR ty a, Monad m) =>
Vector ty a -> m a
headM Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a (m :: * -> *).
(Vector v a, Monad m) =>
v a -> m a
G.headM Vector ty a
v
lastM :: (SVECTOR ty a, Monad m) => Vector ty a -> m a
{-# INLINE lastM #-}
lastM :: forall (ty :: SEXPTYPE) a (m :: * -> *).
(SVECTOR ty a, Monad m) =>
Vector ty a -> m a
lastM Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a (m :: * -> *).
(Vector v a, Monad m) =>
v a -> m a
G.lastM Vector ty a
v
unsafeIndexM :: (SVECTOR ty a, Monad m) => Vector ty a -> Int -> m a
{-# INLINE unsafeIndexM #-}
unsafeIndexM :: forall (ty :: SEXPTYPE) a (m :: * -> *).
(SVECTOR ty a, Monad m) =>
Vector ty a -> Int -> m a
unsafeIndexM Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a (m :: * -> *).
(Vector v a, Monad m) =>
v a -> Int -> m a
G.unsafeIndexM Vector ty a
v
unsafeHeadM :: (SVECTOR ty a, Monad m) => Vector ty a -> m a
{-# INLINE unsafeHeadM #-}
unsafeHeadM :: forall (ty :: SEXPTYPE) a (m :: * -> *).
(SVECTOR ty a, Monad m) =>
Vector ty a -> m a
unsafeHeadM Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a (m :: * -> *).
(Vector v a, Monad m) =>
v a -> m a
G.unsafeHeadM Vector ty a
v
unsafeLastM :: (SVECTOR ty a, Monad m) => Vector ty a -> m a
{-# INLINE unsafeLastM #-}
unsafeLastM :: forall (ty :: SEXPTYPE) a (m :: * -> *).
(SVECTOR ty a, Monad m) =>
Vector ty a -> m a
unsafeLastM Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a (m :: * -> *).
(Vector v a, Monad m) =>
v a -> m a
G.unsafeLastM Vector ty a
v
slice :: SVECTOR ty a
=> Int
-> Int
-> Vector ty a
-> Vector ty a
{-# INLINE slice #-}
slice :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Int -> Int -> Vector ty a -> Vector ty a
slice Int
i Int
n Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => Int -> Int -> v a -> v a
G.slice Int
i Int
n) Vector ty a
v
init :: SVECTOR ty a => Vector ty a -> Vector ty a
{-# INLINE init #-}
init :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Vector ty a -> Vector ty a
init Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. Vector v a => v a -> v a
G.init Vector ty a
v
tail :: SVECTOR ty a => Vector ty a -> Vector ty a
{-# INLINE tail #-}
tail :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Vector ty a -> Vector ty a
tail Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. Vector v a => v a -> v a
G.tail Vector ty a
v
take :: SVECTOR ty a => Int -> Vector ty a -> Vector ty a
{-# INLINE take #-}
take :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Int -> Vector ty a -> Vector ty a
take Int
i Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => Int -> v a -> v a
G.take Int
i) Vector ty a
v
drop :: SVECTOR ty a => Int -> Vector ty a -> Vector ty a
{-# INLINE drop #-}
drop :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Int -> Vector ty a -> Vector ty a
drop Int
i Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => Int -> v a -> v a
G.drop Int
i) Vector ty a
v
{-# INLINE splitAt #-}
splitAt :: SVECTOR ty a => Int -> Vector ty a -> (Vector ty a, Vector ty a)
splitAt :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Int -> Vector ty a -> (Vector ty a, Vector ty a)
splitAt Int
i Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ (\(W t ty a
a,W t ty a
b) -> (forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW W t ty a
a, forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW W t ty a
b)) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => Int -> v a -> (v a, v a)
G.splitAt Int
i) Vector ty a
v
unsafeSlice :: SVECTOR ty a => Int
-> Int
-> Vector ty a
-> Vector ty a
{-# INLINE unsafeSlice #-}
unsafeSlice :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Int -> Int -> Vector ty a -> Vector ty a
unsafeSlice Int
i Int
j Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => Int -> Int -> v a -> v a
G.unsafeSlice Int
i Int
j) Vector ty a
v
unsafeInit :: SVECTOR ty a => Vector ty a -> Vector ty a
{-# INLINE unsafeInit #-}
unsafeInit :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Vector ty a -> Vector ty a
unsafeInit Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. Vector v a => v a -> v a
G.unsafeInit Vector ty a
v
unsafeTail :: SVECTOR ty a => Vector ty a -> Vector ty a
{-# INLINE unsafeTail #-}
unsafeTail :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Vector ty a -> Vector ty a
unsafeTail Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. Vector v a => v a -> v a
G.unsafeTail Vector ty a
v
unsafeTake :: SVECTOR ty a => Int -> Vector ty a -> Vector ty a
{-# INLINE unsafeTake #-}
unsafeTake :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Int -> Vector ty a -> Vector ty a
unsafeTake Int
i Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => Int -> v a -> v a
G.unsafeTake Int
i) Vector ty a
v
unsafeDrop :: SVECTOR ty a => Int -> Vector ty a -> Vector ty a
{-# INLINE unsafeDrop #-}
unsafeDrop :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Int -> Vector ty a -> Vector ty a
unsafeDrop Int
i Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => Int -> v a -> v a
G.unsafeDrop Int
i) Vector ty a
v
empty :: SVECTOR ty a => Vector ty a
{-# INLINE empty #-}
empty :: forall (ty :: SEXPTYPE) a. SVECTOR ty a => Vector ty a
empty = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW forall (v :: * -> *) a. Vector v a => v a
G.empty
singleton :: SVECTOR ty a => a -> Vector ty a
{-# INLINE singleton #-}
singleton :: forall (ty :: SEXPTYPE) a. SVECTOR ty a => a -> Vector ty a
singleton a
a = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. Vector v a => a -> v a
G.singleton a
a)
replicate :: SVECTOR ty a => Int -> a -> Vector ty a
{-# INLINE replicate #-}
replicate :: forall (ty :: SEXPTYPE) a. SVECTOR ty a => Int -> a -> Vector ty a
replicate Int
i a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. Vector v a => Int -> a -> v a
G.replicate Int
i a
v)
generate :: SVECTOR ty a => Int -> (Int -> a) -> Vector ty a
{-# INLINE generate #-}
generate :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Int -> (Int -> a) -> Vector ty a
generate Int
i Int -> a
f = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. Vector v a => Int -> (Int -> a) -> v a
G.generate Int
i Int -> a
f)
iterateN :: SVECTOR ty a => Int -> (a -> a) -> a -> Vector ty a
{-# INLINE iterateN #-}
iterateN :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Int -> (a -> a) -> a -> Vector ty a
iterateN Int
i a -> a
f a
a = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. Vector v a => Int -> (a -> a) -> a -> v a
G.iterateN Int
i a -> a
f a
a)
unfoldr :: SVECTOR ty a => (b -> Maybe (a, b)) -> b -> Vector ty a
{-# INLINE unfoldr #-}
unfoldr :: forall (ty :: SEXPTYPE) a b.
SVECTOR ty a =>
(b -> Maybe (a, b)) -> b -> Vector ty a
unfoldr b -> Maybe (a, b)
g b
a = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a b.
Vector v a =>
(b -> Maybe (a, b)) -> b -> v a
G.unfoldr b -> Maybe (a, b)
g b
a)
unfoldrN :: SVECTOR ty a => Int -> (b -> Maybe (a, b)) -> b -> Vector ty a
{-# INLINE unfoldrN #-}
unfoldrN :: forall (ty :: SEXPTYPE) a b.
SVECTOR ty a =>
Int -> (b -> Maybe (a, b)) -> b -> Vector ty a
unfoldrN Int
n b -> Maybe (a, b)
g b
a = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a b.
Vector v a =>
Int -> (b -> Maybe (a, b)) -> b -> v a
G.unfoldrN Int
n b -> Maybe (a, b)
g b
a)
constructN :: SVECTOR ty a => Int -> (Vector ty a -> a) -> Vector ty a
{-# INLINE constructN #-}
constructN :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Int -> (Vector ty a -> a) -> Vector ty a
constructN Int
n Vector ty a -> a
g = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. Vector v a => Int -> (v a -> a) -> v a
G.constructN Int
n (Vector ty a -> a
gforall b c a. (b -> c) -> (a -> b) -> a -> c
.forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW))
constructrN :: SVECTOR ty a => Int -> (Vector ty a -> a) -> Vector ty a
{-# INLINE constructrN #-}
constructrN :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Int -> (Vector ty a -> a) -> Vector ty a
constructrN Int
n Vector ty a -> a
g = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. Vector v a => Int -> (v a -> a) -> v a
G.constructrN Int
n (Vector ty a -> a
gforall b c a. (b -> c) -> (a -> b) -> a -> c
.forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW))
enumFromN :: (SVECTOR ty a, Num a) => a -> Int -> Vector ty a
{-# INLINE enumFromN #-}
enumFromN :: forall (ty :: SEXPTYPE) a.
(SVECTOR ty a, Num a) =>
a -> Int -> Vector ty a
enumFromN a
a Int
i = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. (Vector v a, Num a) => a -> Int -> v a
G.enumFromN a
a Int
i)
enumFromStepN :: (SVECTOR ty a, Num a) => a -> a -> Int -> Vector ty a
{-# INLINE enumFromStepN #-}
enumFromStepN :: forall (ty :: SEXPTYPE) a.
(SVECTOR ty a, Num a) =>
a -> a -> Int -> Vector ty a
enumFromStepN a
f a
t Int
s = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. (Vector v a, Num a) => a -> a -> Int -> v a
G.enumFromStepN a
f a
t Int
s)
enumFromTo :: (SVECTOR ty a, Enum a) => a -> a -> Vector ty a
{-# INLINE enumFromTo #-}
enumFromTo :: forall (ty :: SEXPTYPE) a.
(SVECTOR ty a, Enum a) =>
a -> a -> Vector ty a
enumFromTo a
f a
t = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. (Vector v a, Enum a) => a -> a -> v a
G.enumFromTo a
f a
t)
enumFromThenTo :: (SVECTOR ty a, Enum a) => a -> a -> a -> Vector ty a
{-# INLINE enumFromThenTo #-}
enumFromThenTo :: forall (ty :: SEXPTYPE) a.
(SVECTOR ty a, Enum a) =>
a -> a -> a -> Vector ty a
enumFromThenTo a
f a
t a
s = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. (Vector v a, Enum a) => a -> a -> a -> v a
G.enumFromThenTo a
f a
t a
s)
cons :: SVECTOR ty a => a -> Vector ty a -> Vector ty a
{-# INLINE cons #-}
cons :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
a -> Vector ty a -> Vector ty a
cons a
a Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => a -> v a -> v a
G.cons a
a) Vector ty a
v
snoc :: SVECTOR ty a => Vector ty a -> a -> Vector ty a
{-# INLINE snoc #-}
snoc :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Vector ty a -> a -> Vector ty a
snoc Vector ty a
v a
a = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => v a -> a -> v a
`G.snoc` a
a) Vector ty a
v
infixr 5 ++
(++) :: SVECTOR ty a => Vector ty a -> Vector ty a -> Vector ty a
{-# INLINE (++) #-}
Vector ty a
v1 ++ :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Vector ty a -> Vector ty a -> Vector ty a
++ Vector ty a
v2 = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (tya :: SEXPTYPE) a (tyb :: SEXPTYPE) b r (p :: * -> *).
(W t tya a -> W t tyb b -> r)
-> Vector tya a -> Vector tyb b -> p t -> r
proxyFW2 forall (v :: * -> *) a. Vector v a => v a -> v a -> v a
(G.++) Vector ty a
v1 Vector ty a
v2
concat :: SVECTOR ty a => [Vector ty a] -> Vector ty a
{-# INLINE concat #-}
concat :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
[Vector ty a] -> Vector ty a
concat [Vector ty a]
vs = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p -> forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall a b. (a -> b) -> a -> b
$ forall (v :: * -> *) a. Vector v a => [v a] -> v a
G.concat forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
Prelude.map (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p) [Vector ty a]
vs
replicateM :: (Monad m, SVECTOR ty a) => Int -> m a -> m (Vector ty a)
{-# INLINE replicateM #-}
replicateM :: forall (m :: * -> *) (ty :: SEXPTYPE) a.
(Monad m, SVECTOR ty a) =>
Int -> m a -> m (Vector ty a)
replicateM Int
n m a
f = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p -> (\W t ty a
v -> forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW W t ty a
v Proxy t
p) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *) (v :: * -> *) a.
(Monad m, Vector v a) =>
Int -> m a -> m (v a)
G.replicateM Int
n m a
f
generateM :: (Monad m, SVECTOR ty a) => Int -> (Int -> m a) -> m (Vector ty a)
{-# INLINE generateM #-}
generateM :: forall (m :: * -> *) (ty :: SEXPTYPE) a.
(Monad m, SVECTOR ty a) =>
Int -> (Int -> m a) -> m (Vector ty a)
generateM Int
n Int -> m a
f = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p -> (\W t ty a
v -> forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW W t ty a
v Proxy t
p) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *) (v :: * -> *) a.
(Monad m, Vector v a) =>
Int -> (Int -> m a) -> m (v a)
G.generateM Int
n Int -> m a
f
create :: SVECTOR ty a => (forall r. ST r (MVector r ty a)) -> Vector ty a
{-# INLINE create #-}
create :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(forall r. ST r (MVector r ty a)) -> Vector ty a
create forall r. ST r (MVector r ty a)
f = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p -> forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall a b. (a -> b) -> a -> b
$ forall (v :: * -> *) a.
Vector v a =>
(forall s. ST s (Mutable v s a)) -> v a
G.create (forall (proxy :: * -> *) t s (ty :: SEXPTYPE) a.
proxy t -> MVector s ty a -> W t ty s a
Mutable.withW Proxy t
p forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall r. ST r (MVector r ty a)
f)
force :: SVECTOR ty a => Vector ty a -> Vector ty a
{-# INLINE force #-}
force :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Vector ty a -> Vector ty a
force Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. Vector v a => v a -> v a
G.force Vector ty a
v
(//) :: SVECTOR ty a
=> Vector ty a
-> [(Int, a)]
-> Vector ty a
{-# INLINE (//) #-}
// :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Vector ty a -> [(Int, a)] -> Vector ty a
(//) Vector ty a
v [(Int, a)]
l = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => v a -> [(Int, a)] -> v a
G.// [(Int, a)]
l) Vector ty a
v
unsafeUpd :: SVECTOR ty a => Vector ty a -> [(Int, a)] -> Vector ty a
{-# INLINE unsafeUpd #-}
unsafeUpd :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Vector ty a -> [(Int, a)] -> Vector ty a
unsafeUpd Vector ty a
v [(Int, a)]
l = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => v a -> [(Int, a)] -> v a
`G.unsafeUpd` [(Int, a)]
l) Vector ty a
v
accum :: SVECTOR ty a
=> (a -> b -> a)
-> Vector ty a
-> [(Int,b)]
-> Vector ty a
{-# INLINE accum #-}
accum :: forall (ty :: SEXPTYPE) a b.
SVECTOR ty a =>
(a -> b -> a) -> Vector ty a -> [(Int, b)] -> Vector ty a
accum a -> b -> a
f Vector ty a
v [(Int, b)]
l = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (\W t ty a
w -> forall (v :: * -> *) a b.
Vector v a =>
(a -> b -> a) -> v a -> [(Int, b)] -> v a
G.accum a -> b -> a
f W t ty a
w [(Int, b)]
l) Vector ty a
v
unsafeAccum :: SVECTOR ty a => (a -> b -> a) -> Vector ty a -> [(Int,b)] -> Vector ty a
{-# INLINE unsafeAccum #-}
unsafeAccum :: forall (ty :: SEXPTYPE) a b.
SVECTOR ty a =>
(a -> b -> a) -> Vector ty a -> [(Int, b)] -> Vector ty a
unsafeAccum a -> b -> a
f Vector ty a
v [(Int, b)]
l = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (\W t ty a
w -> forall (v :: * -> *) a b.
Vector v a =>
(a -> b -> a) -> v a -> [(Int, b)] -> v a
G.unsafeAccum a -> b -> a
f W t ty a
w [(Int, b)]
l) Vector ty a
v
reverse :: SVECTOR ty a => Vector ty a -> Vector ty a
{-# INLINE reverse #-}
reverse :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Vector ty a -> Vector ty a
reverse Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. Vector v a => v a -> v a
G.reverse Vector ty a
v
map :: (SVECTOR ty a, SVECTOR ty b) => (a -> b) -> Vector ty a -> Vector ty b
{-# INLINE map #-}
map :: forall (ty :: SEXPTYPE) a b.
(SVECTOR ty a, SVECTOR ty b) =>
(a -> b) -> Vector ty a -> Vector ty b
map a -> b
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b) -> v a -> v b
G.map a -> b
f) Vector ty a
v
imap :: (SVECTOR ty a, SVECTOR ty b) => (Int -> a -> b) -> Vector ty a -> Vector ty b
{-# INLINE imap #-}
imap :: forall (ty :: SEXPTYPE) a b.
(SVECTOR ty a, SVECTOR ty b) =>
(Int -> a -> b) -> Vector ty a -> Vector ty b
imap Int -> a -> b
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(Int -> a -> b) -> v a -> v b
G.imap Int -> a -> b
f) Vector ty a
v
concatMap :: (SVECTOR tya a, SVECTOR tyb b)
=> (a -> Vector tyb b)
-> Vector tya a
-> Vector tyb b
{-# INLINE concatMap #-}
#if MIN_VERSION_vector(0,11,0)
concatMap :: forall (tya :: SEXPTYPE) a (tyb :: SEXPTYPE) b.
(SVECTOR tya a, SVECTOR tyb b) =>
(a -> Vector tyb b) -> Vector tya a -> Vector tyb b
concatMap a -> Vector tyb b
f Vector tya a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p ->
let v' :: Bundle (W t tya) a
v' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tya a
v)
in forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. Vector v a => Bundle v a -> v a
G.unstream forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a (v :: * -> *).
Monad m =>
Stream m a -> Size -> Bundle m v a
Bundle.fromStream (forall (m :: * -> *) a b.
Monad m =>
(a -> Stream m b) -> Stream m a -> Stream m b
Stream.concatMap (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Vector tyb b
f) (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tya) a
v')) Size
Unknown) Proxy t
p
#else
concatMap f v =
phony $ \p ->
(`proxyW` p) $
G.unstream $
Stream.concatMap (G.stream . withW p . f) $
G.stream $
withW p v
#endif
mapM :: (Monad m, SVECTOR ty a, SVECTOR ty b) => (a -> m b) -> Vector ty a -> m (Vector ty b)
{-# INLINE mapM #-}
mapM :: forall (m :: * -> *) (ty :: SEXPTYPE) a b.
(Monad m, SVECTOR ty a, SVECTOR ty b) =>
(a -> m b) -> Vector ty a -> m (Vector ty b)
mapM a -> m b
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p -> forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (m :: * -> *) (v :: * -> *) a b.
(Monad m, Vector v a, Vector v b) =>
(a -> m b) -> v a -> m (v b)
G.mapM a -> m b
f) Vector ty a
v Proxy t
p
mapM_ :: (Monad m, SVECTOR ty a) => (a -> m b) -> Vector ty a -> m ()
{-# INLINE mapM_ #-}
mapM_ :: forall (m :: * -> *) (ty :: SEXPTYPE) a b.
(Monad m, SVECTOR ty a) =>
(a -> m b) -> Vector ty a -> m ()
mapM_ a -> m b
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (m :: * -> *) (v :: * -> *) a b.
(Monad m, Vector v a) =>
(a -> m b) -> v a -> m ()
G.mapM_ a -> m b
f) Vector ty a
v
forM :: (Monad m, SVECTOR ty a, SVECTOR ty b) => Vector ty a -> (a -> m b) -> m (Vector ty b)
{-# INLINE forM #-}
forM :: forall (m :: * -> *) (ty :: SEXPTYPE) a b.
(Monad m, SVECTOR ty a, SVECTOR ty b) =>
Vector ty a -> (a -> m b) -> m (Vector ty b)
forM Vector ty a
v a -> m b
f = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p -> forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (m :: * -> *) (v :: * -> *) a b.
(Monad m, Vector v a, Vector v b) =>
v a -> (a -> m b) -> m (v b)
`G.forM` a -> m b
f) Vector ty a
v Proxy t
p
forM_ :: (Monad m, SVECTOR ty a) => Vector ty a -> (a -> m b) -> m ()
{-# INLINE forM_ #-}
forM_ :: forall (m :: * -> *) (ty :: SEXPTYPE) a b.
(Monad m, SVECTOR ty a) =>
Vector ty a -> (a -> m b) -> m ()
forM_ Vector ty a
v a -> m b
f = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (m :: * -> *) (v :: * -> *) a b.
(Monad m, Vector v a) =>
v a -> (a -> m b) -> m ()
`G.forM_` a -> m b
f) Vector ty a
v
#if MIN_VERSION_vector(0,11,0)
smallest :: [Size] -> Size
smallest :: [Size] -> Size
smallest = forall a. (a -> a -> a) -> [a] -> a
List.foldl1' Size -> Size -> Size
smaller
#endif
zipWith :: (SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c)
=> (a -> b -> c) -> Vector tya a -> Vector tyb b -> Vector tyc c
{-# INLINE zipWith #-}
#if MIN_VERSION_vector(0,11,0)
zipWith :: forall (tya :: SEXPTYPE) a (tyb :: SEXPTYPE) b (tyc :: SEXPTYPE) c.
(SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c) =>
(a -> b -> c) -> Vector tya a -> Vector tyb b -> Vector tyc c
zipWith a -> b -> c
f Vector tya a
xs Vector tyb b
ys = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p ->
let xs' :: Bundle (W t tya) a
xs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tya a
xs)
ys' :: Bundle (W t tyb) b
ys' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyb b
ys)
sz :: Size
sz = Size -> Size -> Size
smaller (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tya) a
xs') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyb) b
ys')
in forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. Vector v a => Bundle v a -> v a
G.unstream forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a (v :: * -> *).
Monad m =>
Stream m a -> Size -> Bundle m v a
Bundle.fromStream (forall (m :: * -> *) a b c.
Monad m =>
(a -> b -> c) -> Stream m a -> Stream m b -> Stream m c
Stream.zipWith a -> b -> c
f (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tya) a
xs') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyb) b
ys')) Size
sz) Proxy t
p
#else
zipWith f xs ys = phony $ \p ->
proxyW (G.unstream (Stream.zipWith f (G.stream (withW p xs)) (G.stream (withW p ys)))) p
#endif
zipWith3 :: (SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c, SVECTOR tyd d)
=> (a -> b -> c -> d) -> Vector tya a -> Vector tyb b -> Vector tyc c -> Vector tyd d
{-# INLINE zipWith3 #-}
#if MIN_VERSION_vector(0,11,0)
zipWith3 :: forall (tya :: SEXPTYPE) a (tyb :: SEXPTYPE) b (tyc :: SEXPTYPE) c
(tyd :: SEXPTYPE) d.
(SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c, SVECTOR tyd d) =>
(a -> b -> c -> d)
-> Vector tya a -> Vector tyb b -> Vector tyc c -> Vector tyd d
zipWith3 a -> b -> c -> d
f Vector tya a
as Vector tyb b
bs Vector tyc c
cs = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p ->
let as' :: Bundle (W t tya) a
as' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tya a
as)
bs' :: Bundle (W t tyb) b
bs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyb b
bs)
cs' :: Bundle (W t tyc) c
cs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyc c
cs)
sz :: Size
sz = [Size] -> Size
smallest [forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tya) a
as', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyb) b
bs', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyc) c
cs']
in forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. Vector v a => Bundle v a -> v a
G.unstream forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a (v :: * -> *).
Monad m =>
Stream m a -> Size -> Bundle m v a
Bundle.fromStream (forall (m :: * -> *) a b c d.
Monad m =>
(a -> b -> c -> d)
-> Stream m a -> Stream m b -> Stream m c -> Stream m d
Stream.zipWith3 a -> b -> c -> d
f (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tya) a
as') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyb) b
bs') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyc) c
cs')) Size
sz) Proxy t
p
#else
zipWith3 f as bs cs = phony $ \p ->
proxyW (G.unstream (Stream.zipWith3 f (G.stream (withW p as)) (G.stream (withW p bs)) (G.stream (withW p cs)))) p
#endif
zipWith4 :: (SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c, SVECTOR tyd d, SVECTOR tye e)
=> (a -> b -> c -> d -> e)
-> Vector tya a -> Vector tyb b -> Vector tyc c -> Vector tyd d -> Vector tye e
{-# INLINE zipWith4 #-}
#if MIN_VERSION_vector(0,11,0)
zipWith4 :: forall (tya :: SEXPTYPE) a (tyb :: SEXPTYPE) b (tyc :: SEXPTYPE) c
(tyd :: SEXPTYPE) d (tye :: SEXPTYPE) e.
(SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c, SVECTOR tyd d,
SVECTOR tye e) =>
(a -> b -> c -> d -> e)
-> Vector tya a
-> Vector tyb b
-> Vector tyc c
-> Vector tyd d
-> Vector tye e
zipWith4 a -> b -> c -> d -> e
f Vector tya a
as Vector tyb b
bs Vector tyc c
cs Vector tyd d
ds = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p ->
let as' :: Bundle (W t tya) a
as' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tya a
as)
bs' :: Bundle (W t tyb) b
bs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyb b
bs)
cs' :: Bundle (W t tyc) c
cs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyc c
cs)
ds' :: Bundle (W t tyd) d
ds' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyd d
ds)
sz :: Size
sz = [Size] -> Size
smallest [forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tya) a
as', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyb) b
bs', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyc) c
cs', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyd) d
ds']
in forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. Vector v a => Bundle v a -> v a
G.unstream forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a (v :: * -> *).
Monad m =>
Stream m a -> Size -> Bundle m v a
Bundle.fromStream (forall (m :: * -> *) a b c d e.
Monad m =>
(a -> b -> c -> d -> e)
-> Stream m a
-> Stream m b
-> Stream m c
-> Stream m d
-> Stream m e
Stream.zipWith4 a -> b -> c -> d -> e
f (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tya) a
as') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyb) b
bs') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyc) c
cs') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyd) d
ds')) Size
sz) Proxy t
p
#else
zipWith4 f as bs cs ds = phony $ \p ->
proxyW (G.unstream (Stream.zipWith4 f (G.stream (withW p as)) (G.stream (withW p bs)) (G.stream (withW p cs)) (G.stream (withW p ds)))) p
#endif
zipWith5 :: (SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c, SVECTOR tyd d, SVECTOR tye e,
SVECTOR tyf f)
=> (a -> b -> c -> d -> e -> f)
-> Vector tya a -> Vector tyb b -> Vector tyc c -> Vector tyd d -> Vector tye e
-> Vector tyf f
{-# INLINE zipWith5 #-}
#if MIN_VERSION_vector(0,11,0)
zipWith5 :: forall (tya :: SEXPTYPE) a (tyb :: SEXPTYPE) b (tyc :: SEXPTYPE) c
(tyd :: SEXPTYPE) d (tye :: SEXPTYPE) e (tyf :: SEXPTYPE) f.
(SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c, SVECTOR tyd d,
SVECTOR tye e, SVECTOR tyf f) =>
(a -> b -> c -> d -> e -> f)
-> Vector tya a
-> Vector tyb b
-> Vector tyc c
-> Vector tyd d
-> Vector tye e
-> Vector tyf f
zipWith5 a -> b -> c -> d -> e -> f
f Vector tya a
as Vector tyb b
bs Vector tyc c
cs Vector tyd d
ds Vector tye e
es = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p ->
let as' :: Bundle (W t tya) a
as' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tya a
as)
bs' :: Bundle (W t tyb) b
bs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyb b
bs)
cs' :: Bundle (W t tyc) c
cs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyc c
cs)
ds' :: Bundle (W t tyd) d
ds' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyd d
ds)
es' :: Bundle (W t tye) e
es' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tye e
es)
sz :: Size
sz = [Size] -> Size
smallest [forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tya) a
as', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyb) b
bs', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyc) c
cs', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyd) d
ds', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tye) e
es']
in forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. Vector v a => Bundle v a -> v a
G.unstream forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a (v :: * -> *).
Monad m =>
Stream m a -> Size -> Bundle m v a
Bundle.fromStream (forall (m :: * -> *) a b c d e f.
Monad m =>
(a -> b -> c -> d -> e -> f)
-> Stream m a
-> Stream m b
-> Stream m c
-> Stream m d
-> Stream m e
-> Stream m f
Stream.zipWith5 a -> b -> c -> d -> e -> f
f (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tya) a
as') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyb) b
bs') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyc) c
cs') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyd) d
ds') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tye) e
es')) Size
sz) Proxy t
p
#else
zipWith5 f as bs cs ds es = phony $ \p ->
proxyW (G.unstream (Stream.zipWith5 f (G.stream (withW p as)) (G.stream (withW p bs)) (G.stream (withW p cs)) (G.stream (withW p ds)) (G.stream (withW p es)))) p
#endif
zipWith6 :: (SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c, SVECTOR tyd d, SVECTOR tye e,
SVECTOR tyf f, SVECTOR tyg g)
=> (a -> b -> c -> d -> e -> f -> g)
-> Vector tya a -> Vector tyb b -> Vector tyc c -> Vector tyd d -> Vector tye e
-> Vector tyf f -> Vector tyg g
{-# INLINE zipWith6 #-}
#if MIN_VERSION_vector(0,11,0)
zipWith6 :: forall (tya :: SEXPTYPE) a (tyb :: SEXPTYPE) b (tyc :: SEXPTYPE) c
(tyd :: SEXPTYPE) d (tye :: SEXPTYPE) e (tyf :: SEXPTYPE) f
(tyg :: SEXPTYPE) g.
(SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c, SVECTOR tyd d,
SVECTOR tye e, SVECTOR tyf f, SVECTOR tyg g) =>
(a -> b -> c -> d -> e -> f -> g)
-> Vector tya a
-> Vector tyb b
-> Vector tyc c
-> Vector tyd d
-> Vector tye e
-> Vector tyf f
-> Vector tyg g
zipWith6 a -> b -> c -> d -> e -> f -> g
f Vector tya a
as Vector tyb b
bs Vector tyc c
cs Vector tyd d
ds Vector tye e
es Vector tyf f
fs = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p ->
let as' :: Bundle (W t tya) a
as' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tya a
as)
bs' :: Bundle (W t tyb) b
bs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyb b
bs)
cs' :: Bundle (W t tyc) c
cs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyc c
cs)
ds' :: Bundle (W t tyd) d
ds' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyd d
ds)
es' :: Bundle (W t tye) e
es' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tye e
es)
fs' :: Bundle (W t tyf) f
fs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyf f
fs)
sz :: Size
sz = [Size] -> Size
smallest [forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tya) a
as', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyb) b
bs', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyc) c
cs', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyd) d
ds', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tye) e
es', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyf) f
fs']
in forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. Vector v a => Bundle v a -> v a
G.unstream forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a (v :: * -> *).
Monad m =>
Stream m a -> Size -> Bundle m v a
Bundle.fromStream (forall (m :: * -> *) a b c d e f g.
Monad m =>
(a -> b -> c -> d -> e -> f -> g)
-> Stream m a
-> Stream m b
-> Stream m c
-> Stream m d
-> Stream m e
-> Stream m f
-> Stream m g
Stream.zipWith6 a -> b -> c -> d -> e -> f -> g
f (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tya) a
as') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyb) b
bs') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyc) c
cs') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyd) d
ds') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tye) e
es') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyf) f
fs')) Size
sz) Proxy t
p
#else
zipWith6 f as bs cs ds es fs = phony $ \p ->
proxyW (G.unstream (Stream.zipWith6 f (G.stream (withW p as)) (G.stream (withW p bs)) (G.stream (withW p cs)) (G.stream (withW p ds)) (G.stream (withW p es)) (G.stream (withW p fs)))) p
#endif
izipWith :: (SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c)
=> (Int -> a -> b -> c) -> Vector tya a -> Vector tyb b -> Vector tyc c
{-# INLINE izipWith #-}
#if MIN_VERSION_vector(0,11,0)
izipWith :: forall (tya :: SEXPTYPE) a (tyb :: SEXPTYPE) b (tyc :: SEXPTYPE) c.
(SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c) =>
(Int -> a -> b -> c)
-> Vector tya a -> Vector tyb b -> Vector tyc c
izipWith Int -> a -> b -> c
f Vector tya a
as Vector tyb b
bs = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p ->
let as' :: Bundle (W t tya) a
as' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tya a
as)
bs' :: Bundle (W t tyb) b
bs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyb b
bs)
sz :: Size
sz = Size -> Size -> Size
smaller (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tya) a
as') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyb) b
bs')
in forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. Vector v a => Bundle v a -> v a
G.unstream forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a (v :: * -> *).
Monad m =>
Stream m a -> Size -> Bundle m v a
Bundle.fromStream (forall (m :: * -> *) a b c.
Monad m =>
(a -> b -> c) -> Stream m a -> Stream m b -> Stream m c
Stream.zipWith (forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry Int -> a -> b -> c
f) (forall (m :: * -> *) a. Monad m => Stream m a -> Stream m (Int, a)
Stream.indexed (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tya) a
as')) (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyb) b
bs')) Size
sz) Proxy t
p
#else
izipWith f as bs = phony $ \p ->
proxyW (G.unstream (Stream.zipWith (uncurry f) (Stream.indexed (G.stream (withW p as))) (G.stream (withW p bs)))) p
#endif
izipWith3 :: (SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c, SVECTOR tyd d)
=> (Int -> a -> b -> c -> d)
-> Vector tya a -> Vector tyb b -> Vector tyc c -> Vector tyd d
{-# INLINE izipWith3 #-}
#if MIN_VERSION_vector(0,11,0)
izipWith3 :: forall (tya :: SEXPTYPE) a (tyb :: SEXPTYPE) b (tyc :: SEXPTYPE) c
(tyd :: SEXPTYPE) d.
(SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c, SVECTOR tyd d) =>
(Int -> a -> b -> c -> d)
-> Vector tya a -> Vector tyb b -> Vector tyc c -> Vector tyd d
izipWith3 Int -> a -> b -> c -> d
f Vector tya a
as Vector tyb b
bs Vector tyc c
cs = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p ->
let as' :: Bundle (W t tya) a
as' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tya a
as)
bs' :: Bundle (W t tyb) b
bs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyb b
bs)
cs' :: Bundle (W t tyc) c
cs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyc c
cs)
sz :: Size
sz = [Size] -> Size
smallest [forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tya) a
as', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyb) b
bs', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyc) c
cs']
in forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. Vector v a => Bundle v a -> v a
G.unstream forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a (v :: * -> *).
Monad m =>
Stream m a -> Size -> Bundle m v a
Bundle.fromStream (forall (m :: * -> *) a b c d.
Monad m =>
(a -> b -> c -> d)
-> Stream m a -> Stream m b -> Stream m c -> Stream m d
Stream.zipWith3 (forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry Int -> a -> b -> c -> d
f) (forall (m :: * -> *) a. Monad m => Stream m a -> Stream m (Int, a)
Stream.indexed (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tya) a
as')) (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyb) b
bs') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyc) c
cs')) Size
sz) Proxy t
p
#else
izipWith3 f as bs cs = phony $ \p ->
proxyW (G.unstream (Stream.zipWith3 (uncurry f) (Stream.indexed (G.stream (withW p as))) (G.stream (withW p bs)) (G.stream (withW p cs)))) p
#endif
izipWith4 :: (SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c, SVECTOR tyd d, SVECTOR tye e)
=> (Int -> a -> b -> c -> d -> e)
-> Vector tya a -> Vector tyb b -> Vector tyc c -> Vector tyd d -> Vector tye e
{-# INLINE izipWith4 #-}
#if MIN_VERSION_vector(0,11,0)
izipWith4 :: forall (tya :: SEXPTYPE) a (tyb :: SEXPTYPE) b (tyc :: SEXPTYPE) c
(tyd :: SEXPTYPE) d (tye :: SEXPTYPE) e.
(SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c, SVECTOR tyd d,
SVECTOR tye e) =>
(Int -> a -> b -> c -> d -> e)
-> Vector tya a
-> Vector tyb b
-> Vector tyc c
-> Vector tyd d
-> Vector tye e
izipWith4 Int -> a -> b -> c -> d -> e
f Vector tya a
as Vector tyb b
bs Vector tyc c
cs Vector tyd d
ds = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p ->
let as' :: Bundle (W t tya) a
as' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tya a
as)
bs' :: Bundle (W t tyb) b
bs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyb b
bs)
cs' :: Bundle (W t tyc) c
cs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyc c
cs)
ds' :: Bundle (W t tyd) d
ds' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyd d
ds)
sz :: Size
sz = [Size] -> Size
smallest [ forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tya) a
as', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyb) b
bs', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyc) c
cs', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyd) d
ds']
in forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. Vector v a => Bundle v a -> v a
G.unstream forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a (v :: * -> *).
Monad m =>
Stream m a -> Size -> Bundle m v a
Bundle.fromStream (forall (m :: * -> *) a b c d e.
Monad m =>
(a -> b -> c -> d -> e)
-> Stream m a
-> Stream m b
-> Stream m c
-> Stream m d
-> Stream m e
Stream.zipWith4 (forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry Int -> a -> b -> c -> d -> e
f) (forall (m :: * -> *) a. Monad m => Stream m a -> Stream m (Int, a)
Stream.indexed (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tya) a
as')) (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyb) b
bs') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyc) c
cs') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyd) d
ds')) Size
sz) Proxy t
p
#else
izipWith4 f as bs cs ds = phony $ \p ->
proxyW (G.unstream (Stream.zipWith4 (uncurry f) (Stream.indexed (G.stream (withW p as))) (G.stream (withW p bs)) (G.stream (withW p cs)) (G.stream (withW p ds)))) p
#endif
izipWith5 :: (SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c, SVECTOR tyd d, SVECTOR tye e,
SVECTOR tyf f)
=> (Int -> a -> b -> c -> d -> e -> f)
-> Vector tya a -> Vector tyb b -> Vector tyc c -> Vector tyd d -> Vector tye e
-> Vector tyf f
{-# INLINE izipWith5 #-}
#if MIN_VERSION_vector(0,11,0)
izipWith5 :: forall (tya :: SEXPTYPE) a (tyb :: SEXPTYPE) b (tyc :: SEXPTYPE) c
(tyd :: SEXPTYPE) d (tye :: SEXPTYPE) e (tyf :: SEXPTYPE) f.
(SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c, SVECTOR tyd d,
SVECTOR tye e, SVECTOR tyf f) =>
(Int -> a -> b -> c -> d -> e -> f)
-> Vector tya a
-> Vector tyb b
-> Vector tyc c
-> Vector tyd d
-> Vector tye e
-> Vector tyf f
izipWith5 Int -> a -> b -> c -> d -> e -> f
f Vector tya a
as Vector tyb b
bs Vector tyc c
cs Vector tyd d
ds Vector tye e
es = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p ->
let as' :: Bundle (W t tya) a
as' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tya a
as)
bs' :: Bundle (W t tyb) b
bs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyb b
bs)
cs' :: Bundle (W t tyc) c
cs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyc c
cs)
ds' :: Bundle (W t tyd) d
ds' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyd d
ds)
es' :: Bundle (W t tye) e
es' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tye e
es)
sz :: Size
sz = [Size] -> Size
smallest [ forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tya) a
as', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyb) b
bs', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyc) c
cs', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyd) d
ds', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tye) e
es']
in forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. Vector v a => Bundle v a -> v a
G.unstream forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a (v :: * -> *).
Monad m =>
Stream m a -> Size -> Bundle m v a
Bundle.fromStream (forall (m :: * -> *) a b c d e f.
Monad m =>
(a -> b -> c -> d -> e -> f)
-> Stream m a
-> Stream m b
-> Stream m c
-> Stream m d
-> Stream m e
-> Stream m f
Stream.zipWith5 (forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry Int -> a -> b -> c -> d -> e -> f
f) (forall (m :: * -> *) a. Monad m => Stream m a -> Stream m (Int, a)
Stream.indexed (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tya) a
as')) (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyb) b
bs') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyc) c
cs') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyd) d
ds') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tye) e
es')) Size
sz) Proxy t
p
#else
izipWith5 f as bs cs ds es = phony $ \p ->
proxyW (G.unstream (Stream.zipWith5 (uncurry f) (Stream.indexed (G.stream (withW p as))) (G.stream (withW p bs)) (G.stream (withW p cs)) (G.stream (withW p ds)) (G.stream (withW p es)))) p
#endif
izipWith6 :: (SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c, SVECTOR tyd d, SVECTOR tye e,
SVECTOR tyf f, SVECTOR tyg g)
=> (Int -> a -> b -> c -> d -> e -> f -> g)
-> Vector tya a -> Vector tyb b -> Vector tyc c -> Vector tyd d -> Vector tye e
-> Vector tyf f -> Vector tyg g
{-# INLINE izipWith6 #-}
#if MIN_VERSION_vector(0,11,0)
izipWith6 :: forall (tya :: SEXPTYPE) a (tyb :: SEXPTYPE) b (tyc :: SEXPTYPE) c
(tyd :: SEXPTYPE) d (tye :: SEXPTYPE) e (tyf :: SEXPTYPE) f
(tyg :: SEXPTYPE) g.
(SVECTOR tya a, SVECTOR tyb b, SVECTOR tyc c, SVECTOR tyd d,
SVECTOR tye e, SVECTOR tyf f, SVECTOR tyg g) =>
(Int -> a -> b -> c -> d -> e -> f -> g)
-> Vector tya a
-> Vector tyb b
-> Vector tyc c
-> Vector tyd d
-> Vector tye e
-> Vector tyf f
-> Vector tyg g
izipWith6 Int -> a -> b -> c -> d -> e -> f -> g
f Vector tya a
as Vector tyb b
bs Vector tyc c
cs Vector tyd d
ds Vector tye e
es Vector tyf f
fs = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p ->
let as' :: Bundle (W t tya) a
as' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tya a
as)
bs' :: Bundle (W t tyb) b
bs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyb b
bs)
cs' :: Bundle (W t tyc) c
cs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyc c
cs)
ds' :: Bundle (W t tyd) d
ds' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyd d
ds)
es' :: Bundle (W t tye) e
es' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tye e
es)
fs' :: Bundle (W t tyf) f
fs' = forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyf f
fs)
sz :: Size
sz = [Size] -> Size
smallest [ forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tya) a
as', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyb) b
bs', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyc) c
cs', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyd) d
ds', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tye) e
es', forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle (W t tyf) f
fs']
in forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. Vector v a => Bundle v a -> v a
G.unstream forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a (v :: * -> *).
Monad m =>
Stream m a -> Size -> Bundle m v a
Bundle.fromStream (forall (m :: * -> *) a b c d e f g.
Monad m =>
(a -> b -> c -> d -> e -> f -> g)
-> Stream m a
-> Stream m b
-> Stream m c
-> Stream m d
-> Stream m e
-> Stream m f
-> Stream m g
Stream.zipWith6 (forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry Int -> a -> b -> c -> d -> e -> f -> g
f) (forall (m :: * -> *) a. Monad m => Stream m a -> Stream m (Int, a)
Stream.indexed (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tya) a
as')) (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyb) b
bs') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyc) c
cs') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyd) d
ds') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tye) e
es') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle (W t tyf) f
fs')) Size
sz) Proxy t
p
#else
izipWith6 f as bs cs ds es fs = phony $ \p ->
proxyW (G.unstream (Stream.zipWith6 (uncurry f) (Stream.indexed (G.stream (withW p as))) (G.stream (withW p bs)) (G.stream (withW p cs)) (G.stream (withW p ds)) (G.stream (withW p es)) (G.stream (withW p fs)))) p
#endif
zipWithM :: (MonadR m, VECTOR (Region m) tya a, VECTOR (Region m) tyb b, VECTOR (Region m) tyc c, ElemRep V tya ~ a, ElemRep V tyb ~ b, ElemRep V tyc ~ c)
=> (a -> b -> m c)
-> Vector tya a
-> Vector tyb b
-> m (Vector tyc c)
{-# INLINE zipWithM #-}
#if MIN_VERSION_vector(0,11,0)
zipWithM :: forall (m :: * -> *) (tya :: SEXPTYPE) a (tyb :: SEXPTYPE) b
(tyc :: SEXPTYPE) c.
(MonadR m, VECTOR (Region m) tya a, VECTOR (Region m) tyb b,
VECTOR (Region m) tyc c, ElemRep V tya ~ a, ElemRep V tyb ~ b,
ElemRep V tyc ~ c) =>
(a -> b -> m c) -> Vector tya a -> Vector tyb b -> m (Vector tyc c)
zipWithM a -> b -> m c
f Vector tya a
xs Vector tyb b
ys = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p ->
let xs' :: Bundle m (W t tya) a
xs' = forall (m :: * -> *) (v :: * -> *) a.
Monad m =>
Bundle Id v a -> Bundle m v a
lift forall a b. (a -> b) -> a -> b
$ forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tya a
xs)
ys' :: Bundle m (W t tyb) b
ys' = forall (m :: * -> *) (v :: * -> *) a.
Monad m =>
Bundle Id v a -> Bundle m v a
lift forall a b. (a -> b) -> a -> b
$ forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyb b
ys)
sz :: Size
sz = Size -> Size -> Size
smaller (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle m (W t tya) a
xs') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Size
sSize Bundle m (W t tyb) b
ys')
in forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.fmap forall (v :: * -> *) a. Vector v a => Bundle v a -> v a
G.unstream (forall (m :: * -> *) a (v :: * -> *).
Monad m =>
Size -> [a] -> Bundle m v a
Bundle.unsafeFromList Size
sz forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *) a. Monad m => Stream m a -> m [a]
Stream.toList (forall (m :: * -> *) a b c.
Monad m =>
(a -> b -> m c) -> Stream m a -> Stream m b -> Stream m c
Stream.zipWithM a -> b -> m c
f (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle m (W t tya) a
xs') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle m (W t tyb) b
ys')))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> forall (f :: * -> *) a. Applicative f => a -> f a
pure Proxy t
p
#else
zipWithM f xs ys = phony $ \p ->
proxyW <$>
unstreamM (Stream.zipWithM f (G.stream (withW p xs)) (G.stream (withW p ys))) <*>
return p
where
unstreamM s = do
zs <- MStream.toList s
return $ G.unstream $ Stream.unsafeFromList (MStream.size s) zs
#endif
zipWithM_ :: (Monad m, SVECTOR tya a, SVECTOR tyb b)
=> (a -> b -> m c)
-> Vector tya a
-> Vector tyb b
-> m ()
{-# INLINE zipWithM_ #-}
#if MIN_VERSION_vector(0,11,0)
zipWithM_ :: forall (m :: * -> *) (tya :: SEXPTYPE) a (tyb :: SEXPTYPE) b c.
(Monad m, SVECTOR tya a, SVECTOR tyb b) =>
(a -> b -> m c) -> Vector tya a -> Vector tyb b -> m ()
zipWithM_ a -> b -> m c
f Vector tya a
xs Vector tyb b
ys = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p ->
let xs' :: Bundle m (W t tya) a
xs' = forall (m :: * -> *) (v :: * -> *) a.
Monad m =>
Bundle Id v a -> Bundle m v a
lift forall a b. (a -> b) -> a -> b
$ forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tya a
xs)
ys' :: Bundle m (W t tyb) b
ys' = forall (m :: * -> *) (v :: * -> *) a.
Monad m =>
Bundle Id v a -> Bundle m v a
lift forall a b. (a -> b) -> a -> b
$ forall (v :: * -> *) a. Vector v a => v a -> Bundle v a
G.stream (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector tyb b
ys)
in forall (m :: * -> *) a b c.
Monad m =>
(a -> b -> m c) -> Stream m a -> Stream m b -> m ()
Stream.zipWithM_ a -> b -> m c
f (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle m (W t tya) a
xs') (forall (m :: * -> *) (v :: * -> *) a. Bundle m v a -> Stream m a
sElems Bundle m (W t tyb) b
ys')
#else
zipWithM_ f xs ys = phony $ \p ->
Stream.zipWithM_ f (G.stream (withW p xs)) (G.stream (withW p ys))
#endif
filter :: SVECTOR ty a => (a -> Bool) -> Vector ty a -> Vector ty a
{-# INLINE filter #-}
filter :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> Bool) -> Vector ty a -> Vector ty a
filter a -> Bool
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => (a -> Bool) -> v a -> v a
G.filter a -> Bool
f) Vector ty a
v
ifilter :: SVECTOR ty a => (Int -> a -> Bool) -> Vector ty a -> Vector ty a
{-# INLINE ifilter #-}
ifilter :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(Int -> a -> Bool) -> Vector ty a -> Vector ty a
ifilter Int -> a -> Bool
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a.
Vector v a =>
(Int -> a -> Bool) -> v a -> v a
G.ifilter Int -> a -> Bool
f) Vector ty a
v
filterM :: (Monad m, SVECTOR ty a) => (a -> m Bool) -> Vector ty a -> m (Vector ty a)
{-# INLINE filterM #-}
filterM :: forall (m :: * -> *) (ty :: SEXPTYPE) a.
(Monad m, SVECTOR ty a) =>
(a -> m Bool) -> Vector ty a -> m (Vector ty a)
filterM a -> m Bool
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p -> forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (m :: * -> *) (v :: * -> *) a.
(Monad m, Vector v a) =>
(a -> m Bool) -> v a -> m (v a)
G.filterM a -> m Bool
f) Vector ty a
v Proxy t
p
takeWhile :: SVECTOR ty a => (a -> Bool) -> Vector ty a -> Vector ty a
{-# INLINE takeWhile #-}
takeWhile :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> Bool) -> Vector ty a -> Vector ty a
takeWhile a -> Bool
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => (a -> Bool) -> v a -> v a
G.takeWhile a -> Bool
f) Vector ty a
v
dropWhile :: SVECTOR ty a => (a -> Bool) -> Vector ty a -> Vector ty a
{-# INLINE dropWhile #-}
dropWhile :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> Bool) -> Vector ty a -> Vector ty a
dropWhile a -> Bool
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => (a -> Bool) -> v a -> v a
G.dropWhile a -> Bool
f) Vector ty a
v
partition :: SVECTOR ty a => (a -> Bool) -> Vector ty a -> (Vector ty a, Vector ty a)
{-# INLINE partition #-}
partition :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> Bool) -> Vector ty a -> (Vector ty a, Vector ty a)
partition a -> Bool
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ (\(W t ty a
a,W t ty a
b) -> (forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW W t ty a
a, forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW W t ty a
b)) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a.
Vector v a =>
(a -> Bool) -> v a -> (v a, v a)
G.partition a -> Bool
f) Vector ty a
v
unstablePartition :: SVECTOR ty a => (a -> Bool) -> Vector ty a -> (Vector ty a, Vector ty a)
{-# INLINE unstablePartition #-}
unstablePartition :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> Bool) -> Vector ty a -> (Vector ty a, Vector ty a)
unstablePartition a -> Bool
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ (\(W t ty a
a,W t ty a
b) -> (forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW W t ty a
a, forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW W t ty a
b)) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a.
Vector v a =>
(a -> Bool) -> v a -> (v a, v a)
G.unstablePartition a -> Bool
f) Vector ty a
v
span :: SVECTOR ty a => (a -> Bool) -> Vector ty a -> (Vector ty a, Vector ty a)
{-# INLINE span #-}
span :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> Bool) -> Vector ty a -> (Vector ty a, Vector ty a)
span a -> Bool
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ (\(W t ty a
a,W t ty a
b) -> (forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW W t ty a
a, forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW W t ty a
b)) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a.
Vector v a =>
(a -> Bool) -> v a -> (v a, v a)
G.span a -> Bool
f) Vector ty a
v
break :: SVECTOR ty a => (a -> Bool) -> Vector ty a -> (Vector ty a, Vector ty a)
{-# INLINE break #-}
break :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> Bool) -> Vector ty a -> (Vector ty a, Vector ty a)
break a -> Bool
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ (\(W t ty a
a,W t ty a
b) -> (forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW W t ty a
a, forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW W t ty a
b)) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a.
Vector v a =>
(a -> Bool) -> v a -> (v a, v a)
G.break a -> Bool
f) Vector ty a
v
infix 4 `elem`
elem :: (SVECTOR ty a, Eq a) => a -> Vector ty a -> Bool
{-# INLINE elem #-}
elem :: forall (ty :: SEXPTYPE) a.
(SVECTOR ty a, Eq a) =>
a -> Vector ty a -> Bool
elem a
a Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. (Vector v a, Eq a) => a -> v a -> Bool
G.elem a
a) Vector ty a
v
infix 4 `notElem`
notElem :: (SVECTOR ty a, Eq a) => a -> Vector ty a -> Bool
{-# INLINE notElem #-}
notElem :: forall (ty :: SEXPTYPE) a.
(SVECTOR ty a, Eq a) =>
a -> Vector ty a -> Bool
notElem a
a Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. (Vector v a, Eq a) => a -> v a -> Bool
G.notElem a
a) Vector ty a
v
find :: SVECTOR ty a => (a -> Bool) -> Vector ty a -> Maybe a
{-# INLINE find #-}
find :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> Bool) -> Vector ty a -> Maybe a
find a -> Bool
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => (a -> Bool) -> v a -> Maybe a
G.find a -> Bool
f) Vector ty a
v
findIndex :: SVECTOR ty a => (a -> Bool) -> Vector ty a -> Maybe Int
{-# INLINE findIndex #-}
findIndex :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> Bool) -> Vector ty a -> Maybe Int
findIndex a -> Bool
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a.
Vector v a =>
(a -> Bool) -> v a -> Maybe Int
G.findIndex a -> Bool
f) Vector ty a
v
elemIndex :: (SVECTOR ty a, Eq a) => a -> Vector ty a -> Maybe Int
{-# INLINE elemIndex #-}
elemIndex :: forall (ty :: SEXPTYPE) a.
(SVECTOR ty a, Eq a) =>
a -> Vector ty a -> Maybe Int
elemIndex a
a Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. (Vector v a, Eq a) => a -> v a -> Maybe Int
G.elemIndex a
a) Vector ty a
v
foldl :: SVECTOR ty b => (a -> b -> a) -> a -> Vector ty b -> a
{-# INLINE foldl #-}
foldl :: forall (ty :: SEXPTYPE) b a.
SVECTOR ty b =>
(a -> b -> a) -> a -> Vector ty b -> a
foldl a -> b -> a
f a
s Vector ty b
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) b a.
Vector v b =>
(a -> b -> a) -> a -> v b -> a
G.foldl a -> b -> a
f a
s) Vector ty b
v
foldl1 :: SVECTOR ty a => (a -> a -> a) -> Vector ty a -> a
{-# INLINE foldl1 #-}
foldl1 :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> a -> a) -> Vector ty a -> a
foldl1 a -> a -> a
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => (a -> a -> a) -> v a -> a
G.foldl1 a -> a -> a
f) Vector ty a
v
foldl' :: SVECTOR ty b => (a -> b -> a) -> a -> Vector ty b -> a
{-# INLINE foldl' #-}
foldl' :: forall (ty :: SEXPTYPE) b a.
SVECTOR ty b =>
(a -> b -> a) -> a -> Vector ty b -> a
foldl' a -> b -> a
f a
s Vector ty b
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) b a.
Vector v b =>
(a -> b -> a) -> a -> v b -> a
G.foldl' a -> b -> a
f a
s) Vector ty b
v
foldl1' :: SVECTOR ty a => (a -> a -> a) -> Vector ty a -> a
{-# INLINE foldl1' #-}
foldl1' :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> a -> a) -> Vector ty a -> a
foldl1' a -> a -> a
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => (a -> a -> a) -> v a -> a
G.foldl1' a -> a -> a
f) Vector ty a
v
foldr :: SVECTOR ty a => (a -> b -> b) -> b -> Vector ty a -> b
{-# INLINE foldr #-}
foldr :: forall (ty :: SEXPTYPE) a b.
SVECTOR ty a =>
(a -> b -> b) -> b -> Vector ty a -> b
foldr a -> b -> b
f b
s Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a b.
Vector v a =>
(a -> b -> b) -> b -> v a -> b
G.foldr a -> b -> b
f b
s) Vector ty a
v
foldr1 :: SVECTOR ty a => (a -> a -> a) -> Vector ty a -> a
{-# INLINE foldr1 #-}
foldr1 :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> a -> a) -> Vector ty a -> a
foldr1 a -> a -> a
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => (a -> a -> a) -> v a -> a
G.foldr1 a -> a -> a
f) Vector ty a
v
foldr' :: SVECTOR ty a => (a -> b -> b) -> b -> Vector ty a -> b
{-# INLINE foldr' #-}
foldr' :: forall (ty :: SEXPTYPE) a b.
SVECTOR ty a =>
(a -> b -> b) -> b -> Vector ty a -> b
foldr' a -> b -> b
f b
s Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a b.
Vector v a =>
(a -> b -> b) -> b -> v a -> b
G.foldr' a -> b -> b
f b
s) Vector ty a
v
foldr1' :: SVECTOR ty a => (a -> a -> a) -> Vector ty a -> a
{-# INLINE foldr1' #-}
foldr1' :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> a -> a) -> Vector ty a -> a
foldr1' a -> a -> a
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => (a -> a -> a) -> v a -> a
G.foldr1' a -> a -> a
f) Vector ty a
v
ifoldl :: SVECTOR ty b => (a -> Int -> b -> a) -> a -> Vector ty b -> a
{-# INLINE ifoldl #-}
ifoldl :: forall (ty :: SEXPTYPE) b a.
SVECTOR ty b =>
(a -> Int -> b -> a) -> a -> Vector ty b -> a
ifoldl a -> Int -> b -> a
f a
s Vector ty b
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) b a.
Vector v b =>
(a -> Int -> b -> a) -> a -> v b -> a
G.ifoldl a -> Int -> b -> a
f a
s) Vector ty b
v
ifoldl' :: SVECTOR ty b => (a -> Int -> b -> a) -> a -> Vector ty b -> a
{-# INLINE ifoldl' #-}
ifoldl' :: forall (ty :: SEXPTYPE) b a.
SVECTOR ty b =>
(a -> Int -> b -> a) -> a -> Vector ty b -> a
ifoldl' a -> Int -> b -> a
f a
s Vector ty b
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) b a.
Vector v b =>
(a -> Int -> b -> a) -> a -> v b -> a
G.ifoldl' a -> Int -> b -> a
f a
s) Vector ty b
v
ifoldr :: SVECTOR ty a => (Int -> a -> b -> b) -> b -> Vector ty a -> b
{-# INLINE ifoldr #-}
ifoldr :: forall (ty :: SEXPTYPE) a b.
SVECTOR ty a =>
(Int -> a -> b -> b) -> b -> Vector ty a -> b
ifoldr Int -> a -> b -> b
f b
s Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a b.
Vector v a =>
(Int -> a -> b -> b) -> b -> v a -> b
G.ifoldr Int -> a -> b -> b
f b
s) Vector ty a
v
ifoldr' :: SVECTOR ty a => (Int -> a -> b -> b) -> b -> Vector ty a -> b
{-# INLINE ifoldr' #-}
ifoldr' :: forall (ty :: SEXPTYPE) a b.
SVECTOR ty a =>
(Int -> a -> b -> b) -> b -> Vector ty a -> b
ifoldr' Int -> a -> b -> b
f b
s Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a b.
Vector v a =>
(Int -> a -> b -> b) -> b -> v a -> b
G.ifoldr' Int -> a -> b -> b
f b
s) Vector ty a
v
all :: SVECTOR ty a => (a -> Bool) -> Vector ty a -> Bool
{-# INLINE all #-}
all :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> Bool) -> Vector ty a -> Bool
all a -> Bool
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p -> forall (v :: * -> *) a. Vector v a => (a -> Bool) -> v a -> Bool
G.all a -> Bool
f (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector ty a
v)
any :: SVECTOR ty a => (a -> Bool) -> Vector ty a -> Bool
{-# INLINE any #-}
any :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> Bool) -> Vector ty a -> Bool
any a -> Bool
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ \Proxy t
p -> forall (v :: * -> *) a. Vector v a => (a -> Bool) -> v a -> Bool
G.any a -> Bool
f (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy t
p Vector ty a
v)
sum :: (SVECTOR ty a, Num a) => Vector ty a -> a
{-# INLINE sum #-}
sum :: forall (ty :: SEXPTYPE) a.
(SVECTOR ty a, Num a) =>
Vector ty a -> a
sum Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. (Vector v a, Num a) => v a -> a
G.sum Vector ty a
v
product :: (SVECTOR ty a, Num a) => Vector ty a -> a
{-# INLINE product #-}
product :: forall (ty :: SEXPTYPE) a.
(SVECTOR ty a, Num a) =>
Vector ty a -> a
product Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. (Vector v a, Num a) => v a -> a
G.product Vector ty a
v
maximum :: (SVECTOR ty a, Ord a) => Vector ty a -> a
{-# INLINE maximum #-}
maximum :: forall (ty :: SEXPTYPE) a.
(SVECTOR ty a, Ord a) =>
Vector ty a -> a
maximum Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. (Vector v a, Ord a) => v a -> a
G.maximum Vector ty a
v
maximumBy :: SVECTOR ty a => (a -> a -> Ordering) -> Vector ty a -> a
{-# INLINE maximumBy #-}
maximumBy :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> a -> Ordering) -> Vector ty a -> a
maximumBy a -> a -> Ordering
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a.
Vector v a =>
(a -> a -> Ordering) -> v a -> a
G.maximumBy a -> a -> Ordering
f) Vector ty a
v
minimum :: (SVECTOR ty a, Ord a) => Vector ty a -> a
{-# INLINE minimum #-}
minimum :: forall (ty :: SEXPTYPE) a.
(SVECTOR ty a, Ord a) =>
Vector ty a -> a
minimum Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. (Vector v a, Ord a) => v a -> a
G.minimum Vector ty a
v
minimumBy :: SVECTOR ty a => (a -> a -> Ordering) -> Vector ty a -> a
{-# INLINE minimumBy #-}
minimumBy :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> a -> Ordering) -> Vector ty a -> a
minimumBy a -> a -> Ordering
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a.
Vector v a =>
(a -> a -> Ordering) -> v a -> a
G.minimumBy a -> a -> Ordering
f) Vector ty a
v
maxIndex :: (SVECTOR ty a, Ord a) => Vector ty a -> Int
{-# INLINE maxIndex #-}
maxIndex :: forall (ty :: SEXPTYPE) a.
(SVECTOR ty a, Ord a) =>
Vector ty a -> Int
maxIndex Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. (Vector v a, Ord a) => v a -> Int
G.maxIndex Vector ty a
v
maxIndexBy :: SVECTOR ty a => (a -> a -> Ordering) -> Vector ty a -> Int
{-# INLINE maxIndexBy #-}
maxIndexBy :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> a -> Ordering) -> Vector ty a -> Int
maxIndexBy a -> a -> Ordering
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a.
Vector v a =>
(a -> a -> Ordering) -> v a -> Int
G.maxIndexBy a -> a -> Ordering
f) Vector ty a
v
minIndex :: (SVECTOR ty a, Ord a) => Vector ty a -> Int
{-# INLINE minIndex #-}
minIndex :: forall (ty :: SEXPTYPE) a.
(SVECTOR ty a, Ord a) =>
Vector ty a -> Int
minIndex Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. (Vector v a, Ord a) => v a -> Int
G.minIndex Vector ty a
v
minIndexBy :: SVECTOR ty a => (a -> a -> Ordering) -> Vector ty a -> Int
{-# INLINE minIndexBy #-}
minIndexBy :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> a -> Ordering) -> Vector ty a -> Int
minIndexBy a -> a -> Ordering
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a.
Vector v a =>
(a -> a -> Ordering) -> v a -> Int
G.minIndexBy a -> a -> Ordering
f) Vector ty a
v
foldM :: (Monad m, SVECTOR ty b) => (a -> b -> m a) -> a -> Vector ty b -> m a
{-# INLINE foldM #-}
foldM :: forall (m :: * -> *) (ty :: SEXPTYPE) b a.
(Monad m, SVECTOR ty b) =>
(a -> b -> m a) -> a -> Vector ty b -> m a
foldM a -> b -> m a
f a
s Vector ty b
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (m :: * -> *) (v :: * -> *) b a.
(Monad m, Vector v b) =>
(a -> b -> m a) -> a -> v b -> m a
G.foldM a -> b -> m a
f a
s) Vector ty b
v
fold1M :: (Monad m, SVECTOR ty a) => (a -> a -> m a) -> Vector ty a -> m a
{-# INLINE fold1M #-}
fold1M :: forall (m :: * -> *) (ty :: SEXPTYPE) a.
(Monad m, SVECTOR ty a) =>
(a -> a -> m a) -> Vector ty a -> m a
fold1M a -> a -> m a
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (m :: * -> *) (v :: * -> *) a.
(Monad m, Vector v a) =>
(a -> a -> m a) -> v a -> m a
G.fold1M a -> a -> m a
f) Vector ty a
v
foldM' :: (Monad m, SVECTOR ty b) => (a -> b -> m a) -> a -> Vector ty b -> m a
{-# INLINE foldM' #-}
foldM' :: forall (m :: * -> *) (ty :: SEXPTYPE) b a.
(Monad m, SVECTOR ty b) =>
(a -> b -> m a) -> a -> Vector ty b -> m a
foldM' a -> b -> m a
f a
s Vector ty b
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (m :: * -> *) (v :: * -> *) b a.
(Monad m, Vector v b) =>
(a -> b -> m a) -> a -> v b -> m a
G.foldM' a -> b -> m a
f a
s) Vector ty b
v
fold1M' :: (Monad m, SVECTOR ty a) => (a -> a -> m a) -> Vector ty a -> m a
{-# INLINE fold1M' #-}
fold1M' :: forall (m :: * -> *) (ty :: SEXPTYPE) a.
(Monad m, SVECTOR ty a) =>
(a -> a -> m a) -> Vector ty a -> m a
fold1M' a -> a -> m a
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (m :: * -> *) (v :: * -> *) a.
(Monad m, Vector v a) =>
(a -> a -> m a) -> v a -> m a
G.fold1M' a -> a -> m a
f) Vector ty a
v
foldM_ :: (Monad m, SVECTOR ty b) => (a -> b -> m a) -> a -> Vector ty b -> m ()
{-# INLINE foldM_ #-}
foldM_ :: forall (m :: * -> *) (ty :: SEXPTYPE) b a.
(Monad m, SVECTOR ty b) =>
(a -> b -> m a) -> a -> Vector ty b -> m ()
foldM_ a -> b -> m a
f a
s Vector ty b
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (m :: * -> *) (v :: * -> *) b a.
(Monad m, Vector v b) =>
(a -> b -> m a) -> a -> v b -> m ()
G.foldM_ a -> b -> m a
f a
s) Vector ty b
v
fold1M_ :: (Monad m, SVECTOR ty a) => (a -> a -> m a) -> Vector ty a -> m ()
{-# INLINE fold1M_ #-}
fold1M_ :: forall (m :: * -> *) (ty :: SEXPTYPE) a.
(Monad m, SVECTOR ty a) =>
(a -> a -> m a) -> Vector ty a -> m ()
fold1M_ a -> a -> m a
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (m :: * -> *) (v :: * -> *) a.
(Monad m, Vector v a) =>
(a -> a -> m a) -> v a -> m ()
G.fold1M_ a -> a -> m a
f) Vector ty a
v
foldM'_ :: (Monad m, SVECTOR ty b) => (a -> b -> m a) -> a -> Vector ty b -> m ()
{-# INLINE foldM'_ #-}
foldM'_ :: forall (m :: * -> *) (ty :: SEXPTYPE) b a.
(Monad m, SVECTOR ty b) =>
(a -> b -> m a) -> a -> Vector ty b -> m ()
foldM'_ a -> b -> m a
f a
s Vector ty b
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (m :: * -> *) (v :: * -> *) b a.
(Monad m, Vector v b) =>
(a -> b -> m a) -> a -> v b -> m ()
G.foldM'_ a -> b -> m a
f a
s) Vector ty b
v
fold1M'_ :: (Monad m, SVECTOR ty a) => (a -> a -> m a) -> Vector ty a -> m ()
{-# INLINE fold1M'_ #-}
fold1M'_ :: forall (m :: * -> *) (ty :: SEXPTYPE) a.
(Monad m, SVECTOR ty a) =>
(a -> a -> m a) -> Vector ty a -> m ()
fold1M'_ a -> a -> m a
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (m :: * -> *) (v :: * -> *) a.
(Monad m, Vector v a) =>
(a -> a -> m a) -> v a -> m ()
G.fold1M'_ a -> a -> m a
f) Vector ty a
v
prescanl :: (SVECTOR ty a, SVECTOR ty b) => (a -> b -> a) -> a -> Vector ty b -> Vector ty a
{-# INLINE prescanl #-}
prescanl :: forall (ty :: SEXPTYPE) a b.
(SVECTOR ty a, SVECTOR ty b) =>
(a -> b -> a) -> a -> Vector ty b -> Vector ty a
prescanl a -> b -> a
f a
s Vector ty b
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> a) -> a -> v b -> v a
G.prescanl a -> b -> a
f a
s) Vector ty b
v
prescanl' :: (SVECTOR ty a, SVECTOR ty b) => (a -> b -> a) -> a -> Vector ty b -> Vector ty a
{-# INLINE prescanl' #-}
prescanl' :: forall (ty :: SEXPTYPE) a b.
(SVECTOR ty a, SVECTOR ty b) =>
(a -> b -> a) -> a -> Vector ty b -> Vector ty a
prescanl' a -> b -> a
f a
s Vector ty b
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> a) -> a -> v b -> v a
G.prescanl' a -> b -> a
f a
s) Vector ty b
v
postscanl :: (SVECTOR ty a, SVECTOR ty b) => (a -> b -> a) -> a -> Vector ty b -> Vector ty a
{-# INLINE postscanl #-}
postscanl :: forall (ty :: SEXPTYPE) a b.
(SVECTOR ty a, SVECTOR ty b) =>
(a -> b -> a) -> a -> Vector ty b -> Vector ty a
postscanl a -> b -> a
f a
s Vector ty b
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> a) -> a -> v b -> v a
G.postscanl a -> b -> a
f a
s) Vector ty b
v
postscanl' :: (SVECTOR ty a, SVECTOR ty b) => (a -> b -> a) -> a -> Vector ty b -> Vector ty a
{-# INLINE postscanl' #-}
postscanl' :: forall (ty :: SEXPTYPE) a b.
(SVECTOR ty a, SVECTOR ty b) =>
(a -> b -> a) -> a -> Vector ty b -> Vector ty a
postscanl' a -> b -> a
f a
s Vector ty b
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> a) -> a -> v b -> v a
G.postscanl' a -> b -> a
f a
s) Vector ty b
v
scanl :: (SVECTOR ty a, SVECTOR ty b) => (a -> b -> a) -> a -> Vector ty b -> Vector ty a
{-# INLINE scanl #-}
scanl :: forall (ty :: SEXPTYPE) a b.
(SVECTOR ty a, SVECTOR ty b) =>
(a -> b -> a) -> a -> Vector ty b -> Vector ty a
scanl a -> b -> a
f a
s Vector ty b
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> a) -> a -> v b -> v a
G.scanl a -> b -> a
f a
s) Vector ty b
v
scanl' :: (SVECTOR ty a, SVECTOR ty b) => (a -> b -> a) -> a -> Vector ty b -> Vector ty a
{-# INLINE scanl' #-}
scanl' :: forall (ty :: SEXPTYPE) a b.
(SVECTOR ty a, SVECTOR ty b) =>
(a -> b -> a) -> a -> Vector ty b -> Vector ty a
scanl' a -> b -> a
f a
s Vector ty b
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> a) -> a -> v b -> v a
G.scanl' a -> b -> a
f a
s) Vector ty b
v
scanl1 :: SVECTOR ty a => (a -> a -> a) -> Vector ty a -> Vector ty a
{-# INLINE scanl1 #-}
scanl1 :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> a -> a) -> Vector ty a -> Vector ty a
scanl1 a -> a -> a
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => (a -> a -> a) -> v a -> v a
G.scanl1 a -> a -> a
f) Vector ty a
v
scanl1' :: SVECTOR ty a => (a -> a -> a) -> Vector ty a -> Vector ty a
{-# INLINE scanl1' #-}
scanl1' :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> a -> a) -> Vector ty a -> Vector ty a
scanl1' a -> a -> a
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => (a -> a -> a) -> v a -> v a
G.scanl1' a -> a -> a
f) Vector ty a
v
prescanr :: (SVECTOR ty a, SVECTOR ty b) => (a -> b -> b) -> b -> Vector ty a -> Vector ty b
{-# INLINE prescanr #-}
prescanr :: forall (ty :: SEXPTYPE) a b.
(SVECTOR ty a, SVECTOR ty b) =>
(a -> b -> b) -> b -> Vector ty a -> Vector ty b
prescanr a -> b -> b
f b
s Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> b) -> b -> v a -> v b
G.prescanr a -> b -> b
f b
s) Vector ty a
v
prescanr' :: (SVECTOR ty a, SVECTOR ty b) => (a -> b -> b) -> b -> Vector ty a -> Vector ty b
{-# INLINE prescanr' #-}
prescanr' :: forall (ty :: SEXPTYPE) a b.
(SVECTOR ty a, SVECTOR ty b) =>
(a -> b -> b) -> b -> Vector ty a -> Vector ty b
prescanr' a -> b -> b
f b
s Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> b) -> b -> v a -> v b
G.prescanr' a -> b -> b
f b
s) Vector ty a
v
postscanr :: (SVECTOR ty a, SVECTOR ty b) => (a -> b -> b) -> b -> Vector ty a -> Vector ty b
{-# INLINE postscanr #-}
postscanr :: forall (ty :: SEXPTYPE) a b.
(SVECTOR ty a, SVECTOR ty b) =>
(a -> b -> b) -> b -> Vector ty a -> Vector ty b
postscanr a -> b -> b
f b
s Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> b) -> b -> v a -> v b
G.postscanr a -> b -> b
f b
s) Vector ty a
v
postscanr' :: (SVECTOR ty a, SVECTOR ty b) => (a -> b -> b) -> b -> Vector ty a -> Vector ty b
{-# INLINE postscanr' #-}
postscanr' :: forall (ty :: SEXPTYPE) a b.
(SVECTOR ty a, SVECTOR ty b) =>
(a -> b -> b) -> b -> Vector ty a -> Vector ty b
postscanr' a -> b -> b
f b
s Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> b) -> b -> v a -> v b
G.postscanr' a -> b -> b
f b
s) Vector ty a
v
scanr :: (SVECTOR ty a, SVECTOR ty b) => (a -> b -> b) -> b -> Vector ty a -> Vector ty b
{-# INLINE scanr #-}
scanr :: forall (ty :: SEXPTYPE) a b.
(SVECTOR ty a, SVECTOR ty b) =>
(a -> b -> b) -> b -> Vector ty a -> Vector ty b
scanr a -> b -> b
f b
s Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> b) -> b -> v a -> v b
G.scanr a -> b -> b
f b
s) Vector ty a
v
scanr' :: (SVECTOR ty a, SVECTOR ty b) => (a -> b -> b) -> b -> Vector ty a -> Vector ty b
{-# INLINE scanr' #-}
scanr' :: forall (ty :: SEXPTYPE) a b.
(SVECTOR ty a, SVECTOR ty b) =>
(a -> b -> b) -> b -> Vector ty a -> Vector ty b
scanr' a -> b -> b
f b
s Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a b.
(Vector v a, Vector v b) =>
(a -> b -> b) -> b -> v a -> v b
G.scanr' a -> b -> b
f b
s) Vector ty a
v
scanr1 :: SVECTOR ty a => (a -> a -> a) -> Vector ty a -> Vector ty a
{-# INLINE scanr1 #-}
scanr1 :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> a -> a) -> Vector ty a -> Vector ty a
scanr1 a -> a -> a
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => (a -> a -> a) -> v a -> v a
G.scanr1 a -> a -> a
f) Vector ty a
v
scanr1' :: SVECTOR ty a => (a -> a -> a) -> Vector ty a -> Vector ty a
{-# INLINE scanr1' #-}
scanr1' :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
(a -> a -> a) -> Vector ty a -> Vector ty a
scanr1' a -> a -> a
f Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW (forall (v :: * -> *) a. Vector v a => (a -> a -> a) -> v a -> v a
G.scanr1' a -> a -> a
f) Vector ty a
v
toList :: SVECTOR ty a => Vector ty a -> [a]
{-# INLINE toList #-}
toList :: forall (ty :: SEXPTYPE) a. SVECTOR ty a => Vector ty a -> [a]
toList Vector ty a
v = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a r (p :: * -> *).
(W t ty a -> r) -> Vector ty a -> p t -> r
proxyFW forall (v :: * -> *) a. Vector v a => v a -> [a]
G.toList Vector ty a
v
fromList :: forall ty a . SVECTOR ty a => [a] -> Vector ty a
{-# INLINE fromList #-}
fromList :: forall (ty :: SEXPTYPE) a. SVECTOR ty a => [a] -> Vector ty a
fromList [a]
xs = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. Vector v a => Int -> [a] -> v a
G.fromListN (forall (t :: * -> *) a. Foldable t => t a -> Int
Prelude.length [a]
xs) [a]
xs)
fromListN :: forall ty a . SVECTOR ty a => Int -> [a] -> Vector ty a
{-# INLINE fromListN #-}
fromListN :: forall (ty :: SEXPTYPE) a.
SVECTOR ty a =>
Int -> [a] -> Vector ty a
fromListN Int
i [a]
l = forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall a b. (a -> b) -> a -> b
$ forall t (ty :: SEXPTYPE) a (p :: * -> *).
W t ty a -> p t -> Vector ty a
proxyW (forall (v :: * -> *) a. Vector v a => Int -> [a] -> v a
G.fromListN Int
i [a]
l)
unsafeFreeze :: (VECTOR (Region m) ty a, MonadR m, ElemRep V ty ~ a)
=> MVector (Region m) ty a -> m (Vector ty a)
{-# INLINE unsafeFreeze #-}
unsafeFreeze :: forall (m :: * -> *) (ty :: SEXPTYPE) a.
(VECTOR (Region m) ty a, MonadR m, ElemRep V ty ~ a) =>
MVector (Region m) ty a -> m (Vector ty a)
unsafeFreeze MVector (Region m) ty a
m = forall (m :: * -> *) r.
MonadR m =>
(forall s. Reifies s (AcquireIO (Region m)) => Proxy s -> m r)
-> m r
withAcquire forall a b. (a -> b) -> a -> b
$ \Proxy s
p -> forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
Mutable v (PrimState m) a -> m (v a)
G.unsafeFreeze (forall (proxy :: * -> *) t s (ty :: SEXPTYPE) a.
proxy t -> MVector s ty a -> W t ty s a
Mutable.withW Proxy s
p MVector (Region m) ty a
m)
unsafeThaw :: (MonadR m, VECTOR (Region m) ty a, ElemRep V ty ~ a)
=> Vector ty a -> m (MVector (Region m) ty a)
{-# INLINE unsafeThaw #-}
unsafeThaw :: forall (m :: * -> *) (ty :: SEXPTYPE) a.
(MonadR m, VECTOR (Region m) ty a, ElemRep V ty ~ a) =>
Vector ty a -> m (MVector (Region m) ty a)
unsafeThaw Vector ty a
v = forall (m :: * -> *) r.
MonadR m =>
(forall s. Reifies s (AcquireIO (Region m)) => Proxy s -> m r)
-> m r
withAcquire forall a b. (a -> b) -> a -> b
$ \Proxy s
p -> forall t (ty :: SEXPTYPE) s a. W t ty s a -> MVector s ty a
Mutable.unW forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
v a -> m (Mutable v (PrimState m) a)
G.unsafeThaw (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy s
p Vector ty a
v)
thaw :: (MonadR m, VECTOR (Region m) ty a, ElemRep V ty ~ a)
=> Vector ty a -> m (MVector (Region m) ty a)
{-# INLINE thaw #-}
thaw :: forall (m :: * -> *) (ty :: SEXPTYPE) a.
(MonadR m, VECTOR (Region m) ty a, ElemRep V ty ~ a) =>
Vector ty a -> m (MVector (Region m) ty a)
thaw Vector ty a
v1 = forall (m :: * -> *) r.
MonadR m =>
(forall s. Reifies s (AcquireIO (Region m)) => Proxy s -> m r)
-> m r
withAcquire forall a b. (a -> b) -> a -> b
$ \Proxy s
p -> forall t (ty :: SEXPTYPE) s a. W t ty s a -> MVector s ty a
Mutable.unW forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
v a -> m (Mutable v (PrimState m) a)
G.thaw (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy s
p Vector ty a
v1)
freeze :: (MonadR m, VECTOR (Region m) ty a, ElemRep V ty ~ a)
=> MVector (Region m) ty a -> m (Vector ty a)
{-# INLINE freeze #-}
freeze :: forall (m :: * -> *) (ty :: SEXPTYPE) a.
(MonadR m, VECTOR (Region m) ty a, ElemRep V ty ~ a) =>
MVector (Region m) ty a -> m (Vector ty a)
freeze MVector (Region m) ty a
m1 = forall (m :: * -> *) r.
MonadR m =>
(forall s. Reifies s (AcquireIO (Region m)) => Proxy s -> m r)
-> m r
withAcquire forall a b. (a -> b) -> a -> b
$ \Proxy s
p -> forall t (ty :: SEXPTYPE) a. W t ty a -> Vector ty a
unW forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
Mutable v (PrimState m) a -> m (v a)
G.freeze (forall (proxy :: * -> *) t s (ty :: SEXPTYPE) a.
proxy t -> MVector s ty a -> W t ty s a
Mutable.withW Proxy s
p MVector (Region m) ty a
m1)
unsafeCopy
:: (MonadR m, VECTOR (Region m) ty a, ElemRep V ty ~ a)
=> MVector (Region m) ty a -> Vector ty a -> m ()
{-# INLINE unsafeCopy #-}
unsafeCopy :: forall (m :: * -> *) (ty :: SEXPTYPE) a.
(MonadR m, VECTOR (Region m) ty a, ElemRep V ty ~ a) =>
MVector (Region m) ty a -> Vector ty a -> m ()
unsafeCopy MVector (Region m) ty a
m1 Vector ty a
v2 = forall (m :: * -> *) r.
MonadR m =>
(forall s. Reifies s (AcquireIO (Region m)) => Proxy s -> m r)
-> m r
withAcquire forall a b. (a -> b) -> a -> b
$ \Proxy s
p -> forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
Mutable v (PrimState m) a -> v a -> m ()
G.unsafeCopy (forall (proxy :: * -> *) t s (ty :: SEXPTYPE) a.
proxy t -> MVector s ty a -> W t ty s a
Mutable.withW Proxy s
p MVector (Region m) ty a
m1) (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy s
p Vector ty a
v2)
copy :: (MonadR m, VECTOR (Region m) ty a, ElemRep V ty ~ a)
=> MVector (Region m) ty a -> Vector ty a -> m ()
{-# INLINE copy #-}
copy :: forall (m :: * -> *) (ty :: SEXPTYPE) a.
(MonadR m, VECTOR (Region m) ty a, ElemRep V ty ~ a) =>
MVector (Region m) ty a -> Vector ty a -> m ()
copy MVector (Region m) ty a
m1 Vector ty a
v2 = forall (m :: * -> *) r.
MonadR m =>
(forall s. Reifies s (AcquireIO (Region m)) => Proxy s -> m r)
-> m r
withAcquire forall a b. (a -> b) -> a -> b
$ \Proxy s
p -> forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
Mutable v (PrimState m) a -> v a -> m ()
G.copy (forall (proxy :: * -> *) t s (ty :: SEXPTYPE) a.
proxy t -> MVector s ty a -> W t ty s a
Mutable.withW Proxy s
p MVector (Region m) ty a
m1) (forall (proxy :: * -> *) t (ty :: SEXPTYPE) a.
proxy t -> Vector ty a -> W t ty a
withW Proxy s
p Vector ty a
v2)
phony :: (forall t . Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony :: forall s r.
(forall t. Reifies t (AcquireIO s) => Proxy t -> r) -> r
phony forall t. Reifies t (AcquireIO s) => Proxy t -> r
f = forall a r. a -> (forall s. Reifies s a => Proxy s -> r) -> r
reify (forall s.
(forall (ty :: SEXPTYPE). SEXP V ty -> IO (SEXP s ty))
-> AcquireIO s
AcquireIO forall (ty :: SEXPTYPE) g. SEXP V ty -> IO (SEXP g ty)
acquireIO) forall a b. (a -> b) -> a -> b
$ \Proxy s
p -> forall t. Reifies t (AcquireIO s) => Proxy t -> r
f Proxy s
p
where
acquireIO :: SEXP V ty -> IO (SEXP g ty)
acquireIO :: forall (ty :: SEXPTYPE) g. SEXP V ty -> IO (SEXP g ty)
acquireIO SEXP V ty
x = forall a. IO a -> IO a
mask_ forall a b. (a -> b) -> a -> b
$ do
forall s (a :: SEXPTYPE). SEXP s a -> IO ()
R.preserveObject SEXP V ty
x
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ forall s (a :: SEXPTYPE) r. SEXP s a -> SEXP r a
R.unsafeRelease SEXP V ty
x