Add `findSliceIndex` function to other collections
See original GitHub issueDescription
Related: https://github.com/fsprojects/FSharpPlus/issues/158#issuecomment-513526420
I propose we add findSliceIndex / tryFindSliceIndex
which we recently added to String
extension to other collections’ extensions.
val findSliceIndex : slice:'Collection<'a> -> source:'Collection<'a> -> int
val tryFindSliceIndex : slice:'Collection<'a> -> source:'Collection<'a> -> int option
It will work just like the existing findIndex : 'a -> 'Collection<'a> -> int
but it searches a “slice” (i.e. subsequence, sub-collection) instead of an elementString.findIndex
.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Add more string functions · Issue #158
Description Add more string functions in Extensions, to the String module. I propose we compile first a list of nice-to-have functions.
Read more >Extensions
Extensions are what you probably expect: helper functions for existing types. ... Some functions are common across foldable types such as intercalate on...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m personally fine with this, definitely it makes sense to have them for other collections.
It also makes sense to have the generic version, if you are willing to do this PR I leave it to your criteria/willingness to include the generic functions or not.
Of course, I’m happy to help fighting the compiler 😉
Yes, go ahead please !