8000 Add Path.flatMapOperations to make editing Path more convenient by RafalSumislawski · Pull Request #418 · http4s/rho · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add Path.flatMapOperations to make editing Path more convenient #418

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

Merged
merged 3 commits into from
Dec 13, 2020

Conversation

RafalSumislawski
Copy link
Member

No description provided.

@@ -254,6 +254,17 @@ object models {
vendorExtensions.foreach { case (key, value) => p.setVendorExtension(key, value) }
p
}

def flatMapOperations(f: Operation => Option[Operation]): Path =
Copy link
Member

Choose a reason for hiding this comment

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

Not opposed to putting in this code, but naming wise, I think flat map is not appropriate. This is probably more akin to a collect ?

Copy link
Member Author

Choose a reason for hiding this comment

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

collestSome maybe? The signature is more similar to collestFirstSome or collectFoldSome than to collect/collectFirst/collectFold which all take a PartialFunction as an argument.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, collectSomeOperations ? It's wordy but I think captures better than flatMap here.

@zarthross zarthross merged commit d6d2f93 into http4s:master Dec 13, 2020
@zarthross
Copy link
Member

Release in https://github.com/http4s/rho/releases/tag/v0.21.0-RC2 should be rolling out to mvn central now

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.

2 participants
0