haskell / haskell/vector

Add insertion functions

Open
#76 1 comment 0 reactions 0 assignees View on GitHub
design-shed enhancement
Dominant language
Haskell
Stars
400
Forks
145
PR merge metrics
No merged PRs in 30d

Description

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](http://stackoverflow.com/a/28665345/1477667) on StackOverflow; `insertAt` should be particularly simple.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.