rio-0.1.22.0: A standard library for Haskell

Safe Haskell | None
Language | Haskell2010

RIO.Vector.Storable.Partial

Contents

- Accessors
  - Indexing
  - Monadic indexing
  - Extracting subvectors
- Modifying vectors
  - Bulk updates
  - Accumulations
  - Permutations
- Folding
  - Specialised folds
  - Monadic folds
- Prefix sums (scans)

Description

Storable `Vector` partial functions. Import as:

    import qualified RIO.Vector.Storable.Partial as VS'

Synopsis

- (!) :: Storable a => Vector a -> Int -> a
- head :: Storable a => Vector a -> a
- last :: Storable a => Vector a -> a
- indexM :: (Storable a, Monad m) => Vector a -> Int -> m a
- headM :: (Storable a, Monad m) => Vector a -> m a
- lastM :: (Storable a, Monad m) => Vector a -> m a
- init :: Storable a => Vector a -> Vector a
- tail :: Storable a => Vector a -> Vector a
- (//) :: Storable a => Vector a -> [(Int, a)] -> Vector a
- update_ :: Storable a => Vector a -> Vector Int -> Vector a -> Vector a
- accum :: Storable a => (a -> b -> a) -> Vector a -> [(Int, b)] -> Vector a
- accumulate_ :: (Storable a, Storable b) => (a -> b -> a) -> Vector a -> Vector Int -> Vector b -> Vector a
- backpermute :: Storable a => Vector a -> Vector Int -> Vector a
- foldl1 :: Storable a => (a -> a -> a) -> Vector a -> a
- foldl1' :: Storable a => (a -> a -> a) -> Vector a -> a
- foldr1 :: Storable a => (a -> a -> a) -> Vector a -> a
- foldr1' :: Storable a => (a -> a -> a) -> Vector a -> a
- maximum :: (Storable a, Ord a) => Vector a -> a
- maximumBy :: Storable a => (a -> a -> Ordering) -> Vector a -> a
- minimum :: (Storable a, Ord a) => Vector a -> a
- minimumBy :: Storable a => (a -> a -> Ordering) -> Vector a -> a
- minIndex :: (Storable a, Ord a) => Vector a -> Int
- minIndexBy :: Storable a => (a -> a -> Ordering) -> Vector a -> Int
- maxIndex :: (Storable a, Ord a) => Vector a -> Int
- maxIndexBy :: Storable a => (a -> a -> Ordering) -> Vector a -> Int
- fold1M :: (Monad m, Storable a) => (a -> a -> m a) -> Vector a -> m a
- fold1M' :: (Monad m, Storable a) => (a -> a -> m a) -> Vector a -> m a
- fold1M_ :: (Monad m, Storable a) => (a -> a -> m a) -> Vector a -> m ()
- fold1M'_ :: (Monad m, Storable a) => (a -> a -> m a) -> Vector a -> m ()
- scanl1 :: Storable a => (a -> a -> a) -> Vector a -> Vector a
- scanl1' :: Storable a => (a -> a -> a) -> Vector a -> Vector a
- scanr1 :: Storable a => (a -> a -> a) -> Vector a -> Vector a
- scanr1' :: Storable a => (a -> a -> a) -> Vector a -> Vector a

# Accessors

## Indexing

(!) :: Storable a => Vector a -> Int -> a #

head :: Storable a => Vector a -> a #

last :: Storable a => Vector a -> a #

## Monadic indexing

indexM :: (Storable a, Monad m) => Vector a -> Int -> m a #

headM :: (Storable a, Monad m) => Vector a -> m a #

lastM :: (Storable a, Monad m) => Vector a -> m a #

## Extracting subvectors

init :: Storable a => Vector a -> Vector a #

tail :: Storable a => Vector a -> Vector a #

# Modifying vectors

## Bulk updates

(//) :: Storable a => Vector a -> [(Int, a)] -> Vector a #

update_ :: Storable a => Vector a -> Vector Int -> Vector a -> Vector a #

## Accumulations

accum :: Storable a => (a -> b -> a) -> Vector a -> [(Int, b)] -> Vector a #

accumulate_ :: (Storable a, Storable b) => (a -> b -> a) -> Vector a -> Vector Int -> Vector b -> Vector a #

## Permutations

backpermute :: Storable a => Vector a -> Vector Int -> Vector a #

# Folding

foldl1 :: Storable a => (a -> a -> a) -> Vector a -> a #

foldl1' :: Storable a => (a -> a -> a) -> Vector a -> a #

foldr1 :: Storable a => (a -> a -> a) -> Vector a -> a #

foldr1' :: Storable a => (a -> a -> a) -> Vector a -> a #

## Specialised folds

maximum :: (Storable a, Ord a) => Vector a -> a #

maximumBy :: Storable a => (a -> a -> Ordering) -> Vector a -> a #

minimum :: (Storable a, Ord a) => Vector a -> a #

minimumBy :: Storable a => (a -> a -> Ordering) -> Vector a -> a #

minIndex :: (Storable a, Ord a) => Vector a -> Int #

minIndexBy :: Storable a => (a -> a -> Ordering) -> Vector a -> Int #

maxIndex :: (Storable a, Ord a) => Vector a -> Int #

maxIndexBy :: Storable a => (a -> a -> Ordering) -> Vector a -> Int #

## Monadic folds

fold1M :: (Monad m, Storable a) => (a -> a -> m a) -> Vector a -> m a #

fold1M' :: (Monad m, Storable a) => (a -> a -> m a) -> Vector a -> m a #

fold1M_ :: (Monad m, Storable a) => (a -> a -> m a) -> Vector a -> m () #

fold1M'_ :: (Monad m, Storable a) => (a -> a -> m a) -> Vector a -> m () #

# Prefix sums (scans)

scanl1 :: Storable a => (a -> a -> a) -> Vector a -> Vector a #

scanl1' :: Storable a => (a -> a -> a) -> Vector a -> Vector a #

scanr1 :: Storable a => (a -> a -> a) -> Vector a -> Vector a #

scanr1' :: Storable a => (a -> a -> a) -> Vector a -> Vector a #