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

Options - F# missing convert to other types #40039

Open
naxels opened this issue Mar 16, 2024 · 1 comment · May be fixed by #44512
Open

Options - F# missing convert to other types #40039

naxels opened this issue Mar 16, 2024 · 1 comment · May be fixed by #44512
Labels
dotnet-fsharp/svc help wanted Good for community contributors to help [up-for-grabs] in-pr This issue will be closed (fixed) by an active pull request.

Comments

@naxels
Copy link

naxels commented Mar 16, 2024

Type of issue

Missing information

Description

Hi team,

Thank you for the details documentation on the Options in F#.

As a beginner, I did find some information missing that would be very valuable for converting Option to another type.
where other documentation would go straight into Pattern Matching Some/None,
F# also has a handy build-in function Option.defaultValue (as referenced here: https://stackoverflow.com/a/39436459)

A little expansion of the "Converting to Other Types" section of the documentation with for example:

String and Int

would already help with the following guided code:

optionString |> Option.defaultValue ""
optionInt |> Option.defaultValue 0

Thank you for consideration!

Page URL

https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/options

Content source URL

https://github.com/dotnet/docs/blob/main/docs/fsharp/language-reference/options.md

Document Version Independent Id

431e250a-3588-7741-dd43-8021d6c7ffa8

Article author

@KathleenDollard

Metadata

  • ID: ed1e23a2-091b-38be-3bbe-b3b38aa06aa5
  • Service: dotnet-fsharp
@dotnet-bot dotnet-bot added the ⌚ Not Triaged Not triaged label Mar 16, 2024
@dotnetrepoman dotnetrepoman bot removed the ⌚ Not Triaged Not triaged label Nov 18, 2024
@BillWagner BillWagner added the help wanted Good for community contributors to help [up-for-grabs] label Nov 18, 2024
@shethaadit
Copy link
Contributor

Hi @BillWagner, I will work on this and raise PR soon. Could you please assign this issue to myself? :)

@dotnet-policy-service dotnet-policy-service bot added the in-pr This issue will be closed (fixed) by an active pull request. label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet-fsharp/svc help wanted Good for community contributors to help [up-for-grabs] in-pr This issue will be closed (fixed) by an active pull request.
Projects
None yet
4 participants