Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace internal option–voption conversions with FSharp.Core funcs #18269

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

brianrourkeboll
Copy link
Contributor

Description

Reprise of #17457, now that FSharp.Core 9 has shipped.

Resolves #17460.

Checklist

  • These changes are internal only, so release notes shouldn't be needed.

Copy link
Contributor

github-actions bot commented Jan 25, 2025

⚠️ Release notes required, but author opted out

Warning

Author opted out of release notes, check is disabled for this pull request.
cc @dotnet/fsharp-team-msft

@brianrourkeboll brianrourkeboll marked this pull request as ready for review January 25, 2025 20:44
@brianrourkeboll brianrourkeboll requested a review from a team as a code owner January 25, 2025 20:44
@T-Gro T-Gro added the NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes label Jan 27, 2025
@T-Gro T-Gro enabled auto-merge (squash) January 27, 2025 09:50
Copy link
Member

@psfinaki psfinaki left a comment

Choose a reason for hiding this comment

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

Well, good memory!

@T-Gro T-Gro merged commit 013c998 into dotnet:main Jan 27, 2025
33 of 34 checks passed
@brianrourkeboll brianrourkeboll deleted the option-voption-cleanup-2 branch January 27, 2025 12:01
Comment on lines 3527 to +3530
[<return: Struct>]
let (|ExtractAttribNamedArg|_|) nm args =
args |> List.tryPick (function AttribNamedArg(nm2, _, _, v) when nm = nm2 -> Some v | _ -> None) |> ValueOptionInternal.ofOption
args |> List.tryPick (function AttribNamedArg(nm2, _, _, v) when nm = nm2 -> Some v | _ -> None) |> ValueOption.ofOption

Copy link
Contributor

@kerams kerams Jan 27, 2025

Choose a reason for hiding this comment

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

Off topic, but what is the point of this AP returning voption when option is still being created? Doesn't the conversion do nothing but add overhead?

Copy link
Member

Choose a reason for hiding this comment

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

Yes.
A tryPickV equivalent would be better here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NO_RELEASE_NOTES Label for pull requests which signals, that user opted-out of providing release notes
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Cleanup: replace internal option conversion funcs with FSharp.Core ones once shipped
4 participants