Skip to content

Add insertion functions #76

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions