rio-0.1.22.0: A standard library for Haskell

Safe Haskell | None
Language | Haskell2010

RIO.Vector.Boxed.Unsafe

Contents

- Accessors
  - Indexing
  - Monadic indexing
  - Extracting subvectors
- Modifying vectors
  - Bulk updates
  - Accumulations
  - Permutations
- Conversions
  - Mutable vectors

Description

Boxed `Vector` unsafe functions. These perform no bounds checking, and may cause segmentation faults etc.! Import as:

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

Synopsis

- unsafeIndex :: Vector a -> Int -> a
- unsafeHead :: Vector a -> a
- unsafeLast :: Vector a -> a
- unsafeIndexM :: Monad m => Vector a -> Int -> m a
- unsafeHeadM :: Monad m => Vector a -> m a
- unsafeLastM :: Monad m => Vector a -> m a
- unsafeSlice :: Int -> Int -> Vector a -> Vector a
- unsafeInit :: Vector a -> Vector a
- unsafeTail :: Vector a -> Vector a
- unsafeTake :: Int -> Vector a -> Vector a
- unsafeDrop :: Int -> Vector a -> Vector a
- unsafeUpd :: Vector a -> [(Int, a)] -> Vector a
- unsafeUpdate :: Vector a -> Vector (Int, a) -> Vector a
- unsafeUpdate_ :: Vector a -> Vector Int -> Vector a -> Vector a
- unsafeAccum :: (a -> b -> a) -> Vector a -> [(Int, b)] -> Vector a
- unsafeAccumulate :: (a -> b -> a) -> Vector a -> Vector (Int, b) -> Vector a
- unsafeAccumulate_ :: (a -> b -> a) -> Vector a -> Vector Int -> Vector b -> Vector a
- unsafeBackpermute :: Vector a -> Vector Int -> Vector a
- unsafeFreeze :: PrimMonad m => MVector (PrimState m) a -> m (Vector a)
- unsafeThaw :: PrimMonad m => Vector a -> m (MVector (PrimState m) a)
- unsafeCopy :: PrimMonad m => MVector (PrimState m) a -> Vector a -> m ()

# Accessors

## Indexing

unsafeIndex :: Vector a -> Int -> a #

unsafeHead :: Vector a -> a #

unsafeLast :: Vector a -> a #

## Monadic indexing

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

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

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

## Extracting subvectors

unsafeSlice :: Int -> Int -> Vector a -> Vector a #

unsafeInit :: Vector a -> Vector a #

unsafeTail :: Vector a -> Vector a #

unsafeTake :: Int -> Vector a -> Vector a #

unsafeDrop :: Int -> Vector a -> Vector a #

# Modifying vectors

## Bulk updates

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

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

unsafeUpdate_ :: Vector a -> Vector Int -> Vector a -> Vector a #

## Accumulations

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

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

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

## Permutations

unsafeBackpermute :: Vector a -> Vector Int -> Vector a #

# Conversions

## Mutable vectors

unsafeFreeze :: PrimMonad m => MVector (PrimState m) a -> m (Vector a) #

unsafeThaw :: PrimMonad m => Vector a -> m (MVector (PrimState m) a) #

unsafeCopy :: PrimMonad m => MVector (PrimState m) a -> Vector a -> m () #