Add `sequenceIgnore` and `mapMIgnore` to Validation by semyon2105 · Pull Request #365 · fsprojects/FSharpx.Extras · GitHub
Skip to content

Add sequenceIgnore and mapMIgnore to Validation#365

Merged
gdziadkiewicz merged 2 commits into
fsprojects:masterfrom
semyon2105:master
May 10, 2020
Merged

Add sequenceIgnore and mapMIgnore to Validation#365
gdziadkiewicz merged 2 commits into
fsprojects:masterfrom
semyon2105:master

Conversation

@semyon2105

Copy link
Copy Markdown
Contributor

No description provided.

@panesofglass

panesofglass commented Feb 3, 2020

Copy link
Copy Markdown
Contributor

@semyon2105

Copy link
Copy Markdown
Contributor Author

The underscore here basically means "ignore". AFAIK it's a common convention in F# and Haskell to use an underscore suffix in function names that represent the "value ignored" versions of such functions. The alternative names I can think of are mapMIgnore and sequenceIgnore

I don't see how renaming this function to chooseM is appropriate in this case. mapM_'s semantics is the same as in mapM. It's just that the possible success value will be dropped and we'll have unit instead.

@panesofglass

Copy link
Copy Markdown
Contributor

I've typically seen the _ suffix used with lenses and optics, so that's probably what led to my confusion. I think using Ignore as a suffix would be clearer. Do you mind making that change?

@semyon2105

Copy link
Copy Markdown
Contributor Author

Renamed the functions

@gdziadkiewicz gdziadkiewicz self-assigned this May 10, 2020
@gdziadkiewicz gdziadkiewicz reopened this May 10, 2020
@gdziadkiewicz gdziadkiewicz merged commit 48fcd5a into fsprojects:master May 10, 2020
@gdziadkiewicz

Copy link
Copy Markdown
Collaborator

@gdziadkiewicz gdziadkiewicz changed the title Add sequence_ and mapM_ to Validation Add sequenceIgnore and mapMIgnore to Validation May 13, 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

Successfully merging this pull request may close these issues.

3 participants