I doubt these are needed too terribly often, but it might make sense to add them anyway—the usual Vector API doesn't seem to offer any way to implement them efficiently.
insertBeforeFirst :: (a -> Bool) -> a -> Vector a -> Vector a
insertAfterLast :: (a -> Bool) -> a -> Vector a -> Vector a
insertAt :: Int -> a -> Vector a -> Vector a
I've written two fusing versions of (essentially) insertBeforeFirst in an answer on StackOverflow; insertAt should be particularly simple.
I doubt these are needed too terribly often, but it might make sense to add them anyway—the usual
VectorAPI doesn't seem to offer any way to implement them efficiently.insertBeforeFirst :: (a -> Bool) -> a -> Vector a -> Vector ainsertAfterLast :: (a -> Bool) -> a -> Vector a -> Vector ainsertAt :: Int -> a -> Vector a -> Vector aI've written two fusing versions of (essentially)
insertBeforeFirstin an answer on StackOverflow;insertAtshould be particularly simple.