-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Efficient RRB-Vectors -- -- An RRB-Vector is an efficient sequence data structure. It supports -- fast indexing, iteration, concatenation and splitting. -- --
-- empty = fromList [] --empty :: Vector a -- | <math>. A vector with a single element. -- --
-- singleton x = fromList [x] --singleton :: a -> Vector a -- | <math>. Create a new vector from a list. fromList :: [a] -> Vector a -- | <math>. Add an element to the left end of the vector. -- --
-- >>> 1 <| fromList [2, 3, 4] -- fromList [1,2,3,4] --(<|) :: a -> Vector a -> Vector a infixr 5 <| -- | <math>. Add an element to the right end of the vector. -- --
-- >>> fromList [1, 2, 3] |> 4 -- fromList [1,2,3,4] --(|>) :: Vector a -> a -> Vector a infixl 5 |> -- | <math>. Concatenates two vectors. -- --
-- >>> fromList [1, 2, 3] >< fromList [4, 5] -- fromList [1,2,3,4,5] --(><) :: Vector a -> Vector a -> Vector a infixr 5 >< -- | <math>. The first element and the vector without the first -- element, or Nothing if the vector is empty. -- --
-- >>> viewl (fromList [1, 2, 3]) -- Just (1,fromList [2,3]) --viewl :: Vector a -> Maybe (a, Vector a) -- | <math>. The vector without the last element and the last -- element, or Nothing if the vector is empty. -- --
-- >>> viewr (fromList [1, 2, 3]) -- Just (fromList [1,2],3) --viewr :: Vector a -> Maybe (Vector a, a) -- | <math>. The element at the index or Nothing if the index -- is out of range. lookup :: Int -> Vector a -> Maybe a -- | <math>. The element at the index. Calls error if the -- index is out of range. index :: HasCallStack => Int -> Vector a -> a -- | <math>. A flipped version of lookup. (!?) :: Vector a -> Int -> Maybe a -- | <math>. A flipped version of index. (!) :: HasCallStack => Vector a -> Int -> a -- | <math>. Update the element at the index with a new element. If -- the index is out of range, the original vector is returned. update :: Int -> a -> Vector a -> Vector a -- | <math>. Adjust the element at the index by applying the function -- to it. If the index is out of range, the original vector is returned. adjust :: Int -> (a -> a) -> Vector a -> Vector a -- | <math>. Like adjust, but the result of the function is -- forced. adjust' :: Int -> (a -> a) -> Vector a -> Vector a -- | <math>. The first i elements of the vector. If -- i is negative, the empty vector is returned. If the vector -- contains less than i elements, the whole vector is returned. take :: Int -> Vector a -> Vector a -- | <math>. The vector without the first i elements If -- i is negative, the whole vector is returned. If the vector -- contains less than i elements, the empty vector is returned. drop :: Int -> Vector a -> Vector a -- | <math>. Split the vector at the given index. -- --
-- splitAt n v = (take n v, drop n v) --splitAt :: Int -> Vector a -> (Vector a, Vector a) -- | <math>. Insert an element at the given index. insertAt :: Int -> a -> Vector a -> Vector a -- | <math>. Delete the element at the given index. deleteAt :: Int -> Vector a -> Vector a -- | <math>. Apply the function to every element. -- --
-- >>> map (+ 1) (fromList [1, 2, 3]) -- fromList [2,3,4] --map :: (a -> b) -> Vector a -> Vector b -- | <math>. Reverse the vector. -- --
-- >>> reverse (fromList [1, 2, 3]) -- fromList [3,2,1] --reverse :: Vector a -> Vector a -- | <math>. Take two vectors and return a vector of corresponding -- pairs. If one input is longer, excess elements are discarded from the -- right end. -- --
-- zip = zipWith (,) --zip :: Vector a -> Vector b -> Vector (a, b) -- | <math>. zipWith generalizes zip by zipping with -- the function. zipWith :: (a -> b -> c) -> Vector a -> Vector b -> Vector c -- | <math>. Unzip a vector of pairs. -- --
-- >>> unzip (fromList [(1, "a"), (2, "b"), (3, "c")]) -- (fromList [1,2,3],fromList ["a","b","c"]) --unzip :: Vector (a, b) -> (Vector a, Vector b)