|
Data.Vector.Storable | Portability | non-portable | Stability | experimental | Maintainer | Roman Leshchinskiy <[email protected]> |
|
|
|
|
|
Description |
Storable-based vectors.
|
|
Synopsis |
|
data Vector a | | data MVector a = MVector !Int !Int !(ForeignPtr a) | | Storable (sizeOf, alignment, peekElemOff, pokeElemOff, peekByteOff, pokeByteOff, peek, poke) | | length :: Storable a => Vector a -> Int | | null :: Storable a => Vector a -> Bool | | empty :: Storable a => Vector a | | singleton :: Storable a => a -> Vector a | | cons :: Storable a => a -> Vector a -> Vector a | | snoc :: Storable a => Vector a -> a -> Vector a | | replicate :: Storable a => Int -> a -> Vector a | | (++) :: Storable a => Vector a -> Vector a -> Vector a | | copy :: Storable a => Vector a -> Vector a | | (!) :: Storable a => Vector a -> Int -> a | | head :: Storable a => Vector a -> a | | last :: Storable a => Vector a -> a | | slice :: Storable a => Vector a -> Int -> Int -> Vector a | | init :: Storable a => Vector a -> Vector a | | tail :: Storable a => Vector a -> Vector a | | take :: Storable a => Int -> Vector a -> Vector a | | drop :: Storable a => Int -> Vector a -> Vector a | | accum :: Storable a => (a -> b -> a) -> Vector a -> [(Int, b)] -> Vector a | | (//) :: Storable a => Vector a -> [(Int, a)] -> Vector a | | backpermute :: Storable a => Vector a -> Vector Int -> Vector a | | reverse :: Storable a => Vector a -> Vector a | | map :: (Storable a, Storable b) => (a -> b) -> Vector a -> Vector b | | concatMap :: (Storable a, Storable b) => (a -> Vector b) -> Vector a -> Vector b | | zipWith :: (Storable a, Storable b, Storable c) => (a -> b -> c) -> Vector a -> Vector b -> Vector c | | zipWith3 :: (Storable a, Storable b, Storable c, Storable d) => (a -> b -> c -> d) -> Vector a -> Vector b -> Vector c -> Vector d | | filter :: Storable a => (a -> Bool) -> Vector a -> Vector a | | takeWhile :: Storable a => (a -> Bool) -> Vector a -> Vector a | | dropWhile :: Storable a => (a -> Bool) -> Vector a -> Vector a | | elem :: (Storable a, Eq a) => a -> Vector a -> Bool | | notElem :: (Storable a, Eq a) => a -> Vector a -> Bool | | find :: Storable a => (a -> Bool) -> Vector a -> Maybe a | | findIndex :: Storable a => (a -> Bool) -> Vector a -> Maybe Int | | foldl :: Storable b => (a -> b -> a) -> a -> Vector b -> a | | foldl1 :: Storable a => (a -> a -> a) -> Vector a -> a | | foldl' :: Storable b => (a -> b -> a) -> a -> Vector b -> a | | foldl1' :: Storable a => (a -> a -> a) -> Vector a -> a | | foldr :: Storable a => (a -> b -> b) -> b -> Vector a -> b | | foldr1 :: Storable a => (a -> a -> a) -> Vector a -> a | | and :: Vector Bool -> Bool | | or :: Vector Bool -> Bool | | sum :: (Storable a, Num a) => Vector a -> a | | product :: (Storable a, Num a) => Vector a -> a | | maximum :: (Storable a, Ord a) => Vector a -> a | | minimum :: (Storable a, Ord a) => Vector a -> a | | unfoldr :: Storable a => (b -> Maybe (a, b)) -> b -> Vector a | | prescanl :: (Storable a, Storable b) => (a -> b -> a) -> a -> Vector b -> Vector a | | prescanl' :: (Storable a, Storable b) => (a -> b -> a) -> a -> Vector b -> Vector a | | postscanl :: (Storable a, Storable b) => (a -> b -> a) -> a -> Vector b -> Vector a | | postscanl' :: (Storable a, Storable b) => (a -> b -> a) -> a -> Vector b -> Vector a | | scanl :: (Storable a, Storable b) => (a -> b -> a) -> a -> Vector b -> Vector a | | scanl' :: (Storable a, Storable b) => (a -> b -> a) -> a -> Vector b -> Vector a | | scanl1 :: Storable a => (a -> a -> a) -> Vector a -> Vector a | | scanl1' :: Storable a => (a -> a -> a) -> Vector a -> Vector a | | enumFromTo :: (Storable a, Enum a) => a -> a -> Vector a | | enumFromThenTo :: (Storable a, Enum a) => a -> a -> a -> Vector a | | toList :: Storable a => Vector a -> [a] | | fromList :: Storable a => [a] -> Vector a |
|
|
Documentation |
|
|
|
|
|
Mutable Storable-based vectors in the IO monad.
| Constructors | | Instances | |
|
|
Storable (sizeOf, alignment, peekElemOff, pokeElemOff, peekByteOff, pokeByteOff, peek, poke) |
|
Length information
|
|
|
|
|
|
Construction
|
|
|
Empty vector
|
|
|
Vector with exaclty one element
|
|
|
Prepend an element
|
|
|
Append an element
|
|
|
Vector of the given length with the given value in each position
|
|
|
Concatenate two vectors
|
|
|
Create a copy of a vector. Useful when dealing with slices.
|
|
Accessing individual elements
|
|
|
Indexing
|
|
|
First element
|
|
|
Last element
|
|
Subvectors
|
|
|
:: Storable a | | => Vector a | | -> Int | starting index
| -> Int | length
| -> Vector a | | Yield a part of the vector without copying it. Safer version of
unsafeSlice.
|
|
|
|
Yield all but the last element without copying.
|
|
|
All but the first element (without copying).
|
|
|
Yield the first n elements without copying.
|
|
|
Yield all but the first n elements without copying.
|
|
Permutations
|
|
|
|
|
|
|
|
|
|
Mapping
|
|
|
Map a function over a vector
|
|
|
|
Zipping and unzipping
|
|
|
Zip two vectors with the given function.
|
|
|
Zip three vectors with the given function.
|
|
Filtering
|
|
|
Drop elements which do not satisfy the predicate
|
|
|
Yield the longest prefix of elements satisfying the predicate.
|
|
|
Drop the longest prefix of elements that satisfy the predicate.
|
|
Searching
|
|
|
Check whether the vector contains an element
|
|
|
Inverse of elem
|
|
|
Yield Just the first element matching the predicate or Nothing if no
such element exists.
|
|
|
Yield Just the index of the first element matching the predicate or
Nothing if no such element exists.
|
|
Folding
|
|
|
Left fold
|
|
|
Lefgt fold on non-empty vectors
|
|
|
Left fold with strict accumulator
|
|
|
Left fold on non-empty vectors with strict accumulator
|
|
|
Right fold
|
|
|
Right fold on non-empty vectors
|
|
Specialised folds
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Unfolding
|
|
|
|
Scans
|
|
|
Prefix scan
|
|
|
Prefix scan with strict accumulator
|
|
|
Suffix scan
|
|
|
Suffix scan with strict accumulator
|
|
|
Haskell-style scan
|
|
|
Haskell-style scan with strict accumulator
|
|
|
Scan over a non-empty Vector
|
|
|
Scan over a non-empty Vector with a strict accumulator
|
|
Enumeration
|
|
|
|
|
|
Conversion to/from lists
|
|
|
Convert a vector to a list
|
|
|
Convert a list to a vector
|
|
Produced by Haddock version 2.4.2 |