rio-0.1.24.0: A standard library for Haskell

Safe Haskell | None
Language | Haskell2010

RIO.Vector.Boxed.Partial

Contents

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

Description

Boxed `Vector` partial functions. Import as:

    import qualified RIO.Vector.Boxed.Partial as VB'

Synopsis

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

# Accessors

## Indexing

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

head :: Vector a -> a #

last :: Vector a -> a #

## Monadic indexing

indexM :: Monad m => Vector a -> Int -> m a #

headM :: Monad m => Vector a -> m a #

lastM :: Monad m => Vector a -> m a #

## Extracting subvectors

init :: Vector a -> Vector a #

tail :: Vector a -> Vector a #

# Modifying vectors

## Bulk updates

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

update :: Vector a -> Vector (Int, a) -> Vector a #

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

## Accumulations

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

accumulate :: (a -> b -> a) -> Vector a -> Vector (Int, b) -> Vector a #

accumulate_ :: (a -> b -> a) -> Vector a -> Vector Int -> Vector b -> Vector a #

## Permutations

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

# Folding

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

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

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

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

## Specialised folds

maximum :: Ord a => Vector a -> a #

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

minimum :: Ord a => Vector a -> a #

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

minIndex :: Ord a => Vector a -> Int #

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

maxIndex :: Ord a => Vector a -> Int #

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

## Monadic folds

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

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

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

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

# Prefix sums (scans)

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

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

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

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