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

  1. cartazio commented on Jul 24, 2016

    @cartazio
    Contributor

    something like this is valid to have at the bundle / stream layer, not sure if it makes sense to expose them at the vector layer because it may require some care for them to be well behaved, but solid idea

    lets at least poke at doing something like this for 0.12 in the fusion framework layer

  2. added this to the 0.12 milestone on Jul 24, 2016
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