Add consolidated extensions from different projects#73
Merged
Conversation
park-jasper
reviewed
Oct 5, 2025
ax0l0tl
reviewed
Oct 6, 2025
park-jasper
reviewed
Oct 6, 2025
ax0l0tl
reviewed
Oct 6, 2025
park-jasper
reviewed
Oct 6, 2025
park-jasper
reviewed
Oct 7, 2025
… also uses to optimize common cases test: add tests for new extensions and untested existing methods
park-jasper
reviewed
Nov 3, 2025
test: test all EnumerableExtensions with a pure enumerable and with one that implements IList<T> to hit both the optimized and unoptimized branch
… flipped refactor: change .BeautifulName extension to be more readable test: run mutation test and add test methods to reach 95% of mutations killed
park-jasper
reviewed
Nov 3, 2025
Collaborator
Author
|
From my perspective this pr can be close, @ax0l0tl @park-jasper what do you think? |
ax0l0tl
reviewed
Nov 19, 2025
| string? valueTarget = "Hi"; | ||
|
|
||
| nullTarget.ToOption(false).Should().BeNone(); | ||
| nullTarget.ToOption(true).Should().BeNone(); |
Member
There was a problem hiding this comment.
This is weird :). I propose to remove the ToOption(bool) overloads. They unclear and inefficient. I'd always prefer a flag ? value : Option<T>.None over value.ToOption(flag). The ToOption(Func<T, bool> overloads) are fine because here the 'null results in None' semantics is clear due to non null T predicate argument.
Member
There was a problem hiding this comment.
I can see that, lets reduce it to the general case, if a user wants to then write value.ToOption(_ => true) it still carries more semantics than just using the bool parameter
ax0l0tl
reviewed
Nov 19, 2025
…ar enough that this also does a null check, in favor of the ToOption(this T?, Func<T, bool>) extension
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.
We want to move the useful extensions we currently use across different projects into FS so that we don't have to copy them all the time.