Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Container.Vector
Contents
Synopsis
- alloc :: Vector v a => Int -> v a
- replicate' :: Vector v a => Int -> v a -> v a
- index :: Vector v a => v a -> Int -> Maybe a
- (!) :: Vector v a => v a -> Int -> Maybe a
- (!!) :: Vector v a => v a -> Int -> a
- head :: Vector v a => v a -> Maybe a
- last :: Vector v a => v a -> Maybe a
- init :: Vector v a => v a -> Maybe (v a)
- tail :: Vector v a => v a -> Maybe (v a)
- splitHead :: Vector v a => v a -> Maybe (a, v a)
- splitLast :: Vector v a => v a -> Maybe (a, v a)
- unsafeSplitHead :: Vector v a => v a -> (a, v a)
- unsafeSplitLast :: Vector v a => v a -> (a, v a)
- takeTill :: Vector v a => (a -> Bool) -> v a -> v a
- takeWhile :: Vector v a => (a -> Bool) -> v a -> v a
- takeWhileStream :: Vector v a => (a -> Bool) -> v a -> v a
- dropWhileStream :: Vector v a => (a -> Bool) -> v a -> v a
- breakAll :: Vector v a => (a -> Bool) -> v a -> [v a]
- replaceUsing :: Vector v a => (a -> Bool) -> (a -> v a) -> v a -> v a
- replace :: (Vector v a, Eq a) => a -> v a -> v a -> v a
- commonPrefixes :: (Vector v a, Eq a) => v a -> v a -> Maybe (v a, v a, v a)
- span :: Vector v a => (a -> Bool) -> v a -> (v a, v a)
- concatMap :: (Vector v a, Vector v b) => (a -> v b) -> v a -> v b
- imap :: (Vector v a, Vector v b) => (Int -> a -> b) -> v a -> v b
- map :: (Vector v a, Vector v b) => (a -> b) -> v a -> v b
- concat :: Vector v a => [v a] -> v a
- snoc :: Vector v a => v a -> a -> v a
- cons :: Vector v a => a -> v a -> v a
- singleton :: Vector v a => a -> v a
- unsafeDrop :: Vector v a => Int -> v a -> v a
- unsafeTake :: Vector v a => Int -> v a -> v a
- unsafeTail :: Vector v a => v a -> v a
- unsafeInit :: Vector v a => v a -> v a
- unsafeSlice :: Vector v a => Int -> Int -> v a -> v a
- splitAt :: Vector v a => Int -> v a -> (v a, v a)
- unsafeLast :: Vector v a => v a -> a
- unsafeHead :: Vector v a => v a -> a
- unsafeIndex :: Vector v a => v a -> Int -> a
- null :: Vector v a => v a -> Bool
- length :: Vector v a => v a -> Int
Documentation
replicate' :: Vector v a => Int -> v a -> v a Source #
O(n)
unsafeSplitHead :: Vector v a => v a -> (a, v a) Source #
O(1)
unsafeSplitLast :: Vector v a => v a -> (a, v a) Source #
O(1)
takeWhileStream :: Vector v a => (a -> Bool) -> v a -> v a Source #
O(s) Just like takeWhile, but uses streaming instead of slicing.
dropWhileStream :: Vector v a => (a -> Bool) -> v a -> v a Source #
O(s)
replaceUsing :: Vector v a => (a -> Bool) -> (a -> v a) -> v a -> v a Source #
O(n)
span :: Vector v a => (a -> Bool) -> v a -> (v a, v a) #
O(n) Split the vector into the longest prefix of elements that satisfy the predicate and the rest without copying.
concatMap :: (Vector v a, Vector v b) => (a -> v b) -> v a -> v b #
Map a function over a vector and concatenate the results.
imap :: (Vector v a, Vector v b) => (Int -> a -> b) -> v a -> v b #
O(n) Apply a function to every element of a vector and its index
unsafeDrop :: Vector v a => Int -> v a -> v a #
O(1) Yield all but the first n
elements without copying. The vector
must contain at least n
elements but this is not checked.
unsafeTake :: Vector v a => Int -> v a -> v a #
O(1) Yield the first n
elements without copying. The vector must
contain at least n
elements but this is not checked.
unsafeTail :: Vector v a => v a -> v a #
O(1) Yield all but the first element without copying. The vector may not be empty but this is not checked.
unsafeInit :: Vector v a => v a -> v a #
O(1) Yield all but the last element without copying. The vector may not be empty but this is not checked.
O(1) Yield a slice of the vector without copying. The vector must
contain at least i+n
elements but this is not checked.
unsafeLast :: Vector v a => v a -> a #
O(1) Last element without checking if the vector is empty
unsafeHead :: Vector v a => v a -> a #
O(1) First element without checking if the vector is empty
unsafeIndex :: Vector v a => v a -> Int -> a #
O(1) Unsafe indexing without bounds checking
Orphan instances
(Vector Vector a, Convertible' Char a) => Convertible Char (Vector a) Source # | |
(Vector Vector a, Convertible' Char a) => Convertible Text (Vector a) Source # | |
(Vector Vector a, Convertible' Char a) => IsString (Vector a) Source # | |
Methods fromString :: String -> Vector a # | |
(Vector Vector a, Convertible' a Char) => Convertible (Vector a) Text Source # | |
Vector Vector a => Convertible [a] (Vector a) Source # | |
(Vector Vector a, Convertible' t a) => Convertible [t] (Vector a) Source # | We cannot use automatic Convertible1 -> Convertible lifting, because converting unboxed Vectors constraints |
Vector Vector a => Convertible (Vector a) [a] Source # | |
(Vector Vector a, Convertible' a t) => Convertible (Vector a) [t] Source # | |