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

Duplicates and naming #325

Open
Evangelink opened this issue Jul 30, 2015 · 4 comments
Open

Duplicates and naming #325

Evangelink opened this issue Jul 30, 2015 · 4 comments

Comments

@Evangelink
Copy link

Hi,

First of all, thank you for this helpful library.

I'd like to report here a duplication of the same method with 3 names (ofBoolAndValue, fromTryPattern, tryParseWith).
let a = Double.TryParse "2" |> Option.ofBoolAndValue
let b = Option.fromTryPattern Double.TryParse "2"
let c = Option.tryParseWith Double.TryParse "2"

Also, I was wondering if you should not rename the Option.concat to Option.flatten or Option.switch (to look like Observable.switch) because the name is quite misleading and actually doesn't concat some options.

Cheers

@mausch
Copy link
Member

mausch commented Jul 30, 2015

Good point about those duplicate functions. Too many people contributing without discussing things I guess.

About Option.concat, it's the same concept as the built-in List.concat i.e. m (m a) -> m a

@Evangelink
Copy link
Author

Don't know how you want to handle things but if you need some help, feel free to ask/contact me.

@sideeffffect
Copy link
Contributor

m (m a) -> m a

shouldn't we name it join

@gdziadkiewicz
Copy link
Collaborator

4th variant:

let d = Double.TryParse "2" |> toOption

https://github.com/fsprojects/FSharpx.Extras/blob/master/src/FSharpx.Extras/Prelude.fs#L89-L92

gdziadkiewicz added a commit to gdziadkiewicz/FSharpx.Extras that referenced this issue Feb 23, 2020
gdziadkiewicz added a commit to gdziadkiewicz/FSharpx.Extras that referenced this issue May 31, 2020
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