|
| Data.Vector | | Portability | non-portable | | Stability | experimental | | Maintainer | Roman Leshchinskiy <rl@cse.unsw.edu.au> |
|
|
|
|
|
| Description |
| Boxed vectors
|
|
| Synopsis |
|
| data Vector a | | | data MVector m a | | | length :: Vector a -> Int | | | null :: Vector a -> Bool | | | empty :: Vector a | | | singleton :: a -> Vector a | | | cons :: a -> Vector a -> Vector a | | | snoc :: Vector a -> a -> Vector a | | | replicate :: Int -> a -> Vector a | | | (++) :: Vector a -> Vector a -> Vector a | | | copy :: Vector a -> Vector a | | | (!) :: 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 | | | slice :: Vector a -> Int -> Int -> Vector a | | | init :: Vector a -> Vector a | | | tail :: Vector a -> Vector a | | | take :: Int -> Vector a -> Vector a | | | drop :: Int -> Vector a -> Vector a | | | accum :: (a -> b -> a) -> Vector a -> [(Int, b)] -> Vector a | | | (//) :: Vector a -> [(Int, a)] -> Vector a | | | update :: Vector a -> Vector (Int, a) -> Vector a | | | backpermute :: Vector a -> Vector Int -> Vector a | | | reverse :: Vector a -> Vector a | | | map :: (a -> b) -> Vector a -> Vector b | | | concatMap :: (a -> Vector b) -> Vector a -> Vector b | | | zipWith :: (a -> b -> c) -> Vector a -> Vector b -> Vector c | | | zipWith3 :: (a -> b -> c -> d) -> Vector a -> Vector b -> Vector c -> Vector d | | | zip :: Vector a -> Vector b -> Vector (a, b) | | | zip3 :: Vector a -> Vector b -> Vector c -> Vector (a, b, c) | | | unzip :: Vector (a, b) -> (Vector a, Vector b) | | | unzip3 :: Vector (a, b, c) -> (Vector a, Vector b, Vector c) | | | filter :: (a -> Bool) -> Vector a -> Vector a | | | takeWhile :: (a -> Bool) -> Vector a -> Vector a | | | dropWhile :: (a -> Bool) -> Vector a -> Vector a | | | elem :: Eq a => a -> Vector a -> Bool | | | notElem :: Eq a => a -> Vector a -> Bool | | | find :: (a -> Bool) -> Vector a -> Maybe a | | | findIndex :: (a -> Bool) -> Vector a -> Maybe Int | | | foldl :: (a -> b -> a) -> a -> Vector b -> a | | | foldl1 :: (a -> a -> a) -> Vector a -> a | | | foldl' :: (a -> b -> a) -> a -> Vector b -> a | | | foldl1' :: (a -> a -> a) -> Vector a -> a | | | foldr :: (a -> b -> b) -> b -> Vector a -> b | | | foldr1 :: (a -> a -> a) -> Vector a -> a | | | and :: Vector Bool -> Bool | | | or :: Vector Bool -> Bool | | | sum :: Num a => Vector a -> a | | | product :: Num a => Vector a -> a | | | maximum :: Ord a => Vector a -> a | | | minimum :: Ord a => Vector a -> a | | | unfoldr :: (b -> Maybe (a, b)) -> b -> Vector a | | | prescanl :: (a -> b -> a) -> a -> Vector b -> Vector a | | | prescanl' :: (a -> b -> a) -> a -> Vector b -> Vector a | | | postscanl :: (a -> b -> a) -> a -> Vector b -> Vector a | | | postscanl' :: (a -> b -> a) -> a -> Vector b -> Vector a | | | scanl :: (a -> b -> a) -> a -> Vector b -> Vector a | | | scanl' :: (a -> b -> a) -> a -> Vector b -> Vector a | | | scanl1 :: (a -> a -> a) -> Vector a -> Vector a | | | scanl1' :: (a -> a -> a) -> Vector a -> Vector a | | | enumFromTo :: Enum a => a -> a -> Vector a | | | enumFromThenTo :: Enum a => a -> a -> a -> Vector a | | | toList :: Vector a -> [a] | | | fromList :: [a] -> Vector a |
|
|
| Documentation |
|
|
Instances | |
|
|
|
| Mutable boxed vectors keyed on the monad they live in (IO or ST s).
| Instances | |
|
|
| 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
|
|
|
| Monadic indexing which can be strict in the vector while remaining lazy in
the element
|
|
|
|
|
|
| Subvectors
|
|
|
| :: | | | => 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 |