Skip to content

Add insertion functions #76

@treeowl

Description

@treeowl

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.

  1. insertBeforeFirst :: (a -> Bool) -> a -> Vector a -> Vector a
  2. insertAfterLast :: (a -> Bool) -> a -> Vector a -> Vector a
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions