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

More Option functions #980

Closed
ploeh opened this issue Feb 23, 2016 · 7 comments
Closed

More Option functions #980

ploeh opened this issue Feb 23, 2016 · 7 comments

Comments

@ploeh
Copy link
Contributor

ploeh commented Feb 23, 2016

In the F# User Voice forum, there's a suggestion to add various functions to the Option module. These include:

  • Option.getOrDefault : 'a -> 'a option -> 'a
  • Option.map2: ('a -> 'b -> 'c) -> 'a option -> 'b option -> 'c option
  • Option.map3: ('a -> 'b -> 'c -> 'd) -> 'a option -> 'b option -> 'c option -> 'd option

I often find that I need better building blocks for option values, and while they're easy enough to define, I think it would make the F# language more productive if these fundamental functions were already present.

I'll be happy to write the tests and implementation and send a pull request for this, but I'm opening this issue first, in order to gauge the interest.

If there's interest, I'll get started on some pull requests, but if there's no interest, please close this issue and the User Voice suggestion.

@smoothdeveloper
Copy link
Contributor

Please consider reviewing @vasily-kirichenko answer in this user voice, there seems to be many other existing resources to draw from, should we prepare a RFC so we can discuss naming / signatures to greater extent?

Definitely agree that having more extensive support over Option in the core library makes lots of sense.

@dsyme
Copy link
Contributor

dsyme commented Feb 25, 2016

Closing as this will go via UserVoice per CONTRIBUTING.md

@dsyme dsyme closed this as completed Feb 25, 2016
@ploeh
Copy link
Contributor Author

ploeh commented Feb 26, 2016

@dsyme, could you please advise how to move forward with these suggestions?

The User Voice suggestion that I already linked to has been inactive for more than a year. In order to get the ball rolling, I wanted to restart the discussion.

The problems with User Voice are:

  • The User Voice UI doesn't support code formatting. That makes it suboptimal to discuss code.
  • You don't get any notifications when there are new comments (at least, I don't).

A GitHub issue solves these problems.

Per CONTRIBUTING.md I could have sent a pull request, since there already is a User Voice suggestion. I did, however, consider that suggestion poorly specified, which is the reason I wanted to restart the discussion.

I am, as written above, offering to implement the Option features, but now I don't know how to proceed... Please advise.

@dsyme
Copy link
Contributor

dsyme commented Feb 29, 2016

@ploeh I will mark the UV item as approved-in-principle which means we can open an RFC on it and have a really proper discussion about the Option module.

However the best way to help would then be to volunteer to help do facilitation work on setting up RFCs for approved UV items, per my tweet here :) Basically I'd give you access to FSharpLangDesign to set up about 20-40 RFCs, one for each approved-in-principle issue, and then we as a community can get to work on the details and discussions.

@ploeh
Copy link
Contributor Author

ploeh commented Mar 1, 2016

@dsyme I'll be happy to help to the best of my abilities. The process isn't entirely clear to me, though. Should I just take one of the documents at https://github.com/fsharp/FSharpLangDesign/tree/master/RFCs (e.g. https://github.com/fsharp/FSharpLangDesign/blob/master/RFCs/FS-1007-xxx.md), rename it in fill in the blanks?

If so, I'll be happy to do so.

@enricosada
Copy link
Contributor

wait a bit @ploeh , i already done that for this issue 😄 You can help with another, i was trying to do rfc for this one because was closed in visualfsharp, so we can continue discussion in RFC as @dsyme said.
Sry, didnt see you want to contribute to RFC

ref fsharp/fslang-design#60

@ploeh i pushed the RFC and there is a template https://github.com/fsharp/FSharpLangDesign/blob/master/RFC_template.md

@dsyme
Copy link
Contributor

dsyme commented Mar 1, 2016

@ploeh @enricosada Yes, basically, feel free to send a PR creating the RFC for any approved-in-principle issue. First in first served. If you want to grab the token then send one doing nothing but renaming the file, and then fill in the further details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants