Conversation
…o all the other modules
ntwilson
marked this pull request as ready for review
March 20, 2026 18:27
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends SafetyFirst’s collection helpers by adding split, takeWhileIncluding, and skipUntilIncluding across Seq, List, Array, and FSeq/FiniteSeq, along with accompanying tests and release note updates.
Changes:
- Add
takeWhileIncludingandskipUntilIncludingtoSeq,List,Array, andFiniteSeq/FSeq(plus NonEmpty wrappers where applicable). - Add
splitimplementations forSeq(lazy inner/outer) and for strict collections (List/Array/FiniteSeq). - Add/expand specs for the new functions and update
ReleaseNotes.md.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| SafetyFirst/Seq.fs | Adds skipUntilIncluding, takeWhileIncluding, split, and updates Seq.NonEmpty.split to delegate to the new Seq.split. |
| SafetyFirst/List.fs | Adds skipUntilIncluding, takeWhileIncluding, split, plus List.NonEmpty.takeWhileIncluding. |
| SafetyFirst/FiniteSeqModule.fs | Adds FiniteSeq/FSeq implementations for skipUntilIncluding, takeWhileIncluding, and split, plus NonEmpty wrappers. |
| SafetyFirst/Array.fs | Adds skipUntilIncluding, takeWhileIncluding, split, and updates Array.NonEmpty.split to delegate to the new Array.split. |
| SafetyFirst.Specs/SeqSpec.fs | Adds test coverage for Seq.takeWhileIncluding, Seq.skipUntilIncluding, and Seq.split. |
| SafetyFirst.Specs/ListSpec.fs | Adds tests for List.split, plus coverage for List.(NonEmpty.)takeWhileIncluding and List.skipUntilIncluding. |
| SafetyFirst.Specs/FSeqSpec.fs | Adds tests for FSeq.split, FSeq.takeWhileIncluding, and FSeq.skipUntilIncluding; simplifies a helper to use NonEmpty.assume. |
| SafetyFirst.Specs/ArraySpec.fs | Adds tests for Array.split, Array.takeWhileIncluding, and Array.skipUntilIncluding (plus NonEmpty coverage). |
| ReleaseNotes.md | Updates release notes to list the newly added functions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
SafetyFirst/FiniteSeqModule.fs:2439
- Doc example code is missing a space between the first argument and the list argument (
FSeq.NonEmpty.create 1[ ... ]), which makes the snippet invalid F#. Update toFSeq.NonEmpty.create 1 [ ... ].
/// split ((=) 100) (FSeq.NonEmpty.create 1[2;3;100;100;4;100;5;6])
/// //returns ([[1;2;3;100];[100];[4;100];[5;6]])
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was going for
split, but theSeqimplementation of split depended ontakeUntilIncludingandskipUntilIncluding, which seemed useful enough to make public, so I added them to Seq (and then added them to all the other modules too)