rio-0.1.24.0: A standard library for Haskell

Safe Haskell | None
Language | Haskell2010

RIO.Vector.Unboxed.Unsafe

Contents

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

Description

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

    import qualified RIO.Vector.Unoxed.Unsafe as VU'

Synopsis

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

# Accessors

## Indexing

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

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

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

## Monadic indexing

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

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

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

## Extracting subvectors

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

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

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

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

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

# Modifying vectors

## Bulk updates

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

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

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

## Accumulations

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

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

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

## Permutations

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

# Conversions

## Mutable vectors

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

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

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