question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `findSliceIndex` function to other collections

See original GitHub issue

Description

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 element String.findIndex.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
gustycommented, Jul 29, 2019

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 😉

1reaction
gustycommented, Jul 30, 2019

Yes, go ahead please !

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found