Skip to content

Conversation

@gampleman
Copy link
Collaborator

Closes #22.

@gampleman gampleman requested review from lue-bird and miniBill July 25, 2024 21:33
@miniBill
Copy link
Collaborator

I wonder if a version based on Array.foldl would be faster or slower

(Array.append (Array.slice 0 startIndex array)
(spliceFunction (Array.slice startIndex (startIndex + rc) array))
)
(Array.slice (startIndex + rc) (Array.length array) array)
Copy link
Collaborator

@lue-bird lue-bird Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since startIndex can be negative, this slice start can get non-negative and therefore incorrectly add additional elements.

In general, tests would be cool

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Array.Extra.splice

4 participants