rio-0.1.22.0: A standard library for Haskell

Safe Haskell | None
Language | Haskell2010

RIO.Vector.Unboxed.Partial

Contents

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

Description

Unboxed `Vector` partial functions. Import as:

    import qualified RIO.Vector.Unboxed.Partial as VU'

Synopsis

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

# Accessors

## Indexing

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

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

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

## Monadic indexing

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

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

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

## Extracting subvectors

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

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

# Modifying vectors

## Bulk updates

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

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

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

## Accumulations

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

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

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

## Permutations

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

# Folding

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

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

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

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

## Specialised folds

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

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

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

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

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

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

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

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

## Monadic folds

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

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

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

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

# Prefix sums (scans)

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

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

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

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